✏️ 正在编辑: protocol.cpython-312.pyc
路径:
/var/opt/nydus/ops/mysql/connector/__pycache__/protocol.cpython-312.pyc
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
� ��'j3� � �P � d Z ddlmZ ddlZddlZddlmZ ddlmZm Z ddl mZmZm Z mZmZmZmZmZmZ ddlmZ dd lmZmZmZmZmZ dd lmZ ddlmZm Z m!Z!m"Z" ddl#m#Z# dd l$m%Z%m&Z& ddl'm(Z( ddl)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0 erddl1m2Z2 dZ3dZ4dZ5dZ6dZ7dZ8dZ9dZ:dZ;dZ< G d� d� Z=y)z,Implements the MySQL Client/Server protocol.� )�annotationsN)�deque)�Decimal�DecimalException) � TYPE_CHECKING�Any�Deque�Dict�List�Optional�Sequence�Tuple�Union� )�utils)�PARAMETER_COUNT_AVAILABLE� ClientFlag� FieldFlag� FieldType� ServerCmd)�MySQLConverter)� DatabaseError�InterfaceError�ProgrammingError� get_exception)�logger)�MySQLAuthPlugin�get_auth_plugin)�"MySQLCachingSHA2PasswordAuthPlugin)�BinaryProtocolType�DescriptionType� EofPacketType� HandShakeType�OkPacketType�StatsPacketType� StrOrBytes)�MySQLSocket� � � � � �- i @c �F � e Zd ZdZed#d�� Zed$d�� Zed$d�� Zed%d�� Zed&d�� Z e d' d(d �� Z eded eddddddf d)d�� Z eed ef d*d�� Zed+d,d �� Zed-d.d�� Zed/d�� Zed0d�� Zed1d�� Zed2d3d�� Zd4d�Zed5d6d�� Z d7 d8d�Ze d9d�� Ze d:d�� Ze d; d<d�� Ze d=d�� Zed>d�� Z d2 d?d�Z d@ dAd�ZedBd�� ZedCd�� Z e dDd�� Z!e dEd �� Z"edFd!�� Z# dG dHd"�Z$y)I� MySQLProtocolzRImplements MySQL client/server protocol Create and parses MySQL packets. c �: � | d t k( st d� �| dd S )a Parse a MySQL auth more data packet. Args: pkt: Packet representing an `auth more data` response. Returns: auth_data: Authentication method data (see [1]). Raises: InterfaceError: If packet's status tag doesn't match `protocol.EXCHANGE_FURTHER_STATUS`. References: [1]: https://dev.mysql.com/doc/dev/mysql-server/latest/ page_protocol_connection_phase_packets_protocol_auth_more_data.html � z"Failed parsing AuthMoreData packet� N)�EXCHANGE_FURTHER_STATUSr )�pkts �I/opt/nydus/tmp/pip-target-k0fmikie/lib/python/mysql/connector/protocol.py�parse_auth_more_dataz"MySQLProtocol.parse_auth_more_data^ s( � �$ �1�v�0�0� �!E�F�F��1�2�w�� c � � | d t k7 rt d� �t j | dd d�� \ } }| r | d dk( r| dd } |j � | fS ) a| Parse a MySQL auth switch request packet. Args: pkt: Packet representing an `auth switch request` response. Returns: plugin_name: Name of the client authentication plugin to switch to. plugin_provided_data: Plugin provided data (see [1]). Raises: InterfaceError: If packet's status tag doesn't match `protocol.AUTH_SWITCH_STATUS`. References: [1]: https://dev.mysql.com/doc/dev/mysql-server/ latest/page_protocol_connection_phase_packets_protocol_ auth_switch_request.html r1 z'Failed parsing AuthSwitchRequest packetr2 N� ��end���r )�AUTH_SWITCH_STATUSr r �read_string�decode)r4 �plugin_names r5 �parse_auth_switch_requestz'MySQLProtocol.parse_auth_switch_requestt sf � �( �q�6�'�'� �!J�K�K� �,�,�S���W�'�B���[��3�r�7�a�<��c�r�(�C��!�!�#�S�(�(r7 c � � t j | dd d� \ } }|t k7 rt d� �t j | d�� \ } }|j � | fS )a� Parse a MySQL auth next factor packet. Args: pkt: Packet representing an `auth next factor` response. Returns: plugin_name: Name of the client authentication plugin. plugin_provided_data: Initial authentication data for that client plugin (see [1]). Raises: InterfaceError: If packet's packet type doesn't match `protocol.MFA_STATUS`. References: [1]: https://dev.mysql.com/doc/dev/mysql-server/latest/ page_protocol_connection_phase_packets_protocol_auth_ next_factor_request.html r1 Nr z.Failed parsing AuthNextFactor packet (invalid)r9 r: )r �read_int� MFA_STATUSr r>