Ë
    ùmxiÐ  ã                   óæ   — d Z ddlmZ ddlmZ ddlmZ ddlmZ 	 ddlmZ  G d„ d	ej                  «      Z	d
„ Z
 G d„ dej                  ej                  ej                  «      Zy# e$ r dZY ŒMw xY w)a  Google App Engine standard environment support.

This module provides authentication and signing for applications running on App
Engine in the standard environment using the `App Identity API`_.


.. _App Identity API:
    https://cloud.google.com/appengine/docs/python/appidentity/
é    )Ú_helpers)Úcredentials)Úcrypt)Ú
exceptions)Úapp_identityNc                   ód   — e Zd ZdZed„ «       Z ej                  ej                  «      d„ «       Z
y)ÚSignerz»Signs messages using the App Engine App Identity service.

    This can be used in place of :class:`google.auth.crypt.Signer` when
    running in the App Engine standard environment.
    c                  ó   — y)zÖOptional[str]: The key ID used to identify this private key.

        .. warning::
           This is always ``None``. The key ID used by App Engine can not
           be reliably determined ahead of time.
        N© ©Úselfs    úM/home/htdocs/ttos/venv/lib/python3.12/site-packages/google/auth/app_engine.pyÚkey_idzSigner.key_id.   s   € ð ó    c                 ó`   — t        j                  |«      }t        j                  |«      \  }}|S ©N)r   Úto_bytesr   Ú	sign_blob)r   ÚmessageÚ_Ú	signatures       r   ÚsignzSigner.sign8   s,   € ä×#Ñ# GÓ,ˆÜ#×-Ñ-¨gÓ6‰ˆˆ9ØÐr   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úpropertyr   r   Úcopy_docstringr   r	   r   r   r   r   r	   r	   '   s@   „ ñð ñó ðð €X×Ñ˜UŸ\™\Ó*ñó +ñr   r	   c                  ó`   — t         €t        j                  d«      ‚t        j                  «       S )zÇGets the project ID for the current App Engine application.

    Returns:
        str: The project ID

    Raises:
        google.auth.exceptions.OSError: If the App Engine APIs are unavailable.
    ú&The App Engine APIs are not available.)r   r   ÚOSErrorÚget_application_idr   r   r   Úget_project_idr#   ?   s+   € ô ÐÜ× Ñ Ð!IÓJÐJÜ×*Ñ*Ó,Ð,r   c                   óú  ‡ — e Zd ZdZ	 	 	 	 dˆ fd„	Z ej                  ej                  «      d„ «       Z	e
d„ «       Ze
d„ «       Z ej                  ej                  «      dd„«       Z ej                  ej                  «      d„ «       Z ej                  ej"                  «      d„ «       Ze
 ej                  ej"                  «      d	„ «       «       Ze
 ej                  ej"                  «      d
„ «       «       Zˆ xZS )ÚCredentialsz‰App Engine standard environment credentials.

    These credentials use the App Engine App Identity API to obtain access
    tokens.
    c                 ó¶   •— t         €t        j                  d«      ‚t        t        | �  «        || _        || _        || _        t        «       | _
        || _        y)aÚ  
        Args:
            scopes (Sequence[str]): Scopes to request from the App Identity
                API.
            default_scopes (Sequence[str]): Default scopes passed by a
                Google client library. Use 'scopes' for user-defined scopes.
            service_account_id (str): The service account ID passed into
                :func:`google.appengine.api.app_identity.get_access_token`.
                If not specified, the default application service account
                ID will be used.
            quota_project_id (Optional[str]): The project ID used for quota
                and billing.

        Raises:
            google.auth.exceptions.OSError: If the App Engine APIs are unavailable.
        Nr    )r   r   r!   Úsuperr%   Ú__init__Ú_scopesÚ_default_scopesÚ_service_account_idr	   Ú_signerÚ_quota_project_id)r   ÚscopesÚdefault_scopesÚservice_account_idÚquota_project_idÚ	__class__s        €r   r(   zCredentials.__init__Y   sR   ø€ ô4 ÐÜ×$Ñ$Ð%MÓNÐNäŒk˜4Ñ)Ô+ØˆŒØ-ˆÔØ#5ˆÔ Ü“xˆŒØ!1ˆÕr   c                 óÚ   — | j                   �| j                   n| j                  }t        j                  || j                  «      \  }}t        j                  |«      }||c| _        | _        y r   )	r)   r*   r   Úget_access_tokenr+   r   ÚutcfromtimestampÚtokenÚexpiry)r   Úrequestr.   r6   Úttlr7   s         r   ÚrefreshzCredentials.refresh}   sX   € à!%§¡Ð!9�—’¸t×?SÑ?Sˆä!×2Ñ2°6¸4×;SÑ;SÓT‰
ˆˆsÜ×*Ñ*¨3Ó/ˆà"'¨ÐˆŒ
�D•Kr   c                 ód   — | j                   €t        j                  «       | _         | j                   S )zThe service account email.)r+   r   Úget_service_account_namer   s    r   Úservice_account_emailz!Credentials.service_account_email†   s-   € ð ×#Ñ#Ð+Ü'3×'LÑ'LÓ'NˆDÔ$Ø×'Ñ'Ð'r   c                 ó:   — | j                    xr | j                   S )zˆChecks if the credentials requires scopes.

        Returns:
            bool: True if there are no scopes set otherwise False.
        )r)   r*   r   s    r   Úrequires_scopeszCredentials.requires_scopes�   s   € ð —<‘<ÐÒ<¨×(<Ñ(<Ð$<Ð<r   c                 óT   — | j                  ||| j                  | j                  ¬«      S )N)r.   r/   r0   r1   )r2   r+   r1   )r   r.   r/   s      r   Úwith_scopeszCredentials.with_scopes–   s0   € à�~‰~ØØ)Ø#×7Ñ7Ø!×2Ñ2ð	 ó 
ð 	
r   c                 óR   — | j                  | j                  | j                  |¬«      S )N)r.   r0   r1   )r2   r)   r+   )r   r1   s     r   Úwith_quota_projectzCredentials.with_quota_projectŸ   s+   € à�~‰~Ø—<‘<Ø#×7Ñ7Ø-ð ó 
ð 	
r   c                 ó8   — | j                   j                  |«      S r   )r,   r   )r   r   s     r   Ú
sign_byteszCredentials.sign_bytes§   s   € à�|‰|× Ñ  Ó)Ð)r   c                 ó   — | j                   S r   )r=   r   s    r   Úsigner_emailzCredentials.signer_email«   s   € ð ×)Ñ)Ð)r   c                 ó   — | j                   S r   )r,   r   s    r   ÚsignerzCredentials.signer°   s   € ð �|‰|Ðr   )NNNNr   )r   r   r   r   r(   r   r   r   r%   r:   r   r=   r?   ÚScopedrA   ÚCredentialsWithQuotaProjectrC   ÚSigningrE   rG   rI   Ú__classcell__)r2   s   @r   r%   r%   P   s?  ø„ ñð ØØØõ"2ðH €X×Ñ˜[×4Ñ4Ó5ñ0ó 6ð0ð ñ(ó ð(ð ñ=ó ð=ð €X×Ñ˜[×/Ñ/Ó0ò
ó 1ð
ð €X×Ñ˜[×DÑDÓEñ
ó Fð
ð €X×Ñ˜[×0Ñ0Ó1ñ*ó 2ð*ð Ø€X×Ñ˜[×0Ñ0Ó1ñ*ó 2ó ð*ð Ø€X×Ñ˜[×0Ñ0Ó1ñó 2ó ôr   r%   )r   Úgoogle.authr   r   r   r   Úgoogle.appengine.apir   ÚImportErrorr	   r#   rJ   rL   rK   r%   r   r   r   ú<module>rQ      sq   ðñõ !Ý #Ý Ý "ðÝ1ôˆU�\‰\ô ò0-ô"cØ×Ñ˜×+Ñ+¨[×-TÑ-Tõcøð] ò Ø‚Lðús   œA& Á&A0Á/A0