
    9-e                         d dl mZ d dlmZ d dlmZ d dlmZ d dlZd dlmZ d dlm	Z	 d dl
mZ d	d
e iZ G d de	          Z G d de	          Z G d de          ZdS )    )cached_property)List)Optional)UnionN)	BaseModel)BaseSettings)__version__z
User-Agentzanaconda-cloud-auth/c                   ~    e Zd ZU  G d d          ZdZeed<   dZee         ed<   e	de
edf         fd            ZdS )		APIConfigc                       e Zd ZdZdZefZdS )APIConfig.ConfigANACONDA_CLOUD_API_.envN)__name__
__module____qualname__
env_prefixenv_filer   keep_untouched     :lib/python3.11/site-packages/anaconda_cloud_auth/config.pyConfigr      s"        *

r   r   zanaconda.clouddomainNkeyreturnc                 l    	 ddl m} n# t          $ r Y d S w xY w	  |            S # t          $ r Y d S w xY w)Nr   )token_string)anaconda_anon_usage.tokensr   ImportError	Exception)selfr   s     r   	aau_tokenzAPIConfig.aau_token   ss    	??????? 	 	 	44		<>>! 	 	 	 44	s   	 
	% 
33)r   r   r   r   r   str__annotations__r   r   r   r   r#   r   r   r   r   r      s         
 
 
 
 
 
 
 
 #FC"""C#5d+    _  r   r   c                       e Zd ZU  G d d          ZdZeed<   dZeed<   dZeed<   d	Z	eed
<   e
dd defd            Ze
dd            ZdS )
AuthConfigc                       e Zd ZdZdZdS )AuthConfig.ConfigANACONDA_CLOUD_AUTH_r   N)r   r   r   r   r   r   r   r   r   r)   +   s        +
r   r   zid.anaconda.cloudr   z$b4ad7f1d-c784-46b5-a9fe-106e50441f5a	client_idzhttp://127.0.0.1:8000/auth/oidcredirect_uriz .well-known/openid-configurationopenid_config_pathr"   r   c                 &    d| j          d| j         S )z4The URL from which to load the OpenID configuration.zhttps:///)r   r-   )r"   s    r   well_known_urlzAuthConfig.well_known_url4   s      B$+AA(?AAAr   OpenIDConfigurationc                     t          j        | j        t                    }|                                 t          di |                                }| j                            d|          S )z?The OIDC configuration, cached as a regular instance attribute.)headers_oidcr   )	requestsgetr0   OIDC_REQUEST_HEADERSraise_for_statusr1   json__dict__
setdefault)r"   resoidc_configs      r   oidczAuthConfig.oidc9   sa     l4.8LMMM)77CHHJJ77}''===r   N)r   r1   )r   r   r   r   r   r$   r%   r+   r,   r-   propertyr0   r>   r   r   r   r'   r'   *   s                 &FC%%%;Is;;;9L#999@@@@B\ Bc B B B XB > > > X> > >r   r'   c                   H    e Zd ZU eed<   eed<   eed<   g Zee         ed<   dS )r1   authorization_endpointtoken_endpointjwks_uri%id_token_signing_alg_values_supportedN)r   r   r   r$   r%   rD   r   r   r   r   r1   r1   B   sH         MMM79)4999999r   r1   )	functoolsr   typingr   r   r   r5   pydanticr   r   anaconda_cloud_authr	   versionr7   r   r'   r1   r   r   r   <module>rJ      s(   % % % % % %                          ! ! ! ! ! ! 6 6 6 6 6 6$&FW&F&FG        6> > > > > > > >0: : : : :) : : : : :r   