zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
U
£ý°d+ã@sLdZddlmZddlmZmZddlmZddlm    Z    Gdd„deƒZ
d    S)
z!Base Authentication Plugin class.é)ÚABC)ÚOptionalÚUnioné)Úerrors)Ú
StrOrBytesc@sxeZdZUdZdZeed<dZeed<de    e
e    e e    ee    ee ddœdd    „Z e
d
œd d „Zde    e
e
d œdd„ZdS)ÚBaseAuthPluginaÊBase class for authentication pluginsF
 
 
    Classes inheriting from BaseAuthPlugin should implement the method
    prepare_password(). When instantiating, auth_data argument is
    required. The username, password and database are optional. The
    ssl_enabled argument can be used to tell the plugin whether SSL is
    active or not.
 
    The method auth_response() method is used to retrieve the password
    which was prepared by prepare_password().
    FÚ requires_sslÚÚ plugin_nameN)Ú    auth_dataÚusernameÚpasswordÚdatabaseÚ ssl_enabledÚreturncCs:||_t|ttfƒr| d¡n||_||_||_||_dS)ZInitializationÚutf8N)    Z
_auth_dataÚ
isinstanceÚbytesÚ    bytearrayÚdecodeZ    _usernameÚ    _passwordZ    _databaseÚ _ssl_enabled)Úselfr r rrr©rúWd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\mysql/connector/plugins/__init__.pyÚ__init__7s     ÿ ýzBaseAuthPlugin.__init__)rcCs,|js
dS|j}t|tƒr$| d¡}|dS)znPrepare and return password as as clear text.
 
        Returns:
            bytes: Prepared password.
        ór)rrÚstrÚencode)rrrrrÚprepare_passwordJs 
 
zBaseAuthPlugin.prepare_password)r rcCs&|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)r    rrZInterfaceErrorr r )rr rrrÚ auth_responseYs zBaseAuthPlugin.auth_response)NNNF)N)Ú__name__Ú
__module__Ú __qualname__Ú__doc__r    ÚintÚ__annotations__r rrrrÚboolrr r!rrrrr&s*
  úù ÿþrN) r%ÚabcrÚtypingrrr
rÚtypesrrrrrrÚ<module>s