§
    •áûfa  ã                   ó‚   — d Z ddlZddlmZ ddlZddlmZ ddlmZ ddlm	Z	 dgZ
dZdZd	Z G d
„ dej        ¦  «        ZdS )zÇTools for using the Google `Cloud Identity and Access Management (IAM)
API`_'s auth-related functionality.

.. _Cloud Identity and Access Management (IAM) API:
    https://cloud.google.com/iam/docs/
é    N)Ú_helpers)Úcrypt)Ú
exceptionsz#https://www.googleapis.com/auth/iamzZhttps://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/{}:generateAccessTokenzOhttps://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/{}:signBlobzVhttps://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/{}:generateIdTokenc                   óp   — e Zd ZdZd„ Zd„ Zed„ ¦   «         Z ej	        e
j        ¦  «        d„ ¦   «         ZdS )ÚSignera  Signs messages using the IAM `signBlob API`_.

    This is useful when you need to sign bytes but do not have access to the
    credential's private key file.

    .. _signBlob API:
        https://cloud.google.com/iam/reference/rest/v1/projects.serviceAccounts
        /signBlob
    c                 ó0   — || _         || _        || _        dS )aÝ  
        Args:
            request (google.auth.transport.Request): The object used to make
                HTTP requests.
            credentials (google.auth.credentials.Credentials): The credentials
                that will be used to authenticate the request to the IAM API.
                The credentials must have of one the following scopes:

                - https://www.googleapis.com/auth/iam
                - https://www.googleapis.com/auth/cloud-platform
            service_account_email (str): The service account email identifying
                which service account to use to sign bytes. Often, this can
                be the same as the service account email in the given
                credentials.
        N)Ú_requestÚ_credentialsÚ_service_account_email)ÚselfÚrequestÚcredentialsÚservice_account_emails       úI/var/www/html/Alfredo/env/lib/python3.11/site-packages/google/auth/iam.pyÚ__init__zSigner.__init__<   s!   € ð   ˆŒØ'ˆÔØ&;ˆÔ#Ð#Ð#ó    c                 ó`  — t          j        |¦  «        }d}t                               | j        ¦  «        }ddi}t          j        dt          j        |¦  «         	                    d¦  «        i¦  «         
                    d¦  «        }| j                             | j        |||¦  «         |                      ||||¬¦  «        }|j        t          j        k    r,t#          j        d                     |j        ¦  «        ¦  «        ‚t          j        |j         	                    d¦  «        ¦  «        S )z(Makes a request to the API signBlob API.ÚPOSTzContent-Typezapplication/jsonÚpayloadzutf-8)ÚurlÚmethodÚbodyÚheadersz&Error calling the IAM signBlob API: {})r   Úto_bytesÚ_IAM_SIGN_ENDPOINTÚformatr   ÚjsonÚdumpsÚbase64Ú	b64encodeÚdecodeÚencoder
   Úbefore_requestr	   ÚstatusÚhttp_clientÚOKr   ÚTransportErrorÚdataÚloads)r   Úmessager   r   r   r   Úresponses          r   Ú_make_signing_requestzSigner._make_signing_requestP   s  € åÔ# GÑ,Ô,ˆàˆÝ ×'Ò'¨Ô(CÑDÔDˆØ!Ð#5Ð6ˆÝŒzØÔ(¨Ñ1Ô1×8Ò8¸ÑAÔAÐBñ
ô 
ç
Š&‰/Œ/ð 	ð 	Ô×(Ò(¨¬¸ÀÀWÑMÔMÐMØ—=’= S°¸dÈG=ÑTÔTˆàŒ?kœnÒ,Ð,ÝÔ+Ø8×?Ò?ÀÄÑNÔNñô ð õ Œz˜(œ-×.Ò.¨wÑ7Ô7Ñ8Ô8Ð8r   c                 ó   — dS )zÏOptional[str]: The key ID used to identify this private key.

        .. warning::
           This is always ``None``. The key ID used by IAM can not
           be reliably determined ahead of time.
        N© )r   s    r   Úkey_idzSigner.key_ide   s	   € ð ˆtr   c                 ó`   — |                       |¦  «        }t          j        |d         ¦  «        S )NÚ
signedBlob)r,   r   Ú	b64decode)r   r*   r+   s      r   ÚsignzSigner.signo   s+   € à×-Ò-¨gÑ6Ô6ˆÝÔ ¨Ô 6Ñ7Ô7Ð7r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r,   Úpropertyr/   r   Úcopy_docstringr   r   r3   r.   r   r   r   r   1   s‚   € € € € € ðð ð<ð <ð <ð(9ð 9ð 9ð* ðð ñ „Xðð €XÔ˜Uœ\Ñ*Ô*ð8ð 8ñ +Ô*ð8ð 8ð 8r   r   )r7   r   Úhttp.clientÚclientr%   r   Úgoogle.authr   r   r   Ú
_IAM_SCOPEÚ_IAM_ENDPOINTr   Ú_IAM_IDTOKEN_ENDPOINTr   r.   r   r   ú<module>r@      sÓ   ððð ð €€€Ø !Ð !Ð !Ð !Ð !Ð !Ø €€€à  Ð  Ð  Ð  Ð  Ð  Ø Ð Ð Ð Ð Ð Ø "Ð "Ð "Ð "Ð "Ð "ð 4Ð4€
ð0ð ð%ð ð6ð ðA8ð A8ð A8ð A8ð A8ˆUŒ\ñ A8ô A8ð A8ð A8ð A8r   