
    (ph                         S r SSKrSSKJr  SSKJr  SSKJr  SSKJr   SSKJr   " S S	\R                  5      r
S
 r " S S\R                  \R                  \R                  5      rg! \	 a    Sr NNf = f)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/
    N)_helpers)credentials)crypt)
exceptions)app_identityc                   l    \ rS rSrSr\S 5       r\R                  " \	R                  5      S 5       rSrg)Signer(   zSigns 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                     g)zOptional[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    I/var/www/html/venv/lib/python3.13/site-packages/google/auth/app_engine.pykey_idSigner.key_id/   s         c                 b    [         R                  " U5      n[        R                  " U5      u  p#U$ N)r   to_bytesr   	sign_blob)r   message_	signatures       r   signSigner.sign9   s*    ##G,#--g6r   r   N)__name__
__module____qualname____firstlineno____doc__propertyr   r   copy_docstringr   r	   r   __static_attributes__r   r   r   r	   r	   (   s>       U\\* +r   r	   c                  f    [         c  [        R                  " S5      e[         R                  " 5       $ )zGets 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                     ^  \ rS rSrSr    SU 4S jjr\R                  " \R                  5      S 5       r
\S 5       r\S 5       r\R                  " \R                  5      SS j5       r\R                  " \R                   5      S 5       r\R                  " \R$                  5      S	 5       r\\R                  " \R$                  5      S
 5       5       r\\R                  " \R$                  5      S 5       5       rSrU =r$ )CredentialsQ   z}App Engine standard environment credentials.

These credentials use the App Engine App Identity API to obtain access
tokens.
c                    > [         c  [        R                  " S5      e[        [        U ]  5         Xl        X l        X0l        [        5       U l
        X@l        g)aj  
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.   Credentials.__init__Z   sJ    4 $$%MNNk4)+-#5 x!1r   c                     U R                   b  U R                   OU R                  n[        R                  " X R                  5      u  p4[
        R
                  R                  U5      nX5sU l        U l        g r   )	r/   r0   r   get_access_tokenr1   datetimeutcfromtimestamptokenexpiry)r   requestr4   r>   ttlr?   s         r   refreshCredentials.refresh~   sX    !%!9t?S?S!226;S;ST
""33C8"'
DKr   c                 h    U R                   c  [        R                  " 5       U l         U R                   $ )zThe service account email.)r1   r   get_service_account_namer   s    r   service_account_email!Credentials.service_account_email   s-     ##+'3'L'L'ND$'''r   c                 T    U R                   (       + =(       a    U R                  (       + $ )zpChecks if the credentials requires scopes.

Returns:
    bool: True if there are no scopes set otherwise False.
)r/   r0   r   s    r   requires_scopesCredentials.requires_scopes   s     <<<(<(<$<<r   c                 N    U R                  UUU R                  U R                  S9$ )N)r4   r5   r6   r7   )r8   r1   r7   )r   r4   r5   s      r   with_scopesCredentials.with_scopes   s0    ~~)#77!22	  
 	
r   c                 L    U R                  U R                  U R                  US9$ )N)r4   r6   r7   )r8   r/   r1   )r   r7   s     r   with_quota_projectCredentials.with_quota_project   s+    ~~<<#77-  
 	
r   c                 8    U R                   R                  U5      $ r   )r2   r   )r   r   s     r   
sign_bytesCredentials.sign_bytes   s    ||  ))r   c                     U R                   $ r   )rF   r   s    r   signer_emailCredentials.signer_email   s     )))r   c                     U R                   $ r   )r2   r   s    r   signerCredentials.signer   s     ||r   )r0   r3   r/   r1   r2   r?   r>   )NNNNr   )r   r   r   r   r    r.   r   r"   r   r*   rB   r!   rF   rI   ScopedrL   CredentialsWithQuotaProjectrO   SigningrR   rU   rX   r#   __classcell__)r8   s   @r   r*   r*   Q   s3    "2H [4450 60 ( ( = = [//0
 1
 [DDE
 F
 [001* 2* [001* 2 * [001 2 r   r*   )r    r<   google.authr   r   r   r   google.appengine.apir   ImportErrorr	   r(   rZ   r\   r[   r*   r   r   r   <module>ra      st       #  "1U\\ 0-"c++[-T-Tc]  Ls   A* *A54A5