U
    ec^                     @   sj   d Z ddlZddlZddlmZ ddlmZmZ ee	
e  ee	ZdZeddd	d
d ZdS )z5Implementing support for MySQL Authentication Plugins    N)	lru_cache   )NotSupportedErrorProgrammingErrorzmysql.connector.plugins
   F)maxsizetypedc              
   C   s   t }| rzFtd| td|  td|  |}td|j t||jW S  tk
r| } ztd| W 5 d}~X Y n2 t	k
r } zt
d| |W 5 d}~X Y nX td|  d	dS )
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.

    Raises NotSupportedError when plugin_name is not supported.

    Returns subclass of BaseAuthPlugin.
    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_PKG_LOGGERinfo	importlibimport_moduleZAUTHENTICATION_PLUGIN_CLASSgetattrModuleNotFoundErrorwarning
ValueErrorr   r   )Zplugin_namepackageZplugin_moduleerr r   B/tmp/pip-unpacked-wheel-ix8dg7li/mysql/connector/authentication.pyget_auth_plugin-   s     "r   )__doc__r   logging	functoolsr   errorsr   r   	getLogger__name__
addHandlerNullHandlerr   r
   r   r   r   r   r   <module>   s   

