hyb
2026-01-09 4cb426cb3ae31e772a09d4ade5b2f0242aaeefa0
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
Ë
Wñúh“2ãó—dZddlmZdgZddlmZmZmZmZddl    m
Z
m Z m Z ddl mZmZmZmZmZmZmZddlmZd    d
lmZd    d lmZmZd    d l mZerd    d lmZGd„d«Zy)z6Implementing support for MySQL Authentication Plugins.é)Ú annotationsÚMySQLAuthenticator)Ú TYPE_CHECKINGÚAnyÚDictÚOptionalé)ÚInterfaceErrorÚNotSupportedErrorÚ get_exception)ÚAUTH_SWITCH_STATUSÚDEFAULT_CHARSET_IDÚDEFAULT_MAX_ALLOWED_PACKETÚ
ERR_STATUSÚEXCHANGE_FURTHER_STATUSÚ
MFA_STATUSÚ    OK_STATUS)Ú HandShakeTypeé)Úlogger)ÚMySQLAuthPluginÚget_auth_plugin)Ú MySQLProtocol)Ú MySQLSocketcóü—eZdZdZdd„Zedd„«Zedd„«Zdd„Z            d                                    dd„Z                            dd„Z
                        dd    „Z d
d
d
d
de d d e dddd ddf                                                                                                                                            dd „Zy)rz$Implements the authentication phase.cóX—d|_i|_i|_d|_d|_d|_y)z Constructor.ÚFN)Ú    _usernameÚ
_passwordsÚ_plugin_configÚ _ssl_enabledÚ_auth_strategyÚ_auth_plugin_class©Úselfs úUH:\Change_password\venv_build\Lib\site-packages\mysql/connector/aio/authentication.pyÚ__init__zMySQLAuthenticator.__init__;s0€à ˆŒØ*,ˆŒØ.0ˆÔØ"'ˆÔØ9=ˆÔØ15ˆÕócó—|jS)z&Signals whether or not SSL is enabled.)r!r$s r&Ú ssl_enabledzMySQLAuthenticator.ssl_enabledDs€ðנѠРr(có—|jS)aöCustom arguments that are being provided to the authentication plugin.
 
        The parameters defined here will override the ones defined in the
        auth plugin itself.
 
        The plugin config is a read-only property - the plugin configuration
        provided when invoking `authenticate()` is recorded and can be queried
        by accessing this property.
 
        Returns:
            dict: The latest plugin configuration provided when invoking
                  `authenticate()`.
        )r r$s r&Ú plugin_configz MySQLAuthenticator.plugin_configIs€ð×"Ñ"Ð"r(có:—|jj|«y)z,Update the 'plugin_config' instance variableN)r Úupdate)r%Úconfigs  r&Úupdate_plugin_configz'MySQLAuthenticator.update_plugin_configZs€à ×Ñ×"Ñ" 6Õ*r(Ncóæ—|€ |j}|€ |j}tjd|«t    ||¬«||j
j |d«|j¬«|_y)a¬Switch the authorization plugin.
 
        Args:
            new_strategy_name: New authorization plugin name to switch to.
            strategy_class: New authorization plugin class to switch to
                            (has higher precedence than the authorization plugin name).
            username: Username to be used - if not defined, the username
                      provided when `authentication()` was invoked is used.
            password_factor: Up to three levels of authentication (MFA) are allowed,
                             hence you can choose the password corresponding to the 1st,
                             2nd, or 3rd factor - 1st is the default.
        NzSwitching to strategy %s)Ú plugin_nameÚauth_plugin_classr)r*)    rr#rÚdebugrrÚgetr*r")r%Únew_strategy_nameÚstrategy_classÚusernameÚpassword_factors     r&Ú_switch_auth_strategyz(MySQLAuthenticator._switch_auth_strategy^sq€ð& Ð Ø—~‘~ˆHà Ð !Ø!×4Ñ4ˆNä ‰ Ð/Ð1BÔCð
œoØ)¸^ô
ð Ø O‰O× Ñ  °Ó 4Ø×(Ñ(ô 
ˆÕr(cƒóÖK—d}|dtk(r=||jvr td«‚tj|«\}}|j ||¬«t jd||jj«|jj||fi|j¤Žƒd{–—†}|dtk(rEtj|«}|jj||fi|j¤Žƒd{–—†}|dtk(rt jd«|S|dt k(r t#|«‚|dz }|dtk(rŒ=t j$d    «y7Œ¸7Œi­w)
a Handle MFA (Multi-Factor Authentication) response.
 
        Up to three levels of authentication (MFA) are allowed.
 
        Args:
            sock: Pointer to the socket connection.
            pkt: MFA response.
 
        Returns:
            ok_packet: If last server's response is an OK packet.
            None: If last server's response isn't an OK packet and no ERROR was raised.
 
        Raises:
            InterfaceError: If got an invalid N factor.
            errors.ErrorTypes: If got an ERROR response.
        r    éz5Failed Multi Factor Authentication (invalid N factor))r9zMFA %i factor %sNzMFA completed succesfullyrz"MFA terminated with a no ok packet)rrr
rÚparse_auth_next_factorr:rr4r"ÚnameÚauth_switch_responser rÚparse_auth_more_dataÚauth_more_responserrr Úwarning)r%ÚsockÚpktÚn_factorr6Ú    auth_datas      r&Ú _mfa_n_factorz MySQLAuthenticator._mfa_n_factor€sièø€ð*ˆØ!‰fœ
Ó"ؘtŸ™Ñ.Ü$ØKóðô,9×+OÑ+OÐPSÓ+TÑ (Ð ˜yØ × &Ñ &Ð'8È(Ð &Ô SÜ L‰LÐ+¨X°t×7JÑ7J×7OÑ7OÔ Pà@˜×+Ñ+×@Ñ@ؐiñØ#'×#6Ñ#6ñ÷ˆCð1‰vÔ0Ò0Ü)×>Ñ>¸sÓC    ØB˜D×/Ñ/×BÑBؘ)ñØ'+×':Ñ':ñ÷ð1‰vœÒ"Ü— ‘ Ð8Ô9ؐ
à1‰vœÒ#Ü# CÓ(Ð(à ˜‰MˆHð7!‰fœ
Ô"ô:    ‰Ð;Ô<Øð)øð ús,‚B*E)Â,E%Â-AE)Ã=E'Ã>AE)ÅE)Å'E)cƒóŒK—|dtk(rt|«dk(r td«‚|dtk(rntjd«t j |«\}}|j|«|jj||fi|j¤Žƒd{–—†}|dtk(rZtjd«t j|«}|jj||fi|j¤Žƒd{–—†}|dtk(r,tjd|jj«|S|dt k(rYtjd«tjd    |jj«|j#||«ƒd{–—†S|dt$k(r t'|«‚y7Œ 7Œ¼7Œ!­w)
aüHandle server's response.
 
        Args:
            sock: Pointer to the socket connection.
            pkt: Server's response after completing the `HandShakeResponse`.
 
        Returns:
            ok_packet: If last server's response is an OK packet.
            None: If last server's response isn't an OK packet and no ERROR was raised.
 
        Raises:
            errors.ErrorTypes: If got an ERROR response.
            NotSupportedError: If got Authentication with old (insecure) passwords.
        r<éz‡Authentication with old (insecure) passwords is not supported. For more information, lookup Password Hashing in the latest MySQL manualz+Server's response is an auth switch requestNzExchanging further packetsz%s completed succesfullyz$Starting multi-factor authenticationzMFA 1 factor %s)r Úlenr rr4rÚparse_auth_switch_requestr:r"r?r rr@rArr>rrGrr )r%rCrDr6rFs     r&Ú_handle_server_responsez*MySQLAuthenticator._handle_server_response¶s¢èø€ð& ˆq‰6Ô'Ò '¬C°«H¸ªMÜ#ð>óð ð ˆq‰6Ô'Ò 'Ü L‰LÐFÔ GÜ+8×+RÑ+RÐSVÓ+WÑ (Ð ˜yØ × &Ñ &Ð'8Ô 9Ø@˜×+Ñ+×@Ñ@ؐiñØ#'×#6Ñ#6ñ÷ˆCð ˆq‰6Ô,Ò ,Ü L‰LÐ5Ô 6Ü%×:Ñ:¸3Ó?ˆIØ>˜×+Ñ+×>Ñ>ؐiñØ#'×#6Ñ#6ñ÷ˆCð ˆq‰6”YÒ Ü L‰LÐ3°T×5HÑ5H×5MÑ5MÔ N؈Jà ˆq‰6”ZÒ Ü L‰LÐ?Ô @Ü L‰LÐ*¨D×,?Ñ,?×,DÑ,DÔ EØ×+Ñ+¨D°#Ó6×6Ð 6à ˆq‰6”ZÒ Ü Ó$Ð $àð/ùðøð7ús8‚BGÂF=ÂA%GÄGÄBGÆ GÆ!GÇGÇGrrFcƒó¸K—||_|||dœ|_|
|_| |_t    j
||||||    | | | |||j |j¬« \}|_|rdd|fndd|f}|j|g|¢­Žƒd{–—†t|j|«ƒd{–—†«}|j||«ƒd{–—†}|€ td«d‚|S7ŒP7Œ47Œ­w)aäPerform the authentication phase.
 
        During re-authentication you must set `is_change_user_request` to True.
 
        Args:
            sock: Pointer to the socket connection.
            handshake: Initial handshake.
            username: Account's username.
            password1: Account's password factor 1.
            password2: Account's password factor 2.
            password3: Account's password factor 3.
            database: Initial database name for the connection.
            charset: Client charset (see [1]), only the lower 8-bits.
            client_flags: Integer representing client capabilities flags.
            ssl_enabled: Boolean indicating whether SSL is enabled,
            max_allowed_packet: Maximum packet size.
            auth_plugin: Authorization plugin name.
            auth_plugin_class: Authorization plugin class (has higher precedence
                               than the authorization plugin name).
            conn_attrs: Connection attributes.
            is_change_user_request: Whether is a `change user request` operation or not.
            read_timeout: Timeout in seconds upto which the connector should wait for
                          the server to reply back before raising an ReadTimeoutError.
            write_timeout: Timeout in seconds upto which the connector should spend to
                           send data to the server before raising an WriteTimeoutError.
 
        Returns:
            ok_packet: OK packet.
 
        Raises:
            InterfaceError: If OK packet is NULL.
            ReadTimeoutError: If the time taken for the server to reply back exceeds
                              'read_timeout' (if set).
            WriteTimeoutError: If the time taken to send data packets to the server
                               exceeds 'write_timeout' (if set).
 
        References:
            [1]: https://dev.mysql.com/doc/dev/mysql-server/latest/                page_protocol_basic_character_set.html#a_protocol_character_set
        )rr    é) Ú    handshaker8ÚpasswordÚdatabaseÚcharsetÚ client_flagsÚmax_allowed_packetÚ auth_pluginr3Ú
conn_attrsÚis_change_user_requestr*r,rNzGot a NULL ok_pkt)rrr!r#rÚ    make_authr*r,r"ÚwriteÚbytesÚreadrLr
)r%rCrOr8Ú    password1Ú    password2Ú    password3rQrRrSr*rTrUr3rVrWÚ read_timeoutÚ write_timeoutÚresponse_payloadÚ    send_argsrDÚok_pkts                      r&Ú authenticatezMySQLAuthenticator.authenticateís èø€ðz"ˆŒØ'¨I¸)ÑDˆŒØ'ˆÔØ"3ˆÔô1>×0GÑ0GØØØØØØ%Ø1Ø#Ø/Ø!Ø#9Ø×(Ñ(Ø×,Ñ,ô1
Ñ-И$Ô-ñ&&ð=Ñ !à˜˜mÐ,ð    ð
ˆdj‰jÐ)Ð6¨IÒ6×6Ð6ô˜$Ÿ)™) LÓ1×1Ó2ˆà×3Ñ3°D¸#Ó>×>ˆØ ˆ>Ü Ð!4Ó5¸4Ð ?àˆ ð    7øð2øà>ús6‚BCÂCÂCÂ!CÂ"CÂ?CÃCÃCÃC)ÚreturnÚNone)reÚbool)reúDict[str, Any])r/rhrerf)NNr)
r6Ústrr7ú Optional[str]r8rjr9Úintrerf)rCrrDrZrezOptional[bytes])$rCrrOrr8rir\rir]rir^rirQrjrRrkrSrkr*rgrTrkrUrjr3rjrVzOptional[Dict[str, str]]rWrgr_ú Optional[int]r`rlrerZ)Ú__name__Ú
__module__Ú __qualname__Ú__doc__r'Úpropertyr*r,r0r:rGrLrrrd©r(r&rr8sµ„Ù.ó6ðò!óð!ðò#óð#ó +ð)-Ø"&Ø ð  
àð 
ð&ð 
ð ð     
ð
ð  
ð
ó  
ðD4àð4ðð4ð
ó    4ðl5àð5ðð5ð
ó    5ðvØØØØ"&Ø)ØØ!Ø"<Ø%)Ø+/Ø/3Ø',Ø&*Ø'+ð%bàðbð!ðbðð    bð
ð bð ð bððbð ðbððbððbððbð ðbð#ðbð)ðbð-ðbð !%ð!bð"$ð#bð$%ð%bð&
ô'br(N)rpÚ
__future__rÚ__all__ÚtypingrrrrÚerrorsr
r r Úprotocolr rrrrrrÚtypesrrÚpluginsrrrÚnetworkrrrrr(r&ú<module>r{sPðñ:=å"à Ð
 €ç5Ó5çEÑE÷÷ñõ"Ýß5Ý#áÝ$÷WòWr(