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/plugins/__pycache__/mysql_clear_password.cpython-39.pyc
a

�,�h'�@sddZddlmZmZmZddlmZddlmZddlmZerLddl	m
Z
d	ZGd
d	�d	e�ZdS)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�_/opt/nydus/tmp/pip-target-wkfpz8uv/lib64/python/mysql/connector/plugins/mysql_clear_password.py�_prepare_password.sz.MySQLClearPasswordAuthPlugin._prepare_passwordcCsdS)zPlugin official name.Zmysql_clear_passwordrrrrr�name6sz!MySQLClearPasswordAuthPlugin.namecCsdS)z'Signals whether or not SSL is required.Trrrrr�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_response@s	z*MySQLClearPasswordAuthPlugin.auth_responser
)�sockrrrcKs\|j|fi|��}|dur$t�d��t�d|t|��|�|�t|���}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�send�bytes�recv)rrrr�responseZpktrrr�auth_switch_responseMs

z1MySQLClearPasswordAuthPlugin.auth_switch_responseN)�__name__�
__module__�__qualname__�__doc__rr�property�strr�boolrrrrr!rrrrr+s�N)
r%�typingrrr�rrr	�networkr
ZAUTHENTICATION_PLUGIN_CLASSrrrrr�<module>s