
    g
                     H    d Z ddlZddlmZ  G d dej                        Zy)zInterface for base credentials.    N)_helpersc                   B    e Zd ZdZd Zej                  d        ZddZy)_BaseCredentialsa  Base class for all credentials.

    All credentials have a :attr:`token` that is used for authentication and
    may also optionally set an :attr:`expiry` to indicate when the token will
    no longer be valid.

    Most credentials will be :attr:`invalid` until :meth:`refresh` is called.
    Credentials can do this automatically before the first HTTP request in
    :meth:`before_request`.

    Although the token and expiration will change as the credentials are
    :meth:`refreshed <refresh>` and used, credentials should be considered
    immutable. Various credentials will accept configuration such as private
    keys, scopes, and other options. These options are not changeable after
    construction. Some classes will provide mechanisms to copy the credentials
    with modifications such as :meth:`ScopedCredentials.with_scopes`.

    Attributes:
        token (Optional[str]): The bearer token that can be used in HTTP headers to make
            authenticated requests.
    c                     d | _         y N)token)selfs    z/var/www/html/FastMealFinder_FlaskServer-InitialRelease/venv/lib/python3.12/site-packages/google/auth/_credentials_base.py__init__z_BaseCredentials.__init__.   s	    
    c                     t        d      )a  Refreshes the access token.

        Args:
            request (google.auth.transport.Request): The object used to make
                HTTP requests.

        Raises:
            google.auth.exceptions.RefreshError: If the credentials could
                not be refreshed.
        zRefresh must be implemented)NotImplementedError)r	   requests     r
   refreshz_BaseCredentials.refresh1   s     ""?@@r   Nc                 n    dj                  t        j                  |xs | j                              |d<   y)zApply the token to the authentication header.

        Args:
            headers (Mapping): The HTTP request headers.
            token (Optional[str]): If specified, overrides the current access
                token.
        z	Bearer {}authorizationN)formatr   
from_bytesr   )r	   headersr   s      r
   _applyz_BaseCredentials._applyA   s0     $/#5#5 34$
 r   r   )	__name__
__module____qualname____doc__r   abcabstractmethodr   r    r   r
   r   r      s-    , 	A A

r   r   )	metaclass)r   r   google.authr   ABCMetar   r   r   r
   <module>r!      s      & 
  4
 4
r   