Ë
    ûmxih  ã                   óÈ   — d Z ddlZ	 ddlZddlZdZ	 ddlZ	 ddlZddl	ZdZ
dd„Zdd„Zd„ Zd„ Zd	„ Zd
„ Zd„ Zd„ Zy# e$ r dZY Œ4w xY w# e$ r dZY Œ<w xY w# e$ r dZ
Y Œ>w xY w)z=Helpers for authentication using oauth2client or google-auth.é    NTFc                 ór   — t         r't        j                  j                  | ||¬«      \  }}|S t	        d«      ‚)z'Returns credentials loaded from a file.©ÚscopesÚquota_project_idzAclient_options.credentials_file is only supported in google-auth.)ÚHAS_GOOGLE_AUTHÚgoogleÚauthÚload_credentials_from_fileÚEnvironmentError)Úfilenamer   r   ÚcredentialsÚ_s        úL/home/htdocs/ttos/venv/lib/python3.12/site-packages/googleapiclient/_auth.pyÚcredentials_from_filer   )   sC   € åÜŸ™×?Ñ?Ø˜VÐ6Fð @ó 
‰ˆ�Qð ÐäØOó
ð 	
ó    c                 óê   — t         r&t        j                  j                  | |¬«      \  }}|S t        r7| €|�t        d«      ‚t        j                  j                  j                  «       S t        d«      ‚)z(Returns Application Default Credentials.r   zwclient_options.scopes and client_options.quota_project_id are not supported in oauth2client.Please install google-auth.zZNo authentication library is available. Please install either google-auth or oauth2client.)
r   r   r	   ÚdefaultÚHAS_OAUTH2CLIENTr   Úoauth2clientÚclientÚGoogleCredentialsÚget_application_default)r   r   r   r   s       r   Údefault_credentialsr   6   s€   € åÜŸ™×,Ñ,ØÐ,<ð -ó 
‰ˆ�Qð ÐÝ	ØÐÐ!1Ð!=Ü"ð.óð ô ×"Ñ"×4Ñ4×LÑLÓNÐNäð+ó
ð 	
r   c                 ó(  — t         rXt        | t        j                  j                  j
                  «      r*t        j                  j                  j                  | |«      S 	 | j                  «       r| j                  |«      S | S # t        $ r | cY S w xY w)a…  Scopes the credentials if necessary.

    Args:
        credentials (Union[
            google.auth.credentials.Credentials,
            oauth2client.client.Credentials]): The credentials to scope.
        scopes (Sequence[str]): The list of scopes.

    Returns:
        Union[google.auth.credentials.Credentials,
            oauth2client.client.Credentials]: The scoped credentials.
    )
r   Ú
isinstancer   r	   r   ÚCredentialsÚwith_scopes_if_requiredÚcreate_scoped_requiredÚcreate_scopedÚAttributeError)r   r   s     r   Úwith_scopesr!   K   sz   € õ œ: k´6·;±;×3JÑ3J×3VÑ3VÔWÜ�{‰{×&Ñ&×>Ñ>¸{ÈFÓSÐSð	Ø×1Ñ1Ô3Ø"×0Ñ0°Ó8Ð8à"Ð"øÜò 	ØÒð	ús   Á  B ÂB ÂBÂBc                 óü   — ddl m} t        r[t        | t        j
                  j                  j                  «      r-t        €t        d«      ‚t        j                  |  |«       ¬«      S | j                   |«       «      S )aa  Returns an http client that is authorized with the given credentials.

    Args:
        credentials (Union[
            google.auth.credentials.Credentials,
            oauth2client.client.Credentials]): The credentials to use.

    Returns:
        Union[httplib2.Http, google_auth_httplib2.AuthorizedHttp]: An
            authorized http client.
    r   )Ú
build_httpz¶Credentials from google.auth specified, but google-api-python-client is unable to use these credentials unless google-auth-httplib2 is installed. Please install google-auth-httplib2.©Úhttp)Úgoogleapiclient.httpr#   r   r   r   r	   r   r   Úgoogle_auth_httplib2Ú
ValueErrorÚAuthorizedHttpÚ	authorize)r   r#   s     r   Úauthorized_httpr+   d   se   € õ 0åœ: k´6·;±;×3JÑ3J×3VÑ3VÔWÜÐ'Üð(óð ô $×2Ñ2°;ÁZÃ\ÔRÐRà×$Ñ$¡Z£\Ó2Ð2r   c                 ó   — t        j                  «       }t        rTt        | t        j
                  j                  j                  «      r&t        j                  |«      }| j                  |«      S | j                  |«      S ©N)Úhttplib2ÚHttpr   r   r   r	   r   r   r'   ÚRequestÚrefresh)r   Úrefresh_httpÚrequests      r   Úrefresh_credentialsr4      s]   € ô
 —=‘=“?€LÝœ: k´6·;±;×3JÑ3J×3VÑ3VÔWÜ&×.Ñ.¨|Ó<ˆØ×"Ñ" 7Ó+Ð+à×"Ñ" <Ó0Ð0r   c                 óP   — t        | «      st        | «       | j                  |«      S r-   )Úis_validr4   Úapply)r   Úheaderss     r   Úapply_credentialsr9   Œ   s#   € ä�KÔ Ü˜KÔ(Ø×Ñ˜WÓ%Ð%r   c                 ó¼   — t         r:t        | t        j                  j                  j
                  «      r| j                  S | j                  d uxr | j                   S r-   )	r   r   r   r	   r   r   ÚvalidÚaccess_tokenÚaccess_token_expired)r   s    r   r6   r6   “   sP   € Ýœ: k´6·;±;×3JÑ3J×3VÑ3VÔWØ× Ñ Ð ð ×$Ñ$¨DÐ0ò 5Ø×4Ñ4Ð4ð	
r   c                 óÚ   — | €y t        | j                  d«      r| j                  j                  S t        | d«      r0t        | j                  t        j
                  «      s| j                  S y )Nr   )Úhasattrr3   r   r   r.   r   r$   s    r   Úget_credentials_from_httpr@   �   s[   € Ø€|ØÜ	�—‘˜}Ô	-Ø�|‰|×'Ñ'Ð'Ü	��}Ô	%¬jØ×Ñœ(×.Ñ.ô/ð ×ÑÐàr   )NN)Ú__doc__r.   Úgoogle.authr   Úgoogle.auth.credentialsr   ÚImportErrorr'   r   Úoauth2client.clientr   r   r   r!   r+   r4   r9   r6   r@   © r   r   ú<module>rG      s¢   ðñ Dã ðÛÛ"à€Oð ÛðÛÛàÐó


ó
ò*ò23ò6
1ò&ò
ó
øðK ò Ø‚Oðûð
 ò  ØÒð ûð ò ØÒðús1   ˆ
= “A
 ˜
A ½AÁAÁ
AÁAÁA!Á A!