§
    8?Äjª¬  ã                   ó¼  — d dl Z d dlZd dlZd dlmZ d dlZd dlZd dl	Z	d dl
Zd dlZd dlmZ d dlmZmZmZmZ d dlZd dlZd dlmZmZmZ d dlmZ d dlmZ d dlm Z  d dl!m"Z" erd dl#Z#d d	l#m$Z$ n	 d dl#Z#d d	l#m$Z$ n# e%e&f$ r dZ$Y nw xY w ej'        e(¦  «        Z)g d
¢Z*	 d dl+m,Z- dZ.n# e%$ r dZ.Y nw xY wed„ ¦   «         Z/ G d„ de¦  «        Z0 G d„ d¦  «        Z1dS )é    N)Úasynccontextmanager)ÚTYPE_CHECKINGÚMappingÚOptionalÚUnion)Ú_exponential_backoffÚ_helpersÚ
exceptions)Ú	transport)ÚCredentials)Úmtls)ÚTimeoutError)ÚClientTimeout)zmtls.googleapis.comzmtls.sandbox.googleapis.comzp.googleapis.com)ÚRequestTFc                ó�   ‡‡‡K  — t          j        ¦   «         Š| Šˆˆfd„Šˆˆfd„}	 |W V —  ‰¦   «          dS #  ‰¦   «          w xY w)a·  
    timeout_guard is an asynchronous context manager to apply a timeout to an asynchronous block of code.

    Args:
        timeout (float): The time in seconds before the context manager times out.

    Raises:
        google.auth.exceptions.TimeoutError: If the code within the context exceeds the provided timeout.

    Usage:
        async with timeout_guard(10) as with_timeout:
            await with_timeout(async_function())
    c                  óx   •— ‰€d S t          j        ¦   «         ‰z
  } ‰| z
  }|dk    rt          d‰› d�¦  «        ‚|S )Nr   z3Context manager exceeded the configured timeout of ús.)ÚtimeÚ	monotonicr   )ÚelapsedÚ	remainingÚstartÚtotal_timeouts     €€úSC:\Projects\Historical\venv\Lib\site-packages\google/auth/aio/transport/sessions.pyÚ_remaining_timez&timeout_guard.<locals>._remaining_timeP   s[   ø€ ØÐ Ø�4Ý”.Ñ"Ô" UÑ*ˆØ! GÑ+ˆ	Ø˜Š>ˆ>ÝØWÀmÐWÐWÐWñô ð ð Ðó    c              “   óÂ   •K  — 	  ‰¦   «         }t          j        | |¦  «        ƒ d {V —†}|S # t           j        t          f$ r}t          d| › d‰› d�¦  «        |‚d }~ww xY w)NzThe operation z$ exceeded the configured timeout of r   )ÚasyncioÚwait_forr   )Úcoror   ÚresponseÚer   r   s       €€r   Úwith_timeoutz#timeout_guard.<locals>.with_timeout[   s”   øè è € ð	Ø'˜Ñ)Ô)ˆIÝ$Ô-¨d°IÑ>Ô>Ð>Ð>Ð>Ð>Ð>Ð>ˆHØˆOøÝÔ$¥lÐ3ð 	ð 	ð 	ÝØ\ Ð\Ð\È=Ð\Ð\Ð\ñô àðøøøøð	øøøs   …&, ¬AÁAÁAN)r   r   )Útimeoutr#   r   r   r   s     @@@r   Útimeout_guardr%   >   s—   øøøè è € õ ŒNÑÔ€EØ€Mð	ð 	ð 	ð 	ð 	ð 	ðð ð ð ð ð ðØÐÐÐÐð 	ˆÑÔÐÐÐøˆˆÑÔÐÐøøøs	   ¨9 ¹Ac                   óâ  — e Zd ZdZdej        j        j        fd„Ze	d„ ¦   «         Z
d„ Ze	d„ ¦   «         Ze	d„ ¦   «         Ze	 ej        ej        j        j        ¦  «        d„ ¦   «         ¦   «         Ze	 ej        ej        j        j        ¦  «        d	„ ¦   «         ¦   «         Zd
„ Z ej        e¦  «        dd„¦   «         Z ej        e¦  «        d„ ¦   «         Z ej        e¦  «        d„ ¦   «         ZdS )Ú_SyncCredentialsAdapterag  Adapts synchronous credentials to the asynchronous credentials interface.

    :class:`AsyncAuthorizedSession` wraps :class:`google.auth.credentials.Credentials`
    (e.g. application default credentials) with this adapter so that they can be
    used with an asynchronous transport. Calls are delegated to the wrapped
    credentials using a synchronous transport, and blocking calls such as
    refreshing the access token run in a worker thread so that the event loop
    is not blocked.

    Args:
        credentials (google.auth.credentials.Credentials): The synchronous
            credentials to adapt.
    Úcredentialsc                 ó0   — || _         d | _        d | _        d S ©N)Ú_credentialsÚ_sync_request_instanceÚ_pending_refresh)Úselfr(   s     r   Ú__init__z _SyncCredentialsAdapter.__init__{   s&   € Ø'ˆÔð '+ˆÔ#ð AEˆÔÐÐr   c                 ó\   — | j         €ddlm} |                     ¦   «         | _         | j         S )Nr   )Úrequests)r,   Úgoogle.auth.transportr1   r   )r.   Úsync_requestss     r   Ú_sync_requestz%_SyncCredentialsAdapter._sync_request…   s=   € àÔ&Ð.ð HÐGÐGÐGÐGÐGà*7×*?Ò*?Ñ*AÔ*AˆDÔ'ØÔ*Ð*r   c                 óž   — | j         �At          | j         d¦  «        r.| j         j        �$| j         j                             ¦   «          d S d S d S d S )NÚsession)r,   Úhasattrr6   Úclose©r.   s    r   r8   z_SyncCredentialsAdapter.close�   s^   € àÔ'Ð3Ý˜Ô3°YÑ?Ô?ð 4àÔ+Ô3Ð?àÔ'Ô/×5Ò5Ñ7Ô7Ð7Ð7Ð7ð	 4Ð3Ð3Ð3à?Ð?r   c                 ó   — | j         j        S )zhOptional[str]: The bearer token that can be used in HTTP headers to make
        authenticated requests.)r+   Útokenr9   s    r   r;   z_SyncCredentialsAdapter.token—   s   € ð Ô Ô&Ð&r   c                 ó   — | j         j        S )z�Optional[datetime]: When the token expires and is no longer valid.
        If this is None, the token is assumed to never expire.)r+   Úexpiryr9   s    r   r=   z_SyncCredentialsAdapter.expiry�   s   € ð Ô Ô'Ð'r   c                 ó   — | j         j        S r*   )r+   Úvalidr9   s    r   r?   z_SyncCredentialsAdapter.valid£   s   € ð Ô Ô&Ð&r   c                 ó   — | j         j        S r*   )r+   Úexpiredr9   s    r   rA   z_SyncCredentialsAdapter.expired¨   s   € ð Ô Ô(Ð(r   c              ƒ   óþ   K  — | j         �| j                              ¦   «         r;t          j        t          j        | j        j        | j        ¦  «        ¦  «        | _         t          j        | j         ¦  «        ƒ d{V —† dS )a^  Refreshes the wrapped credentials, joining a refresh already in flight.

        The refresh is shielded from cancellation: a caller that is cancelled
        while waiting (e.g. because of a timeout) stops waiting, but the refresh
        completes so that the next caller joins it rather than starting a
        second, concurrent refresh.
        N)	r-   Údoner   Úcreate_taskÚ	to_threadr+   Úrefreshr4   Úshieldr9   s    r   Ú_refresh_sharedz'_SyncCredentialsAdapter._refresh_shared­   s€   è è € ð Ô Ð(¨DÔ,A×,FÒ,FÑ,HÔ,HÐ(Ý$+Ô$7ÝÔ! $Ô"3Ô";¸TÔ=OÑPÔPñ%ô %ˆDÔ!õ Œn˜TÔ2Ñ3Ô3Ð3Ð3Ð3Ð3Ð3Ð3Ð3Ð3Ð3r   Nc              ƒ   óB   K  — | j                              ||¬¦  «         d S )N)r;   )r+   Úapply)r.   Úheadersr;   s      r   rJ   z_SyncCredentialsAdapter.apply»   s(   è è € àÔ×Ò ¨uÐÑ5Ô5Ð5Ð5Ð5r   c              ƒ   ó>   K  — |                       ¦   «         ƒ d {V —† d S r*   )rH   )r.   Úrequests     r   rF   z_SyncCredentialsAdapter.refresh¿   s0   è è € à×"Ò"Ñ$Ô$Ð$Ð$Ð$Ð$Ð$Ð$Ð$Ð$Ð$r   c              ƒ   ó°   K  — | j         j        s|                      ¦   «         ƒ d {V —† t          j        | j         j        | j        |||¦  «        ƒ d {V —† d S r*   )r+   r?   rH   r   rE   Úbefore_requestr4   )r.   rM   ÚmethodÚurlrK   s        r   rO   z&_SyncCredentialsAdapter.before_requestÃ   s�   è è € àÔ Ô&ð 	)Ø×&Ò&Ñ(Ô(Ð(Ð(Ð(Ð(Ð(Ð(Ð(ÝÔØÔÔ,ØÔØØØñ
ô 
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
r   r*   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚgoogleÚauthr(   r   r/   Úpropertyr4   r8   r;   r=   r	   Úcopy_docstringr?   rA   rH   rJ   rF   rO   © r   r   r'   r'   l   s­  € € € € € ðð ðE F¤KÔ$;Ô$Gð Eð Eð Eð Eð ð+ð +ñ „Xð+ð8ð 8ð 8ð ð'ð 'ñ „Xð'ð
 ð(ð (ñ „Xð(ð
 Ø€XÔ˜Vœ[Ô4Ô@ÑAÔAð'ð 'ñ BÔAñ „Xð'ð Ø€XÔ˜Vœ[Ô4Ô@ÑAÔAð)ð )ñ BÔAñ „Xð)ð4ð 4ð 4ð €XÔ˜[Ñ)Ô)ð6ð 6ð 6ñ *Ô)ð6ð €XÔ˜[Ñ)Ô)ð%ð %ñ *Ô)ð%ð €XÔ˜[Ñ)Ô)ð	
ð 	
ñ *Ô)ð	
ð 	
ð 	
r   r'   c                   ó  — e Zd ZdZ	 ddeeej        j        j        f         de	e
j                 fd„Zdd„Zdde
j        e
j        e
j        fdeded	e	e         d
e	eeef                  dedeeef         de	e         de
j        fd„Z ej        e¦  «        dde
j        e
j        e
j        fded	e	e         d
e	eeef                  dedeeef         de	e         de
j        fd„¦   «         Z ej        e¦  «        dde
j        e
j        e
j        fded	e	e         d
e	eeef                  dedeeef         de	e         de
j        fd„¦   «         Z ej        e¦  «        dde
j        e
j        e
j        fded	e	e         d
e	eeef                  dedeeef         de	e         de
j        fd„¦   «         Z ej        e¦  «        dde
j        e
j        e
j        fded	e	e         d
e	eeef                  dedeeef         de	e         de
j        fd„¦   «         Z ej        e¦  «        dde
j        e
j        e
j        fded	e	e         d
e	eeef                  dedeeef         de	e         de
j        fd„¦   «         Zed„ ¦   «         Z dd„Z!dS )ÚAsyncAuthorizedSessionak  This is an asynchronous implementation of :class:`google.auth.requests.AuthorizedSession` class.
    We utilize an instance of a class that implements :class:`google.auth.aio.transport.Request` configured
    by the caller or otherwise default to `google.auth.aio.transport.aiohttp.Request` if the external aiohttp
    package is installed.

    A Requests Session class with credentials.

    This class is used to perform asynchronous requests to API endpoints that require
    authorization::

        import aiohttp
        from google.auth.aio.transport import sessions

        async with sessions.AsyncAuthorizedSession(credentials) as authed_session:
            response = await authed_session.request(
                'GET', 'https://www.googleapis.com/storage/v1/b')

    The underlying :meth:`request` implementation handles adding the
    credentials' headers to the request and refreshing credentials as needed.

    Args:
        credentials (Union[google.auth.aio.credentials.Credentials, google.auth.credentials.Credentials]):
            The credentials to add to the request. Synchronous credentials
            (e.g. application default credentials) are also supported.
        auth_request (Optional[google.auth.aio.transport.Request]):
            An instance of a class that implements
            :class:`~google.auth.aio.transport.Request` used to make requests
            and refresh credentials. If not passed,
            an instance of :class:`~google.auth.aio.transport.aiohttp.Request`
            is created.

    Raises:
        - google.auth.exceptions.TransportError: If `auth_request` is `None`
            and the external package `aiohttp` is not installed.
        - google.auth.exceptions.InvalidType: If the provided credentials are
            not of type `google.auth.aio.credentials.Credentials` or
            `google.auth.credentials.Credentials`.
    Nr(   Úauth_requestc                 óè  — t          |t          j        j        j        ¦  «        rt          |¦  «        }n:t          |t          ¦  «        s%t          j        dt          |¦  «        › d�¦  «        ‚|| _	        |}|st          rt          ¦   «         }d| _        d | _        d | _        d | _        g | _        |€t          j        d¦  «        ‚|| _        d | _        d| _        d| _        d | _        d| _        d S )Nz#The configured credentials of type zs are invalid and must be of type `google.auth.aio.credentials.Credentials` or `google.auth.credentials.Credentials`Fzv`auth_request` must either be configured or the external package `aiohttp` must be installed to use the default value.r   )Ú
isinstancerV   rW   r(   r   r'   r
   ÚInvalidTypeÚtyper+   ÚAIOHTTP_INSTALLEDÚAiohttpRequestÚ_is_mtlsÚ_mtls_init_taskÚ_cached_certÚ_client_cert_callbackÚ_old_auth_requestsÚTransportErrorÚ_auth_requestÚ_mtls_rotation_lockÚ_mtls_check_counterÚ_mtls_reconfig_counterÚ_refresh_lockÚ_refresh_counter)r.   r(   r]   rj   s       r   r/   zAsyncAuthorizedSession.__init__ø   s   € õ
 �k¥6¤;Ô#:Ô#FÑGÔGð 	Ý1°+Ñ>Ô>ˆKˆKÝ˜K­Ñ5Ô5ð 	ÝÔ(ð }µd¸;Ñ6GÔ6Gð  }ð  }ð  }ñô ð ð *5ˆÔØ$ˆØð 	-Õ!2ð 	-Ý*Ñ,Ô,ˆMØˆŒØ#ˆÔØ ˆÔØ%)ˆÔ"Ø;=ˆÔØÐ ÝÔ+ð Iñô ð ð +ˆÔØ;?ˆÔ Ø#$ˆÔ Ø&'ˆÔ#Ø59ˆÔØ !ˆÔÐÐr   c              ƒ   ó¼   ‡ ‡K  — ‰ j         €.‰‰ _        ˆˆ fd„}t          j         |¦   «         ¦  «        ‰ _         	 ‰ j         ƒ d{V —†S # t          $ r	 d‰ _         ‚ w xY w)a’  Configure the client certificate and key for SSL connection.

        This method configures mTLS if client certificates are explicitly enabled
        (via GOOGLE_API_USE_CLIENT_CERTIFICATE=true) or auto-enabled (when the env
        variable is unset and workload certificates are discovered). In these cases,
        the underlying transport will be reconfigured to use mTLS.

        Note: This function does nothing if the `aiohttp` library is not
        installed.
        Important: Calling this method will close any ongoing API requests associated
        with the current session. To ensure a smooth transition, it is recommended
        to call this during session initialization.

        Args:
            client_cert_callback (Optional[Callable[[], (bytes, bytes)]]):
                The optional callback returns the client certificate and private
                key bytes both in PEM format.
                If the callback is None, application default SSL credentials
                will be used.

        Raises:
            google.auth.exceptions.MutualTLSChannelError: If mutual TLS channel
                creation failed for any reason.
        Nc               “   ó   •K  — t          j        t          j        j        j        j        ¦  «        ƒ d {V —†} | sd S 	 t          j        ‰¦  «        ƒ d {V —†\  }}}|�rot          �rKt          ‰j
        t          ¦  «        �r0t          j        t           j        ||¦  «        ƒ d {V —†}t          j        |¬¦  «        }t          j        |¬¦  «        }‰j
        }t          |¬¦  «        ‰_
        ‰j                             |¦  «         t%          ‰j        ¦  «        dk    r‘‰j        d         }	 t'          |d¦  «        r0|                     ¦   «         }	t+          j        |	¦  «        r|	ƒ d {V —† n# t.          $ r Y nw xY w‰j                             d¦  «         t%          ‰j        ¦  «        dk    °‘nd}t3          j        dt6          ¦  «         |‰_        |r	|‰_        d S d ‰_        d S # t.          $ r}
t=          j        |
¦  «        }||
‚d }
~
ww xY w)	N)Ússl)Ú	connector)r6   é   r   r8   Fa9  Attempted to establish mTLS, but a custom async transport was provided. google-auth cannot automatically configure custom transports for mTLS. Falling back to standard TLS. If your custom transport is not manually configured for mTLS, you may encounter 401 Unauthorized errors when using Certificate-Bound Tokens.) r   Ú_run_in_executorrV   rW   r   Ú_mtls_helperÚcheck_use_client_certÚget_client_cert_and_keyrb   r_   rj   rc   Úmake_client_cert_ssl_contextÚaiohttpÚTCPConnectorÚClientSessionrh   ÚappendÚlenr7   r8   ÚinspectÚisawaitableÚ	ExceptionÚpopÚwarningsÚwarnÚUserWarningrd   rf   r
   ÚMutualTLSChannelError)Úuse_client_certÚis_mtlsÚcertÚkeyÚssl_contextrs   Únew_sessionÚold_auth_requestÚoldest_auth_requestÚresÚ
caught_excÚnew_excÚclient_cert_callbackr.   s               €€r   Ú_do_configurezDAsyncAuthorizedSession.configure_mtls_channel.<locals>._do_configure3  s™  øè è € å(,Ô(=Ý”KÔ)Ô6ÔLñ)ô )ð #ð #ð #ð #ð #ð #�ð 'ð Ø�Fð42õ
 #Ô:Ð;OÑPÔPÐPÐPÐPÐPÐPÐPñ	ØØØð ñ #å,ñ !µØ Ô.µñ2ô 2ñ !õ 15Ô0EÝ $Ô AÀ4Èñ1ô 1ð +ð +ð +ð +ð +ð +˜Kõ )0Ô(<ÀÐ(MÑ(MÔ(M˜IÝ*1Ô*?È)Ð*TÑ*TÔ*T˜Kà/3Ô/AÐ,Ý1?ÈÐ1TÑ1TÔ1T˜DÔ.Ø Ô3×:Ò:Ð;KÑLÔLÐLå"% dÔ&=Ñ">Ô">ÀÒ"BÐ"BØ6:Ô6MÈaÔ6PÐ 3ð!)Ý'.Ð/BÀGÑ'LÔ'Lð %6Ø.A×.GÒ.GÑ.IÔ.I¨Ý+2Ô+>¸sÑ+CÔ+Cð )6Ø25¨I¨I¨I¨I¨I¨I¨IøøÝ'0ð !)ð !)ð !)Ø$( Dð!)øøøà $Ô 7× ;Ò ;¸AÑ >Ô >Ð >õ #& dÔ&=Ñ">Ô">ÀÒ"BÐ"Bøð ',˜GÝ$œMð!Bõ
 !,ñô ð ð %,�D”MØð 1Ø,0˜Ô)Ð)Ð)à,0˜Ô)Ð)Ð)øå ð 2ð 2ð 2Ý(Ô>¸zÑJÔJ�GØ! zÐ1øøøøð2øøøsD   ¼C/G' Ä,A E- Å,G' Å-
E:Å7G' Å9E:Å:A"G' ÇG' Ç'
HÇ1HÈH)re   rg   r   rD   ÚBaseException)r.   r’   r“   s   `` r   Úconfigure_mtls_channelz-AsyncAuthorizedSession.configure_mtls_channel  s›   øøè è € ð2 ÔÐ'Ø)=ˆDÔ&ð<2ð <2ð <2ð <2ð <2ð <2õ| $+Ô#6°}°}±´Ñ#GÔ#GˆDÔ ð	ØÔ-Ð-Ð-Ð-Ð-Ð-Ð-Ð-øÝð 	ð 	ð 	Ø#'ˆDÔ Øð	øøøs   »A ÁArP   rQ   ÚdatarK   Úmax_allowed_timer$   Útotal_attemptsÚreturnc              ‹   ó4  ‡ ‡‡‡‡‡‡K  — |                      dd¦  «        }	‰ j        rJ‰ j                             ¦   «         s1	 t          j        ‰ j        ¦  «        ƒ d{V —† n# t
          $ r Y nw xY wt          j        |¬¦  «        }
|�t          |¦  «        ni }t          j
        ¦   «         }‰ j        Š‰ j        Š‰ j        Št          |¦  «        4 ƒd{V —†} |‰ j                             ‰ j        |‰|¦  «        ¦  «        ƒ d{V —† d}t$          �&t'          |t$          ¦  «        r|j        �|j        nd}n+t'          |t*          t,          f¦  «        rt-          |¦  «        }|
2 3 d{V —†} | ‰ j        ‰||||fi |¤Ž¦  «        ƒ d{V —†Š‰j        t0          j        vr nŒ>6 	 ddd¦  «        ƒd{V —† n# 1 ƒd{V —†swxY w Y   ‰j        t4          j        k    �r;|	dk     �r4	 |�Tt          j
        ¦   «         |z
  }t9          d||z
  ¦  «        }|dk    r$t:          j        j                              d¦  «        ‚nd}|duo?t'          |tB          j"        j#        tB          j"        j$        f¦  «        ptK          |d¦  «        Šˆˆˆˆˆˆ ˆfd	„}t          |¦  «        4 ƒd{V —†} | |¦   «         ¦  «        ƒ d{V —†}ddd¦  «        ƒd{V —† n# 1 ƒd{V —†swxY w Y   nm# t
          t          j&        f$ rT tK          ‰d
¦  «        rB	 ‰ '                    ¦   «         }tQ          j)        |¦  «        r|ƒ d{V —† n# t
          $ r Y nw xY w‚ w xY w|�|S tK          ‰d
¦  «        rB	 ‰ '                    ¦   «         }tQ          j)        |¦  «        r|ƒ d{V —† n# t
          $ r Y nw xY w|�Qt9          d|t          j
        ¦   «         |z
  z
  ¦  «        }|dk    r$t:          j        j                              d¦  «        ‚|	dz   |d<    ‰ j*        |‰f|||||dœ|¤Žƒ d{V —†S ‰S )aÿ  
        Args:
                method (str): The http method used to make the request.
                url (str): The URI to be requested.
                data (Optional[bytes]): The payload or body in HTTP request.
                headers (Optional[Mapping[str, str]]): Request headers.
                timeout (float, aiohttp.ClientTimeout):
                The amount of time in seconds to wait for the server response
                with each individual request.
                max_allowed_time (float):
                If the method runs longer than this, a ``Timeout`` exception is
                automatically raised. Unlike the ``timeout`` parameter, this
                value applies to the total method execution time, even if
                multiple requests are made under the hood.
                total_attempts (int):
                The total number of retry attempts.

                Mind that it is not guaranteed that the timeout error is raised
                at ``max_allowed_time``. It might take longer, for example, if
                an underlying request takes a lot of time, but the request
                itself does not timeout, e.g. if a large file is being
                transmitted. The timeout error will be raised after such
                request completes.

        Returns:
                google.auth.aio.transport.Response: The HTTP response.

        Raises:
                google.auth.exceptions.TimeoutError: If the method does not complete within
                the configured `max_allowed_time` or the request exceeds the configured
                `timeout`.
                google.auth.exceptions.MutualTLSChannelError: If mutual TLS
                channel reconfiguration fails for any reason during certificate rotation.
        Ú_auth_retry_countr   N)r˜   g        rt   z6Timeout exceeded before credential refresh could beginÚreadc            	   “   ó°  •‡‡‡K  — d} ‰j         �rft          j                             ‰¦  «        j        Š‰r t          ˆfd„t          D ¦   «         ¦  «        } | �r‰j        €t          j	        ¦   «         ‰_        ‰j        4 ƒd {V —† ‰j
        ‰k    r�n¿	 t          j        ‰j        ‰j        ¦  «        ƒ d {V —†\  ŠŠ}}|�õ||k    rï‰j        }	 t                               d¦  «         ‰j        �?‰j                             ¦   «         s	 ‰j        ƒ d {V —† n# t&          $ r Y nw xY wd ‰_        ‰                     ˆˆfd„¦  «        ƒ d {V —† ‰xj        dz  c_        nB# t&          $ r5}t                               d|¦  «         t/          j        d¦  «        |‚d }~ww xY w	 |‰_        n™# |‰_        w xY w|€t                               d¦  «         npt                               d	¦  «         nU# t.          j        t.          j        t4          t6          t8          f$ r%}t                               d
|¦  «         Y d }~nd }~ww xY w‰xj
        dz  c_
        	 d d d ¦  «        ƒd {V —† n# 1 ƒd {V —†swxY w Y   ‰j        €t          j	        ¦   «         ‰_        ‰j        4 ƒd {V —† ‰j        ‰k    rt                                d¦  «         nå	 ‰j!         "                    ‰j#        ¦  «        ƒ d {V —† ‰xj        dz  c_        n®# tH          $ r@ t                                d¦  «         | r‰j        ‰
k    r‰cY cd d d ¦  «        ƒd {V —† S Y net.          j%        tM          t.          dt&          ¦  «        f$ r9}t                                d|¦  «         ‰cY d }~cd d d ¦  «        ƒd {V —† S d }~ww xY wd d d ¦  «        ƒd {V —† n# 1 ƒd {V —†swxY w Y   ‰	r‰S d S )NFc              3   óT   •K  — | ]"}‰|k    p‰                      d |z   ¦  «        V — Œ#dS )ú.N)Úendswith)Ú.0ÚprefixÚhostnames     €r   ú	<genexpr>zNAsyncAuthorizedSession.request.<locals>._recover_auth_state.<locals>.<genexpr>ç  sY   øè è € ð 7"ð 7"ð )/ð %-°Ò$6ð %GØ'/×'8Ò'8¸¸v¹Ñ'FÔ'Fð7"ð 7"ð 7"ð 7"ð 7"ð 7"r   z;Client certificate has changed, reconfiguring mTLS channel.c                  ó   •— ‰ ‰fS r*   rZ   )Úcall_cert_bytesÚcall_key_bytess   €€r   ú<lambda>zMAsyncAuthorizedSession.request.<locals>._recover_auth_state.<locals>.<lambda>'  s   ø€ Ø<KØ<JðA:€ r   é   z&Failed to reconfigure mTLS channel: %sz"Failed to reconfigure mTLS channelzWSkipping reconfiguration of mTLS channel because the client certificate does not exist.zXSkipping reconfiguration of mTLS channel because the client certificate has not changed.zUFailed to check client certificate parameters: %s. Proceeding with original response.zTCredentials were already refreshed by a concurrent task. Skipping duplicate refresh.z'Credentials do not implement refresh().ÚInvalidOperationz<Credential refresh failed, returning 401 response. Error: %s)'rd   ÚurllibÚparseÚurlsplitr£   ÚanyÚ_MTLS_URL_PREFIXESrk   r   ÚLockrl   r   Ú*check_parameters_for_unauthorized_responserf   rg   Ú_LOGGERÚinfore   rC   r�   r•   rm   Úerrorr
   r†   ÚClientCertErrorÚOSErrorÚ
ValueErrorÚImportErrorÚwarningrn   ro   Údebugr+   rF   rj   ÚNotImplementedErrorÚRefreshErrorÚgetattr)Úis_mtls_endpointÚcached_fingerprintÚcurrent_cert_fingerprintÚsaved_callbackr"   r¦   r§   r£   Úcheck_counter_at_errorÚis_streamingÚreconfig_counter_at_errorÚrefresh_counter_at_errorr!   r.   rQ   s        @@@€€€€€€€r   Ú_recover_auth_statez;AsyncAuthorizedSession.request.<locals>._recover_auth_stateâ  sk  øøøøè è € Ø+0Ð(Øœ=ñ aFÝ'-¤|×'<Ò'<¸SÑ'AÔ'AÔ'J˜HØ'ð "Ý36ð 7"ð 7"ð 7"ð 7"õ 3Eð7"ñ 7"ô 7"ñ 4"ô 4"Ð 0ð  0ñ WFØ#'Ô#;Ð#CÝ?F¼|¹~¼~ DÔ$<Ø+/Ô+Cð T!Fð T!Fð T!Fð T!Fð T!Fð T!Fð T!Fð T!Fð )-Ô(@Ø*@ò)Að )Añ )-ðI)6õ 7;Ô6eØ04Ô0AØ04Ô0Jñ7.ô 7.ð 1.ð 1.ð 1.ð 1.ð 1.ð 1.ñ-.Ø0?Ø0>Ø0BØ0Hð$ 1IÐ0TØ4FØ3Kò5Lð 5Lð 59Ô4Nð 1?ð 16Ý4;·L²Lð9Cñ56ô 56ð 56ð 8<Ô7KÐ7WØ?CÔ?S×?XÒ?XÑ?ZÔ?Zð 9Eð=EàDHÔDXðABð ABð ABð ABð ABð ABð ABð ABøõ DMð =Eð =Eð =EØ@DÀð=EøøøàOS¸Ô8LØ:>×:UÒ:Uð9:ð 9:ð 9:ð 9:ð 9:ñ;6ô ;6ð 56ð 56ð 56ð 56ð 56ð 56ð 56ð 59Ð4OÔ4OÐSTÑ4TÐ4OÔ4OÐ4OøÝ7@ð 1=ð 1=ð 1=Ý4;·M²MØ8`Ø89ñ56ô 56ð 56õ ;EÔ:ZØ8\ñ;6ô ;6à;<ð5=øøøøð1=øøøð 5Pð 9Gð 59Ô4NÐ4NøØ8Fð 59Ô4Nð 56ð 56ð 56ð 56ð 4LÐ3SÝ4;·L²Lð9Wñ56ô 56ð 56ð 56õ
 5<·L²Lð9Xñ56ô 56ð 56ð 56øõw -7Ô,FÝ,6Ô,LÝ,3Ý,6Ý,7ð0*ð 
).ð 
).ð 
).õ -4¯OªOð 1HØ01ñ-.ô -.ð -.ð -.ð -.ð -.ð -.ð -.øøøøð
).øøøðB )-Ð(@Ô(@ÀAÑ(EÐ(@Ô(@Ð(@ðiT!Fð T!Fð T!Fñ T!Fô T!Fð T!Fð T!Fð T!Fð T!Fð T!Fð T!Fð T!Fð T!Fð T!Fð T!Fð T!Fð T!Fð T!Fð T!Fð T!Fð T!Fð T!Fð T!Føøøð T!Fð T!Fð T!Fð T!Fðj  Ô-Ð5Ý18´±´˜DÔ.à#'Ô#5ð "?ð "?ð "?ð "?ð "?ð "?ð "?ð "?à#Ô4Ð7OÒOÐOÝ '§¢Ø$zñ!"ô !"ð !"ð !"ð!?Ø*.Ô*;×*CÒ*CÀDÔDVÑ*WÔ*WÐ$WÐ$WÐ$WÐ$WÐ$WÐ$WÐ$Wð4 %)Ð$9Ô$9¸QÑ$>Ð$9Ô$9Ð$9øõ3 (;ð !8ð !8ð !8Ý$+§M¢MØ(Qñ%&ô %&ð %&ð -=ð%8à+/Ô+FØ+Dò,Eð ,Eð 08¨¨ð/"?ð "?ð "?ð "?ñ "?ô "?ð "?ð "?ð "?ð "?ð "?ð "?ð "?ð "?ð(,Eð ,Eõ
 %/Ô$;Ý$+­JÐ8JÍIÑ$VÔ$Vð("ð !4ð !4ð !4õ %,§M¢MØ(fØ()ñ%&ô %&ð %&ð ,4 O O O O OðA"?ð "?ð "?ð "?ñ "?ô "?ð "?ð "?ð "?ð "?ð "?ð "?ð "?ð "?øøøøð0!4øøøð1"?ð "?ð "?ñ "?ô "?ð "?ð "?ð "?ð "?ð "?ð "?ð "?ð "?ð "?ð "?ð "?ð "?ð "?ð "?ð "?ð "?ð "?ð "?øøøð "?ð "?ð "?ð "?ðH (ð ,Ø#+˜Oà#˜tsê   ÂI&Â*G.Â?I&Ã:EÄ
DÄEÄ
D%Ä"EÄ$D%Ä%9EÅF*Å
FÅ)0FÆFÆF*Æ"I&Æ*	F3Æ3;I&Ç.-I ÈH;È6I&È;I É I&É&
I0É3I0Ê#'OË%LË0OÌ3N,Ì4OÍOÍ
)N,Í3N'ÎN,ÎOÎ'N,Î,OÏ
OÏOr8   z,Timeout exceeded before retrying the requestr©   )r–   rK   r—   r$   r˜   )+r‚   re   rC   r   rG   r�   r   ÚAsyncExponentialBackoffÚdictr   r   ro   rl   rm   r%   r+   rO   rj   r   r_   ÚtotalÚintÚfloatÚstatus_coder   ÚDEFAULT_RETRYABLE_STATUS_CODESÚhttp_clientÚUNAUTHORIZEDÚmaxrV   rW   r
   r   ÚcollectionsÚabcÚIteratorÚAsyncIterabler7   ÚCancelledErrorr8   r   r€   rM   )r.   rP   rQ   r–   rK   r—   r$   r˜   Úkwargsr›   ÚretriesÚrequest_headersÚ
start_timer#   Úactual_timeoutÚ_r   Úremaining_timerÆ   Úauth_with_timeoutÚearly_return_responser�   rÂ   rÃ   rÄ   rÅ   r!   s   ` `                   @@@@@r   rM   zAsyncAuthorizedSession.requesty  så  øøøøøøøè è € ðZ #ŸJšJÐ':¸AÑ>Ô>ÐØÔð 	¨Ô(<×(AÒ(AÑ(CÔ(Cð 	ðÝ”n TÔ%9Ñ:Ô:Ð:Ð:Ð:Ð:Ð:Ð:Ð:Ð:øÝð ð ð ð �ðøøøõ 'Ô>Ø)ð
ñ 
ô 
ˆð ,3Ð+>�$˜w™-œ-˜-ÀBˆÝ”^Ñ%Ô%ˆ
Ø#'Ô#8Ð Ø!%Ô!9ÐØ$(Ô$?Ð!Ý Ð!1Ñ2Ô2ð 	ð 	ð 	ð 	ð 	ð 	ð 	°lØ�,àÔ!×0Ò0ØÔ&¨°°_ñô ñô ð ð ð ð ð ð ð ð %(ˆNÝÐ(­Z¸ÅÑ-OÔ-OÐ(Ø29´-Ð2K ¤ ÐQT��Ý˜G¥c­5 \Ñ2Ô2ð 0Ý!& w¡¤�ð #ð ð ð ð ð ð ð �aØ!- Ø&�DÔ&Ø˜V T¨?¸Nðð ØNTðð ñ"ô "ð ð ð ð ð ð �ð Ô'­yÔ/WÐWÐWØ�Eð Xð #˜7ð	ð 	ð 	ñ 	ô 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	øøøð 	ð 	ð 	ð 	ð0 Ô¥;Ô#;Ò;Ñ;Ø  1Ò$Ñ$ðnØ'Ð3Ý"&¤.Ñ"2Ô"2°ZÑ"?˜Ý),¨SÐ2BÀWÑ2LÑ)MÔ)M˜Ø)¨SÒ0Ð0Ý"(¤+Ô"8×"EÒ"EØ Xñ#ô #ð ð 1ð
 *.˜Ø#'¨tÐ#3ð $Ý"Ø Ý(œ_Ô5µ{´Ô7TÐUñô ð 1õ # 4¨Ñ0Ô0ð !ðN$ð N$ð N$ð N$ð N$ð N$ð N$ð N$ð N$ð N$ð N$õ`  -¨^Ñ<Ô<ð ð ð ð ð ð ð Ð@QØ6GÐ6GØ/Ð/Ñ1Ô1ñ7ô 7ð 1ð 1ð 1ð 1ð 1ð 1Ð-ðð ð ñ ô ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð øøøð ð ð ð øøõ "¥7Ô#9Ð:ð ð ð Ý˜x¨Ñ1Ô1ð !ð!Ø"*§.¢.Ñ"2Ô"2˜CÝ&Ô2°3Ñ7Ô7ð *Ø&) 	 	 	 	 	 	 	øøÝ(ð !ð !ð !Ø ˜Dð!øøøàðøøøð )Ð4Ø0Ð0Ý˜8 WÑ-Ô-ð ðØ&ŸnšnÑ.Ô.˜Ý"Ô.¨sÑ3Ô3ð &Ø"%˜I˜I˜I˜I˜I˜I˜IøøÝ$ð ð ð Ø˜ðøøøà#Ð/Ý%(ØÐ-µ´Ñ1AÔ1AÀJÑ1NÑOñ&ô &�Nð &¨Ò,Ð,Ý$œkÔ4×AÒAØJñô ð ð /@À!Ñ.C�Ð*Ñ+Ø)˜Tœ\ØØð	ð Ø#Ø%3Ø#Ø#1ð	ð 	ð ð	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð ˆs˜   ÁA! Á!
A.Á-A.ÃBF6Å$F"Å*9F6Æ6
G ÇG Ç%B<K Ê!KÊ;K Ë
KËK ËKËK Ë&M	Ì0L7Ì6M	Ì7
MÍM	ÍMÍM	Í!0N Î
NÎNc           	   ‹   ó:   K  —  | j         d||||||fi |¤Žƒ d{V —†S )á  
        Args:
                url (str): The URI to be requested.
                data (Optional[bytes]): The payload or body in HTTP request.
                headers (Optional[Mapping[str, str]]): Request headers.
                max_allowed_time (float):
                If the method runs longer than this, a ``Timeout`` exception is
                automatically raised. Unlike the ``timeout`` parameter, this
                value applies to the total method execution time, even if
                multiple requests are made under the hood.
                timeout (float, aiohttp.ClientTimeout):
                The amount of time in seconds to wait for the server response
                with each individual request.
                total_attempts (int):
                The total number of retry attempts.

                Mind that it is not guaranteed that the timeout error is raised
                at ``max_allowed_time``. It might take longer, for example, if
                an underlying request takes a lot of time, but the request
                itself does not timeout, e.g. if a large file is being
                transmitted. The timeout error will be raised after such
                request completes.

        Returns:
                google.auth.aio.transport.Response: The HTTP response.

        Raises:
                google.auth.exceptions.TimeoutError: If the method does not complete within
                the configured `max_allowed_time` or the request exceeds the configured
                `timeout`.
        ÚGETN©rM   ©r.   rQ   r–   rK   r—   r$   r˜   rÖ   s           r   ÚgetzAsyncAuthorizedSession.getž  óa   è è € ðT "�T”\ØØØØØØØð	
ð 	
ð ð	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 		
r   c           	   ‹   ó:   K  —  | j         d||||||fi |¤Žƒ d{V —†S )rà   ÚPOSTNrâ   rã   s           r   ÚpostzAsyncAuthorizedSession.postÓ  sa   è è € ðT "�T”\ØØØØØØØð	
ð 	
ð ð	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 		
r   c           	   ‹   ó:   K  —  | j         d||||||fi |¤Žƒ d{V —†S )rà   ÚPUTNrâ   rã   s           r   ÚputzAsyncAuthorizedSession.put  rå   r   c           	   ‹   ó:   K  —  | j         d||||||fi |¤Žƒ d{V —†S )rà   ÚPATCHNrâ   rã   s           r   ÚpatchzAsyncAuthorizedSession.patch=  sa   è è € ðT "�T”\ØØØØØØØð	
ð 	
ð ð	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 		
r   c           	   ‹   ó:   K  —  | j         d||||||fi |¤Žƒ d{V —†S )rà   ÚDELETENrâ   rã   s           r   ÚdeletezAsyncAuthorizedSession.deleter  sa   è è € ðT "�T”\ØØØØØØØð	
ð 	
ð ð	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 		
r   c                 ó   — | j         S )z#Indicates if mutual TLS is enabled.)rd   r9   s    r   rˆ   zAsyncAuthorizedSession.is_mtls§  s   € ð Œ}Ðr   c              ƒ   óì  K  — | j         rV| j                              ¦   «         s=| j                              ¦   «          	 | j         ƒ d{V —† n# t          j        $ r Y nw xY w	 t          | j        d¦  «        r5| j                             ¦   «         }t          j	        |¦  «        r|ƒ d{V —† t          | j
        d¦  «        r| j
                             ¦   «          | j        D ]S}	 t          |d¦  «        r0|                     ¦   «         }t          j	        |¦  «        r|ƒ d{V —† ŒD# t          $ r Y ŒPw xY w| j                             ¦   «          dS # t          | j
        d¦  «        r| j
                             ¦   «          | j        D ]S}	 t          |d¦  «        r0|                     ¦   «         }t          j	        |¦  «        r|ƒ d{V —† ŒD# t          $ r Y ŒPw xY w| j                             ¦   «          w xY w)z<
        Close the underlying auth request session.
        Nr8   )re   rC   Úcancelr   rÕ   r7   rj   r8   r   r€   r+   rh   r�   Úclear)r.   r�   Úold_requests      r   r8   zAsyncAuthorizedSession.close¬  sa  è è € ð Ôð 	¨Ô(<×(AÒ(AÑ(CÔ(Cð 	ØÔ ×'Ò'Ñ)Ô)Ð)ðØÔ*Ð*Ð*Ð*Ð*Ð*Ð*Ð*Ð*øÝÔ)ð ð ð Ø�ðøøøð	,Ý�tÔ)¨7Ñ3Ô3ð ØÔ(×.Ò.Ñ0Ô0�ÝÔ& sÑ+Ô+ð Ø�I�I�I�I�I�I�Iå�tÔ(¨'Ñ2Ô2ð *ØÔ!×'Ò'Ñ)Ô)Ð)Ø#Ô6ð ð �ðÝ˜{¨GÑ4Ô4ð &Ø)×/Ò/Ñ1Ô1˜Ý"Ô.¨sÑ3Ô3ð &Ø"%˜I˜I˜I˜I˜I˜I˜IøøÝ ð ð ð Ø�DðøøøàÔ#×)Ò)Ñ+Ô+Ð+Ð+Ð+øõ �tÔ(¨'Ñ2Ô2ð *ØÔ!×'Ò'Ñ)Ô)Ð)Ø#Ô6ð ð �ðÝ˜{¨GÑ4Ô4ð &Ø)×/Ò/Ñ1Ô1˜Ý"Ô.¨sÑ3Ô3ð &Ø"%˜I˜I˜I˜I˜I˜I˜IøøÝ ð ð ð Ø�DðøøøàÔ#×)Ò)Ñ+Ô+Ð+Ð+øøøsV   ½A ÁAÁAÁ!A
E Ã#A D$Ä$
D1Ä0D1Å8G3ÆA G	ÇG3Ç	
G	ÇG3ÇG	ÇG3r*   )r™   N)"rR   rS   rT   rU   r   r   rV   rW   r(   r   r   r   r/   r•   Ú_DEFAULT_TIMEOUT_SECONDSÚDEFAULT_MAX_RETRY_ATTEMPTSÚstrÚbytesr   rË   r   rÊ   ÚResponserM   Ú	functoolsÚwrapsrä   rè   rë   rî   rñ   rX   rˆ   r8   rZ   r   r   r\   r\   Ð   sç  € € € € € ð%ð %ðT 59ð"ð "à˜;¨¬Ô(?Ô(KÐKÔLð"ð ˜yÔ0Ô1ð"ð "ð "ð "ð>`ð `ð `ð `ðL !%Ø/3Ø"+Ô"DØ/8Ô/QØ(1Ô(Lðcð càðcð ðcð �uŒoð	cð
 ˜' # s (Ô+Ô,ðcð  ðcð �u˜mÐ+Ô,ðcð ! œðcð 
Ô	ðcð cð cð cðJ	 €Y„_�WÑÔð !%Ø/3Ø"+Ô"DØ/8Ô/QØ(1Ô(Lð2
ð 2
àð2
ð �uŒoð2
ð ˜' # s (Ô+Ô,ð	2
ð
  ð2
ð �u˜mÐ+Ô,ð2
ð ! œð2
ð 
Ô	ð2
ð 2
ð 2
ñ Ôð2
ðh €Y„_�WÑÔð !%Ø/3Ø"+Ô"DØ/8Ô/QØ(1Ô(Lð2
ð 2
àð2
ð �uŒoð2
ð ˜' # s (Ô+Ô,ð	2
ð
  ð2
ð �u˜mÐ+Ô,ð2
ð ! œð2
ð 
Ô	ð2
ð 2
ð 2
ñ Ôð2
ðh €Y„_�WÑÔð !%Ø/3Ø"+Ô"DØ/8Ô/QØ(1Ô(Lð2
ð 2
àð2
ð �uŒoð2
ð ˜' # s (Ô+Ô,ð	2
ð
  ð2
ð �u˜mÐ+Ô,ð2
ð ! œð2
ð 
Ô	ð2
ð 2
ð 2
ñ Ôð2
ðh €Y„_�WÑÔð !%Ø/3Ø"+Ô"DØ/8Ô/QØ(1Ô(Lð2
ð 2
àð2
ð �uŒoð2
ð ˜' # s (Ô+Ô,ð	2
ð
  ð2
ð �u˜mÐ+Ô,ð2
ð ! œð2
ð 
Ô	ð2
ð 2
ð 2
ñ Ôð2
ðh €Y„_�WÑÔð !%Ø/3Ø"+Ô"DØ/8Ô/QØ(1Ô(Lð2
ð 2
àð2
ð �uŒoð2
ð ˜' # s (Ô+Ô,ð	2
ð
  ð2
ð �u˜mÐ+Ô,ð2
ð ! œð2
ð 
Ô	ð2
ð 2
ð 2
ñ Ôð2
ðh ðð ñ „Xðð,ð ,ð ,ð ,ð ,ð ,r   r\   )2r   Úcollections.abcrÑ   rü   Úhttp.clientÚclientrÎ   r   Úloggingr   Úurllib.parser«   rƒ   Ú
contextlibr   Útypingr   r   r   r   Úgoogle.auth.credentialsrV   Ú"google.auth.transport._mtls_helperÚgoogle.authr   r	   r
   Úgoogle.auth.aior   Úgoogle.auth.aio.credentialsr   Úgoogle.auth.aio.transportr   Úgoogle.auth.exceptionsr   rz   r   r¸   ÚAttributeErrorÚ	getLoggerrR   r²   r¯   Ú!google.auth.aio.transport.aiohttpr   rc   rb   r%   r'   r\   rZ   r   r   ú<module>r     s‰  ðð €€€Ø Ð Ð Ð Ø Ð Ð Ð Ø !Ð !Ð !Ð !Ð !Ð !Ø €€€Ø €€€Ø €€€Ø Ð Ð Ð Ø €€€Ø *Ð *Ð *Ð *Ð *Ð *Ø :Ð :Ð :Ð :Ð :Ð :Ð :Ð :Ð :Ð :Ð :Ð :à Ð Ð Ð Ø )Ð )Ð )Ð )Ø BÐ BÐ BÐ BÐ BÐ BÐ BÐ BÐ BÐ BØ %Ð %Ð %Ð %Ð %Ð %Ø 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø *Ð *Ð *Ð *Ð *Ð *Ø /Ð /Ð /Ð /Ð /Ð /àð 	Ø€N€N€NØ%Ð%Ð%Ð%Ð%Ð%Ð%ðØˆˆˆØ)Ð)Ð)Ð)Ð)Ð)Ð)øØ˜Ð(ð ð ð Øˆˆˆðøøøð ˆ'Ô
˜HÑ
%Ô
%€ðð ð Ð ðØKÐKÐKÐKÐKÐKàÐÐøØð ð ð ØÐÐÐðøøøð ð*ð *ñ Ôð*ðZa
ð a
ð a
ð a
ð a
˜kñ a
ô a
ð a
ðHv,ð v,ð v,ð v,ð v,ñ v,ô v,ð v,ð v,ð v,s$   Á1
A< Á<	BÂBÂ B) Â)B3Â2B3