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__/__init__.cpython-39.pyc
a

�,�h��@s�dZddlZddlmZmZddlmZddlmZm	Z	m
Z
mZddlm
Z
mZddlmZerldd	lmZd
ZGdd�de�Zed
dd�dee
eeed�dd��ZdS)z!Base Authentication Plugin class.�N)�ABC�abstractmethod)�	lru_cache)�
TYPE_CHECKING�Any�Optional�Type�)�NotSupportedError�ProgrammingError)�logger)�MySQLSocketzmysql.connector.pluginsc@s�eZdZdZdeeedd�dd�Zeed�dd	��Zee	ed�d
d���Z
ee	ed�dd
���Ze	ee
eed�dd��Zdee
ed�dd�Ze	dee
ed�dd��ZdS)�MySQLAuthPluginzAuthorization plugin interface.FN)�username�password�ssl_enabled�returncCs.|durdn||_|durdn||_||_dS)zConstructor.N�)Z	_usernameZ	_password�_ssl_enabled)�selfrrr�r�S/opt/nydus/tmp/pip-target-wkfpz8uv/lib64/python/mysql/connector/plugins/__init__.py�__init__1szMySQLAuthPlugin.__init__)rcCs|jS)z&Signals whether or not SSL is enabled.)r�rrrrr<szMySQLAuthPlugin.ssl_enabledcCsdS)z'Signals whether or not SSL is required.Nrrrrr�requires_sslAszMySQLAuthPlugin.requires_sslcCsdS)zPlugin official name.Nrrrrr�nameFszMySQLAuthPlugin.name)�	auth_data�kwargsrcKsdS)a�Make the client's authorization response.

        Args:
            auth_data: Authorization data.
            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: Client's authorization response.
        Nr)rrrrrr�
auth_responseKszMySQLAuthPlugin.auth_responser
)�sockrrrcKst�dS)a1Handles server's `auth more data` response.

        Args:
            sock: Pointer to the socket connection.
            auth_data: Authentication method data (from a packet representing
                       an `auth more data` 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.
        N)�NotImplementedError�rrrrrrr�auth_more_responseYsz"MySQLAuthPlugin.auth_more_responsecKsdS)a?Handles 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.
        Nrr!rrr�auth_switch_responseksz$MySQLAuthPlugin.auth_switch_response)F)�__name__�
__module__�__qualname__�__doc__�str�boolr�propertyrrrr�bytesrrrr"r#rrrrr.s2����r�
F)�maxsize�typed)�plugin_name�auth_plugin_classrc
Cs�t}|r�zVt�d|�t�d|�t�d|��|�}|rBt||�sH|j}t�d|�t||�WSty�}zt�	d|�WYd}~n<d}~0t
y�}ztd|���|�WYd}~n
d}~00td|�d	���dS)
a�Return authentication class based on plugin name

    This function returns the class for the authentication plugin plugin_name.
    The returned class is a subclass of BaseAuthPlugin.

    Args:
        plugin_name (str): Authentication plugin name.
        auth_plugin_class (str): Authentication plugin class name.

    Raises:
        NotSupportedError: When plugin_name is not supported.

    Returns:
        Subclass of `MySQLAuthPlugin`.
    zpackage: %szplugin_name: %s�.zAUTHENTICATION_PLUGIN_CLASS: %sz"Requested Module was not found: %sNzInvalid module name: zAuthentication plugin 'z' is not supported)
�DEFAULT_PLUGINS_PKGr�info�	importlib�
import_module�hasattrZAUTHENTICATION_PLUGIN_CLASS�getattr�ModuleNotFoundError�warning�
ValueErrorrr
)r/r0�packageZ
plugin_module�errrrr�get_auth_plugin~s &r=)N)r'r4�abcrr�	functoolsr�typingrrrr�errorsr
rr�networkr
r2rr(r=rrrr�<module>s"P
��