+
    5mj                    r  a  0 t $ ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RI	H
t
 ^ RIHt ^ RIHt ^ RIHt ]P"                  ! 4       R,          tR	]R
&   Rt ! R R]
4      t]! RR7       ! R R4      4       tR$R R lltR$R R l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t. R%Ot R# )&    )annotationsN)	dataclass)Enum)Path)Callable)ClaudeTokenIdentityz.clauder   LIVE_CLAUDE_HOMEzclaude-account-identity.jsonc                      ] tR t^tRtRtRtR# )CredentialAuthoritya  Every credentials file belongs to the vendor CLI: Anthropic refresh tokens are
one-time-use, and Claude Code sessions rotate account-home files directly via
CLAUDE_CONFIG_DIR, so a second rotator replays a consumed token and the provider
revokes the whole grant.zvendor-managed N)__name__
__module____qualname____firstlineno____doc__VENDOR_MANAGED__static_attributes__r       \/home/user/overdeck-private-tests/workstation-ai-broad/modules/systray/claude_credentials.pyr   r      s     
 &Nr   r   T)frozenc                  B    ] tR t^t$ R]R&   R]R&   ]R R l4       tRtR# )	ResolvedCredentialsr   pathr   	authorityc                   V ^8  d   QhRR/# )   returnboolr   )formats   "r   __annotate__ ResolvedCredentials.__annotate__!   s      4 r   c                	    R # )Tr   )selfs   &r   	read_onlyResolvedCredentials.read_only    s    r   r   N)r   r   r   r   __annotations__propertyr$   r   r   r   r   r   r      s    
J"" r   r   c               (    V ^8  d   QhRRRRRRRR/# )	r   account_homer   	live_homePath | Noneidentify#Callable[[Path], str | None] | Noner   r   r   )r   s   "r   r    r    %   s6     
H 
H
H
H 2
H 	
Hr   c                    V R ,          pVf   \         MTpVR ,          pWS8w  d-   \        WV4      '       d   \        V\        P                  4      # \        V\        P                  4      # ).credentials.json)r	   live_owner_isr   r   r   )r)   r*   r,   ownhomelives   &&&   r   resolve_credentialsr4   %   s`    
 ,
,C(0iD%%D{}\BB"4)<)K)KLLs$7$F$FGGr   c               (    V ^8  d   QhRRRRRRRR/# )	r   r)   r   r*   r+   r,   r-   r   r   r   )r   s   "r   r    r    2   s0     ) ))) 2) 
	)r   c                    Vf   \         MTpVR,          p\        V4      '       g   R# \        V 4      pVf   R# Vf   \        4       P                  MTpWV! V4      8H  # )zPWhether the vendor's live credentials file currently holds this account's grant.r/   F)r	   _has_tokenspinned_account_uuidr   account_uuid_for)r)   r*   r,   r2   r3   account_uuidresolves   &&&    r   r0   r0   2   sb      )0iD%%Dt&|4L8@8H!#44hG74=((r   c                    V ^8  d   QhRRRR/# )r   r   r   r   
str | Noner   )r   s   "r   r    r    C   s      $ : r   c                   \        V 4      pVf   R # VP                  R4      p\        V\        4      '       g   R # \        P
                  ! 4       pR F]  pVP                  V4      pTP                  \        V\        4      '       g   RMVP                  R4      4       VP                  R4       K_  	  VP                  4       # )NclaudeAiOauth    utf-8   )accessTokenrefreshToken)
_read_json_objectget
isinstancedicthashlibsha256updatestrencode	hexdigest)r   payloadoauthdigestkeyvalues   &     r   credentials_fingerprintrT   C   s    %GKK(EeT""^^F.		#Zs%;%;ggAVWg / r   c                    V ^8  d   QhRRRR/# )r   r2   r   r   r=   r   )r   s   "r   r    r    R   s     
 
$ 
: 
r   c                    \        V R ,          4      pVf   R# VP                  R4      p\        V\        4      '       g   R# VP                  R4      p\        V\        4      '       d   V'       d   V# R# )z.claude.jsonNoauthAccountaccountUuid)rE   rF   rG   rH   rL   )r2   rO   rP   r:   s   &   r   account_uuid_ofrY   R   s]    ~ 56GKK'EeT""99]+L,$$r   c                    V ^8  d   QhRRRR/# )r   r)   r   r   r   )r   s   "r   r    r    _   s     7 7D 7T 7r   c                0    V P                   \        ,          # )N)parentIDENTITY_PIN_FILENAME)r)   s   &r   identity_pin_pathr^   _   s    !666r   c                    V ^8  d   QhRRRR/# )r   r)   r   r   r=   r   )r   s   "r   r    r    c   s     T Td Tz Tr   c                    \        \        V 4      4      pVf   R # VP                  R4      p\        V\        4      '       d   V'       d   V# R # )Nr:   )rE   r^   rF   rG   rL   )r)   rO   r:   s   &  r   r8   r8   c   sA     1, ?@G;;~.L%lC88\<StSr   c               $    V ^8  d   QhRRRRRR/# )r   r)   r   r:   rL   r   Noner   )r   s   "r   r    r    k   s!      4 s t r   c                ^   \        V 4      e   R # \        V 4      pR p \        P                  ! VP                  R\
         R2R7      w  rC\        P                  ! VRRR7      ;_uu_ 4       p\        P                  ! RV/V4       VP                  4        \        P                  ! VP                  4       4       R R R 4       \        P                  ! W24       R #   + '       g   i     L(; i  \         d6    Te.    \        P                  ! T4        R #   \         d      R # i ; i R # i ; i)N.)dirprefixwrA   encodingr:   )r8   r^   tempfilemkstempr\   r]   osfdopenjsondumpflushfsyncfilenoreplaceOSErrorunlink)r)   r:   r   tmp_namefdhandles   &&    r   pin_account_uuidry   k   s    <(4\*DH''DKK!DYCZZ[@\]YYr311VII~|4f=LLNHHV]]_% 2 	

8"	 21
  		(#   sI   AC, +AC9C, C)	$C, ,D,<DD% D,$D%%D,+D,c                    V ^8  d   QhRRRR/# )r   r   r   r   r   r   )r   s   "r   r    r       s     N Nd Nt Nr   c                    \        V 4      pVf   R# VP                  R4      p\        V\        4      '       g   R# \	        VP                  R4      4      ;'       d    \	        VP                  R4      4      # )NFr?   rC   rD   )rE   rF   rG   rH   r   )r   rO   rP   s   &  r   r7   r7      s\    %GKK(EeT""		-()MMd599^3L.MMr   c                    V ^8  d   QhRRRR/# )r   r   r   r   zdict[str, object] | Noner   )r   s   "r   r    r       s     : :D :%= :r   c                     \         P                  ! V P                  R R7      4      p\        T\        4      '       d   T# R#   \        \         P                  3 d     R# i ; i)rA   rh   N)rn   loads	read_textrt   JSONDecodeErrorrG   rH   )r   rO   s   & r   rE   rE      sX    **T^^W^=> !$//79T9 T))* s   &A A! A!)NN)r	   r]   r   r   rY   rT   r^   r0   ry   r8   r4   )!__conditional_annotations__
__future__r   rI   rn   rl   rj   dataclassesr   enumr   pathlibr   typingr   claude_identityr   r2   r	   r&   r]   r   r   r4   r0   rT   rY   r^   r8   ry   r7   rE   __all__)r   s   @r   <module>r      s    " "   	  !    /y0 $ 06 &$ & $  
H)"
7T(N:r   