+
    cdjh  c                     ^ RI Ht ^ RIt^ RIHu Ht ^ RIt^ RI	H
t
 ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHtHt ^ RIHt ^ RIt]P,                  P/                  ^ ]! ]! ]4      P5                  4       P6                  ^,          4      4       ^ RIt^ RIt^ RIHtH t H!t!H"t"H#t# ^ RIH$t$H%t%H&t&H't'H(t(H)t)H*t*H+t+H,t,H-t- ^ RI.H/t/H0t0 ^ R	IH1t1H2t2H3t3 R
RRRR]Ph                  ! R4      RRRRRRRR/t5 ! R R]4      t6]Pn                  R R l4       t8R R lt9R R lt:R  R! lt;R" R# lt<R$ R% lt=R& R' lt>R( R) lt?R* R+ lt@R, R- ltAR. R/ ltBR0 R1 ltCR2 R3 ltDR4 R5 ltER6 R7 ltFR8 R9 ltG]P                  P                  RR. RSO4      R: R; l4       tJR< R= ltKR> R? ltLR@ RA ltMRB RC ltNRD RE ltORF RG ltPRH RI ltQRJ RK ltRRL RM ltSRN RO ltTRP RQ ltUR# )T    )annotationsN)ThreadPoolExecutor)BaseHTTPRequestHandlerThreadingHTTPServer)Path)Account
AccountRefAccountRegistryKindAuthorityBindingAuthorityMode)
AuthorityConfigurationErrorGatewayStatusGatewayUsageGatewayUsageWindowbuild_authority_launchfetch_gateway_statusfetch_gateway_usagegateway_health_snapshotmaterialize_gateway_homeresolve_authority_endpoint)AccountSnapshotHealthStatus)AuthorityHealthAdapterProviderServiceMapProviderServicesstatereadyprovidercodexroute_fingerprintroute-fixturegrant_fingerprint0123456789abgrant_expires_at2099-01-01T00:00:00Zgrant_revokedFaccount_availability	availablec                  Z    ] tR t^9t$ ]! ]4      t. tR]R&   R R lt	R R lt
R R ltR	tR
# )_StatusHandlerzlist[tuple[str, str | None]]requestsc                   V ^8  d   QhRR/#    returnNone )formats   "U/home/user/overdeck-gateway-renew-test/modules/systray/tests/test_authority_client.py__annotate___StatusHandler.__annotate__=   s     " " "    c                	   V P                   P                  P                  V P                  V P                  P                  R 4      34       \        P                  ! V P                   P                  4      P                  R4      pV P                  ^4       V P                  RR4       V P                  R\        \        V4      4      4       V P                  4        V P                  P!                  V4       R# )Authorizationutf-8Content-Typeapplication/jsonContent-LengthN)	__class__r*   appendpathheadersgetjsondumpsbodyencodesend_responsesend_headerstrlenend_headerswfilewriteselfpayloads   & r2   do_GET_StatusHandler.do_GET=   s    &&		4<<3C3CO3T'UV**T^^00188A3);<)3s7|+<=

!r5   c                   V ^8  d   QhRR/# r,   r0   )r1   s   "r2   r3   r4   F   s     !" !" !"r5   c                	   V P                   P                  P                  V P                  V P                  P                  R 4      34       \        P                  ! RRRRRRRRR	R
RRR/RRR^*R
RRR/RRRRR^R
RRR/./4      P                  R4      pV P                  ^4       V P                  RR4       V P                  R\        \        V4      4      4       V P                  4        V P                  P                  V4       R# )r7   
checked_atz2026-08-23T12:00:00ZfreshTwindowsnameprimaryused_percentffffff1@limit_window_secondsPF  reset_after_secondsX  	secondary:	   GPT-Spark/primaryfeature	GPT-Spark,  r8   r9   r:   r;   N)r<   r*   r=   r>   r?   r@   rA   rB   rD   rE   rF   rG   rH   rI   rJ   rK   rL   s   & r2   do_POST_StatusHandler.do_POSTF   s   &&		4<<3C3CO3T'UV**4	&.-s	 &.-t	  3!;&.-s
4 &/5 	6 	3);<)3s7|+<=

!r5   c               $    V ^8  d   QhRRRRRR/# r-   _formatrG   _argsobjectr.   r/   r0   )r1   s   "r2   r3   r4   i   s!      3  4 r5   c                	    R # Nr0   rM   ri   rj   s   &&*r2   log_message_StatusHandler.log_messagei   s    r5   r0   N)__name__
__module____qualname____firstlineno__dict_READY_STATUSrC   r*   __annotations__rO   re   ro   __static_attributes__r0   r5   r2   r)   r)   9   s,    D-/H*/"!"F r5   r)   c                   V ^8  d   QhRR/# )r-   tmp_pathr   r0   )r1   s   "r2   r3   r3   n   s     ( ( (r5   c           
   #    "   . \         n        \        \        4      \         n        \        R\         4      p\        P                  ! VP                  R7      pVP                  4        V R,          pVP                  RR7       VP                  R4       RVP                   2pVR,          pVP                  \        P                  ! RRR	V///4      R
R7       VP                  R4       V R,          pVP                  RR
R7       VP                  R4       \!        \"        P$                  RRRVP'                  4       R7      p\)        \+        RR4      RV R,          R,          RRRVR7      p W8Wt3x  VP-                  4        VP/                  4        VP1                  4        R#   TP-                  4        TP/                  4        TP1                  4        i ; i5i)	127.0.0.1targetruntime  modehttp://127.0.0.1:authority_endpoints.jsonauthoritiesworkstationoriginr8   encoding  zfixture.grantsynthetic-route-keyr    r   r   authority_nameroute_idr   proxy_grant_reffixtureFixturenative
CODEX_HOMENrefaliasaccount_homeemailplan
account_idauthority_bindingr|   r   )r)   r*   ru   rv   rC   r   	threadingThreadserve_foreverstartmkdirchmodserver_port
write_textrA   rB   r
   r   SUBROUTER_DARKresolver   r   shutdownjoinserver_close)	rz   serverthreadbase_dirr   	endpointsgrantbindingaccounts	   &        r2   	authorityr   m   s     N}-N !1>BFV%9%9:F
LLN)#HNNNNN5 !3!3 45F55I

MMHf3E#FGH   OOE&E	*W=	KK))$ G w	*(<7!G00 	s   E*G-F% 32G%2GGc                   V ^8  d   QhRR/# r,   r0   )r1   s   "r2   r3   r3      s     2 2	2r5   c                '  a V w  rr4\        VVR RR.RRRRRRRRR	R
RR
RRRRRR/	R7      oSP                  R,          pRqeV8H  qw'       gy   \        P                  ! RBV3RCWV34      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p	\        \        P                  ! V	4      4      hR;p;rvRpSP                  qV
9  qw'       g   \        P                  ! RDV3REWZ34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                  ! S4      MRR\        P                  ! V
4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;rzRpSP                  qV
9  qw'       g   \        P                  ! RDV3REWZ34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                  ! S4      MRR\        P                  ! V
4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;rzRpSP                  qV
9  qw'       g   \        P                  ! RDV3REWZ34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                  ! S4      MRR\        P                  ! V
4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;rzRpSP                  qV
9  qw'       g   \        P                  ! RDV3REWZ34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                  ! S4      MRR\        P                  ! V
4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;rzR	pSP                  qV
9  qw'       g   \        P                  ! RDV3REWZ34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                  ! S4      MRR\        P                  ! V
4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;rzRpSP                  qV
9  qw'       g   \        P                  ! RDV3REWZ34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                  ! S4      MRR\        P                  ! V
4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;rzSP                  R,          pRqeV8H  qw'       gy   \        P                  ! RBV3RCWV34      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p	\        \        P                  ! V	4      4      hR;p;rvSP                  R,          pSP                  p\        V4      qV8H  qw'       Eg3   \        P                  ! RBV3RFW^34      R\        P                  ! V4      RR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRRR\        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                  ! S4      MRR\        P                  ! V4      R \        P                  ! V4      /,          pR!R"V/,          p\        \        P                  ! V4      4      hR;p;p;rSP                  R,          pSP                  p\        V4      qV8H  qw'       Eg3   \        P                  ! RBV3RFW^34      R\        P                  ! V4      RR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRRR\        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                  ! S4      MRR\        P                  ! V4      R \        P                  ! V4      /,          pR!R"V/,          p\        \        P                  ! V4      4      hR;p;p;rSP                  pVP                  pVV8g  qf'       Eg   \        P                  ! RGV3RHVV34      R#R\        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                  ! S4      MRR$\        P                  ! V4      RR%\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR%R\        P                  ! V4      /,          p	R&R V	/,          p\        \        P                  ! V4      4      hR;p;rm\        P                  pSP                  qP                  pV! 4       pVP                  pV! V4      pR'pVV8H  pV'       Eg   \        P                  ! RBV3RIVV34      R#R(\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MR(R$\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                  ! S4      MRR\        P                  ! V
4      R\        P                  ! V4      R)\        P                  ! V4      R*\        P                  ! V4      R+\        P                  ! V4      R,\        P                  ! V4      /	,          pR-R.V/,          p\        \        P                  ! V4      4      hR;p;p
;p;p;p;p;ppR/ SP                  P!                  4        4       p\#        V4      pR0R1.pVV8H  q'       g   \        P                  ! RBV3RJVV34      R#R2\        P                  ! 4       9   g!   \        P                  ! \"        4      '       d   \        P                  ! \"        4      MR2R$\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pR3R)V/,          p\        \        P                  ! V4      4      hR;p;p;ppV3R4 lRK 4       p\%        V4      qf'       * q'       g   R5R#R6\        P                  ! 4       9   g!   \        P                  ! \$        4      '       d   \        P                  ! \$        4      MR6R$\        P                  ! V4      R\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR;p;rmSP                  R0,          P'                  R7R87      pV R92qUV9   qw'       g   \        P                  ! RLV3RMVV34      R\        P                  ! V4      RR:\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR:/,          pR;RV/,          p\        \        P                  ! V4      4      hR;rWRqUV9  qw'       g   \        P                  ! RDV3RNVV34      R\        P                  ! V4      RR:\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR:/,          pR;RV/,          p\        \        P                  ! V4      4      hR;rW\(        P*                  ! SP                  R1,          P'                  R7R87      4      pVR<,          pR=qeVJ qw'       gy   \        P                  ! ROV3RPWV34      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p	\        \        P                  ! V	4      4      hR;p;rvR>p\(        P,                  q! V4      qV9  qw'       Eg3   \        P                  ! RDV3RQW^34      R\        P                  ! V4      RR?\        P                  ! 4       9   g!   \        P                  ! \(        4      '       d   \        P                  ! \(        4      MR?R\        P                  ! V
4      RR@\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR@R \        P                  ! V4      /,          pR!R"V/,          p\        \        P                  ! V4      4      hR;p;p;r\.        P0                  pRR.p
VV
8H  qf'       g   \        P                  ! RBV3RSVV
34      R#RA\        P                  ! 4       9   g!   \        P                  ! \.        4      '       d   \        P                  ! \.        4      MRAR$\        P                  ! V4      R\        P                  ! V
4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;rjR# )Tr   exectaskOPENAI_API_KEYzmust-not-surviveOPENAI_BASE_URLhttps://wrong.invalidANTHROPIC_AUTH_TOKENANTHROPIC_BASE_URLCLAUDE_CONFIG_DIR/nativer   SUBROUTER_PROXY_KEYwrong-grantHTTPS_PROXYzhttp://wrong.invalidSAFE	preservedinherited_environmentpy1py4assert %(py6)spy6Npy3launchpy5assert %(py7)spy7r   HOMErG   py8assert %(py10)spy10py0py2r   assert %(py8)sr   statpy9py11py13py16zassert %(py18)spy18c              3  8   "   T F  qP                   x  K  	  R # 5irm   rV   .0r>   s   & r2   	<genexpr>\test_build_authority_launch_uses_gateway_only_home_and_strips_native_auth.<locals>.<genexpr>        F(E))(E   zconfig.tomlgateway-manifest.jsonsortedassert %(py9)sc              3  f   <"   T F&  pSP                   V,          P                  4       x  K(  	  R # 5irm   gateway_homeexistsr   rV   r   s   & r2   r   r      *     wEvTF''$.6688Ev   .10assert not %(py4)s
{%(py4)s = %(py0)s(%(py2)s)
}anyr8   r   z/r/route-fixture/v1configassert %(py5)sprovider_auth_files_presentFr    rA   manifestr)   ==z%(py1)s == %(py4)snot inz7%(py1)s not in %(py5)s
{%(py5)s = %(py3)s.environment
}zR%(py1)s == %(py8)s
{%(py8)s = %(py3)s(%(py6)s
{%(py6)s = %(py4)s.gateway_home
})
})!=)zV%(py2)s
{%(py2)s = %(py0)s.gateway_home
} != %(py6)s
{%(py6)s = %(py4)s.account_home
})z%(py13)s
{%(py13)s = %(py2)s
{%(py2)s = %(py0)s.S_IMODE
}(%(py11)s
{%(py11)s = %(py9)s
{%(py9)s = %(py7)s
{%(py7)s = %(py5)s
{%(py5)s = %(py3)s.gateway_home
}.stat
}()
}.st_mode
})
} == %(py16)sz0%(py4)s
{%(py4)s = %(py0)s(%(py2)s)
} == %(py7)s	auth.jsonz.credentials.jsonzclaude.jsoninz%(py1)s in %(py3)sz%(py1)s not in %(py3)sis)z%(py1)s is %(py4)s)zO%(py1)s not in %(py8)s
{%(py8)s = %(py5)s
{%(py5)s = %(py3)s.dumps
}(%(py6)s)
}z"/r/route-fixture/_subrouter/statuszBearer synthetic-route-keyz0%(py2)s
{%(py2)s = %(py0)s.requests
} == %(py5)s)r   environment
@pytest_ar_call_reprcompare	_safereprAssertionError_format_explanation@py_builtinslocals_should_repr_global_namer   rG   r   r   S_IMODEst_modeiterdirr   r   	read_textrA   loadsrB   r)   r*   )r   r   r   _bindingr   @py_assert0@py_assert3@py_assert2@py_format5@py_format7@py_assert4@py_format6@py_format8@py_assert5@py_assert7@py_format9@py_format11@py_assert1@py_assert6@py_assert8@py_assert10@py_assert12@py_assert15@py_assert14@py_format17@py_format19@py_format10r   @py_format4r   r   s   &                             @r2   Itest_build_authority_launch_uses_gateway_only_home_and_strips_native_authr+     s    +4'Hx#	06"$6 "9)!=1K

F$ f%4444444%444%4444444444456#5#55#555555555555555655556555#5555555556F$6$66$666666666666666F6666F666$666666666!;););;);;;;;;!;;;!;;;;;;;;;;;;;);;;;;;;;;9v'9'99'999999999999999v9999v999'9999999998f&8&88&888888888888888f8888f888&8888888882 2 22 222222=222=2222222222222 22222222234M8MM8MMMMMM4MMM4MMM8MMMMMMMMMf%AV-@-@A-@)AA)AAAAAA%AAA%AAAAAAAAAAAAAAAAAVAAAAVAAA-@AAA)AAAAAAAAAl+G63F3FGs3F/GG/GGGGGG+GGG+GGGGGGsGGGGsGGGGGGG6GGGG6GGG3FGGG/GGGGGGGGG6'"6"66"666666"6666666666666666666666'6666'666"666666666<<D++D00D02D2::D<:;DuD;uDDDDD;uDDDDDD4DDDD4DDD<DDDDDDDDDDDDD+DDD0DDD2DDD:DDD;DDDuDDDDDDDDDF(;(;(C(C(EF 6FF K F K    F K     6   6   F   F    K         xEvwwswwwwwwwwwwwwswwwwswwwwwwwwwwwwww!!M1<<g<NFX()3V33333)V333)333333V3333V33333333 ...... ... ..................zz			6	6AA7ASH 12;e;e;;;;;2;;;2;;;e;;;;;;;;6$**6*X"66"666666?666?666666$6666$666*666666X6666X666"666666666"" L' " '    " '     >   >   "    '        r5   c                    V ^8  d   QhRRRR/# r-   monkeypatchzpytest.MonkeyPatchr.   r/   r0   )r1   s   "r2   r3   r3      s      D D.D	Dr5   c                   aa V w  r#rE. o. oR  V3R llpR V3R llpVP                  \        RV4       VP                  \        RV4       \        W#RRR.4      pR	.p	SV	8H  q'       g   \        P                  ! RV
3RSV	34      R
R\
        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                  ! S4      MRR\        P                  ! V	4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;rR	.p	SV	8H  q'       g   \        P                  ! RV
3RSV	34      R
R\
        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                  ! S4      MRR\        P                  ! V	4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;rVP                  R,          pR	qV8H  q'       gy   \        P                  ! RV	3RW34      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;rR# )c                    V ^8  d   QhRRRR/# )r-   _pathr   r.   rG   r0   )r1   s   "r2   r3   Rtest_launch_uses_one_grant_snapshot_for_status_and_execution.<locals>.__annotate__   s       # r5   c                B   < S'       g   R MRpSP                  V4       V# )	first-keyz
second-key)r=   )r1  valuereadss   & r2   	read_onceOtest_launch_uses_one_grant_snapshot_for_status_and_execution.<locals>.read_once   s    #(lUr5   c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r-   	_endpointrk   r  keyrG   timeout_secsfloatr.   r   r0   )r1   s   "r2   r3   r2     s:     	= 	=	=	= 	=
 	= 
	=r5   c               B   < ?SP                  V4       \        R RR4      # )r   Gateway: ready      ?)r=   r   )r:  r  r;  r<  status_keyss   &&&$r2   status_with_keyUtest_launch_uses_one_grant_snapshot_for_status_and_execution.<locals>.status_with_key   s&     3W&6<<r5   _read_proxy_key_fetch_gateway_statusr   r   r   r4  r   r6  r   r   r   NrA  r   r   r   r   r   r   z%(py0)s == %(py3)sr   )setattrauthority_clientr   r  r  r  r  r  r  r	  r
  r  )r   r.  r   r   r  _originr7  rB  r   r  r   r*  r  r  r  r  r  r6  rA  s   &&               @@r2   <test_launch_uses_one_grant_snapshot_for_status_and_executionrJ     s    ,5(HxEK 
	= 	= (*;YG(*A?S#Hw@PQF M!5M!!!!!5M!!!!!!5!!!!5!!!M!!!!!!!!&-';-''''';-'''''';'''';'''-''''''''34CCCCCCC4CCC4CCCCCCCCCCCr5   c                   V ^8  d   QhRR/# r,   r0   )r1   s   "r2   r3   r3      s     +x +xD +xr5   c                  a V w  rr4\        VP                  VP                  VP                  R VP                  R7      p\        \        R R4      RVR,          R,          RRRVR7      p/ \        CRR /C\        n	        \        VVR R	R
.RRRRRRRR/R7      oSP                  R,          pSP                  p\        V4      qV	8H  q'       Eg3   \        P                  ! R/V
3R0Wy34      R\        P                   ! V4      RR\"        P$                  ! 4       9   g!   \        P&                  ! \        4      '       d   \        P                   ! \        4      MRRR\"        P$                  ! 4       9   g   \        P&                  ! S4      '       d   \        P                   ! S4      MRR\        P                   ! V4      R\        P                   ! V	4      /,          pRRV/,          p\)        \        P*                  ! V4      4      hR;p;p
;rSP                  R,          qt R2qV8H  q'       gy   \        P                  ! R/V
3R1W}34      R\        P                   ! V4      R\        P                   ! V4      /,          pRRV/,          p\)        \        P*                  ! V4      4      hR;p;rSP                  R,          pR qV8H  q'       gy   \        P                  ! R/V
3R1W}34      R\        P                   ! V4      R\        P                   ! V4      /,          pRRV/,          p\)        \        P*                  ! V4      4      hR;p;rRpSP                  pVV9  q'       g   \        P                  ! R2V
3R3VV34      R\        P                   ! V4      RR\"        P$                  ! 4       9   g   \        P&                  ! S4      '       d   \        P                   ! S4      MRR!\        P                   ! V4      /,          pR"R#V/,          p\)        \        P*                  ! V4      4      hR;p;p
pRpSP                  pVV9  q'       g   \        P                  ! R2V
3R3VV34      R\        P                   ! V4      RR\"        P$                  ! 4       9   g   \        P&                  ! S4      '       d   \        P                   ! S4      MRR!\        P                   ! V4      /,          pR"R#V/,          p\)        \        P*                  ! V4      4      hR;p;p
pRpSP                  pVV9  q'       g   \        P                  ! R2V
3R3VV34      R\        P                   ! V4      RR\"        P$                  ! 4       9   g   \        P&                  ! S4      '       d   \        P                   ! S4      MRR!\        P                   ! V4      /,          pR"R#V/,          p\)        \        P*                  ! V4      4      hR;p;p
pSP                  R$,          pSP                  p\        V4      qV	8H  q'       Eg3   \        P                  ! R/V
3R0Wy34      R\        P                   ! V4      RR\"        P$                  ! 4       9   g!   \        P&                  ! \        4      '       d   \        P                   ! \        4      MRRR\"        P$                  ! 4       9   g   \        P&                  ! S4      '       d   \        P                   ! S4      MRR\        P                   ! V4      R\        P                   ! V	4      /,          pRRV/,          p\)        \        P*                  ! V4      4      hR;p;p
;rR% SP                  P-                  4        4       p\/        V4      pR&.pVV8H  q'       g   \        P                  ! R/V3R4VV34      R'R(\"        P$                  ! 4       9   g!   \        P&                  ! \.        4      '       d   \        P                   ! \.        4      MR(R)\        P                   ! V4      R\        P                   ! V4      R#\        P                   ! V4      /,          pR*R+V/,          p\)        \        P*                  ! V4      4      hR;p;p;ppV3R, lR5 4       p\1        V4      q'       * q'       g   R-R'R.\"        P$                  ! 4       9   g!   \        P&                  ! \0        4      '       d   \        P                   ! \0        4      MR.R)\        P                   ! V4      R\        P                   ! V4      /,          p\)        \        P*                  ! V4      4      hR;p;rR# )6clauder   r   r   r   r   Nr   r   z--printr   r   CLAUDE_CODE_OAUTH_TOKENremover   r   r   r   r   r   r   rG   r   r   r   r   r   r   r   z/r/route-fixturer   r   r   r   r   r   r   c              3  8   "   T F  qP                   x  K  	  R # 5irm   r   r   s   & r2   r   Ltest_claude_launch_uses_gateway_only_home_and_exact_route.<locals>.<genexpr>  r   r   r   r   r   r   r   r   c              3  f   <"   T F&  pSP                   V,          P                  4       x  K(  	  R # 5irm   r   r   s   & r2   r   rQ    r   r   r   r   r   r   r   r   r   r   r   )r
   r   r   r   r   r   r   rv   r)   rC   r   r  r   rG   r  r  r  r  r  r  r	  r
  r  r   r   )r   r   _accountr   r   claude_bindingr   r  r  r  r  r  r  r  r  r  r  r  r  r   r!  r)  r   s   &                     @r2   9test_claude_launch_uses_gateway_only_home_and_exact_routerU     s   *3'H%\\--!!//N x+(+>>(G B]AJAN#	F%x!=6	
F 12N&:M:MNc:M6NN6NNNNNN2NNN2NNNNNNcNNNNcNNNNNNN&NNNN&NNN:MNNN6NNNNNNNNN23RAQ7RR7RRRRRR3RRR3RRR7RRRRRRRRR45N9NN9NNNNNN5NNN5NNN9NNNNNNNNN$>F,>,>>$,>>>>>>$,>>>>$>>>>>>F>>>>F>>>,>>>>>>>>> :(:(:: (:::::: (:::: :::::::::::::(:::::::::6F$6$66$666666$6666666666F6666F666$666666666f%AV-@-@A-@)AA)AAAAAA%AAA%AAAAAAAAAAAAAAAAAVAAAAVAAA-@AAA)AAAAAAAAAF(;(;(C(C(EF 6FF K F K    F K     6   6   F   F    K         xEvwwswwwwwwwwwwwwswwwwswwwwwwwwwwwwwwwr5   c                   V ^8  d   QhRR/# r,   r0   )r1   s   "r2   r3   r3     s     
 
 
r5   c           	        V w  rr4\        W4      pVR ,          R,          p\        WWS4      pVR,          P                  RRR7       \        P                  ! \
        RR7      ;_uu_ 4        \        WWS4       RRR4       VP                  q! 4       q'       g   R	R
R\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V	4      /,          p
\        \        P                  ! V
4      4      hR;rR#   + '       g   i     L; i)zgateway-homesr   r   z{}r8   r   migration requiredmatchNzAassert %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.exists
}()
}r   rootr   r   )r   r   r   pytestraisesr   r   r  r  r  r  r  r	  r
  )r   r   r   r   rI  endpointr[  firstr   r  r  s   &          r2   -test_gateway_home_refuses_provider_auth_filesr`    s    *3'Hw)(<Ho%/D$XJE
[$$TG$<	2:N	O	O HF 
P ;;;==44;= 
P	Os   +E  E	c                    V ^8  d   QhRRRR/# r-  r0   )r1   s   "r2   r3   r3   *  s     %9 %9.%9	%9r5   c                H  aa V w  r#rE\        VP                  VP                  VP                  VP                  VP
                  VP                  \        VP                  VP                  R VP                  VP                  R7      R7      p\        W&P                  4      p\        P                  o^ oR VV3R llpVP!                  \        RV4       \"        P$                  ! \&        RR7      ;_uu_ 4        \)        W&WvP                  4       RRR4       \        P*                  ! W&VP                  4      p	V	P,                  q! 4       q'       * q'       g   R	R
R\.        P0                  ! 4       9   g   \2        P4                  ! V	4      '       d   \2        P6                  ! V	4      MRR\2        P6                  ! V
4      R\2        P6                  ! V4      /,          p\9        \2        P:                  ! V4      4      hR;p
;rV	P<                  qP>                  pRV	P@                   R2pV! V4      p\C        V4      pV'       * pV'       Eg;   RR
R\.        P0                  ! 4       9   g!   \2        P4                  ! \B        4      '       d   \2        P6                  ! \B        4      MRRR\.        P0                  ! 4       9   g   \2        P4                  ! V	4      '       d   \2        P6                  ! V	4      MRR\2        P6                  ! V4      R\2        P6                  ! V4      R\2        P6                  ! V4      R\2        P6                  ! V4      R\2        P6                  ! V4      /,          p\9        \2        P:                  ! V4      4      hR;p;p;p;p;ppR#   + '       g   i     EL; i)zroute-interruptedr   r   c               (    V ^8  d   QhRRRRRRRR/# )	r-   r>   r   rC   rG   r   intr.   r/   r0   )r1   s   "r2   r3   Utest_gateway_home_interrupted_materialization_publishes_nothing.<locals>.__annotate__A  s(     ) ) )C )s )t )r5   c                P   < S^,          oS^8X  d   \        R4      hS! WV4       R# )   interruptedN)OSError)r>   rC   r   original_writewritess   &&&r2   interrupted_writeZtest_gateway_home_interrupted_materialization_publishes_nothing.<locals>.interrupted_writeA  s(    !Q;-((t4(r5   _atomic_writerX  rY  NzEassert not %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.exists
}()
}r   r[  r   r   .z.*zassert not %(py11)s
{%(py11)s = %(py0)s(%(py9)s
{%(py9)s = %(py5)s
{%(py5)s = %(py3)s
{%(py3)s = %(py1)s.parent
}.glob
}(%(py7)s)
})
}listr   r   r   r   r   r   )"r   r   r   r   r   r   r   r
   r   r   r   r   r   r   rH  rn  rG  r\  r]  r   r   _gateway_rootr   r  r  r  r  r  r	  r
  parentglobrV   rp  )r   r.  r   r   r   rI  reboundr^  rl  r[  r   r  r  r  r  r  r!  r"  r#  r$  @py_format13rj  rk  s   &&                   @@r2   ?test_gateway_home_interrupted_materialization_publishes_nothingrv  *  sO    +4'HwKKmm))mm\\%%*"11(%%#33
G *(4M4MNH%33NF) ) (/;LM	2:N	O	O H>W>WX 
P ))(W=V=VWD{{{}tt{}KK8$$8q2%68$%678t78888888888888t8888t8888888D8888D888K888$888%68887888888888888 
P	O	Os   8NN!	c                    V ^8  d   QhRRRR/# r-  r0   )r1   s   "r2   r3   r3   R  s      A A.A	Ar5   c           	       aaaa V w  r#op. o. o\        \        P                  ! 4       R ,           R,          4      oR VV3R llpR VVV3R llpVP                  \        RR 4       VP                  \        RV4       VP                  \        R	V4       \	        VS4      pVP
                  pR
qV	8H  q'       g   \        P                  ! RV
3RW34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V	4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;r. ROpSV8H  q'       g   \        P                  ! RV3RSV34      RR\        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                  ! S4      MRR\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;rR.pSV8H  q'       g   \        P                  ! RV3RSV34      RR\        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                  ! S4      MRR\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;rR# )i     c               $    V ^8  d   QhRRRRRR/# )r-   r;  rG   r<  r=  r.   r   r0   )r1   s   "r2   r3   Jtest_gateway_status_renews_rejected_local_grant_once.<locals>.__annotate__Z  s&     P P Pe P Pr5   c                  < ?SP                  V4       \        S4      ^8:  d   \        P                  ! R4      h\	        RR\
        P
                  ! 4       S4      # )r-   Gateway: unavailabler   r?  )r=   rH   rH  _GatewayGrantRejectedr   time)r:  r  r;  r<  calls	future_mss   &&&$r2   fetchCtest_gateway_status_renews_rejected_local_grant_once.<locals>.fetchZ  sG    Su:?"889OPPW&6		YOOr5   c               $    V ^8  d   QhRRRRRR/# )r-   r;  rG   r<  r=  r.   rd  r0   )r1   s   "r2   r3   r{  a  s!       e  r5   c                 < ?SP                  VP                  V34       V P                  pS	P                  qTV8H  qf'       Eg   \        P
                  ! R
V3RWE34      RR\        P                  ! 4       9   g   \        P                  ! V 4      '       d   \        P                  ! V 4      MRR\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! S	4      '       d   \        P                  ! S	4      MRR\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR	;p;reS
# )r   r   r^  r   r   r   r   r   r   Nr   )zP%(py2)s
{%(py2)s = %(py0)s.name
} == %(py6)s
{%(py6)s = %(py4)s.authority_name
})r=   r   rV   r   r  r  r  r  r  r  r	  r
  )r^  	candidater;  r<  r   r  r  r  r  r   r  reneweds   &&&$     r2   renewCtest_gateway_status_renews_rejected_local_grant_once.<locals>.renewa  s    	**C01}}6 6 66 666666}666666x6666x666}6666666666666 666666666r5   _can_renew_gateway_grantc                     R # Tr0   rj   s   *r2   <lambda>Ftest_gateway_status_renews_rejected_local_grant_once.<locals>.<lambda>g      UYr5   rE  _renew_gateway_grantr   r   statusr   r   r   r   Nr  r   r   r  r   z-%(py2)s
{%(py2)s = %(py0)s.state
} == %(py5)s)r   r   r   rF  )r    r   )rd  r  rG  rH  r   r   r  r  r  r  r  r  r	  r
  )r   r.  r   rS  rI  r  r  r  r   r  r  r  r  r  r*  r   r  r  r  s   &&             @@@@r2   4test_gateway_status_renews_rejected_local_grant_oncer  R  s    ,5(HE%'GTYY[4'4/0IP P  (*DFYZ(*A5I(*@%H!(G4F<<"7"7"""""<""""""6""""6"""<"""7""""""""YY5YYYYYY5YYYYYYY5YYYY5YYYYYYYYYYYY?@@7@@@@@@7@@@@@@@7@@@@7@@@@@@@@@@@@r5   c                    V ^8  d   QhRRRR/# r-  r0   )r1   s   "r2   r3   r3   r  s      .	r5   c           
     P  aaaaaa V w  opop\         P                  ! 4       o\         P                  ! 4       o^ o\        \        P                  ! 4       R,           R,          4      oR VV3R llpR VVVV3R llpVP                  \        RR 4       VP                  \        RV4       VP                  \        R	V4       \        ^2R
7      ;_uu_ 4       p\        VP                  VV3R l\        ^24      4      4      pRRR4       R X 4       p\        V4      q'       g   RRR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                   ! \        4      MRR\        P                   ! V4      R\        P                   ! V	4      /,          p
\#        \        P$                  ! V
4      4      hR;r^pSV8H  q'       g   \        P&                  ! RV3RSV34      RR\        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                   ! S4      MRR\        P                   ! V4      /,          pRRV/,          p\#        \        P$                  ! V4      4      hR;rR#   + '       g   i     EL; i)r   ry  c               $    V ^8  d   QhRRRRRR/# )r-   _keyrG   r<  r=  r.   r   r0   )r1   s   "r2   r3   dtest_gateway_status_recovers_fifty_concurrent_reconnects_after_grant_rejection.<locals>.__annotate__{  s&     P P Pu P Pr5   c                  < ?SP                  4       '       g   \        P                  ! R 4      h\        RR\        P                  ! 4       S4      # )r}  r   r?  )is_setrH  r~  r   r  )r:  r  r  r<  r  r  s   &&&$r2   r  ]test_gateway_status_recovers_fifty_concurrent_reconnects_after_grant_rejection.<locals>.fetch{  s=    ~~"889OPPW&6		YOOr5   c               $    V ^8  d   QhRRRRRR/# )r-   r  rG   r<  r=  r.   rd  r0   )r1   s   "r2   r3   r    s!       u  r5   c                  < ?S;_uu_ 4        S^,          oSP                  4        RRR4       S#   + '       g   i     S# ; i)rg  N)set)r:  r  r  r<  r  renewal_lockrenewalsr  s   &&&$r2   r  ]test_gateway_status_recovers_fifty_concurrent_reconnects_after_grant_rejection.<locals>.renew  s:    \MHKKM   \ s	   1A	r  c                     R # r  r0   r  s   *r2   r  `test_gateway_status_recovers_fifty_concurrent_reconnects_after_grant_rejection.<locals>.<lambda>  r  r5   rE  r  )max_workersc                   < \        SS4      # rm   )r   )_indexr   r   s   &r2   r  r    s    0DXw0Wr5   Nc              3  >   "   T F  qP                   R 8H  x  K  	  R# 5i)r   N)r   )r   r  s   & r2   r   atest_gateway_status_recovers_fifty_concurrent_reconnects_after_grant_rejection.<locals>.<genexpr>  s     >X6||w&Xs   z,assert %(py4)s
{%(py4)s = %(py0)s(%(py2)s)
}r   allr   r   r  r   r   r   Q r   rF  )r   EventLockrd  r  rG  rH  r   rp  mapranger  r  r  r  r  r  r	  r
  r  )r   r.  rS  rI  r  r  poolstatusesr   r  r  r  r*  r  r   r   r  r  r  r  s   &&            @@@@@@r2   Ntest_gateway_status_recovers_fifty_concurrent_reconnects_after_grant_rejectionr  r  s    ,5(HhooG>>#LHTYY[</478IP P  (*DFYZ(*A5I(*@%H		+	+t!WY^_aYbcd 
, ?X>>3>>>>>>>>>>3>>>>3>>>>>>>>>>>>>>8q=8q88q	 
,	+	+s   *JJ%	c                    V ^8  d   QhRRRR/# r-  r0   )r1   s   "r2   r3   r3     s      .	r5   c                  a
 V w  r#rE. o
VP                  \        R R 4       VP                  \        RV
3R l4       \        P                  ! \        RR7      ;_uu_ 4        \        W$4       RRR4       . pS
V8H  qw'       g   \        P                  ! RV3RS
V34      RR\        P                  ! 4       9   g   \        P                  ! S
4      '       d   \        P                  ! S
4      MRR	\        P                  ! V4      /,          pR
RV/,          p	\        \        P                  ! V	4      4      hR;rvR#   + '       g   i     L; i)rE  c                 Z    R  R 4       P                  \        P                  ! R4      4      # )c              3  $   "   T F  qx  K  	  R # 5irm   r0   )r   _s   & r2   r   itest_gateway_status_rejected_nonlocal_grant_never_uses_admin_renewal.<locals>.<lambda>.<locals>.<genexpr>  s     /b1bs   r}  r0   )throwrH  r~  rj   _kwargss   *,r2   r  Vtest_gateway_status_rejected_nonlocal_grant_never_uses_admin_renewal.<locals>.<lambda>  s"    /b/"7"7223IJ#
r5   r  c               :   < SP                  VP                  4      # rm   )r=   r   )r:  r  r  r<  r  s   &&&$r2   r  r    s    HOO=
r5   unavailablerY  Nr   r  r   r   r   r   rF  )rG  rH  r\  r]  r   r   r  r  r  r  r  r  r	  r
  )r   r.  r   rS  r   rI  r  r   r*  r  r  s   &&        @r2   Dtest_gateway_status_rejected_nonlocal_grant_never_uses_admin_renewalr    s     ,5(HH	
 	
 
2-	H	HX/ 
I 8r>8r88r 
I	Hs    D88E	c                    V ^8  d   QhRRRR/# r-  r0   )r1   s   "r2   r3   r3     s      .	r5   c                
  aaa V w  r#rE\         P                   ! 4       o\        R RS\        SR,           R,          4      4      \        R RS\        SR,           R,          4      4      \        R RS\        SR,           R,          4      4      .o. oVP                  \        RR 4       VP                  \        RV3R l4       VP                  \        RVV3R l4       \        W$4      pVP                  pR	qVJq'       g   \        P                  ! R V	3R!Wx34      R
R\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          p
RRV
/,          p\        \        P                  ! V4      4      hR	;p;rVP                  p^p^<qV,          p^<qV,          pSV,           pRpVV,          p\        V4      pVV8  q'       Eg   \        P                  ! R"V	3R#VV34      R
R\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      RR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRRR\        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                  ! S4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /	,          pRRV/,          p\        \        P                  ! V4      4      hR	;p;p	;p;p;p;p;p;p;p;ppR.pSV8H  qw'       g   \        P                  ! R$V3R%SV34      R
R\        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                  ! S4      MRR\        P                  ! V4      /,          pRRV/,          p
\        \        P                  ! V
4      4      hR	;pp. pSV8H  qw'       g   \        P                  ! R$V3R%SV34      R
R\        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                  ! S4      MRR\        P                  ! V4      /,          pRRV/,          p
\        \        P                  ! V
4      4      hR	;ppR	# )&r   r?  ry  r  c                     R # r  r0   r  s   *r2   r  Dtest_gateway_status_proactively_renews_near_expiry.<locals>.<lambda>  r  r5   rE  c                 &   < SP                  ^ 4      # )r   )pop)rj   r  r  s   *,r2   r  r    s    (,,q/r5   r  c               |   < SP                  VP                  4      ;'       g    \        SR,           R,          4      # )   ry  r  )r=   r   rd  )r:  r  r  r<  nowr  s   &&&$r2   r  r    sG    HOOIL^L^<_  =D  =Dcfhknzhz  C  hC  dD  =Dr5   Nr   r  r   r   r   r   r   rd  r  r   py12r   py19zassert %(py21)spy21r    r  r   r   r  i  r  )is not)z?%(py2)s
{%(py2)s = %(py0)s.grant_expires_at_ms
} is not %(py5)s>)z%(py2)s
{%(py2)s = %(py0)s.grant_expires_at_ms
} > %(py19)s
{%(py19)s = %(py4)s(((%(py5)s + ((%(py7)s * %(py9)s) * %(py12)s)) * %(py16)s))
}r   rF  )r  r   rd  rG  rH  r   grant_expires_at_msr  r  r  r  r  r  r	  r
  )r   r.  r   rS  r   rI  r  r   r  r  r  r  r!  r"  r#  @py_assert11@py_assert13r&  r%  @py_assert17@py_assert18@py_format20@py_format22r  r*  r  r  r  s   &&                       @@@r2   2test_gateway_status_proactively_renews_near_expiryr    sH    ,5(H
))+Cg/c3=D:P6QRg/c3=D:P6QRg/c3;MQU:U6VWH
 H(*DFYZ1
  	D "(4F%%1T1T11111%111111611116111%111T11111111%%H2HH7HRHR<HS<-?H4H-?4,GH,G(HH%(HHHHHH%(HHHHHHH6HHHH6HHH%HHHHHHHHHHHHHHHHHSHHHHSHHH2HHHHHHRHHH4HHH(HHHHHHHHHHH'((8((((((8(((((((8((((8((((((((((((8r>8r88rr5   c                    V ^8  d   QhRRRR/# r-  r0   )r1   s   "r2   r3   r3     s     ,# ,#.,#	,#r5   c                :  a! V w  r#rE. o! ! V!3R  lR\         4      p\        R(V4      p\        P                  ! VP                  R7      pVP                  4        RVP                   2p	\        P                  ! VP                  V	4      p
VP                  \        RVP                  4       VP                  \        RV	4       VP                  \        RR 4        \        P                  ! WRR	R
7       VP                  4        VP                  4        VP                  4        \        S!4      p^qV8H  q'       Eg   \         P"                  ! R)V3R*W34      RR\$        P&                  ! 4       9   g!   \         P(                  ! \        4      '       d   \         P*                  ! \        4      MRRR\$        P&                  ! 4       9   g   \         P(                  ! S!4      '       d   \         P*                  ! S!4      MRR\         P*                  ! V4      R\         P*                  ! V4      /,          pRRV/,          p\-        \         P.                  ! V4      4      hR;p;rS!^ ,          w  pppRpRp^@pVV,          pVV,           pVV8H  pV'       g   \         P"                  ! R)V3R+VV34      RR\$        P&                  ! 4       9   g   \         P(                  ! V4      '       d   \         P*                  ! V4      MRR\         P*                  ! V4      R\         P*                  ! V4      R\         P*                  ! V4      /,          pRRV/,          p\-        \         P.                  ! V4      4      hR;p;p;p;p;ppRpVV8H  pV'       g   \         P"                  ! R)V3R,VV34      RR\$        P&                  ! 4       9   g   \         P(                  ! V4      '       d   \         P*                  ! V4      MRR\         P*                  ! V4      /,          pRRV/,          p\-        \         P.                  ! V4      4      hR;ppRpVV9  q'       g   \         P"                  ! R-V3R.VV34      R\         P*                  ! V4      RR\$        P&                  ! 4       9   g   \         P(                  ! V4      '       d   \         P*                  ! V4      MR/,          pRRV/,          p\-        \         P.                  ! V4      4      hR;pp\0        P2                  pRpV! V4      qP4                  pV! 4       pVV9   pV'       Eg`   \         P"                  ! R/V3R0VV34      RR \$        P&                  ! 4       9   g!   \         P(                  ! \0        4      '       d   \         P*                  ! \0        4      MR R!\         P*                  ! V4      R"\         P*                  ! V4      R\         P*                  ! V4      R\         P*                  ! V4      R#\         P*                  ! V4      R$R\$        P&                  ! 4       9   g   \         P(                  ! V4      '       d   \         P*                  ! V4      MR/,          pR%R&V/,          p \-        \         P.                  ! V 4      4      hR;p;p;p;p;ppR'pVV9   q'       g   \         P"                  ! R/V3R1VV34      R\         P*                  ! V4      RR\$        P&                  ! 4       9   g   \         P(                  ! V4      '       d   \         P*                  ! V4      MR/,          pRRV/,          p\-        \         P.                  ! V4      4      hR;ppR#   TP                  4        TP                  4        TP                  4        i ; i)2c                  6   < ] tR tRtR V 3R lltR R ltRtR# )Ctest_gateway_grant_renewal_sends_hash_not_proxy_key.<locals>._Admini  c                   V ^8  d   QhRR/# r,   r0   )r1   s   "r2   r3   Ptest_gateway_grant_renewal_sends_hash_not_proxy_key.<locals>._Admin.__annotate__  s     		& 		&T 		&r5   c                	:  < \        V P                  P                  R R4      4      pV'       d   V P                  P	                  V4      MRpSP                  V P                  V P                  P                  R4      V34       \        P                  ! RR/4      P                  4       pV P                  ^4       V P                  RR4       V P                  R \        \        V4      4      4       V P                  4        V P                  P!                  V4       R# )	r;   0r5   r7   
expires_atr$   r9   r:   N)rd  r?   r@   rfilereadr=   r>   rA   rB   rD   rE   rF   rG   rH   rI   rJ   rK   )rM   lengthrC   rN   captureds   &   r2   re   Ktest_gateway_grant_renewal_sends_hash_not_proxy_key.<locals>._Admin.do_POST  s    ))*:C@AF.44::??6*#DOOTYY(8(8(I4PQjj,0F!GHOOQGs#^-?@-s3w</@AJJW%r5   c               $    V ^8  d   QhRRRRRR/# rh   r0   )r1   s   "r2   r3   r    !     	 	s 	F 	t 	r5   c                	    R # rm   r0   rn   s   &&*r2   ro   Otest_gateway_grant_renewal_sends_hash_not_proxy_key.<locals>._Admin.log_message      r5   r0   N)rq   rr   rs   rt   re   ro   rx   r  s   r2   _Adminr    s    		& 		&	 	r5   r  r}   r   LOCAL_AUTHORITY_NAMELOCAL_AUTHORITY_ORIGIN_read_authority_admin_tokenc                     R# a@aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar0   r0   r5   r2   r  Etest_gateway_grant_renewal_sends_hash_not_proxy_key.<locals>.<lambda>      QYr5   r         @)r<  r   rH   r   r  r   r   r   r   NBearer r  authorizationr   r   assert %(py11)sr   r5   rC   r   r>   s   synthetic-route-keyhashlibr   r   r   r  zassert %(py14)spy14r    r   r   )z0%(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)sz*%(py0)s == (%(py3)s + (%(py5)s * %(py7)s))rF  r   r   r   )z%(py10)s
{%(py10)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.sha256
}(%(py4)s)
}.hexdigest
}()
} in %(py12)sr   )r   r   r   r   r   r   r   rH  AuthorityEndpointr   rG  r  r   r   r   rH   r  r  r  r  r  r  r	  r
  r  sha256	hexdigest)"r   r.  	_base_dirrS  r   rI  r  r   r   r   r^  r  r  r  r  r  r>   r  rC   r!  r"  @py_assert9r   r)  @py_format12r*  r  r  r  r  r  ru  @py_format15r  s"   &&                               @r2   3test_gateway_grant_renewal_sends_hash_not_proxy_keyr    se    -6)I46H'  !!16:FV%9%9:F
LLN !3!3 45F11'2H2H&QH(*@'BXBXY(*BFK(*GIYZ--43	
 	x=AA=33xx=A (D-%00b0b0I00=000000=0000000=0000=000I000000b00000000043;43443 , ,,,,, ,,, ,,,,,,,,,,,,,,,,,,>>E0E>01E;;E;=E=EEEEE=EEEEEE7EEEE7EEE>EEE0EEE1EEE;EEE=EEEEEEEEEEEEEEEEEEE"?d"""""?d"""?""""""d""""d"""""""" 	s   ]( (2^c                    V ^8  d   QhRRRR/# r-  r0   )r1   s   "r2   r3   r3     s     &1 &1.&1	&1r5   c                   V w  r#rE\        VP                  VP                  VP                  VP                  VP
                  VP                  \        \        P                  VP                  VP                  VP                  VP                  R 7      R7      pVP                  \        RVP                  4       VP                  \        RV4       VP                  \        RR 4       . \         n        \%        W&4      pVP&                  pRqV	J q'       g   \(        P*                  ! R$V
3R%W34      RR\,        P.                  ! 4       9   g   \(        P0                  ! V4      '       d   \(        P2                  ! V4      MRR	\(        P2                  ! V4      R
\(        P2                  ! V	4      /,          pRRV/,          p\5        \(        P6                  ! V4      4      hR;p;rVP8                   Uu. uF%  qP:                  VP<                  VP>                  3NK'  	  pp. R&OqV
8H  q'       gy   \(        P*                  ! R'V3R(W34      R\(        P2                  ! V4      R\(        P2                  ! V
4      /,          pRRV/,          p\5        \(        P6                  ! V4      4      hR;p;r\         P"                  p\A        V4      p	^pV	V8H  pV'       Eg<   \(        P*                  ! R'V3R)V	V34      RR\,        P.                  ! 4       9   g!   \(        P0                  ! \@        4      '       d   \(        P2                  ! \@        4      MRRR\,        P.                  ! 4       9   g!   \(        P0                  ! \         4      '       d   \(        P2                  ! \         4      MRR\(        P2                  ! V4      R
\(        P2                  ! V	4      R\(        P2                  ! V4      /,          pRRV/,          p\5        \(        P6                  ! V4      4      hR;p;p	;pp\         P"                  ^ ,          w  ppVPB                  pRq! V
4      pV'       g   RRR\,        P.                  ! 4       9   g   \(        P0                  ! V4      '       d   \(        P2                  ! V4      MRR	\(        P2                  ! V4      R\(        P2                  ! V
4      R\(        P2                  ! V4      /,          p\5        \(        P6                  ! V4      4      hR;p;p
pRqV9   q'       g   \(        P*                  ! R*V3R+VV34      R\(        P2                  ! V4      RR\,        P.                  ! 4       9   g   \(        P0                  ! V4      '       d   \(        P2                  ! V4      MR/,          pRR
V/,          p\5        \(        P6                  ! V4      4      hR;rRqV9   q'       g   \(        P*                  ! R*V3R+VV34      R\(        P2                  ! V4      RR\,        P.                  ! 4       9   g   \(        P0                  ! V4      '       d   \(        P2                  ! V4      MR/,          pRR
V/,          p\5        \(        P6                  ! V4      4      hR;rRqV9  q'       g   \(        P*                  ! R,V3R-VV34      R\(        P2                  ! V4      RR\,        P.                  ! 4       9   g   \(        P0                  ! V4      '       d   \(        P2                  ! V4      MR/,          pRR
V/,          p\5        \(        P6                  ! V4      4      hR;rRpR p	^@pV	V,          pVV,           pVV8H  q'       g   \(        P*                  ! R'V3R.VV34      RR!\,        P.                  ! 4       9   g   \(        P0                  ! V4      '       d   \(        P2                  ! V4      MR!R\(        P2                  ! V4      R
\(        P2                  ! V	4      R\(        P2                  ! V4      /,          pR"R#V/,          p\5        \(        P6                  ! V4      4      hR;p;p;p	;p;ppR# u upi )/r   r   r  r  r  c                     R# r  r0   r0   r5   r2   r  Htest_gateway_usage_reads_sanitized_local_admin_windows.<locals>.<lambda>  r  r5   Tr   usager   r   r   r   Nr   r   r   r   rH   r)   r   r   r   r   z%/_subrouter/authority-admin/v1/usage?zLassert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.startswith
}(%(py4)s)
}r>   zprovider=codexr   zaccount_id=fixturer   r  r  r  r  r   r  )z-%(py2)s
{%(py2)s = %(py0)s.fresh
} is %(py5)s))rW   rY   N)r^         E@N)ra         @rc   r   r   )zN%(py5)s
{%(py5)s = %(py0)s(%(py3)s
{%(py3)s = %(py1)s.requests
})
} == %(py8)sr   r   r   r   r  )"r   r   r   r   r   r   r   r
   r   	SUBROUTERr   r   r   r   rG  rH  r)   r*   r   rT   r  r  r  r  r  r  r	  r
  rU   rV   rX   rb   rH   
startswith)r   r.  r   r   r   r   activer  r   r  r  r  r  wr  r  r  r  r  r!  r  r  r>   r  r  r*  r"  r   r)  r  s   &&                            r2   6test_gateway_usage_reads_sanitized_local_admin_windowsr    s    *3&HwKKmm))mm\\%%*(("11%%%%#33
F (*@'BXBXY(*BFK(*GIYZ N1E;;$$;55;$9>GAVVQ^^QYY/ G L  L    	G   	G   	 L      	 
 &&,3&',1,'1,,,,,'1,,,,,,3,,,,3,,,,,,,~,,,,~,,,&,,,',,,1,,,,,,,,(11!4D-??CBC?BCCCCCCCCC4CCCC4CCC?CCCBCCCCCCCCCCC#t#####t#########t####t########'4'''''4'''''''''4''''4'''''''' ,,,,,, ,,, ,,,,,,,,,,,,,,,,,,%00b0b0I00=000000=0000000=0000=000I000000b000000000 Hs   /+ac                    V ^8  d   QhRRRR/# r-  r0   )r1   s   "r2   r3   r3   '  s     8 8.8	8r5   c                   V w  r#rE\        VP                  VP                  VP                  VP                  VP
                  VP                  \        \        P                  VP                  VP                  VP                  VP                  R 7      R7      p ! R R4      pVP                  \        RR 4       VP                  \        RR 4       \!        V! V4      4      pVP#                  V4      p	V	P$                  p
\&        P(                  qV8H  q'       Eg   \*        P,                  ! RV3RW34      RR	\.        P0                  ! 4       9   g   \*        P2                  ! V	4      '       d   \*        P4                  ! V	4      MR	R
\*        P4                  ! V
4      RR\.        P0                  ! 4       9   g!   \*        P2                  ! \&        4      '       d   \*        P4                  ! \&        4      MRR\*        P4                  ! V4      /,          pRRV/,          p\7        \*        P8                  ! V4      4      hR;p
;rV	P:                  p
^qV8H  q'       g   \*        P,                  ! RV3RW34      RR	\.        P0                  ! 4       9   g   \*        P2                  ! V	4      '       d   \*        P4                  ! V	4      MR	R
\*        P4                  ! V
4      R\*        P4                  ! V4      /,          pRRV/,          p\7        \*        P8                  ! V4      4      hR;p
;rV	P<                  p
^*qV8H  q'       g   \*        P,                  ! RV3RW34      RR	\.        P0                  ! 4       9   g   \*        P2                  ! V	4      '       d   \*        P4                  ! V	4      MR	R
\*        P4                  ! V
4      R\*        P4                  ! V4      /,          pRRV/,          p\7        \*        P8                  ! V4      4      hR;p
;rV	P>                  p
RqV8H  q'       g   \*        P,                  ! RV3RW34      RR	\.        P0                  ! 4       9   g   \*        P2                  ! V	4      '       d   \*        P4                  ! V	4      MR	R
\*        P4                  ! V
4      R\*        P4                  ! V4      /,          pRRV/,          p\7        \*        P8                  ! V4      4      hR;p
;rV	P@                  p
RqV8H  q'       g   \*        P,                  ! RV3RW34      RR	\.        P0                  ! 4       9   g   \*        P2                  ! V	4      '       d   \*        P4                  ! V	4      MR	R
\*        P4                  ! V
4      R\*        P4                  ! V4      /,          pRRV/,          p\7        \*        P8                  ! V4      4      hR;p
;rV	PB                  p
RqV8H  q'       g   \*        P,                  ! RV3RW34      RR	\.        P0                  ! 4       9   g   \*        P2                  ! V	4      '       d   \*        P4                  ! V	4      MR	R
\*        P4                  ! V
4      R\*        P4                  ! V4      /,          pRRV/,          p\7        \*        P8                  ! V4      4      hR;p
;rV	PD                   Uu. uF1  pVPF                  VPH                  VPJ                  VPL                  3NK3  	  ppR .pVV8H  pV'       gz   \*        P,                  ! RV3R!VV34      R\*        P4                  ! V4      R\*        P4                  ! V4      /,          pRRV/,          p\7        \*        P8                  ! V4      4      hR;p;ppR# u upi )"r   r   c                  "    ] tR tRtR R ltRtR# )Ltest_authority_health_adapter_merges_gateway_usage_limits.<locals>._Registryi;  c                    V ^8  d   QhRRRR/# r-   r>   r   r.   r/   r0   )r1   s   "r2   r3   Ytest_authority_health_adapter_merges_gateway_usage_limits.<locals>._Registry.__annotate__<       	! 	! 	!$ 	!r5   c                	    Wn         R # rm   r   rM   r>   s   &&r2   __init__Utest_authority_health_adapter_merges_gateway_usage_limits.<locals>._Registry.__init__<       Mr5   r  Nrq   rr   rs   rt   r  rx   r0   r5   r2   	_Registryr  ;      	! 	!r5   r  r   c                 >    \        \        P                  R R RRR7      # )Nr@  r?  rS   detailr   r   OKr  s   *,r2   r  Ktest_authority_health_adapter_merges_gateway_usage_limits.<locals>.<lambda>B  s    /OOT4C@P#
r5   r   c                 n    \        R R\        RRRR4      \        RRRR	4      \        R
RRRR4      3R7      # )     @@TrW   rY   r[   r]   r^   r	  r_   r`   ra   r
  rd   rc   rS   rT   rU   )r   r   r  s   *,r2   r  r&  I  sA    ,"9dE3?";fdC"#6UCU#
r5   r   snapshotr   r   r   r   r   r   Nr   r   r   g      @     0@r?  r   r   r   zF%(py2)s
{%(py2)s = %(py0)s.status
} == %(py6)s
{%(py6)s = %(py4)s.OK
}z8%(py2)s
{%(py2)s = %(py0)s.primary_used_pct
} == %(py5)sz:%(py2)s
{%(py2)s = %(py0)s.secondary_used_pct
} == %(py5)s)z8%(py2)s
{%(py2)s = %(py0)s.primary_reset_at
} == %(py5)sz:%(py2)s
{%(py2)s = %(py0)s.secondary_reset_at
} == %(py5)sz.%(py2)s
{%(py2)s = %(py0)s.detail
} == %(py5)s)	five_hourrc      g     P@r   )'r   r   r   r   r   r   r   r
   r   r  r   r   r   r   rG  provider_servicesr   r  r  r   r%  r  r  r  r  r  r  r	  r
  primary_used_pctsecondary_used_pctprimary_reset_atsecondary_reset_atr#  named_limitskindgrouppercent	resets_at)r   r.  r   r   r   rI  r  r  adapterr*  r   r  r  r  r  r  r  r  itemr  r  r  s   &&                    r2   9test_authority_health_adapter_merges_gateway_usage_limitsr?  '  s    +4'HwKKmm))mm\\%%*(("11%%%%#33
F ! ! !	
 	
 %Yx%89G}}V$H??-loo-o-----?------8----8---?------l----l---o--------$$*******$******8****8***$***********&&,",",,,,,&,,,,,,8,,,,8,,,&,,,",,,,,,,,$$.......$......8....8...$...........&&0&0&00000&000000800008000&000&00000000??.........?......8....8...?............NVNcNcdNcdTYY

DLL$..ANc d-i d i    d i   d    i        ds   ?7^	c                   V ^8  d   QhRR/# r,   r0   )r1   s   "r2   r3   r3   b  s     1 1PT 1r5   c                    \         P                  ! \        \        P                  R R RRR7      \        RR\        RRRR4      3R	7      4      p V P                  pR q!VJ q3'       g   \        P                  ! RV3RW34      R
R\        P                  ! 4       9   g   \        P                  ! V 4      '       d   \        P                  ! V 4      MRR\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR ;p;r2V P                   pR q!VJ q3'       g   \        P                  ! RV3RW34      R
R\        P                  ! 4       9   g   \        P                  ! V 4      '       d   \        P                  ! V 4      MRR\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR ;p;r2V P"                  p^q!V8H  q3'       g   \        P                  ! RV3RW34      R
R\        P                  ! 4       9   g   \        P                  ! V 4      '       d   \        P                  ! V 4      MRR\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR ;p;r2V P$                  pRq!V8H  q3'       g   \        P                  ! RV3RW34      R
R\        P                  ! 4       9   g   \        P                  ! V 4      '       d   \        P                  ! V 4      MRR\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR ;p;r2R # )Nr@  r?  r"  r(  TrW   r_   r`   r)  r   r*  r   r   r   r   r+  r  z8%(py2)s
{%(py2)s = %(py0)s.primary_used_pct
} is %(py5)s)z8%(py2)s
{%(py2)s = %(py0)s.primary_reset_at
} is %(py5)sr   r.  r/  )r   _quota_snapshotr   r   r%  r   r   r4  r  r  r  r  r  r  r	  r
  r6  r5  r7  )r*  r   r  r  r  r  s         r2   Ftest_authority_health_adapter_uses_duration_before_generic_window_namerD  b  s%   %55OOT4C@P	
 	'	3EG	
		H $$,,,,,,,$,,,,,,8,,,,8,,,$,,,,,,,,,,,$$,,,,,,,$,,,,,,8,,,,8,,,$,,,,,,,,,,,&&+!+!+++++&++++++8++++8+++&+++!++++++++&&0&0&00000&000000800008000&000&00000000r5   c                   V ^8  d   QhRR/# r,   r0   )r1   s   "r2   r3   r3   t  s     / /RV /r5   c                
   V w  rr4\        W4      pVP                  p\        P                  qvV8H  q'       Eg   \        P
                  ! RV3RWg34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      RR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      /,          p	RRV	/,          p
\        \        P                  ! V
4      4      hR	;p;rVP                  pR
qV8H  q'       g   \        P
                  ! RV3RWk34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR	;p;rVP                  P                  4        \        W4      pVP                  p\        P                  qvV8H  q'       Eg   \        P
                  ! RV3RWg34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      RR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      /,          p	RRV	/,          p
\        \        P                  ! V
4      4      hR	;p;rVP                  pRqV8H  q'       g   \        P
                  ! RV3RWk34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR	;p;rRqP                  qV9  pV'       g   \        P
                  ! RV3RW34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR	;p;ppR	# )r   r   r*  r   r   r   r   r   r   Nr?  r   r   r   r  zGateway: migration requiredr   r   r   r   r,  r0  zK%(py2)s
{%(py2)s = %(py0)s.status
} == %(py6)s
{%(py6)s = %(py4)s.UNKNOWN
}r   )z2%(py1)s not in %(py5)s
{%(py5)s = %(py3)s.detail
})r   r  r   r%  r  r  r  r  r  r  r	  r
  r#  r   unlinkUNKNOWN)r   r   r   r   rI  r*  r   r  r  r  r  r  r  r  r  r  r  s   &                r2   ?test_gateway_status_is_sanitized_and_missing_grant_fails_closedrJ  t  s   *3'Hw&x9H??-loo-o-----?------8----8---?------l----l---o--------??.........?......8....8...?............""$)(<K5!5!55!555555555555;5555;5555555555555555!555555555>!>>!>>>>>>>>>>>>;>>>>;>>>>>>!>>>>>>>>>..........9...9......K....K............r5   c                   V ^8  d   QhRR/# r,   r0   )r1   s   "r2   r3   r3     s     7 7 7r5   c           	        V w  rr4/ \         CR RRR/C\        n        \        W4      pVP                  pRqvV8H  q'       g   \
        P                  ! RV3RWg34      RR\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MRR\
        P                  ! V4      R\
        P                  ! V4      /,          p	RRV	/,          p
\        \
        P                  ! V
4      4      hR	;p;rVP                  pR
qvV8H  q'       g   \
        P                  ! RV3RWg34      RR\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MRR\
        P                  ! V4      R\
        P                  ! V4      /,          p	RRV	/,          p
\        \
        P                  ! V
4      4      hR	;p;rR	# )r   	exhaustedr&   r   r  r   r   r   r   NzGateway: quota exhaustedr   r  r0  )rv   r)   rC   r   r   r  r  r  r  r  r  r	  r
  r#  )r   r   rS  r   rI  r  r   r  r  r  r  s   &          r2   .test_gateway_status_maps_exact_exhausted_staterN    s    +4(H
N "(4F<<&;&;&&&&&<&&&&&&6&&&&6&&&<&&&;&&&&&&&&==666666666=666666666666666=666666666666r5   c               $    V ^8  d   QhRRRRRR/# )r-   fieldrG   r5  rk   r.   r/   r0   )r1   s   "r2   r3   r3     s(     	0 	0	0 	0 
		0r5   c                    V w  r4rV/ \         CW/C\        n        \        P                  ! \
        R R7      ;_uu_ 4        \        W54       RRR4       R#   + '       g   i     R# ; i)r  rY  N)rv   r)   rC   r\  r]  r   r   )r   rP  r5  r   rS  r   rI  s   &&&    r2   5test_gateway_status_rejects_wrong_or_unbounded_schemarR    sJ    " ,5(H9]9E9N	2-	H	HX/ 
I	H	H	Hs   AA%	c                   V ^8  d   QhRR/# r,   r0   )r1   s   "r2   r3   r3     s     : :PT :r5   c           	     X  aa V w  rr4. o ! V3R  lR\         4      p\        RV4      o ! V3R lR\         4      p\        RV4      p\        P                  ! SP                  R7      \        P                  ! VP                  R7      .pV F  p	V	P                  4        K  	   VR,          p
V
P                  \        P                  ! RRRR	VP                   2///4      R
R7       \        P                  ! \        RR7      ;_uu_ 4        \        W4       RRR4       . pSV8H  q'       g   \        P                  ! RV3RSV34      RR\         P"                  ! 4       9   g   \        P$                  ! S4      '       d   \        P&                  ! S4      MRR\        P&                  ! V4      /,          pRRV/,          p\)        \        P*                  ! V4      4      hR;rVP-                  4        SP-                  4        V F  p	V	P/                  4        K  	  VP1                  4        SP1                  4        R#   + '       g   i     EL.; i  TP-                  4        SP-                  4        T F  p	T	P/                  4        K  	  TP1                  4        SP1                  4        i ; i)c                  6   < ] tR tRtR V 3R lltR R ltRtR# )Ltest_gateway_status_refuses_redirect_without_forwarding_grant.<locals>._Sinki  c                   V ^8  d   QhRR/# r,   r0   )r1   s   "r2   r3   Ytest_gateway_status_refuses_redirect_without_forwarding_grant.<locals>._Sink.__annotate__  s     	 	D 	r5   c                	   < SP                  V P                  P                  R 4      4       V P                  ^4       V P	                  4        R# )r7   N)r=   r?   r@   rE   rI   )rM   r  s   &r2   rO   Stest_gateway_status_refuses_redirect_without_forwarding_grant.<locals>._Sink.do_GET  s8    OODLL,,_=>s#r5   c               $    V ^8  d   QhRRRRRR/# rh   r0   )r1   s   "r2   r3   rX    r  r5   c                	    R # rm   r0   rn   s   &&*r2   ro   Xtest_gateway_status_refuses_redirect_without_forwarding_grant.<locals>._Sink.log_message  r  r5   r0   Nrq   rr   rs   rt   rO   ro   rx   r  s   r2   _SinkrV    s    	 	
	 	r5   r_  c                  6   < ] tR tRtR V 3R lltR R ltRtR# )Ptest_gateway_status_refuses_redirect_without_forwarding_grant.<locals>._Redirecti  c                   V ^8  d   QhRR/# r,   r0   )r1   s   "r2   r3   ]test_gateway_status_refuses_redirect_without_forwarding_grant.<locals>._Redirect.__annotate__  s     	 	D 	r5   c                	   < V P                  R 4       V P                  RRSP                   R24       V P                  4        R# )i.  Locationr   z/captureN)rE   rF   r   rI   )rM   sinks   &r2   rO   Wtest_gateway_status_refuses_redirect_without_forwarding_grant.<locals>._Redirect.do_GET  sC    s#/0@0@/AJ r5   c               $    V ^8  d   QhRRRRRR/# rh   r0   )r1   s   "r2   r3   rc    r  r5   c                	    R # rm   r0   rn   s   &&*r2   ro   \test_gateway_status_refuses_redirect_without_forwarding_grant.<locals>._Redirect.log_message  r  r5   r0   Nr^  )rf  s   r2   	_Redirectra    s    	 		 	r5   rk  r}   r   r   r   r   r   r8   r   r  rY  Nr   r  r   r   r   r   r   rF  )r   r   r   r   r   r   r   rA   rB   r   r\  r]  r   r   r  r  r  r  r  r  r	  r
  r   r   r   )r   r   rS  r   rI  r_  rk  redirectthreadsr   r   r  r   r*  r  r  rf  s   &              @@r2   =test_gateway_status_refuses_redirect_without_forwarding_grantrn    s    +4(H!#H&  /7D	* 	 ##3Y?H 2 23 6 67G  99	JJ!%$(9(:N:N9O&P($  	 	
 ]]6mLL 3 M x2~x2xx2FKKM  MLL
 	FKKM s.   "A'I 	H:A'I =A"I :I		I AJ)c                    V ^8  d   QhRRRR/# r-   rz   r   r.   r/   r0   )r1   s   "r2   r3   r3     s     ? ?D ?UY ?r5   c                @   V w  r#rEVP                   P                  R 4       \        P                  ! \        RR7      ;_uu_ 4        \        W#R. 4       RRR4       VR,          pVP                  RRR7       VP                  R	4       VP                   P                  4        VP                   P                  V4       \        P                  ! \        RR7      ;_uu_ 4        \        W#R. 4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)
i  rX  rY  r   Nr~   	syntheticr8   r   r   )	r   r   r\  r]  r   r   r   rH  
symlink_to)r   rz   r   r   r   rI  r~   s   &&     r2   2test_binding_rejects_permissive_or_symlinked_grantrt    s    *3'Hw!!%(	2:N	O	Ox'2> 
P  F
kG4
LL""$&&v.	2:N	O	Ox'2> 
P	O 
P	O 
P	O	Os   C9!D9D		D	c                    V ^8  d   QhRRRR/# rp  r0   )r1   s   "r2   r3   r3     s     	? 	? 	? 	?r5   c                p   V w  r#rEVR ,          pVP                   P                  4        VP                  RRR7       VP                  R4       VP                   P	                  V4       \
        P                  ! \        RR7      ;_uu_ 4        \        W#R. 4       RRR4       R#   + '       g   i     R# ; i)	zoriginal.grantrr  r8   r   r   rX  rY  r   N)	r   rH  r   r   hardlink_tor\  r]  r   r   )r   rz   r   r   r   rI  originals   &&     r2   &test_binding_rejects_hard_linked_grantry    s    *3'Hw**H""$g6NN5''1	2:N	O	Ox'2> 
P	O	O	Os   B$$B5	c                    V ^8  d   QhRRRR/# rp  r0   )r1   s   "r2   r3   r3     s     ? ??	?r5   c                   V w  r#rEVR ,          pVP                  RR7       VR,          pVP                  RR7       VR,          pVP                  RRR7       VP                  R4       VR	,          P                  VR
R7       \	        VP
                  VP                  VP                  VP                  VP                  VP                  \        VP                  VP                  VP                  VP                  VR	,          R,          P!                  4       R7      R7      p	\"        P$                  ! \&        RR7      ;_uu_ 4        \)        W)R. 4       RRR4       R#   + '       g   i     R# ; i)safer   r   outsider   rr  r8   r   r   linkT)target_is_directoryr   r   rX  rY  r   N)r   r   r   rs  r   r   r   r   r   r   r   r
   r   r   r   r   absoluter\  r]  r   r   )
r   rz   r   r   r   rI  r|  r}  r   rt  s
   &&        r2   7test_binding_rejects_intermediate_symlink_in_grant_pathr    s&    +4'HwfDJJEJ"GMMuMgE	[73	KK	F]wDAKKmm))mm\\%%*"11%%%%!F]W4>>@
G  
2:N	O	Ox'2> 
P	O	O	Os   EE0	c                    V ^8  d   QhRRRR/# rp  r0   )r1   s   "r2   r3   r3   $  s     6 66	6r5   c                .   V w  r#rEVR ,          pVP                  R4       \        P                  ! \        RR7      ;_uu_ 4        \	        W$4       RRR4       VR,          pVP                  VP                  RR7      RR7       VP                  R4       VP                  4        VP                  V4       \        P                  ! \        RR7      ;_uu_ 4        \	        W$4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)	r   i  rX  rY  Nzendpoints.jsonr8   r   r   )	r   r\  r]  r   r   r   r  rH  rs  )r   rz   r   rS  r   rI  r   r~   s   &&      r2   >test_endpoint_configuration_refuses_writable_or_symlinked_filer  $  s     ,5(H55IOOE	2:N	O	O"85 
P ((F
i))7);gN
LL 	2:N	O	O"85 
P	O 
P	O 
P	O	Os   C0D0D 	D	c                   V ^8  d   QhRR/# r,   r0   )r1   s   "r2   r3   r3   8  s     6 6	6r5   c                6   V w  rr4VR ,          pVP                  \        P                  ! RRRR///4      RR7       VP                  R4       \        P
                  ! \        RR	7      ;_uu_ 4        \        W4       R
R
R
4       R
#   + '       g   i     R
# ; i)r   r   r   r   zhttp://192.0.2.1:31415r8   r   r   rX  rY  N)r   rA   rB   r   r\  r]  r   r   )r   r   rS  r   rI  r   s   &     r2   :test_endpoint_configuration_refuses_cleartext_non_loopbackr  8  s     ,5(H55I

]X7O,PQR	
 	   OOE	2:N	O	O"85 
P	O	O	Os   1BB	c                    V ^8  d   QhRRRR/# r-  r0   )r1   s   "r2   r3   r3   I  s      )Q )Q.)Q	)Qr5   c                  a V w  r#rE ! R  R4      p\        \        \        P                  ^^RRR7      \        \        P                  RRRRR7      34      oVP                  \        RV3R	 l4       \        V! V4      4      pVP                  q! V4      qP                  p
\        P                  qV8H  q'       Eg   \        P                  ! RV3RW34      R
R\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V	4      R\        P                  ! V
4      RR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      /,          pRRV/,          p\!        \        P"                  ! V4      4      hR;p;p	;p
;rVP                  V4      pVP                  p\        P                  pVV8H  pV'       Eg   \        P                  ! RV3RVV34      R
R\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      RR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      /,          pRRV/,          p\!        \        P"                  ! V4      4      hR;p;ppVP$                  p^qV	8H  pV'       g   \        P                  ! RV3R W34      R
R\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V	4      /,          pRRV/,          p\!        \        P"                  ! V4      4      hR;p;pp	VP&                  p^qV	8H  pV'       g   \        P                  ! RV3R!W34      R
R\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V	4      /,          pRRV/,          p\!        \        P"                  ! V4      4      hR;p;pp	VP(                  pRqV	8H  pV'       g   \        P                  ! RV3R"W34      R
R\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V	4      /,          pRRV/,          p\!        \        P"                  ! V4      4      hR;p;pp	VP*                  pRqV	8H  pV'       g   \        P                  ! RV3R#W34      R
R\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V	4      /,          pRRV/,          p\!        \        P"                  ! V4      4      hR;p;pp	R# )$c                  "    ] tR tRtR R ltRtR# )Ntest_gateway_health_retains_last_verified_snapshot_as_stale.<locals>._RegistryiN  c                    V ^8  d   QhRRRR/# r  r0   )r1   s   "r2   r3   [test_gateway_health_retains_last_verified_snapshot_as_stale.<locals>._Registry.__annotate__O  r  r5   c                	    Wn         R # rm   r  r  s   &&r2   r  Wtest_gateway_health_retains_last_verified_snapshot_as_stale.<locals>._Registry.__init__O  r  r5   r  Nr  r0   r5   r2   r  r  N  r   r5   r        $@r?  )r  r4  r5  rS   r#  N      4@r}  r   c                    < \        S4      # rm   nextrj   r  	snapshotss   *,r2   r  Mtest_gateway_health_retains_last_verified_snapshot_as_stale.<locals>.<lambda>g  	    $y/r5   r   r=  r   r   r   r   r   r   r   r   assert %(py13)sr   staler   r   r   r   r   z3Gateway: unavailable; last verified status is staler   z%(py7)s
{%(py7)s = %(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.fetch
}(%(py3)s)
}.status
} == %(py11)s
{%(py11)s = %(py9)s.OK
}rG  r-  r.  z2%(py2)s
{%(py2)s = %(py0)s.checked_at
} == %(py5)sr0  )iterr   r   r%  rI  rG  r3  r   r  r  r  r  r  r  r  r  r	  r
  r4  r5  rS   r#  )r   r.  r   r   r  rI  r  r=  r   r  r!  r#  r"  r  @py_format14r  r  r  r  r  r  r  r  s   &&                    @r2   ;test_gateway_health_retains_last_verified_snapshot_as_staler  I  s    ,5(Hx! ! #!##$' #++!%#'-	
I$ !1
 %Yx%89G==;=!;((;LOO;O;;;;;(;;;;;;7;;;;7;;;=;;;;;;;;;;;;;!;;;(;;;;;;L;;;;L;;;O;;;;;;;;MM'"E<</<///<//////<///////5////5///<//////<////<////////////!!'R'R'''''!''''''5''''5'''!'''R''''''''##(q(q(((((#((((((5((((5(((#(((q((((((((#t#t###########5####5######t########<<PPPPPPPPP<PPPPPP5PPPP5PPP<PPPPPPPPPPPPr5   c                    V ^8  d   QhRRRR/# r-  r0   )r1   s   "r2   r3   r3   u  s     18 18.18	18r5   c                  a V w  r#rE ! R  R4      p\        \        \        P                  ^^RRR7      \        \        P                  RRRRR7      34      oVP                  \        RV3R	 l4       \        V! V4      4      pVP                  q! V4      qP                  p
\        P                  qV8H  q'       Eg   \        P                  ! RV3R W34      R
R\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V	4      R\        P                  ! V
4      RR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      /,          pRRV/,          p\!        \        P"                  ! V4      4      hR;p;p	;p
;r\%        VP&                  VP(                  VP*                  VP,                  VP.                  VP0                  \3        VP4                  VP6                  RVP8                  VP:                  R7      R7      pVP                  V4      pVP                  p\        P                  pVV8H  pV'       Eg   \        P                  ! RV3R!VV34      R
R\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      RR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      /,          pRRV/,          p\!        \        P"                  ! V4      4      hR;p;ppVP<                  pRqV	J pV'       g   \        P                  ! R"V3R#W34      R
R\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V	4      /,          pRRV/,          p\!        \        P"                  ! V4      4      hR;p;pp	VP>                  pRqV	8H  pV'       g   \        P                  ! RV3R$W34      R
R\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V	4      /,          pRRV/,          p\!        \        P"                  ! V4      4      hR;p;pp	VP@                  pRqV	8H  pV'       g   \        P                  ! RV3R%W34      R
R\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V	4      /,          pRRV/,          p\!        \        P"                  ! V4      4      hR;p;pp	R# )&c                  "    ] tR tRtR R ltRtR# )Ktest_gateway_health_cache_does_not_cross_route_rebinding.<locals>._Registryiz  c                    V ^8  d   QhRRRR/# r  r0   )r1   s   "r2   r3   Xtest_gateway_health_cache_does_not_cross_route_rebinding.<locals>._Registry.__annotate__{  r  r5   c                	    Wn         R # rm   r  r  s   &&r2   r  Ttest_gateway_health_cache_does_not_cross_route_rebinding.<locals>._Registry.__init__{  r  r5   r  Nr  r0   r5   r2   r  r  z  r   r5   r  r  r?  r"  Nr  r}  r   c                    < \        S4      # rm   r  r  s   *,r2   r  Jtest_gateway_health_cache_does_not_cross_route_rebinding.<locals>.<lambda>  r  r5   r   r=  r   r   r   r   r   r   r   r   r  r   zroute-otherr   r   r  r   r   r   r   r   r   r  rG  r  rB  r  r0  )!r  r   r   r%  rI  rG  r3  r   r  r  r  r  r  r  r  r  r	  r
  r   r   r   r   r   r   r   r
   r   r   r   r   r4  rS   r#  )r   r.  r   r   r   rI  r  r=  r   r  r!  r#  r"  r  r  rt  r  r  r  r  r  r  r  r  s   &&                     @r2   8test_gateway_health_cache_does_not_cross_route_rebindingr  u  s    +4'Hw! ! LOORtL\]$$-		
I !1
 %Yx%89G==;=!;((;LOO;O;;;;;(;;;;;;7;;;;7;;;=;;;;;;;;;;;;;!;;;(;;;;;;L;;;;L;;;O;;;;;;;;KKmm))mm\\%%*"11"%%#33
G  --(K5!5!55!555555!5555555;5555;5555555555555555!555555555''/4/4/////'//////;////;///'///4////////!!)T)T)))))!))))));))));)))!)))T))))))))7!77!777777777777;7777;777777!777777777r5   c                    V ^8  d   QhRRRR/# r-  r0   )r1   s   "r2   r3   r3     s      .D .D..D	.Dr5   c                   V w  r#rE ! R  R4      p ! R R4      pVP                  \        RR 4       V! 4       p\        \        P                  V! V4      \        4       VR7      p	\        V	34      P                  V4      p
V
P                  P                  V4      pVP                  p\        P                  qV8H  q'       Eg   \        P                  ! RV3RW34      RR\        P                   ! 4       9   g   \        P"                  ! V4      '       d   \        P$                  ! V4      MRR	\        P$                  ! V4      R
R\        P                   ! 4       9   g!   \        P"                  ! \        4      '       d   \        P$                  ! \        4      MRR\        P$                  ! V4      /,          pRRV/,          p\'        \        P(                  ! V4      4      hR;p;rVP*                  p^pVV8H  q'       g   \        P                  ! RV3RVV34      RR\        P                   ! 4       9   g   \        P"                  ! V4      '       d   \        P$                  ! V4      MRR	\        P$                  ! V4      R\        P$                  ! V4      /,          pRRV/,          p\'        \        P(                  ! V4      4      hR;p;ppVP,                  p^"pVV8H  q'       g   \        P                  ! RV3RVV34      RR\        P                   ! 4       9   g   \        P"                  ! V4      '       d   \        P$                  ! V4      MRR	\        P$                  ! V4      R\        P$                  ! V4      /,          pRRV/,          p\'        \        P(                  ! V4      4      hR;p;ppVP.                  pRpVV8H  q'       g   \        P                  ! RV3RVV34      RR\        P                   ! 4       9   g   \        P"                  ! V4      '       d   \        P$                  ! V4      MRR	\        P$                  ! V4      R\        P$                  ! V4      /,          pRRV/,          p\'        \        P(                  ! V4      4      hR;p;ppVP0                  pRpVV8H  q'       g   \        P                  ! RV3RVV34      RR\        P                   ! 4       9   g   \        P"                  ! V4      '       d   \        P$                  ! V4      MRR	\        P$                  ! V4      R\        P$                  ! V4      /,          pRRV/,          p\'        \        P(                  ! V4      4      hR;p;ppR# )c                  "    ] tR tRtR R ltRtR# )Ttest_dark_binding_preserves_native_health_and_adds_gateway_status.<locals>._Registryi  c                    V ^8  d   QhRRRR/# r  r0   )r1   s   "r2   r3   atest_dark_binding_preserves_native_health_and_adds_gateway_status.<locals>._Registry.__annotate__  r  r5   c                	    Wn         R # rm   r  r  s   &&r2   r  ]test_dark_binding_preserves_native_health_and_adds_gateway_status.<locals>._Registry.__init__  r  r5   r  Nr  r0   r5   r2   r  r    r   r5   r  c                  &    ] tR tRtRR R lltRtR# )Xtest_dark_binding_preserves_native_health_and_adds_gateway_status.<locals>._NativeHealthi  c               $    V ^8  d   QhRRRRRR/# )r-   rS  r   r<  r=  r.   r   r0   )r1   s   "r2   r3   etest_dark_binding_preserves_native_health_and_adds_gateway_status.<locals>._NativeHealth.__annotate__  s!     	 	' 	 	/ 	r5   c                	@    ?\        \        P                  ^^"RRR7      # )   r  zNative: readyr"  r$  )rM   rS  r<  s   &&&r2   r  ^test_dark_binding_preserves_native_health_and_adds_gateway_status.<locals>._NativeHealth.fetch  s%    "& r5   r0   N)r  )rq   rr   rs   rt   r  rx   r0   r5   r2   _NativeHealthr    s    	 	r5   r  r   c                 >    \        \        P                  R R RRR7      # )Nr  r}  r"  )r   r   rI  r  s   *,r2   r  Stest_dark_binding_preserves_native_health_and_adds_gateway_status.<locals>.<lambda>  s    /  )#
r5   )toolregistry	lifecyclehealthr   r*  r   r   r   r   r   r   Nr   r   r   r  z#Native: ready; Gateway: unavailabler   r,  r-  r.  r  r0  )rG  r3  r   r	   CODEXrk   r   for_accountr  r  r  r   r%  r  r  r  r  r  r  r	  r
  r4  r5  rS   r#  )r   r.  r   r   r  rI  r  r  native_healthservicesselectedr*  r   r  r  r  r  r  r  r  s   &&                  r2   Atest_dark_binding_preserves_native_health_and_adds_gateway_statusr    s    ,5(Hx! !	 	 !	

 "OM &&8$(	H "8+.::7CH$$W-H??-loo-o-----?------8----8---?------l----l---o--------$$**$*****$******8****8***$***********&&,",&",,,,,&",,,,,,8,,,,8,,,&,,,",,,,,,,,%#%#%%%%%#%%%%%%8%%%%8%%%%%%#%%%%%%%%??CCC?CCCCCC?CCCCCCC8CCCC8CCC?CCCCCCCCCCCCr5   c                   V ^8  d   QhRR/# r,   r0   )r1   s   "r2   r3   r3     s      	r5   c                   V w  rr4\        \        P                  VP                  VP                  VP
                  VP                  R 7      p\        P                  ! W4      pVP                  qt R2qV8H  q'       g   \        P                  ! RV	3RWx34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          p
RRV
/,          p\!        \        P"                  ! V4      4      hR;p;rVP$                  pR	qV8H  q'       g   \        P                  ! RV	3RWx34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          p
RRV
/,          p\!        \        P"                  ! V4      4      hR;p;rVP&                  pR
qV8  q'       g   \        P                  ! RV	3RWx34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          p
RRV
/,          p\!        \        P"                  ! V4      4      hR;p;rVP(                  qwP*                  p	RqV8H  q'       g   \        P                  ! RV3RW34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V	4      R\        P                  ! V4      /,          pRRV/,          p\!        \        P"                  ! V4      4      hR;p;p	;rVP(                  qwP&                  qP&                  qV8H  q'       Eg+   \        P                  ! RV3RW34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V	4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          pRRV/,          p\!        \        P"                  ! V4      4      hR;p;p	;r\,        P.                  pR.qV8H  q'       g   \        P                  ! RV	3RWx34      RR\        P                  ! 4       9   g!   \        P                  ! \,        4      '       d   \        P                  ! \,        4      MRR\        P                  ! V4      R\        P                  ! V4      /,          p
RRV
/,          p\!        \        P"                  ! V4      4      hR;p;rR# )r   z/r/route-fixture/v1/responsesr   
data_planer   r   r   r   Nr   l    @(%r   r   r   r   r   r   r   r   r)   r   )z5%(py2)s
{%(py2)s = %(py0)s.responses_url
} == %(py5)s)z1%(py2)s
{%(py2)s = %(py0)s.proxy_key
} == %(py5)sr  )z:%(py2)s
{%(py2)s = %(py0)s.grant_expires_at_ms
} > %(py5)s)zS%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.sanitized_status
}.state
} == %(py7)s)z%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.sanitized_status
}.grant_expires_at_ms
} == %(py8)s
{%(py8)s = %(py6)s.grant_expires_at_ms
}r  r  )r
   r   r  r   r   r   r   rH  resolve_authority_data_planeresponses_urlr  r  r  r  r  r  r	  r
  	proxy_keyr  sanitized_statusr   r)   r*   )r   r   rS  r   r   r  r  r   r  r  r  r  r!  r  r)  r  r  r  s   &                 r2   Stest_resolve_authority_data_plane_returns_exact_responses_route_and_verified_expiryr    s    +4'H$$--!!!!//F ">>xPJ##O1N'OO'OOOOOO#OOOOOO:OOOO:OOO#OOO'OOOOOOOOO8#88#888888888888:8888:888888#888888888))=,==,======)======:====:===)===,=========&&7,,7777777,777777:7777:777&777,77777777777&&\::\>\>\\>\\\\\\:\\\\\\:\\\\:\\\&\\\:\\\\\\j\\\\j\\\>\\\\\\\\\"" L'  '    "     >   >   "    '        r5   c                    V ^8  d   QhRRRR/# r-  r0   )r1   s   "r2   r3   r3     s      J J.J	Jr5   c           	     (   V w  r#rEVP                  \        R R 4       \        P                  ! \        RR7      ;_uu_ 4        \        P
                  ! W$4       RRR4       \        \        P                  VP                  VP                  VP                  VP                  RR7      p\        P                  ! \        RR7      ;_uu_ 4        \        P
                  ! W&4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)rD  c                 .    \         P                  ! R 4      # )z#invalid binding read grant material)r\  failr  s   *,r2   r  atest_resolve_authority_data_plane_refuses_dark_or_quiesced_before_reading_grant.<locals>.<lambda>  s    &++.S"Tr5   rX  rY  NT)r   r   r   r   r   quiesced)rG  rH  r\  r]  r   r  r
   r   r  r   r   r   r   )r   r.  r   rS  r   rI  r  s   &&     r2   Otest_resolve_authority_data_plane_refuses_dark_or_quiesced_before_reading_grantr    s     ,5(HT 
2:N	O	O55hH 
P  $$--!!!!//H 
2:N	O	O55hI 
P	O 
P	O 
P	O	Os   C-D -C=	 D	)rP  r5  ))r   rM  )r   ffffffffffff)r!   znot-bounded)r#   z2000-01-01T00:00:00Z)r%   T)r&   r  )
credentialzmust-be-rejected)V
__future__r   builtinsr  _pytest.assertion.rewrite	assertionrewriter  r  concurrent.futuresr   rA   r   sysr   r  http.serverr   r   pathlibr   r\  r>   insertrG   __file__r   parentsrH  r3  account_registryr   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   health_clientr   r   r   r   r   _fingerprintrv   r)   r   r   r+  rJ  rU  r`  rv  r  r  r  r  r  r  r?  rD  rJ  rN  markparametrizerR  rn  rt  ry  r  r  r  r  r  r  r  r  r0   r5   r2   <module>r     s   "    1   
   C   3tH~--/77:; <      8  W)66G.UK1+ 1h ( (V2jDB+x\
%9PA@D6@,#^&1R8v1$/ 7 	0	0:z?"	??@6(6")QX18h.Db0Jr5   