+
    3jm'                    R   ^ RI Ht ^ RIHt ^ RIHt ^ RIt^ RIHt ^ RIH	t	 ^ RI
Ht ^ RIHt ^ R	IHt ^ R
IHt ^ RIHt ^ RIHt ]P*                  ! RR7      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      tR R ltR R lt]P=                  RRR7      R R  l4       t]PA                  R!R7      R" R# l4       t!]PA                  R$R7      ]PD                  ! R%R&R'7      ]PF                  ! R%R(R)R*R'7      ]PF                  ! RR+R'7      ]PF                  ! R,R-R.R/R'7      3R0 R1 ll4       t$]PA                  R2R7      ]PF                  ! R,R3R'7      3R4 R5 ll4       t%]PA                  R6R7      ]PF                  ! R%R(R)4      ]PF                  ! R,R7R84      3R9 R: ll4       t&]PA                  R;R7      ]PD                  ! R<R&R'7      ]PF                  ! R%R(R)R*R'7      ]PF                  ! RR+R'7      ]PF                  ! R%R=R>R?R'7      ]PF                  ! R,R@RARBR'7      ]PF                  ! RRCRDR*R'7      3RE RF ll4       t']PA                  RGR7      ]PF                  ! R%R=R>R?R'7      ]PF                  ! R,R@RARBR'7      ]PF                  ! RRCRDR*R'7      3RH RI ll4       t(R# )J    )annotations)datetime)UUIDN)	BaseModel)Confirm)Table)
BaseClient)	RepoToken)	TokenInfo)console)select_from_listtoken)namec                  ,    ] tR t^t$ R]R&   R]R&   RtR# )TokenInfoResponser   idr   
expires_at N__name__
__module____qualname____firstlineno____annotations____static_attributes__r       2lib/python3.14/site-packages/anaconda_auth/repo.pyr   r      s    Hr   r   c                  ,    ] tR t^t$ R]R&   R]R&   RtR# )TokenCreateResponsestrr   r   r   r   Nr   r   r   r   r   r      s    Jr   r   c                  6    ] tR t^t$ R]R&   R]R&   R]R&   RtR# )OrganizationDatar   r   r    r   titler   Nr   r   r   r   r"   r"      s    H
IJr   r"   c                  0    ] tR t^$t$ RtR]R&   R]R&   RtR# )SubscriptionDataNzUUID | Noneorg_idr    product_coder   )r   r   r   r   r&   r   r   r   r   r   r%   r%   $   s    FKr   r%   c                  V    ] tR t^)tR R ltR R ltRR R lltR R ltR	 R
 ltRt	R# )RepoAPIClientc                    V ^8  d   QhRRRR/# )   org_namer    returnzTokenInfoResponse | Noner   )formats   "r   __annotate__RepoAPIClient.__annotate__*   s     4 4S 45M 4r   c                    V P                  RV R24      pVP                  R8X  d   R# VP                  4        \        R/ VP	                  4       B # )zReturn the token information, if it exists.

Args:
    org_name: The name of the organization.

Returns:
    The token information, including its id and expiration date, or
    None if a token doesn't exist.
/api/organizations//ce/current-tokeni  Nr   )getstatus_coderaise_for_statusr   jsonselfr,   responses   && r   _get_repo_token_info"RepoAPIClient._get_repo_token_info*   sR     88!(+<=
 3&!!# 38==?33r   c                    V ^8  d   QhRRRR/# )r+   r,   r    r-   r   r   )r.   s   "r   r/   r0   <   s     6 63 63F 6r   c                f    V P                  RV R2RR/R7      p\        R/ VP                  4       B # )zCreate a new repo token.

Args:
    org_name: The name of the organization.

Returns:
    The token information, including its value and expiration date.
r2   r3   confirmyes)r7   r   )putr   r7   r8   s   && r   _create_repo_token RepoAPIClient._create_repo_token<   sB     88!(+<=U#  
 #5X]]_55r   c               $    V ^8  d   QhRRRRRR/# )r+   r,   r    r@   boolr-   r   )r.   s   "r   r/   r0   K   s!       $ 3 r   c                   V P                  VR7      pVen   V'       gf   \        P                  ! RV R24       \        P                  ! R4       \        P                  ! RRR7      pV'       g   \
        P                  ! 4       hV P                  VR7      p\        P                  ! RVP                   R	24       VP                  # )
z/Issue a new repository token from anaconda.com.r,   z<An existing token already exists for the organization [cyan]z[/cyan].zhReissuing a new token will revoke and deactivate any existing token access. This action can't be undone.zProceed?F)defaultz6Your conda token has been installed and expires [cyan]zL[/cyan]. To view your token(s), you can use [cyan]anaconda token list[/cyan])
r;   r   printr   asktyperAbortrB   r   r   )r9   r,   r@   existing_token_infoshould_continuer:   s   &&&   r   issue_new_tokenRepoAPIClient.issue_new_tokenK   s    "777J*3MMNxjX`a MMz &kk*eDO"kkm#**H*=DXEXEXDY  Zf  g	
 ~~r   c                   V ^8  d   QhRR/# r+   r-   zlist[OrganizationData]r   )r.   s   "r   r/   r0   a   s     ; ;,B ;r   c                    V P                  R4      pVP                  4        VP                  4       pV Uu. uF  p\        R/ VB NK  	  up# u upi )z4Get a list of all organizations the user belongs to.z/api/organizations/myr   )r4   r6   r7   r"   )r9   r:   dataitems   &   r   get_organizations_for_user(RepoAPIClient.get_organizations_for_usera   sI    8834!!#}}59:TT (4(T:::s   Ac                   V ^8  d   QhRR/# rR   r   )r.   s   "r   r/   r0   h   s     	Y 	Y5K 	Yr   c                L   V P                  4       pV P                  P                  R. 4       Uu. uF  p\        R/ VB NK  	  ppV Uu. uF"  pRVP                  9  g   K  VP
                  NK$  	  ppV Uu. uF  qUP                  V9   g   K  VNK  	  up# u upi u upi u upi )zVGet a list of all organizations the user belongs to that have a Business subscription.subscriptionsstarterr   )rV   accountr4   r%   r'   r&   r   )r9   organizationssubrZ   business_subscription_org_idsorgs   &     r   #get_business_organizations_for_user1RepoAPIClient.get_business_organizations_for_userh   s    779/3||/?/?QS/T
/T#s#/T 	 
 #0)
"/39CDTDT3TJCJJ- 	& )
  -X}:W0W}XX
)
 Ys   B	B!B7B!B!r   N)F)
r   r   r   r   r;   rB   rO   rV   ra   r   r   r   r   r)   r)   )   s"    4$6,;	Y 	Yr   r)   c               $    V ^8  d   QhRRRRRR/# )r+   tokenszlist[RepoToken]legacy_tokenszdict[str, str]r-   Noner   )r.   s   "r   r/   r/   t   s$      ,:	r   c                   \        R RR7      pVP                  R4       VP                  R4       VP                  R4       ^ RIHp V  F:  pV VP                   R2pVP                  VP                  WTP                  4       K<  	  VP                  4        F  w  rgVP                  RWg4       K  	  \        P                  ! V4       R# )	zAnaconda Repository Tokensgreen)r#   title_styleOrganizationzChannel URLToken)REPO_URLz/*N)
r   
add_column anaconda_auth._conda.repo_configrl   r,   add_rowr   itemsr   rI   )rd   re   tablerl   
repo_tokenchannel_urlurlr   s   &&      r   _print_repo_token_tableru   t   s     4'JE	^$	]#	W9
!
:#6#6"7r:j));8H8HI  $))+
dC' , MM%r   c                    V ^8  d   QhRRRR/# )r+   clientr)   r-   r    r   )r.   s   "r   r/   r/      s      ] s r   c                   V P                  4       pV'       g,   \        P                  ! R 4       \        P                  ! 4       h\        V4      ^8X  d/   V^ ,          P                  p\        P                  ! RV 24       V# / p. pV F>  pVP                   RVP                   R2pVP                  W6&   VP                  V4       K@  	  \        RVR7      pW7,          # )zNo organizations found.z6Only one organization found, automatically selecting: z ([cyan]z[/cyan])zPlease select an organization:)choices)
ra   r   rI   rK   rL   lenr   r#   appendr   )rw   r]   r,   name_mapry   r`   key	org_titles   &       r   _select_org_namer      s    >>@M/0kkm
=Q #((DXJO	
 HG8CHH:X6s 
 !(I r   T)invoke_without_commandno_args_is_helpc                   V ^8  d   QhRR/# r+   r-   rf   r   )r.   s   "r   r/   r/      s     , ,d ,r   c                     R# )z!Manage your Anaconda repo tokens.Nr   r   r   r   mainr      s    r   listc                   V ^8  d   QhRR/# r   r   )r.   s   "r   r/   r/      s     F FT Fr   c                     ^ RI Hp  V ! 4       p\        P                  ! RR7      pVP                  pV'       g4   V'       g,   \
        P                  ! R4       \        P                  ! 4       h\        W1R7       R# )z%List all installed repository tokens.)
token_listTcreatezFNo repo tokens are installed. Run [cyan]anaconda token install[/cyan].)rd   re   N)
rn   r   r   loadrepo_tokensr   rI   rK   rL   ru   )r   rd   
token_infor   s       r   list_tokensr      sQ     <\Ft,J((KkT	
 kkm;Er   install zBOptionally, provide the token received via email or web interface.)helpz-oz--orgzOrganization name (slug).z)Automatically configure default channels.Fz-yz--yeszAccept all promptsc          
     ,    V ^8  d   QhRRRRRRRRRR/# )	r+   r   r    r,   set_default_channelsrE   r@   r-   rf   r   )r.   s   "r   r/   r/      s<     $& $&$& 	$&
 $& 
$& 
$&r   c                   \        4       pV'       g   \        V4      pV '       g   VP                  WR7      p ^ RIHp  VP                  V RR7       \        P                  ! RR7      pTP                  Y4       TP                  4        RpT'       d   TP                  TR	7       TR
,          p\        P                  ! RT R24       R#   TP                   d   p\        P                  ! T4      hRp?ii ; i)z*Create and install a new repository token.)r,   r@   repo_configF)no_ssl_verifyNTr   z+Your token has been installed and validatedforcez, and conda has been configuredz	Success! .)r)   r   rO   anaconda_auth._condar   validate_tokenCondaTokenErrorrK   rL   r   r   set_repo_tokensaveconfigure_default_channelsr   rI   )	r   r,   r   r@   rw   r   er   msgs	   &&&&     r   install_tokenr      s     _F#F+&&&B0""5"> t,Jh.OO
7C..S.900MMIcU!$% && kk!ns   C C7C22C7configz7Force configuration of default channels without prompt.c                    V ^8  d   QhRRRR/# )r+   r   rE   r-   rf   r   )r.   s   "r   r/   r/      s     8 88 
	8r   c                6    ^ RI Hp VP                  V R7       R# )zKConfigure conda's default channels to access Anaconda's premium repository.r   r   N)r   r   r   )r   r   s   & r   configure_condar      s     1***7r   	uninstallz-az--allc               $    V ^8  d   QhRRRRRR/# )r+   r,   r    allrE   r-   rf   r   )r.   s   "r   r/   r/      s&      	 
r   c                   \         P                  ! 4       pV'       d9   VP                  4        VP                  4        \        P
                  ! R4       R# V '       g,   \        P
                  ! R4       \        P                  ! 4       hVP                  V R7       VP                  4        \        P
                  ! RV  R24       R# )z9Uninstall a repository token for a specific organization.z2Successfully deleted [cyan]all[/cyan] repo tokens.Nz4Must explicitly provide an [cyan]--org[/cyan] optionrG   z3Successfully deleted token for organization: [cyan]z[/cyan])	r   r   delete_all_repo_tokenr   r   rI   rK   rL   delete_repo_token)r,   r   r   s   && r   uninstall_tokenr      s     !J
((*JKLMkkm  ( 3OOMM
=hZwOr   set.z-fz--filez2Write to the system .condarc file at '~/.condarc'.z-ez--envz}Write to the active conda environment .condarc file. If no environment is active, write to the user config file (~/.condarc).z-sz--systemc               4    V ^8  d   QhRRRRRRRRRRRRR	R
/# )r+   r   r    r,   r   rE   fileenvsystemr-   rf   r   )r.   s   "r   r/   r/     sY     J JJ 	J
 J J 
J" #J( 
)Jr   c                b    V'       d   \        WVR7       ^ RIHp VP                  WWER7       R# )zInstall a new repository token.)r   r,   r   r   )r   r   r   r   N)r   r   r   	token_set)r   r,   r   r   r   r   r   s   &&&&&& r   	set_tokenr     s-    . AU	
 1cIr   removec               (    V ^8  d   QhRRRRRRRR/# )r+   r   r    r   rE   r   r-   rf   r   )r.   s   "r   r/   r/   -  s8     @ @
@ 
	@ @ 
@r   c                8    ^ RI Hp VP                  WVR7       R# )z+Remove binstar token and data from Keyring.r   )r   r   r   N)r   r   token_remove)r   r   r   r   s   &&& r   remove_tokenr   ,  s      1$?r   ))
__future__r   r   uuidr   rK   pydanticr   rich.promptr   
rich.tabler   anaconda_auth.clientr	   anaconda_auth.tokenr
   r   anaconda_cli_baser   anaconda_cli_base.consoler   Typerappr   r   r"   r%   r)   ru   r   callbackr   commandr   ArgumentOptionr   r   r   r   r   r   r   r   <module>r      s   "       + ) ) % 6kkw	 
) 
y y 
HYJ HYV*8 T4@, A, &F F$ )
U LLT79TU!&>" UD'8LM$& $&N (,,M8 8 +LLT73UD'2 4 %V LLT79TU!&>" 
D(!U  M	 <<dJ%@#J J> (
D(!U  M	 <<dJ%@@ @r   