
    bh              	           S r SSKrSSKJrJr  SSKJr  SSKJrJ	r	J
r
Jr  SSKJrJr  SSKJr  \(       a  SS	KJr  S
r " S S\5      r\" SSS9 SS\S\
\   S\\   4S jj5       rg)z!Base Authentication Plugin class.    N)ABCabstractmethod)	lru_cache)TYPE_CHECKINGAnyOptionalType   )NotSupportedErrorProgrammingError)logger)MySQLSocketzmysql.connector.pluginsc            	           \ rS rSrSr SS\S\S\SS4S jjr\S\4S	 j5       r	\\
S\4S
 j5       5       r\\
S\4S j5       5       r\
S\S\S\\   4S j5       rSSS\S\S\4S jr\
SSS\S\S\4S j5       rSrg)MySQLAuthPlugin.   zAuthorization plugin interface.usernamepasswordssl_enabledreturnNc                 @    Uc  SOUU l         Uc  SOUU l        X0l        g)zConstructor.N )	_username	_password_ssl_enabled)selfr   r   r   s       i/var/www/home/psychics-availability/venv/lib/python3.13/site-packages/mysql/connector/plugins/__init__.py__init__MySQLAuthPlugin.__init__1   s&     %-$4b($,$4b("-    c                     U R                   $ )z&Signals whether or not SSL is enabled.)r   r   s    r   r   MySQLAuthPlugin.ssl_enabled<   s        r   c                     g)z'Signals whether or not SSL is required.N r!   s    r   requires_sslMySQLAuthPlugin.requires_sslA       r   c                     g)zPlugin official name.Nr$   r!   s    r   nameMySQLAuthPlugin.nameF   r'   r   	auth_datakwargsc                     g)aH  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$   )r   r+   r,   s      r   auth_responseMySQLAuthPlugin.auth_responseK   r'   r   sockr   c                     [         e)a  Handles 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.
)NotImplementedErrorr   r0   r+   r,   s       r   auth_more_response"MySQLAuthPlugin.auth_more_responseY   s
      "!r   c                     g)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.
Nr$   r3   s       r   auth_switch_response$MySQLAuthPlugin.auth_switch_responsek   r'   r   )r   r   r   )F)__name__
__module____qualname____firstlineno____doc__strboolr   propertyr   r   r%   r)   bytesr   r   r.   r4   r7   __static_attributes__r$   r   r   r   r   .   s   ) "		.	. 	. 		.
 
	. !T ! ! 6d 6  6 $c $  $ u    "!".3"?B"	"$ !.3?B	 r   r   
   F)maxsizetypedplugin_nameauth_plugin_classr   c                    [         nU (       a   [        R                  " SU5        [        R                  " SU 5        [        R                  " SU  3U5      nU(       a  [        X15      (       d  UR                  n[        R                  " SU5        [        X15      $ [        SU  S	35      e! [         a!  n[        R                  " SU5         SnAN5SnAf[         a  n[        SU 35      UeSnAff = f)
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`.
zpackage: %szplugin_name: %s.zAUTHENTICATION_PLUGIN_CLASS: %sz"Requested Module was not found: %sNzInvalid module name: zAuthentication plugin 'z' is not supported)DEFAULT_PLUGINS_PKGr   info	importlibimport_modulehasattrAUTHENTICATION_PLUGIN_CLASSgetattrModuleNotFoundErrorwarning
ValueErrorr   r   )rF   rG   packageplugin_moduleerrs        r   get_auth_pluginrW   ~   s    ( "G	KKKw/KK);7%33a}4EwOM$GM,U,U$1$M$M!KK9;LM=<<
 5k]BTU
VV	 # 	FNN?EE 	K"%:3%#@AsJ	Ks$   BB+ +
C25CC2C--C2)N)r=   rL   abcr   r   	functoolsr   typingr   r   r   r	   errorsr   r   r   networkr   rJ   r   r>   rW   r$   r   r   <module>r]      s   : (  #  5 5 8 %/ Mc M` 2U# (,!W!W}!W 
/!W $!Wr   