/var/opt/nydus/ops/mysql/connector/aio/__pycache__
Edit: /var/opt/nydus/ops/mysql/connector/aio/__pycache__/protocol.cpython-312.pyc (11514B)
Nj(1 d Z dgZddlZddlmZmZmZmZmZ ddl m
Z
mZ ddlm
Z
mZmZ ddlmZ dd lmZmZmZ dd
lmZmZmZmZ ddlmZmZ dd
lmZ ddl m!Z!m"Z" ddl#m$Z$ G d de Zy)z,Implements the MySQL Client/Server protocol.
MySQLProtocol N)AnyDictListOptionalTuple )
ClientFlag ServerCmd)InterfaceErrorProgrammingError
get_exception)logger)DEFAULT_CHARSET_IDDEFAULT_MAX_ALLOWED_PACKETr )BinaryProtocolTypeDescriptionType
EofPacketType
HandShakeType)lc_intread_lc_string_list )MySQLSocket)MySQLAuthPluginget_auth_plugin)"MySQLCachingSHA2PasswordAuthPluginc e Zd ZdZe ddededededee d ed
ee ee
f deeef fd Z
eded
eddddddf
dedededee dedededee dee dee eef ded ed
ee ee
f deeef fd Z ddedee dededee deeeedf ee f fdZ d dedeedf dedee deeeee df ee f f
dZy)!r zSImplements MySQL client/server protocol.
Create and parses MySQL packets.
NF auth_datausernamepasswordauth_pluginauth_plugin_classssl_enabled
plugin_configreturnc @ |s|dk( rdt ||| fS |i } t || ||| } |j | fi |}|t d|j
t
t | |z }||fS # t t f$ r} t d| | d} ~ ww xY w)a Prepare the first authentication response.
Args:
auth_data: Authorization data from initial handshake.
username: Account's username.
password: Account's password.
client_flags: Integer representing client capabilities flags.
auth_plugin: Authorization plugin name.
auth_plugin_class: Authorization plugin class (has higher precedence
than the authorization plugin name).
ssl_enabled: Whether SSL is enabled or not.
plugin_config: Custom configuration to be passed to the auth plugin
when invoked. The parameters defined here will override
the ones defined in the auth plugin itself.
Returns:
auth_response: Authorization plugin response.
auth_strategy: Authorization plugin instance created based
on the provided `auth_plugin` and `auth_plugin_class`
parameters.
Raises:
InterfaceError: If authentication fails or when got a NULL auth response.
)r# NzFailed authentication: z8Got NULL auth response while authenticating with plugin )r r
auth_response TypeErrorr namer len)
r r r r! r" r# r$
auth_strategyr) errs
M/opt/nydus/tmp/pip-target-a90h98xg/lib/python/mysql/connector/aio/protocol.pyauth_plugin_first_responsez(MySQLProtocol.auth_plugin_first_response: s D K2->(
M KKOK9JK(M 8M77 S]SM ',,-/
s=12]B
m++ >* K #:3%!@AsJ Ks (A: :B BBr handshakedatabasecharsetclient_flagsmax_allowed_packet
conn_attrsis_change_user_requestc
\ |j }
g }|
rt j d t j d | t d d| j d t d d |xs | d }t j d
| |
rB|j t j dt |
dt j |
n9d
}|j t j d| t |
d||||
t j | d |||||| \ }}|j | |j t j || |
r%|j t j d| |t j" z r"|j |j dz |t j$ z r&| $|j t j' | dj) | |fS # t
t f$ r}t d| d dd}~ww xY w)a Make a MySQL Authentication packet.
Args:
handshake: Initial handshake.
username: Account's username.
password: Account's password.
database: Initial database name for the connection
charset: Client charset (see [2]), only the lower 8-bits.
client_flags: Integer representing client capabilities flags.
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.
ssl_enabled: Whether SSL is enabled or not.
plugin_config: Custom configuration to be passed to the auth plugin
when invoked. The parameters defined here will override
the one defined in the auth plugin itself.
Returns:
handshake_response: Handshake response as per [1].
auth_strategy: Authorization plugin instance created based
on the provided `auth_plugin` and `auth_plugin_class`.
Raises:
ProgrammingError: Handshake misses authentication info.
References:
[1]: https://dev.mysql.com/doc/dev/mysql-server/latest/ page_protocol_connection_phase_packets_protocol_handshake_response.html
[2]: https://dev.mysql.com/doc/dev/mysql-server/latest/ page_protocol_basic_character_set.html#a_protocol_character_set
zGot a `change user` requestzStarting authorization phaseNzGot a NULL handshaker z$Handshake misses authentication infor! z-Handshake misses authentication plugin info ()z#The provided initial strategy is %sz