
    t i                         S SK r S SKJr  S SKJr  S SKJr  \ R                  " \5      rSS\\\	\
4      S\\   4S jjrS\
S\	4S	 jrS
\S\\
   4S jrg)    N)Optional)Union)
BaseClient
ssl_verifyreturnc                      0 nU b  XS'   [        S0 UD6nUR                  S5      nUR                  5         UR                  5       R                  S5      =(       d    / $ ! [         a     gf = f)z*Fetch organization features from userinfo.Nr   z/api/auth/oauth2/userinfoorganization_features )r   getraise_for_statusjson	Exception)r   kwargsclientresps       8lib/python3.13/site-packages/anaconda_auth/env_logger.pyfetch_org_featuresr   
   so    	!#-< %f%zz56yy{67=2= s   AA 
A,+A,tokenc                 z     [        5       nUR                  SSU 0S9nUR                  S:H  $ ! [         a     gf = f)zCheck if a client token is already mapped to a user.

Uses the read-only client-token-status endpoint.  A 200 response means
the token is already registered; any other outcome is treated as
"not registered".
z%/api/environments/client-token-statusclient_token)params   F)r   r   status_coder   )r   r   r   s      r   check_client_token_statusr      sQ    zz3"E*  
 3&& s   *- 
::org_featuresc                 h    U  Vs/ s H   nSUR                  S/ 5      ;   d  M  US   PM"     sn$ s  snf )zReturn org names that have the env_logger feature enabled.

Returns an empty list for community users since they do not
belong to any organization with the environments feature.
environmentsfeaturesorg)r   )r   r   s     r   get_orgs_with_env_loggerr    *   s>     +*sn
TV@W.W
E
l  s   /	/)N)loggingtypingr   r   anaconda_auth.clientr   	getLogger__name__loggerboolstrlistr   r   r    r
       r   <module>r+      sq       +			8	$8E$),<#= RV S T $4 DI r*   