/var/opt/nydus/ops/mysql/connector/aio/__pycache__
NameSizeModeActions
abstracts.cpython-312.pyc1155400644editdlrm
authentication.cpython-312.pyc131520644editdlrm
charsets.cpython-312.pyc173430644editdlrm
connection.cpython-312.pyc708760644editdlrm
cursor.cpython-312.pyc601950644editdlrm
logger.cpython-312.pyc3510644editdlrm
network.cpython-312.pyc305960644editdlrm
pooling.cpython-312.pyc302760644editdlrm
protocol.cpython-312.pyc115140644editdlrm
utils.cpython-312.pyc59830644editdlrm
_decorating.cpython-312.pyc43120644editdlrm
__init__.cpython-312.pyc4930644editdlrm
Edit: /var/opt/nydus/ops/mysql/connector/aio/__pycache__/authentication.cpython-312.pyc (13152B)
N j2dZddlmZdgZddlmZmZmZmZddl m Z m Z m Z ddl mZmZmZmZmZmZmZddlmZd d lmZd d lmZmZd d l mZerd d lmZGddZy)z6Implementing support for MySQL Authentication Plugins.) annotationsMySQLAuthenticator) TYPE_CHECKINGAnyDictOptional)InterfaceErrorNotSupportedError get_exception)AUTH_SWITCH_STATUSDEFAULT_CHARSET_IDDEFAULT_MAX_ALLOWED_PACKET ERR_STATUSEXCHANGE_FURTHER_STATUS MFA_STATUS OK_STATUS) HandShakeType)logger)MySQLAuthPluginget_auth_plugin) MySQLProtocol) MySQLSocketceZdZdZddZeddZeddZddZ d ddZ ddZ dd Z d d d d de d d e dddd ddf dd Zy)rz$Implements the authentication phase.cXd|_i|_i|_d|_d|_d|_y)z Constructor.FN) _username _passwords_plugin_config _ssl_enabled_auth_strategy_auth_plugin_classselfs S/opt/nydus/tmp/pip-target-a90h98xg/lib/python/mysql/connector/aio/authentication.py__init__zMySQLAuthenticator.__init__;s0 *,.0"'9=15c|jS)z&Signals whether or not SSL is enabled.)r!r$s r& ssl_enabledzMySQLAuthenticator.ssl_enabledDs   r(c|jS)aCustom arguments that are being provided to the authentication plugin. The parameters defined here will override the ones defined in the auth plugin itself. The plugin config is a read-only property - the plugin configuration provided when invoking `authenticate()` is recorded and can be queried by accessing this property. Returns: dict: The latest plugin configuration provided when invoking `authenticate()`. )r r$s r& plugin_configz MySQLAuthenticator.plugin_configIs"""r(c:|jj|y)z,Update the 'plugin_config' instance variableN)r update)r%configs r&update_plugin_configz'MySQLAuthenticator.update_plugin_configZs ""6*r(Nc| |j}| |j}tjd|t ||||j j |d|j|_y)aSwitch the authorization plugin. Args: new_strategy_name: New authorization plugin name to switch to. strategy_class: New authorization plugin class to switch to (has higher precedence than the authorization plugin name). username: Username to be used - if not defined, the username provided when `authentication()` was invoked is used. password_factor: Up to three levels of authentication (MFA) are allowed, hence you can choose the password corresponding to the 1st, 2nd, or 3rd factor - 1st is the default. NzSwitching to strategy %s) plugin_nameauth_plugin_classr)r*) rr#rdebugrrgetr*r")r%new_strategy_namestrategy_classusernamepassword_factors r&_switch_auth_strategyz(MySQLAuthenticator._switch_auth_strategy^sq&  ~~H  !!44N /1BC o)^   OO   4((  r(cKd}|dtk(r=||jvr tdtj|\}}|j ||t jd||jj|jj||fi|jd{}|dtk(rEtj|}|jj||fi|jd{}|dtk(rt jd|S|dt k(r t#||dz }|dtk(r=t j$d y77iw) a Handle MFA (Multi-Factor Authentication) response. Up to three levels of authentication (MFA) are allowed. Args: sock: Pointer to the socket connection. pkt: MFA response. Returns: ok_packet: If last server's response is an OK packet. None: If last server's response isn't an OK packet and no ERROR was raised. Raises: InterfaceError: If got an invalid N factor. errors.ErrorTypes: If got an ERROR response. r z5Failed Multi Factor Authentication (invalid N factor))r9zMFA %i factor %sNzMFA completed succesfullyrz"MFA terminated with a no ok packet)rrr rparse_auth_next_factorr:rr4r"nameauth_switch_responser rparse_auth_more_dataauth_more_responserrr warning)r%sockpktn_factorr6 auth_datas r& _mfa_n_factorz MySQLAuthenticator._mfa_n_factorsi*!f "t.$K,9+O+OPS+T ( y  & &'8( & S LL+Xt7J7J7O7O P@++@@i#'#6#6C1v00)>>sC BD//BB)'+':':1v" 89 1v##C(( MH7!f ": ;<) s,B*E),E%-AE)=E'>AE)E)'E)cK|dtk(rt|dk(r td|dtk(rntjdt j |\}}|j||jj||fi|jd{}|dtk(rZtjdt j|}|jj||fi|jd{}|dtk(r,tjd|jj|S|dt k(rYtjdtjd |jj|j#||d{S|dt$k(r t'|y7 77!w) aHandle server's response. Args: sock: Pointer to the socket connection. pkt: Server's response after completing the `HandShakeResponse`. Returns: ok_packet: If last server's response is an OK packet. None: If last server's response isn't an OK packet and no ERROR was raised. Raises: errors.ErrorTypes: If got an ERROR response. NotSupportedError: If got Authentication with old (insecure) passwords. r<zAuthentication with old (insecure) passwords is not supported. For more information, lookup Password Hashing in the latest MySQL manualz+Server's response is an auth switch requestNzExchanging further packetsz%s completed succesfullyz$Starting multi-factor authenticationzMFA 1 factor %s)r lenr rr4rparse_auth_switch_requestr:r"r?r rr@rArr>rrGrr )r%rCrDr6rFs r&_handle_server_responsez*MySQLAuthenticator._handle_server_responses& q6' 'CHM#>  q6' ' LLF G+8+R+RSV+W ( y  & &'8 9@++@@i#'#6#6C q6, , LL5 6%::3?I>++>>i#'#6#6C q6Y  LL3T5H5H5M5M NJ q6Z  LL? @ LL*D,?,?,D,D E++D#66 6 q6Z $ $/7s8BGF=A%GGBG G!GGGrrFcK||_|||d|_| |_| |_t j |||||| | | | |||j |j \}|_|rdd|fndd|f}|j|g|d{t|j|d{}|j||d{}| tdd|S7P747w)aPerform the authentication phase. During re-authentication you must set `is_change_user_request` to True. Args: sock: Pointer to the socket connection. handshake: Initial handshake. username: Account's username. password1: Account's password factor 1. password2: Account's password factor 2. password3: Account's password factor 3. database: Initial database name for the connection. charset: Client charset (see [1]), only the lower 8-bits. client_flags: Integer representing client capabilities flags. ssl_enabled: Boolean indicating whether SSL is enabled, max_allowed_packet: Maximum packet size. auth_plugin: Authorization plugin name. auth_plugin_class: Authorization plugin class (has higher precedence than the authorization plugin name). conn_attrs: Connection attributes. is_change_user_request: Whether is a `change user request` operation or not. read_timeout: Timeout in seconds upto which the connector should wait for the server to reply back before raising an ReadTimeoutError. write_timeout: Timeout in seconds upto which the connector should spend to send data to the server before raising an WriteTimeoutError. Returns: ok_packet: OK packet. Raises: InterfaceError: If OK packet is NULL. ReadTimeoutError: If the time taken for the server to reply back exceeds 'read_timeout' (if set). WriteTimeoutError: If the time taken to send data packets to the server exceeds 'write_timeout' (if set). References: [1]: https://dev.mysql.com/doc/dev/mysql-server/latest/ page_protocol_basic_character_set.html#a_protocol_character_set )rr ) handshaker8passworddatabasecharset client_flagsmax_allowed_packet auth_pluginr3 conn_attrsis_change_user_requestr*r,rNzGot a NULL ok_pkt)rrr!r#r make_authr*r,r"writebytesreadrLr )r%rCrOr8 password1 password2 password3rQrRrSr*rTrUr3rVrW read_timeout write_timeoutresponse_payload send_argsrDok_pkts r& authenticatezMySQLAuthenticator.authenticates z"'I)D'"31>0G0G%1#/!#9((,,1 -$-&&= !m,  djj)6I666$))L11233D#>> > !454 ?  72>s6BCCC!C"C?CCCC)returnNone)rebool)reDict[str, Any])r/rhrerf)NNr) r6strr7 Optional[str]r8rjr9intrerf)rCrrDrZrezOptional[bytes])$rCrrOrr8rir\rir]rir^rirQrjrRrkrSrkr*rgrTrkrUrjr3rjrVzOptional[Dict[str, str]]rWrgr_ Optional[int]r`rlrerZ)__name__ __module__ __qualname____doc__r'propertyr*r,r0r:rGrLrrrdr(r&rr8s.6!!## +)-"&    &        D444  4l555  5v"&)!"<%)+//3',&*'+%bb!b b  b  bb bbbb b#b)b-b !%!b"$#b$%%b& 'br(N)rp __future__r__all__typingrrrrerrorsr r r protocolr rrrrrrtypesrrpluginsrrrnetworkrrrrr(r&r{sP:="  55EE"5#$WWr(