HEX
Server: Apache
System: Linux 185.122.168.184.host.secureserver.net 5.14.0-570.60.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Nov 5 05:00:59 EST 2025 x86_64
User: barbeatleanalyti (1024)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //var/opt/nydus/ops/mysql/connector/aio/plugins/__pycache__/mysql_clear_password.cpython-39.pyc
a

�,�hW�@sddZddlmZmZmZddlmZddlmZddl	m
Z
erLddlmZd	Z
Gd
d	�d	e
�ZdS)z%Clear Password Authentication Plugin.�)�
TYPE_CHECKING�Any�Optional)�errors)�logger�)�MySQLAuthPlugin�)�MySQLSocket�MySQLClearPasswordAuthPluginc@sleZdZdZed�dd�Zeed�dd��Zee	d�dd��Z
eeeed	�d
d�Z
deeed
�dd�ZdS)rzAClass implementing the MySQL Clear Password authentication plugin)�returncCs|j��dS)znPrepare and return password as as clear text.

        Returns:
            bytes: Prepared password.
        �)Z	_password�encode��self�r�c/opt/nydus/tmp/pip-target-wkfpz8uv/lib64/python/mysql/connector/aio/plugins/mysql_clear_password.py�_prepare_password/sz.MySQLClearPasswordAuthPlugin._prepare_passwordcCsdS)zPlugin official name.Zmysql_clear_passwordrrrrr�name7sz!MySQLClearPasswordAuthPlugin.namecCsdS)z'Signals whether or not SSL is required.Frrrrr�requires_ssl<sz)MySQLClearPasswordAuthPlugin.requires_ssl)�	auth_data�kwargsrcKs&|jr|jst�|j�d���|��S)z�Return the prepared password to send to MySQL.

        Raises:
            InterfaceError: When SSL is required by not enabled.

        Returns:
            str: The prepared password.
        z
 requires SSL)rZ_ssl_enabledr�InterfaceErrorrr)rrrrrr�
auth_responseAs	z*MySQLClearPasswordAuthPlugin.auth_responser
)�sockrrrc�sh|j|fi|��}|dur$t�d��t�d|t|��|�|�IdHt|��IdH�}t�d|�|S)aSHandles server's `auth switch request` response.

        Args:
            sock: Pointer to the socket connection.
            auth_data: Plugin provided data (extracted from a packet
                       representing an `auth switch request` response).
            kwargs: 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:
            packet: Last server's response after back-and-forth
                    communication.
        NzGot a NULL auth responsez# request: %s size: %sz# server response packet: %s)	rrrr�debug�len�write�bytes�read)rrrr�responseZpktrrr�auth_switch_responseNs
z1MySQLClearPasswordAuthPlugin.auth_switch_responseN)�__name__�
__module__�__qualname__�__doc__rr�property�strr�boolrrrrr!rrrrr,s�N)r%�typingrrrZmysql.connectorrZmysql.connector.loggerr�r�networkr
ZAUTHENTICATION_PLUGIN_CLASSrrrrr�<module>s