§
    >Ä³g…  ã            	       óè   — d Z ddlZddlmZmZ ddlmZ ddlmZm	Z	m
Z
mZ ddlmZmZ ddlmZ erdd	lmZ d
Z G d„ de¦  «        Z edd¬¦  «        	 ddede
e         dee         fd„¦   «         ZdS )z!Base Authentication Plugin class.é    N)ÚABCÚabstractmethod)Ú	lru_cache)ÚTYPE_CHECKINGÚAnyÚOptionalÚTypeé   )ÚNotSupportedErrorÚProgrammingError)Úlogger)ÚMySQLSocketzmysql.connector.pluginsc            	       ó  — e Zd ZdZ	 ddedededdfd„Zedefd	„¦   «         Zee	defd
„¦   «         ¦   «         Z
ee	defd„¦   «         ¦   «         Ze	dededee         fd„¦   «         Zdddededefd„Ze	dddededefd„¦   «         ZdS )ÚMySQLAuthPluginzAuthorization plugin interface.FÚusernameÚpasswordÚssl_enabledÚreturnNc                 ó@   — |€dn|| _         |€dn|| _        || _        dS )zConstructor.NÚ )Ú	_usernameÚ	_passwordÚ_ssl_enabled)Úselfr   r   r   s       ú^/var/www/html/mpstechhub/venv/lib/python3.11/site-packages/mysql/connector/plugins/__init__.pyÚ__init__zMySQLAuthPlugin.__init__1   s2   € ð %-Ð$4˜b˜b¸(ˆŒØ$,Ð$4˜b˜b¸(ˆŒØ"-ˆÔÐÐó    c                 ó   — | j         S )z&Signals whether or not SSL is enabled.)r   ©r   s    r   r   zMySQLAuthPlugin.ssl_enabled<   s   € ð Ô Ð r   c                 ó   — dS )z'Signals whether or not SSL is required.N© r   s    r   Úrequires_sslzMySQLAuthPlugin.requires_sslA   ó   € € € r   c                 ó   — dS )zPlugin official name.Nr!   r   s    r   ÚnamezMySQLAuthPlugin.nameF   r#   r   Ú	auth_dataÚkwargsc                 ó   — dS )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!   )r   r&   r'   s      r   Úauth_responsezMySQLAuthPlugin.auth_responseK   r#   r   Úsockr   c                 ó   — t           ‚)a1  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   r*   r&   r'   s       r   Úauth_more_responsez"MySQLAuthPlugin.auth_more_responseY   s
   € õ  "Ð!r   c                 ó   — dS )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!   r-   s       r   Úauth_switch_responsez$MySQLAuthPlugin.auth_switch_responsek   r#   r   )F)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚstrÚboolr   Úpropertyr   r   r"   r%   Úbytesr   r   r)   r.   r0   r!   r   r   r   r   .   s”  € € € € € Ø)Ð)ð "ð		.ð 	.àð	.ð ð	.ð ð		.ð
 
ð	.ð 	.ð 	.ð 	.ð ð!˜Tð !ð !ð !ñ „Xð!ð Øð6˜dð 6ð 6ð 6ñ „^ñ „Xð6ð Øð$�cð $ð $ð $ñ „^ñ „Xð$ð ð uð ¸ð ÀÈÄð ð ð ñ „^ðð"Ø!ð"Ø.3ð"Ø?Bð"à	ð"ð "ð "ð "ð$ ðØ!ðØ.3ðØ?Bðà	ðð ð ñ „^ðð ð r   r   é
   F)ÚmaxsizeÚtypedÚplugin_nameÚauth_plugin_classr   c                 óÔ  — t           }| rÍ	 t          j        d|¦  «         t          j        d| ¦  «         t          j        d| › �|¦  «        }|rt          ||¦  «        s|j        }t          j        d|¦  «         t          ||¦  «        S # t          $ r}t          j	        d|¦  «         Y d}~n(d}~wt          $ r}t          d|› �¦  «        |‚d}~ww xY wt          d| › d	�¦  «        ‚)
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   )r<   r=   ÚpackageÚplugin_moduleÚerrs        r   Úget_auth_pluginrM   ~   s3  € õ( "€GØð Kð	KÝŒK˜ wÑ/Ô/Ð/ÝŒKÐ)¨;Ñ7Ô7Ð7Ý%Ô3Ð4E¸Ð4EÐ4EÀwÑOÔOˆMØ$ð N­G°MÐCTÑ,UÔ,Uð NØ$1Ô$MÐ!ÝŒKÐ9Ð;LÑMÔMÐMÝ˜=Ð*;Ñ<Ô<Ð<øÝ"ð 	Fð 	Fð 	FÝŒNÐ?ÀÑEÔEÐEÐEÐEÐEÐEÐEøøøøÝð 	Kð 	Kð 	KÝ"Ð#@¸3Ð#@Ð#@ÑAÔAÀsÐJøøøøð	Køøøå
ÐU°kÐUÐUÐUÑ
VÔ
VÐVs$   ‹A?B Â
CÂB/Â/CÂ<CÃC)N)r4   rB   Úabcr   r   Ú	functoolsr   Útypingr   r   r   r	   Úerrorsr   r   r   Únetworkr   r@   r   r5   rM   r!   r   r   ú<module>rS      sU  ðð: (Ð 'à Ð Ð Ð à #Ð #Ð #Ð #Ð #Ð #Ð #Ð #Ø Ð Ð Ð Ð Ð Ø 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5à 8Ð 8Ð 8Ð 8Ð 8Ð 8Ð 8Ð 8Ø Ð Ð Ð Ð Ð àð &Ø%Ð%Ð%Ð%Ð%Ð%à/Ð ðMð Mð Mð Mð M�cñ Mô Mð Mð` €�2˜UÐ#Ñ#Ô#ð (,ð!Wð !WØð!Wà ”}ð!Wð 
ˆ/Ôð!Wð !Wð !Wñ $Ô#ð!Wð !Wð !Wr   