hyb
2025-11-07 cadac0a99d87c53805a07f3b4ca7fd11e524fe4a
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
Ë
 
çúhò.ãó—ddlZddlZddlZddlmZmZddlmZddlmZm    Z    m
Z
m Z ddl m Z mZddlmZddlmZej&e«ZGd„d    «ZGd
„d «ZGd „d «ZGd„d«Zd„Zdej6fd„Zy)éN)ÚdatetimeÚtimezone)Úsleep)ÚAnyÚ    AwaitableÚCallableÚUnion)ÚRequestTokenErrÚTokenRenewalErr)ÚIdentityProviderInterface)Ú TokenResponsecóö—eZdZdZd„Zedeeegdfe    ffd„«Z
e
jdeeegdfe    fddfd„«Z
edeee gdfe    ffd„«Z e jdeee gdfe    fddfd    „«Z y)
ÚCredentialsListenerzz
    Listeners that will be notified on events related to credentials.
    Accepts callbacks and awaitable callbacks.
    có —d|_d|_y©N)Ú_on_nextÚ    _on_error©Úselfs õkH:\项目\archive\测试组\脚本\Change_password\venv_build\Lib\site-packages\redis/auth/token_manager.pyÚ__init__zCredentialsListener.__init__s€ØˆŒ ؈óÚreturnNcó—|jSr©rrs rÚon_nextzCredentialsListener.on_nexts €à}‰}ÐrÚcallbackcó—||_yrr©rrs  rrzCredentialsListener.on_nexts    €à ˆ rcó—|jSr©rrs rÚon_errorzCredentialsListener.on_error!s €à~‰~Ðrcó—||_yrr!rs  rr"zCredentialsListener.on_error%s    €à!ˆr)Ú__name__Ú
__module__Ú __qualname__Ú__doc__rÚpropertyr    rrrrÚsetterÚ    Exceptionr"©rrrrså„ñò
ðð˜˜x¨¨¨t¨ Ñ4°iÐ?Ñ@òóðð ‡^^ð!  h°¨u°d¨{Ñ&;¸YÐ&FÑ Gð!ÈDò!óð!ðð˜% ¨)¨°dÐ):Ñ ;¸YРFÑGòóðð‡__ð"  x°° ¸TÐ0AÑ'BÀIÐ'MÑ!Nð"ÐSWò"óñ"rrcó4—eZdZdedefd„Zdefd„Zdefd„Zy)Ú RetryPolicyÚ max_attemptsÚ delay_in_mscó —||_||_yr)r.r/)rr.r/s   rrzRetryPolicy.__init__+s€Ø(ˆÔØ&ˆÕrrcó—|jS)zW
        Retry attempts before exception will be thrown.
 
        :return: int
        )r.rs rÚget_max_attemptszRetryPolicy.get_max_attempts/s€ð נѠРrcó—|jS)zI
        Delay between retries in seconds.
 
        :return: int
        )r/rs rÚget_delay_in_mszRetryPolicy.get_delay_in_ms7s€ð ×ÑÐrN)r$r%r&ÚintÚfloatrr2r4r+rrr-r-*s-„ð' Sð'°uó'ð! #ó!ð  ô rr-cóT—eZdZdedededefd„Zdefd„Zdefd„Zdefd    „Z    defd
„Z
y ) ÚTokenManagerConfigÚexpiration_refresh_ratioÚlower_refresh_bound_millisÚ%token_request_execution_timeout_in_msÚ retry_policycó<—||_||_||_||_yr)Ú_expiration_refresh_ratioÚ_lower_refresh_bound_millisÚ&_token_request_execution_timeout_in_msÚ _retry_policy)rr9r:r;r<s     rrzTokenManagerConfig.__init__As*€ð*BˆÔ&Ø+EˆÔ(à 1ð     Ô3ð*ˆÕrrcó—|jS)a&
        Represents the ratio of a token's lifetime at which a refresh should be triggered. # noqa: E501
        For example, a value of 0.75 means the token should be refreshed
        when 75% of its lifetime has elapsed (or when 25% of its lifetime remains).
 
        :return: float
        )r>rs rÚget_expiration_refresh_ratioz/TokenManagerConfig.get_expiration_refresh_ratioOs€ð×-Ñ-Ð-rcó—|jS)a¤
        Represents the minimum time in milliseconds before token expiration
        to trigger a refresh, in milliseconds.
        This value sets a fixed lower bound for when a token refresh should occur,
        regardless of the token's total lifetime.
        If set to 0 there will be no lower bound and the refresh will be triggered
        based on the expirationRefreshRatio only.
 
        :return: int
        )r?rs rÚget_lower_refresh_bound_millisz1TokenManagerConfig.get_lower_refresh_bound_millisZs€ð×/Ñ/Ð/rcó—|jS)z„
        Represents the maximum time in milliseconds to wait
        for a token request to complete.
 
        :return: int
        )r@rs rÚ)get_token_request_execution_timeout_in_msz<TokenManagerConfig.get_token_request_execution_timeout_in_msgs€ð×:Ñ:Ð:rcó—|jS)z_
        Represents the retry policy for token requests.
 
        :return: RetryPolicy
        )rArs rÚget_retry_policyz#TokenManagerConfig.get_retry_policyps€ð ×!Ñ!Ð!rN) r$r%r&r6r5r-rrCrErGrIr+rrr8r8@s]„ð *à"'ð *ð%(ð *ð03ð     *ð
"ó *ð    .¨eó    .ð 0°ó 0ð;¸3ó;ð" +ô"rr8c ó—eZdZdedefd„Zd„Z    ddedede    gdffd    „Z
            dded
ed e dede    gdff
d „Z d „Z ddefd„Zddefd„Zde de de fd„Zde fd„Zde de fd„Z    ddedej*fd„Z    ddedej*fd„Zy)Ú TokenManagerÚidentity_providerÚconfigcóX—||_||_d|_d|_d|_d|_y)Nr)Ú_idpÚ_configÚ _next_timerÚ    _listenerÚ _init_timerÚ_retries)rrLrMs   rrzTokenManager.__init__zs0€ð&ˆŒ    ØˆŒ ØˆÔØˆŒØˆÔ؈ rcóN—tjd«|j«y)NzToken manager are disposed)ÚloggerÚinfoÚstoprs rÚ__del__zTokenManager.__del__„s€Ü ‰ Ð0Ô1Ø     ‰     rÚlistenerÚ skip_initialrNcóî—||_    tj«}tj«}|jd|j||«|_ tjd«tj|j!«|«j#«|j$S#t$rDtj«}t j t|fd¬«}|j«YŒÖwxYw)NT)ÚtargetÚargsÚdaemonrúToken manager started)rRÚasyncioÚget_running_loopÚ RuntimeErrorÚnew_event_loopÚ    threadingÚThreadÚ_start_event_loop_in_threadÚstartÚEventÚ
call_laterÚ _renew_tokenrSrVrWÚrun_coroutine_threadsafeÚwaitÚresultrX)rrZr[ÚloopÚthreadÚ
init_events      rrhzTokenManager.startˆsɀð
"ˆŒð    Ü×+Ñ+Ó-ˆDô—]‘]“_ˆ
ØŸ?™?Ø ˆt× Ñ  ,°
ó
ˆÔô     ‰ Ð+Ô,ô    ×(Ñ(¨¯©Ó):¸DÓA×HÑHÔJ؏y‰yÐøô#ò    ä×)Ñ)Ó+ˆDÜ×%Ñ%Ü2¸$¸ÈôˆFð L‰LŽNð     ús‰B'Â'A
C4Ã3C4Úblock_for_initialÚinitial_delay_in_mscƒóFK—||_tj«}tj«}t    ||j
||«}|j |dz |«|_tjd«|r|j«ƒd{–—†|jS7Œ­w)Néèr`) rRrarbriÚ_async_to_sync_wrapperÚ_renew_token_asyncrjrSrVrWrmrX)rrZrrrsr[rorqÚwrappeds        rÚ start_asynczTokenManager.start_async¤sèø€ð"ˆŒä×'Ñ'Ó)ˆÜ—]‘]“_ˆ
ô)Ø $×)Ñ)¨<¸ó
ˆð Ÿ?™?Ð+>ÀÑ+EÀwÓOˆÔ܏ ‰ Ð+Ô,á Ø—/‘/Ó#× #Ð #ày‰yÐð $ús‚B B!ÂBÂB!cóž—|j|jj«|j|jj«yyr)rSÚcancelrQrs rrXzTokenManager.stop¼sC€Ø × Ñ Ð 'Ø × Ñ × #Ñ #Ô %Ø × Ñ Ð 'Ø × Ñ × #Ñ #Õ %ð (rcó¬—    |jj|«}d|_t|«S#t$r›}|j|jj «j «kr_|xjdz c_t|jj «j«dz «|j|«cYd}~S|‚d}~wwxYw©Nérur) rOÚ request_tokenr
rTrPrIr2rr4Ú acquire_tokenr ©rÚ force_refreshÚtokenÚes    rr€zTokenManager.acquire_tokenÂsª€ð    Ø—I‘I×+Ñ+¨MÓ:ˆEðˆŒ Ü˜UÓ#Ð#øôò    Ø}‰}˜tŸ|™|×<Ñ<Ó>×OÑOÓQÒQØ— ’  Ñ"• ܐd—l‘l×3Ñ3Ó5×EÑEÓGÈ$ÑNÔOØ×)Ñ)¨-Ó8Õ8àûð     ús!‚/¯    C¸BCÃCà CÃCcƒóìK—    |jj|«}d|_t|«S#t$r·}|j|jj «j «kr{|xjdz c_tj|jj «j«dz «ƒd{–—†7|j|«ƒd{–—†7cYd}~S|‚d}~wwxYw­wr}) rOrr
rTrPrIr2rarr4Úacquire_token_asyncr rs    rr†z TokenManager.acquire_token_asyncÐsÆèø€ð
    Ø—I‘I×+Ñ+¨MÓ:ˆEðˆŒ Ü˜UÓ#Ð#øôò    Ø}‰}˜tŸ|™|×<Ñ<Ó>×OÑOÓQÒQØ— ’  Ñ"• Ü—m‘mØ—L‘L×1Ñ1Ó3×CÑCÓEÈÑLó÷ñð"×5Ñ5°mÓD×DÐDÕDàûð    üsO‚C4„1ŸC4±    C1ºB C,ÃCÃC,ÃC"àC,Ã$C1Ã%C4Ã*C,Ã,C1Ã1C4Ú expire_dateÚ
issue_datecóx—|j|«}|j||«}t||«}|dkrdS|dz S)Nrru)Ú_delay_for_lower_refreshÚ_delay_for_ratio_refreshÚmin)rr‡rˆÚdelay_for_lower_refreshÚdelay_for_ratio_refreshÚdelays      rÚ_calculate_renewal_delayz%TokenManager._calculate_renewal_delayàsI€Ø"&×"?Ñ"?À Ó"LÐØ"&×"?Ñ"?À ÈZÓ"XÐÜÐ+Ð-DÓEˆà˜A’IˆqÐ/ 5¨4¡<Ð/rcó¦—||jj«z
tjtj
«j «dzz
S©Nru)rPrErÚnowrÚutcÚ    timestamp)rr‡s  rrŠz%TokenManager._delay_for_lower_refreshçsB€à ؏l‰l×9Ñ9Ó;ñ <ä|‰|œHŸL™LÓ)×3Ñ3Ó5¸Ñ<ñ >ð    
rcóÀ—||z
}|||jj«zz
}||z
tjtj
«j «dzz
Sr’)rPrCrr“rr”r•)rr‡rˆÚ    token_ttlÚrefresh_befores     rr‹z%TokenManager._delay_for_ratio_refreshîs`€Ø *Ñ,ˆ    Ø"Ø ˜Ÿ ™ ×AÑAÓCÑ Cñ
ˆð
Øñ ä|‰|œHŸL™LÓ)×3Ñ3Ó5¸Ñ<ñ >ð    
rrqcó—    |jd¬«}|j|j«j«|j«j    ««}|j«j «r t d«‚|jj€*tjd«    |r|j«yy|s*    |jj|j««|dkr    |r|j«yytj«}|j||j «|_tj%d|›d«||r|j«SS#t$r}t |«‚d}~wwxYw#t$r=}|jj&€|‚|jj'|«Yd}~nd}~wwxYw    |r|j«yy#|r|j«wwxYw)    zq
        Task to renew token from identity provider.
        Schedules renewal tasks based on token TTL.
        T©r‚úRequested token is expiredNú@No registered callback for token renewal task. Renewal cancelledrú Next token renewal scheduled in ú seconds)r€rÚ    get_tokenÚget_expires_at_msÚget_received_at_msÚ
is_expiredr rRrrVÚwarningÚsetr*rarbrjrkrQrWr")rr[rqÚ    token_resrr„ros       rrkzTokenManager._renew_tokenúsÌ€ð$    !Ø×*Ñ*¸Ð*Ó>ˆIØ×1Ñ1Ø×#Ñ#Ó%×7Ñ7Ó9Ø×#Ñ#Ó%×8Ñ8Ó:óˆEð
×"Ñ"Ó$×/Ñ/Ô1Ü%Ð&BÓCÐCà~‰~×%Ñ%Ð-Ü—‘ØVôðñ*Ø—‘Õ ðñ' ð-Ø—N‘N×*Ñ*¨9×+>Ñ+>Ó+@ÔAð˜ŠzØñØ—‘Õ ðô×+Ñ+Ó-ˆDØ#Ÿ™¨u°d×6GÑ6GÓHˆDÔ Ü K‰KÐ:¸5¸'ÀÐJÔ KØñØ—‘Õ ðøô!!ò-Ü)¨!Ó,Ð,ûð-ûôò    '؏~‰~×&Ñ&Ð.Øà N‰N× #Ñ # A× &Ñ &ûð        'úð 'áØ—‘Õ ðø‰zØ—‘Õ ðús[‚B0F ÃF Ã
)E0Ã3F Ä AF Å0    F    Å9 FÆF    Æ    F Æ     GÆ3G ÇG*Ç GÇG*Ç*G?cƒó*K—    |jd¬«ƒd{–—†}|j|j«j«|j«j    ««}|j«j «r t d«‚|jj€*tjd«    |r|j«yy|s2    |jj|j««ƒd{–—†|dkr    |r|j«yytj«}t||j «}tj#d|›d«|j%||«|r|j«yy7Œo7ŒŠ#t$r}t |«‚d}~wwxYw#t$rF}|jj&€|‚|jj'|«ƒd{–—†7Yd}~Œd}~wwxYw#|r|j«wwxYw­w)    zx
        Async task to renew tokens from identity provider.
        Schedules renewal tasks based on token TTL.
        TršNr›rœrrrž)r†rrŸr r¡r¢r rRrrVr£r¤r*rarbrvrwrWrjr")rr[rqr¥rr„rorxs        rrwzTokenManager._renew_token_async(sÖèø€ð$    !Ø"×6Ñ6ÀTÐ6ÓJ×JˆIØ×1Ñ1Ø×#Ñ#Ó%×7Ñ7Ó9Ø×#Ñ#Ó%×8Ñ8Ó:óˆEð
×"Ñ"Ó$×/Ñ/Ô1Ü%Ð&BÓCÐCà~‰~×%Ñ%Ð-Ü—‘ØVôðñ*Ø—‘Õ ðñ' ð-ØŸ.™.×0Ñ0°×1DÑ1DÓ1FÓG×GÐGð˜ŠzØñØ—‘Õ ðô×+Ñ+Ó-ˆDÜ,¨T°4×3JÑ3JÓKˆGÜ K‰KÐ:¸5¸'ÀÐJÔ KØ O‰O˜E 7Ô +ñØ—‘Õ ððEKùð"HùÜ ò-Ü)¨!Ó,Ð,ûð-ûôò    -؏~‰~×&Ñ&Ð.ؐà—.‘.×)Ñ)¨!Ó,× ,Ö ,ûð        -ûñ Ø—‘Õ ðüs¦‚H„F)™FšB"F)Â=HÃF)Ã,F ÄF ÄF ÄF)Ä HÄAF)Å4HÆF)Æ F Æ     F&Æ F!Æ!F&Æ&F)Æ)    G8Æ26G3Ç(G+Ç)G3Ç.G;Ç3G8Ç8G;Ç;HÈH)F)FrF)FN)r$r%r&r r8rrYrÚboolrrhr6ryrXr r€r†rrŠr‹rarirkrwr+rrrKrKys,„ðØ!:ðØDVóòð#ñà%ðððð
"d(Ñ    ó    ð>#(Ø%&Ø"ñ à%ðð ðð#ð    ð
ð ð
"d(Ñ    ó ò0&ñ $°Mó $ñ$À ó$ð 0°Eð0Àuð0ÐQVó0ð
°Eó
ð
 
°Eð
 
Àuó
 
ðGKñ,!Ø ð,!Ø6=·m±mó,!ð^GKñ,!Ø ð,!Ø6=·m±mô,!rrKc󇇇‡—ˆˆˆˆfd„}|S)aŸ
    Wraps an asynchronous function so it can be used with loop.call_later.
 
    :param loop: The event loop in which the coroutine will be executed.
    :param coro_func: The coroutine function to wrap.
    :param args: Positional arguments to pass to the coroutine function.
    :param kwargs: Keyword arguments to pass to the coroutine function.
    :return: A regular function suitable for loop.call_later.
    có@•—tj‰‰i‰¤Ž‰¬«y)N)ro)raÚ ensure_future)r^Ú    coro_funcÚkwargsros€€€€rrxz'_async_to_sync_wrapper.<locals>.wrappedbsø€ä×Ñ™i¨Ð8°Ñ8¸tÖDrr+)ror«r^r¬rxs```` rrvrvWsû€÷Eð €NrÚ
event_loopcóN—tj|«|j«y)zŠ
    Starts event loop in a thread.
    Used to be able to schedule tasks using loop.call_later.
 
    :param event_loop:
    :return:
    N)raÚset_event_loopÚ run_forever)r­s rrgrgis€ô ×ј:Ô&Ø×ÑÕr)raÚloggingrerrÚtimerÚtypingrrrr    Úredis.auth.errr
r Úredis.auth.idpr Úredis.auth.tokenr Ú    getLoggerr$rVrr-r8rKrvÚAbstractEventLooprgr+rrú<module>r¹sxðÛÛÛß'Ýß2Ó2ç;Ý4Ý*à    ˆ×    Ñ    ˜8Ó    $€÷"ñ"÷6 ñ ÷,6"ñ6"÷r[!ñ[!ò|ð$    ¨G×,EÑ,Eô    r