+
    ^eòj«  ã                   ó¨   € R t ^ RIt^ RIt^ RIt^ RIt^ RIHt  ! R R]P                  4      t ! R R]	4      t
 ! R R]P                  R	7      tR
 tR# )a'  OAuth 2.0 Utilities.

This module provides implementations for various OAuth 2.0 utilities.
This includes `OAuth error handling`_ and
`Client authentication for OAuth flows`_.

OAuth error handling
--------------------
This will define interfaces for handling OAuth related error responses as
stated in `RFC 6749 section 5.2`_.
This will include a common function to convert these HTTP error responses to a
:class:`google.auth.exceptions.OAuthError` exception.


Client authentication for OAuth flows
-------------------------------------
We introduce an interface for defining client authentication credentials based
on `RFC 6749 section 2.3.1`_. This will expose the following
capabilities:

    * Ability to support basic authentication via request header.
    * Ability to support bearer token authentication via request header.
    * Ability to support client ID / secret authentication via request body.

.. _RFC 6749 section 2.3.1: https://tools.ietf.org/html/rfc6749#section-2.3.1
.. _RFC 6749 section 5.2: https://tools.ietf.org/html/rfc6749#section-5.2
N)Ú
exceptionsc                   ó   € ] tR t^5t^t^tRtR# )ÚClientAuthType© N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__ÚbasicÚrequest_bodyÚ__static_attributes__r   ó    ÚŠ/opt/data/installs/351f81cc06284494/environments/aa258815729c481f8402f54f4c368f83/venv/lib/python3.14/site-packages/google/oauth2/utils.pyr   r   5   s   † Ø€EØ„Lr   r   c                   ó.   a € ] tR t^:t o RtRR ltRtV tR# )ÚClientAuthenticationz‹Defines the client authentication credentials for basic and request-body
types based on https://tools.ietf.org/html/rfc6749#section-2.3.1.
Nc                ó*   € Wn         W n        W0n        R# )aH  Instantiates a client authentication object containing the client ID
and secret credentials for basic and response-body auth.

Args:
    client_auth_type (google.oauth2.oauth_utils.ClientAuthType): The
        client authentication type.
    client_id (str): The client ID.
    client_secret (Optional[str]): The client secret.
N©Úclient_auth_typeÚ	client_idÚclient_secret)Úselfr   r   r   s   &&&&r   Ú__init__ÚClientAuthentication.__init__?   s   € ð !1ÔØ"ŒØ*Ör   r   ©N)r   r   r   r	   Ú__doc__r   r   Ú__classdictcell__)Ú__classdict__s   @r   r   r   :   s   ø‡ € ñ÷+ò +r   r   c                   óT   a a€ ] tR t^Nt oRtRV 3R lltRR ltRR ltR tRt	Vt
V ;t# )	ÚOAuthClientAuthHandlerzMAbstract class for handling client authentication in OAuth-based
operations.
c                ó8   <€ \         \        V `  4        Wn        R# )zÎInstantiates an OAuth client authentication handler.

Args:
    client_authentication (Optional[google.oauth2.utils.ClientAuthentication]):
        The OAuth client authentication credentials if available.
N)Úsuperr   r   Ú_client_authentication)r   Úclient_authenticationÚ	__class__s   &&€r   r   ÚOAuthClientAuthHandler.__init__S   s   ø€ ô 	Ô$ dÑ4Ô6Ø&;Ö#r   c                óV   € V P                  W4       Vf   V P                  V4       R# R# )a|  Applies client authentication on the OAuth request's headers or POST
body.

Args:
    headers (Mapping[str, str]): The HTTP request header.
    request_body (Optional[Mapping[str, str]]): The HTTP request body
        dictionary. For requests that do not support request body, this
        is None and will be ignored.
    bearer_token (Optional[str]): The optional bearer token.
N)Ú_inject_authenticated_headersÚ"_inject_authenticated_request_body)r   Úheadersr   Úbearer_tokens   &&&&r   Ú#apply_client_authentication_optionsÚ:OAuthClientAuthHandler.apply_client_authentication_options]   s+   € ð 	×*Ñ*¨7ÔAàÒØ×3Ñ3°LÖAñ  r   c                ó”  € Ve   RV,          VR&   R # V P                   e¨   V P                   P                  \        P                  J d~   V P                   P                  pV P                   P
                  ;'       g    Rp\        P                  ! V: RV: 2P                  4       4      P                  4       pRV,          VR&   R # R # R # )Nz	Bearer %sÚAuthorizationÚ Ú:zBasic %s)
r!   r   r   r
   r   r   Úbase64Ú	b64encodeÚencodeÚdecode)r   r(   r)   ÚusernameÚpasswordÚcredentialss   &&&   r   r&   Ú4OAuthClientAuthHandler._inject_authenticated_headersp   s®   € ØÒ#Ø'2°\Õ'AˆG�OÓ$à×'Ñ'Ò3Ø×+Ñ+×<Ñ<Ä×@TÑ@TÓTà×2Ñ2×<Ñ<ˆHØ×2Ñ2×@Ñ@×FÐFÀBˆHä ×*Ò*Û$¢hÐ/×7Ñ7Ó9óç‰f‹hð ð (2°KÕ'?ˆG�OÓ$ñ Uñ 4r   c                ó&  € V P                   eƒ   V P                   P                  \        P                  J dY   Vf   \        P
                  ! R4      hV P                   P                  VR&   V P                   P                  ;'       g    RVR&   R # R # R # )Nz*HTTP request does not support request-bodyr   r.   r   )r!   r   r   r   r   Ú
OAuthErrorr   r   )r   r   s   &&r   r'   Ú9OAuthClientAuthHandler._inject_authenticated_request_body   sŒ   € à×'Ñ'Ò3Ø×+Ñ+×<Ñ<Ü×*Ñ*ó+ð Ò#Ü ×+Ò+Ø@óð ð -1×,GÑ,G×,QÑ,Q�˜[Ñ)à×/Ñ/×=Ñ=×CÐCÀð ˜_Ó-ñ+ñ 4r   )r!   r   )NN)r   r   r   r	   r   r   r*   r&   r'   r   r   Ú__classcell__)r#   r   s   @@r   r   r   N   s%   ù‡ € ñ÷<ôBô&@÷ò r   r   )Ú	metaclassc                óº  €  . p\         P                  ! V 4      pVP                  RP                  VR,          4      4       RV9   d(   VP                  RP                  VR,          4      4       RV9   d(   VP                  RP                  VR,          4      4       RP	                  V4      p\        P                  ! W04      h  \
        \        3 d    T p L+i ; i)z½Translates an error response from an OAuth operation into an
OAuthError exception.

Args:
    response_body (str): The decoded response data.

Raises:
    google.auth.exceptions.OAuthError
zError code {}ÚerrorÚerror_descriptionz: {}Ú	error_uriz - {}r.   )	ÚjsonÚloadsÚappendÚformatÚjoinÚKeyErrorÚ
ValueErrorr   r9   )Úresponse_bodyÚerror_componentsÚ
error_dataÚerror_detailss   &   r   Úhandle_error_responserL   �   s¿   € ð&ØÐÜ—Z’Z Ó.ˆ
à×Ñ × 6Ñ 6°zÀ'Õ7JÓ KÔLØ *Ô,Ø×#Ñ# F§M¡M°*Ð=PÕ2QÓ$RÔSØ˜*Ô$Ø×#Ñ# G§N¡N°:¸kÕ3JÓ$KÔLØŸ™Ð 0Ó1ˆô
 ×
Ò
 Ó
=Ð=øô ”jÐ!ô &Ø%Šð&ús   ‚B,C ÃCÃC)r   Úabcr0   ÚenumrA   Úgoogle.authr   ÚEnumr   Úobjectr   ÚABCMetar   rL   r   r   r   Ú<module>rS      sM   ðñó8 Û Û Û å "ô
�T—Y‘Yô ô
+˜6ô +ô(? s§{¡{õ ?ôD>r   