?????????? ????????? - ??????????????? - /home/agenciai/.local/lib/python3.9/site-packages/mysql/connector/aio/__pycache__/protocol.cpython-39.pyc
???????
a ��Jh(1 � @ s� 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 dd� de�ZdS )z,Implements the MySQL Client/Server protocol.� MySQLProtocol� N)�Any�Dict�List�Optional�Tuple� )� ClientFlag� ServerCmd)�InterfaceError�ProgrammingError� get_exception)�logger)�DEFAULT_CHARSET_ID�DEFAULT_MAX_ALLOWED_PACKETr )�BinaryProtocolType�DescriptionType� EofPacketType� HandShakeType)�lc_int�read_lc_string_list� )�MySQLSocket)�MySQLAuthPlugin�get_auth_plugin)�"MySQLCachingSHA2PasswordAuthPluginc @ s2 e Zd ZdZedeeeeee eee ee f eeef d�dd��Z edededdddddf eeeee eeeee ee ee eef eeee ee f eeef d�d d ��Zdeee eeee eeeed f ee f d�dd�Zdeeed f eee eeeee d f ee f d�dd�ZdS )r zSImplements MySQL client/server protocol. Create and parses MySQL packets. NF)� auth_data�username�password�auth_plugin�auth_plugin_class�ssl_enabled� plugin_config�returnc C s� |s|dkrdt |||d�fS |du r*i }z*t||�|||d�}|j| fi |��}W n8 ttfy� } ztd| � ��| �W Y d} ~ n d} ~ 0 0 |du r�td|j� ���tt|��| }||fS )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"