/var/opt/nydus/ops/mysql/connector/__pycache__
Edit: /var/opt/nydus/ops/mysql/connector/__pycache__/authentication.cpython-312.pyc (14815B)
Nj9 d Z ddlmZ ddlmZmZmZmZ ddlm Z m
Z
mZ ddlmZ ddl
mZmZ ddlmZmZmZmZmZmZmZmZ dd lmZ erdd
lmZ G d d Zy
)z5Implementing support for MySQL Authentication Plugins )annotations)
TYPE_CHECKINGAnyDictOptional )InterfaceErrorNotSupportedError
get_exception)logger)MySQLAuthPluginget_auth_plugin)AUTH_SWITCH_STATUSDEFAULT_CHARSET_IDDEFAULT_MAX_ALLOWED_PACKET
ERR_STATUSEXCHANGE_FURTHER_STATUS
MFA_STATUS OK_STATUS
MySQLProtocol)
HandShakeType)MySQLSocketc e Zd ZdZddZedd Zedd ZddZe de
f ddZ d dd Z dd
Z
ddZddddde de
dddd
ddf ddZy)MySQLAuthenticatorz$Implements the authentication phase.c X d| _ i | _ i | _ d| _ d| _ d| _ y)zConstructor. FN) _username
_passwords_plugin_config_ssl_enabled_auth_strategy_auth_plugin_classselfs O/opt/nydus/tmp/pip-target-a90h98xg/lib/python/mysql/connector/authentication.py__init__zMySQLAuthenticator.__init__8 s0 *,.0"'9=15 c | j S )z&Signals whether or not SSL is enabled.)r r# s r% ssl_enabledzMySQLAuthenticator.ssl_enabledA s r' c | j S )a Custom arguments that are being provided to the authentication plugin when called.
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_configF s """r' c : | j j | y)z,Update the 'plugin_config' instance variableN)r update)r$ configs r% update_plugin_configz'MySQLAuthenticator.update_plugin_configW s ""6*r' r c |i }t j ||| }|j | t j d |j |j
d |j
d |j
d |j
dd |j
dd |j
d |j
d
}t j d |j || t j d
d| _ |S )a Sets up an SSL communication channel.
Args:
sock: Pointer to the socket connection.
host: Server host name.
ssl_options: SSL and TLS connection options (see
`network.MySQLSocket.build_ssl_context`).
charset: Client charset (see [1]), only the lower 8-bits.
client_flags: Integer representing client capabilities flags.
max_allowed_packet: Maximum packet size.
Returns:
ssl_request_payload: Payload used to carry out SSL authentication.
References:
[1]: https://dev.mysql.com/doc/dev/mysql-server/latest/ page_protocol_basic_character_set.html#a_protocol_character_set
)charsetclient_flagsmax_allowed_packetzBuilding SSL contextcacertkeyverify_certFverify_identitytls_versionstls_ciphersuites)ssl_cassl_certssl_keyssl_verify_certssl_verify_identityr9 tls_cipher_suiteszSwitching to SSLzSSL has been enabledT) r
make_auth_sslsendr debugbuild_ssl_contextget
switch_to_sslr ) r$ sockhostssl_optionsr1 r2 r3 ssl_request_payloadssl_contexts r% setup_sslzMySQLAuthenticator.setup_ssl[ s 6 K ,99%1
%&+,,,??4( __V,OOE*'OOM5A +0A5 I$8)oo.@A -
'(;-+, ""r' Nc || j }|| j }t j d| t || || j
j
|d | j | _ y)a Switches 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) ) r r" r rC r r rE r) r! )r$ new_strategy_namestrategy_classusernamepassword_factors r% _switch_auth_strategyz(MySQLAuthenticator._switch_auth_strategy sq &