hyb
2025-12-30 399ffc4d9829f70529d3b096fe4228f7496cc566
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
Ë
Wñúh­9ãó´—dZddlmZddlmZmZmZmZddlm    Z    m
Z
m Z ddl m Z ddl mZmZddlmZmZmZmZmZmZmZmZdd    lmZerdd
lmZGd „d «Zy )z5Implementing support for MySQL Authentication Pluginsé)Ú annotations)Ú TYPE_CHECKINGÚAnyÚDictÚOptionalé)ÚInterfaceErrorÚNotSupportedErrorÚ get_exception)Úlogger)ÚMySQLAuthPluginÚget_auth_plugin)ÚAUTH_SWITCH_STATUSÚDEFAULT_CHARSET_IDÚDEFAULT_MAX_ALLOWED_PACKETÚ
ERR_STATUSÚEXCHANGE_FURTHER_STATUSÚ
MFA_STATUSÚ    OK_STATUSÚ MySQLProtocol)Ú HandShakeType)Ú MySQLSocketcó —eZdZdZdd„Zedd„«Zedd„«Zdd„Ze    de
f                                                    dd„Z             d                                    dd    „Z                         dd
„Z                         dd „Zd d d d de    de
dddd ddf                                                                                                                                    dd„Zy)ÚMySQLAuthenticatorz$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 úQH:\Change_password\venv_build\Lib\site-packages\mysql/connector/authentication.pyÚ__init__zMySQLAuthenticator.__init__8s0€à ˆŒØ*,ˆŒØ.0ˆÔØ"'ˆÔØ9=ˆÔØ15ˆÕócó—|jS)z&Signals whether or not SSL is enabled.)r r#s r%Ú ssl_enabledzMySQLAuthenticator.ssl_enabledAs€ðנѠРr'có—|jS)aCustom arguments that are being provided to the authentication plugin when called.
 
        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()`.
        )rr#s r%Ú plugin_configz MySQLAuthenticator.plugin_configFs€ð×"Ñ"Ð"r'có:—|jj|«y)z,Update the 'plugin_config' instance variableN)rÚupdate)r$Úconfigs  r%Úupdate_plugin_configz'MySQLAuthenticator.update_plugin_configWs€à ×Ñ×"Ñ" 6Õ*r'rc ó—|€i}tj|||¬«}|j|«tjd«|j |j d«|j d«|j d«|j dd«|j dd«|j d    «|j d
«¬ «}tjd «|j||«tjd «d|_|S)aãSets up an SSL communication channel.
 
        Args:
            sock: Pointer to the socket connection.
            host: Server host name.
            ssl_options: SSL and TLS connection options (see
                         `network.MySQLSocket.build_ssl_context`).
            charset: Client charset (see [1]), only the lower 8-bits.
            client_flags: Integer representing client capabilities flags.
            max_allowed_packet: Maximum packet size.
 
        Returns:
            ssl_request_payload: Payload used to carry out SSL authentication.
 
        References:
            [1]: https://dev.mysql.com/doc/dev/mysql-server/latest/                page_protocol_basic_character_set.html#a_protocol_character_set
        )ÚcharsetÚ client_flagsÚmax_allowed_packetzBuilding SSL contextÚcaÚcertÚkeyÚ verify_certFÚverify_identityÚ tls_versionsÚtls_ciphersuites)Ússl_caÚssl_certÚssl_keyÚssl_verify_certÚssl_verify_identityr9Útls_cipher_suiteszSwitching to SSLzSSL has been enabledT)    rÚ make_auth_sslÚsendr ÚdebugÚbuild_ssl_contextÚgetÚ switch_to_sslr )    r$ÚsockÚhostÚ ssl_optionsr1r2r3Ússl_request_payloadÚ ssl_contexts             r%Ú    setup_sslzMySQLAuthenticator.setup_ssl[sð€ð6 Р؈Kô,×9Ñ9ØØ%Ø1ô
Ðð
         ‰    Ð%Ô&ä ‰ Ð+Ô,Ø×,Ñ,Ø—?‘? 4Ó(Ø —_‘_ VÓ,Ø—O‘O EÓ*Ø'ŸO™O¨M¸5ÓAØ +§¡Ð0AÀ5Ó IØ$Ÿ™¨Ó8Ø)Ÿo™oÐ.@ÓAð-ó
ˆ ô     ‰ Ð'Ô(Ø ×ј;¨Ô-ä ‰ Ð+Ô,Ø ˆÔà"Ð"r'Ncóæ—|€ |j}|€ |j}tjd|«t    ||¬«||j
j |d«|j¬«|_y)a®Switches 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 rCrrrEr)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ó¦—d}|dtk(r-||jvr td«‚tj|«\}}|j ||¬«t jd||jj«|jj||fi|j¤Ž}|dtk(r=tj|«}|jj||fi|j¤Ž}|dtk(rt jd«|S|dt k(r t#|«‚|dz }|dtk(rŒ-t j$d«y    )
a Handles 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.
        ééz5Failed Multi Factor Authentication (invalid N factor))rSzMFA %i factor %szMFA completed succesfullyrz"MFA terminated with a no ok packetN)rrr    rÚparse_auth_next_factorrTr rCr!ÚnameÚauth_switch_responserrÚparse_auth_more_dataÚauth_more_responserrr Úwarning)r$rGÚpktÚn_factorrPÚ    auth_datas      r%Ú _mfa_n_factorz MySQLAuthenticator._mfa_n_factor¶sP€ð*ˆØ!‰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    Ø<d×)Ñ)×<Ñ<ؘ)ñØ'+×':Ñ':ñð1‰vœÒ"Ü— ‘ Ð8Ô9ؐ
à1‰vœÒ#Ü# CÓ(Ð(à ˜‰MˆHð7!‰fœ
Ô"ô:    ‰Ð;Ô<Ør'cóF—|dtk(rt|«dk(r td«‚|dtk(rftjd«t j |«\}}|j|«|jj||fi|j¤Ž}|dtk(rRtjd«t j|«}|jj||fi|j¤Ž}|dtk(r,tjd|jj«|S|dt k(rQtjd«tjd|jj«|j#||«S|dt$k(r t'|«‚y    )
aýHandles 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.
        rWé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 requestzExchanging further packetsz%s completed succesfullyz$Starting multi-factor authenticationzMFA 1 factor %sN)rÚlenr
r rCrÚparse_auth_switch_requestrTr!rZrrr[r\rrYrrarr )r$rGr^rPr`s     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Ø8$×%Ñ%×8Ñ8ؐ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¨CÓ0Ð 0à ˆq‰6”ZÒ Ü Ó$Ð $àr'rFcóf—||_|||dœ|_| |_tj||||||    |
| | | ||j
|j ¬« \}|_|rdd|fndd|f}|j|g|¢­Žt|j|««}|j||«}|€ td«d‚|S)a Performs 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.
            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
        )rrVé) Ú    handshakerRÚpasswordÚdatabaser1r2r3Ú auth_pluginrOÚ
conn_attrsÚis_change_user_requestr)r+rNzGot a NULL ok_pkt) rrr"rÚ    make_authr)r+r!rBÚbytesÚrecvrfr    )r$rGrirRÚ    password1Ú    password2Ú    password3rkr1r2r3rlrOrmrnÚ read_timeoutÚ write_timeoutÚresponse_payloadÚ    send_argsr^Úok_pkts                     r%Ú authenticatezMySQLAuthenticator.authenticate#så€ðt"ˆŒØ'¨I¸)ÑDˆŒØ"3ˆÔô1>×0GÑ0GØØØØØØ%Ø1Ø#Ø/Ø!Ø#9Ø×(Ñ(Ø×,Ñ,ô1
Ñ-И$Ô-ñ&&ð=Ñ !à˜˜mÐ,ð    ð
    ˆ    ‰    Ð"Ð/ YÓ/ôD—I‘I˜lÓ+Ó,ˆà×-Ñ-¨d°CÓ8ˆØ ˆ>Ü Ð!4Ó5¸4Ð ?àˆ r')ÚreturnÚNone)r{Úbool)r{úDict[str, Any])r.r~r{r|)rGrrHÚstrrIzOptional[Dict[str, Any]]r1Úintr2r€r3r€r{rp)NNr)
rPrrQú Optional[str]rRrrSr€r{r|)rGrr^rpr{zOptional[bytes])"rGrrirrRrrrrrsrrtrrkrr1r€r2r€r3r€rlrrOrrmzOptional[Dict[str, str]]rnr}ruú Optional[int]rvr‚r{rp)Ú__name__Ú
__module__Ú __qualname__Ú__doc__r&Úpropertyr)r+r/rrrLrTrarfrz©r'r%rr5sü„Ù.ó6ðò!óð!ðò#óð#ó +ð*ØØ"<ð7#àð7#ðð7#ð.ð    7#ð
ð 7#ð ð 7#ð ð7#ð
ó7#ðx)-Ø"&Ø ð  
àð 
ð&ð 
ð ð     
ð
ð  
ð
ó  
ðD4àð4ðð4ð
ó    4ðl5àð5ðð5ð
ó    5ðvØØØØ"&Ø)ØØ"<Ø%)Ø+/Ø/3Ø',Ø&*Ø'+ð#^àð^ð!ð^ðð    ^ð
ð ^ð ð ^ðð^ð ð^ðð^ðð^ð ð^ð#ð^ð)ð^ð-ð^ð!%ð^ð $ð!^ð"%ð#^ð$
ô%^r'rN)r†Ú
__future__rÚtypingrrrrÚerrorsr    r
r r Úpluginsr rÚprotocolrrrrrrrrÚtypesrÚnetworkrrrˆr'r%ú<module>rsEðñ:<Ý"ç5Ó5çDÑDÝß5÷    ÷    ó    õ!áÝ$÷LòLr'