Ë
    ùmxi
  ã                   óV   — d Z ddlmZ ddlmZ ddlmZ  G d„ dej
                  «      Zy)zšGoogle API key support.
This module provides authentication using the `API key`_.
.. _API key:
    https://cloud.google.com/docs/authentication/api-keys/
é    )Ú_helpers)Úcredentials)Ú
exceptionsc                   ó”   ‡ — e Zd ZdZˆ fd„Zed„ «       Zed„ «       Z ej                  e
j                  «      d„ «       Zdd„Zd„ Zˆ xZS )	ÚCredentialszeAPI key credentials.
    These credentials use API key to provide authorization to applications.
    c                 óf   •— t         t        | �  «        |st        j                  d«      ‚|| _        y)zš
        Args:
            token (str): API key string
        Raises:
            ValueError: If the provided API key is not a non-empty string.
        z(Token must be a non-empty API key stringN)Úsuperr   Ú__init__r   ÚInvalidValueÚtoken)Úselfr   Ú	__class__s     €úJ/home/htdocs/ttos/venv/lib/python3.12/site-packages/google/auth/api_key.pyr
   zCredentials.__init__   s.   ø€ ô 	Œk˜4Ñ)Ô+ÙÜ×)Ñ)Ð*TÓUÐUØˆ�
ó    c                  ó   — y)NF© ©r   s    r   ÚexpiredzCredentials.expired+   s   € àr   c                  ó   — y)NTr   r   s    r   ÚvalidzCredentials.valid/   s   € àr   c                  ó   — y ©Nr   )r   Úrequests     r   ÚrefreshzCredentials.refresh3   s   € àr   c                 ó*   — |xs | j                   |d<   y)zêApply the API key token to the x-goog-api-key header.
        Args:
            headers (Mapping): The HTTP request headers.
            token (Optional[str]): If specified, overrides the current access
                token.
        zx-goog-api-keyN)r   )r   Úheadersr   s      r   ÚapplyzCredentials.apply7   s   € ð %*Ò$7¨T¯Z©ZˆÐ Ò!r   c                 ó&   — | j                  |«       y)a  Performs credential-specific before request logic.
        Refreshes the credentials if necessary, then calls :meth:`apply` to
        apply the token to the x-goog-api-key header.
        Args:
            request (google.auth.transport.Request): The object used to make
                HTTP requests.
            method (str): The request's HTTP method or the RPC method being
                invoked.
            url (str): The request's URI or the RPC service's URI.
            headers (Mapping): The request's headers.
        N)r   )r   r   ÚmethodÚurlr   s        r   Úbefore_requestzCredentials.before_request@   s   € ð 	�
‰
�7Õr   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r
   Úpropertyr   r   r   Úcopy_docstringr   r   r   r   r!   Ú__classcell__)r   s   @r   r   r      sf   ø„ ñô
ð ñó ðð ñó ðð €X×Ñ˜[×4Ñ4Ó5ñó 6ðó8ör   r   N)r%   Úgoogle.authr   r   r   r   r   r   r   ú<module>r*      s'   ðñõ !Ý #Ý "ô2�+×)Ñ)õ 2r   