
    (ph                     z   S r SSKrSSKJr  SSKrSSKrSSKJr  SSK	r	SSK
r
SSKrSSKrSSKJr  SSKrSSKJr  SSKJr  SSKJr  SSKJr  SS	KJr  S
rSrSrSrSrSr " S S\5      rS rS r S r!S0 4S jr"\ " S S5      5       r# " S S\RH                  S9r% " S S\%5      r& " S S\RN                  5      r'g) a	  AWS Credentials and AWS Signature V4 Request Signer.

This module provides credentials to access Google Cloud resources from Amazon
Web Services (AWS) workloads. These credentials are recommended over the
use of service account credentials in AWS as they do not involve the management
of long-live service account private keys.

AWS Credentials are initialized using external_account arguments which are
typically loaded from the external credentials JSON file.

This module also provides a definition for an abstract AWS security credentials supplier.
This supplier can be implemented to return valid AWS security credentials and an AWS region
and used to create AWS credentials. The credentials will then call the
supplier instead of using pre-defined methods such as calling the EC2 metadata endpoints.

This module also provides a basic implementation of the
`AWS Signature Version 4`_ request signing algorithm.

AWS Credentials use serialized signed requests to the
`AWS STS GetCallerIdentity`_ API that can be exchanged for Google access tokens
via the GCP STS endpoint.

.. _AWS Signature Version 4: https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html
.. _AWS STS GetCallerIdentity: https://docs.aws.amazon.com/STS/latest/APIReference/API_GetCallerIdentity.html
    N)	dataclass)Optional)urljoin)_helpers)environment_vars)
exceptions)external_accountzAWS4-HMAC-SHA256aws4_requestzx-amz-security-tokenz
x-amz-datezNhttps://sts.{region}.amazonaws.com?Action=GetCallerIdentity&Version=2011-06-15300c                   ,    \ rS rSrSrS rS0 4S jrSrg)RequestSignerL   zImplements an AWS request signer based on the AWS Signature Version 4 signing
process.
https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html
c                     Xl         g)zInstantiates an AWS request signer used to compute authenticated signed
requests to AWS APIs based on the AWS Signature Version 4 signing process.

Args:
    region_name (str): The AWS region to use.
N_region_name)selfregion_names     B/var/www/html/venv/lib/python3.13/site-packages/google/auth/aws.py__init__RequestSigner.__init__R   s
     (     c                    U=(       d    0 n[         R                  R                  U5      n[         R                  R                  [        U[        R
                  " UR                  5      5      5      nUR                  (       a  UR                  S:w  a  [        R                  " S5      e[        UR                  UR                  =(       d    S[        UR                  5      UU R                  UUUS9nUR                  S5      UR                  S.n	SU;   a  UR                  S5      U	[         '   U H	  n
XZ   X'   M     UR"                  b  UR"                  U	[$        '   X#U	S.nU(       a  XKS	'   U$ )
a  Generates the signed request for the provided HTTP request for calling
an AWS API. This follows the steps described at:
https://docs.aws.amazon.com/general/latest/gr/sigv4_signing.html

Args:
    aws_security_credentials (AWSSecurityCredentials): The AWS security credentials.
    url (str): The AWS service URL containing the canonical URI and
        query string.
    method (str): The HTTP method used to call this API.
    request_payload (Optional[str]): The optional request payload if
        available.
    additional_headers (Optional[Mapping[str, str]]): The optional
        additional headers needed for the requested AWS API.

Returns:
    Mapping[str, str]: The AWS signed request dictionary object.
httpszInvalid AWS service URL/)hostcanonical_uricanonical_querystringmethodregionaws_security_credentialsrequest_payloadadditional_headersauthorization_header)Authorizationr   amz_dateurlr   headersdata)urllibparseurlparser   	posixpathnormpathpathhostnameschemer   InvalidResource#_generate_authentication_header_map_get_canonical_querystringqueryr   get_AWS_DATE_HEADERsession_token_AWS_SECURITY_TOKEN_HEADER)r   r!   r(   r   r"   r#   urinormalized_uri
header_mapr)   keysigned_requests               r   get_request_options!RequestSigner.get_request_options\   sA   4 052ll##C(  ..C++CHH56
 ||szzW4,,-FGG8(--4"<SYY"G$$%=+1	

 (^^,BCLL

 #(2z(BG$%%C-2GL & $11=2J2X2XG./!$7K%46"r   r   N)__name__
__module____qualname____firstlineno____doc__r   r@   __static_attributes__ r   r   r   r   L   s    
( Cr   r   c           	         [         R                  R                  U 5      n0 nU Hq  n[         R                  R                  USS9n/ X$'   X    H2  nX$   R	                  [         R                  R                  USS95        M4     X$   R                  5         Ms     [        UR                  5       5      nUR                  5         / nU H.  nX#    H#  nUR	                  SR                  X55      5        M%     M0     SR                  U5      $ )a   Generates the canonical query string given a raw query string.
Logic is based on
https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html

Args:
    query (str): The raw query string.

Returns:
    str: The canonical query string.
z-_.~)safez{}={}&)
r+   r,   parse_qsquoteappendsortlistkeysformatjoin)r6   querystringquerystring_encoded_mapr>   	quote_keyitemsorted_keysquerystring_encoded_pairss           r   r5   r5      s     ,,''.K LL&&s&8	-/*$D#.55""4f"5 % 	 *//1  .3356K "+0D%,,W^^C-FG 1  88-..r   c                     [         R                  " XR                  S5      [        R                  5      R                  5       $ )zCreates the HMAC-SHA256 hash of the provided message using the provided
key.

Args:
    key (str): The HMAC-SHA256 key to use.
    msg (str): The message to hash.

Returns:
    str: The computed hash bytes.
utf-8)hmacnewencodehashlibsha256digest)r>   msgs     r   _signrc      s+     88CG,gnn=DDFFr   c                     [        SU -   R                  S5      U5      n[        XB5      n[        XS5      n[        US5      nU$ )a  Calculates the signing key used to calculate the signature for
AWS Signature Version 4 based on:
https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html

Args:
    key (str): The AWS secret access key.
    date_stamp (str): The '%Y%m%d' date format.
    region_name (str): The AWS region.
    service_name (str): The AWS service name, eg. sts.

Returns:
    str: The signing key bytes.
AWS4r[   r
   )rc   r^   )r>   
date_stampr   service_namek_datek_region	k_service	k_signings           r   _get_signing_keyrl      sE     FSL((1:>FV)Hh-Ii0Ir   r   c           
      l   U R                  S5      S   n[        R                  " 5       n	U	R                  S5      n
U	R                  S5      n0 nU H  nX}   XR	                  5       '   M     UR
                  b  UR
                  U[        '   XS'   SU;  a  X[        '   Sn[        UR                  5       5      nUR                  5         U H  nSR                  XX   5      nM     S	R                  U5      n[        R                  " U=(       d    SR                  S
5      5      R!                  5       nSR                  UUUUUU5      nSR                  XU["        5      nSR                  [$        U
U[        R                  " UR                  S
5      5      R!                  5       5      n['        UR(                  XU5      n[*        R,                  " UUR                  S
5      [        R                  5      R!                  5       nSR                  [$        UR.                  UUU5      nSU0nSU;  a  U
US'   U$ )a?  Generates the authentication header map needed for generating the AWS
Signature Version 4 signed request.

Args:
    host (str): The AWS service URL hostname.
    canonical_uri (str): The AWS service URL path name.
    canonical_querystring (str): The AWS service URL query string.
    method (str): The HTTP method used to call this API.
    region (str): The AWS region.
    aws_security_credentials (AWSSecurityCredentials): The AWS security credentials.
    request_payload (Optional[str]): The optional request payload if
        available.
    additional_headers (Optional[Mapping[str, str]]): The optional
        additional headers needed for the requested AWS API.

Returns:
    Mapping[str, str]: The AWS authentication header dictionary object.
        This contains the x-amz-date and authorization header information.
.r   z%Y%m%dT%H%M%SZz%Y%m%dr   dater   z{}{}:{}
;r[   z{}
{}
{}
{}
{}
{}z{}/{}/{}/{}z{}
{}
{}
{}z3{} Credential={}/{}, SignedHeaders={}, Signature={}r$   r&   )splitr   utcnowstrftimelowerr9   r:   r8   rP   rQ   rO   rR   rS   r_   r`   r^   	hexdigest_AWS_REQUEST_TYPE_AWS_ALGORITHMrl   secret_access_keyr\   r]   access_key_id)r   r   r   r   r    r!   r"   r#   rg   current_timer&   rf   full_headersr>   canonical_headersheader_keyssigned_headerspayload_hashcanonical_requestcredential_scopestring_to_signsigning_key	signaturer$   authentication_headers                            r   r4   r4      s>   > ::c?1%L??$L$$%56H&&x0J L!$6$;YY[! "  --9 %22 	&	

  
 \!)1%& |((*+K'..L$5
  XXk*N>>?#8b"@"@"IJTTVL 177 %++L*;
 &,,(//89CCE	N # 22JK ^**73W^^ik 
 QWW .. 45IJ\!,4j)  r   c                   B    \ rS rSr% Sr\\S'   \\S'   Sr\\   \S'   Sr	g)AwsSecurityCredentialsi[  ay  A class that models AWS security credentials with an optional session token.

Attributes:
    access_key_id (str): The AWS security credentials access key id.
    secret_access_key (str): The AWS security credentials secret access key.
    session_token (Optional[str]): The optional AWS security credentials session token. This should be set when using temporary credentials.
ry   rx   Nr9   rH   )
rB   rC   rD   rE   rF   str__annotations__r9   r   rG   rH   r   r   r   r   [  s#     #'M8C='r   r   c                   `    \ rS rSrSr\R                  S 5       r\R                  S 5       rSr	g)AwsSecurityCredentialsSupplierij  a7  Base class for AWS security credential suppliers. This can be implemented with custom logic to retrieve
AWS security credentials to exchange for a Google Cloud access token. The AWS external account credential does
not cache the AWS security credentials, so caching logic should be added in the implementation.
c                     [        S5      e)a  Returns the AWS security credentials for the requested context.

.. warning: This is not cached by the calling Google credential, so caching logic should be implemented in the supplier.

Args:
    context (google.auth.externalaccount.SupplierContext): The context object
        containing information about the requested audience and subject token type.
    request (google.auth.transport.Request): The object used to make
        HTTP requests.

Raises:
    google.auth.exceptions.RefreshError: If an error is encountered during
        security credential retrieval logic.

Returns:
    AwsSecurityCredentials: The requested AWS security credentials.
r   NotImplementedErrorr   contextrequests      r   get_aws_security_credentials;AwsSecurityCredentialsSupplier.get_aws_security_credentialsp  s    & ""%%r   c                     [        S5      e)a  Returns the AWS region for the requested context.

Args:
    context (google.auth.externalaccount.SupplierContext): The context object
        containing information about the requested audience and subject token type.
    request (google.auth.transport.Request): The object used to make
        HTTP requests.

Raises:
    google.auth.exceptions.RefreshError: If an error is encountered during
        region retrieval logic.

Returns:
    str: The AWS region.
r   r   r   s      r   get_aws_region-AwsSecurityCredentialsSupplier.get_aws_region  s    " ""%%r   rH   N)
rB   rC   rD   rE   rF   abcabstractmethodr   r   rG   rH   r   r   r   r   j  s;    
 	& &( 	& &r   r   )	metaclassc                       \ rS rSrSrS r\R                  " \5      S 5       r	\R                  " \5      S 5       r
S rS rS rS	rg
)&_DefaultAwsSecurityCredentialsSupplieri  zDefault implementation of AWS security credentials supplier. Supports retrieving
credentials and region via EC2 metadata endpoints and environment variables.
c                     UR                  S5      U l        UR                  S5      U l        UR                  S5      U l        g )N
region_urlr(   imdsv2_session_token_url)r7   _region_url_security_credentials_url_imdsv2_session_token_url)r   credential_sources     r   r   /_DefaultAwsSecurityCredentialsSupplier.__init__  s>    ,00>):)>)>u)E&):)>)>&*
&r   c                     [         R                  R                  [        R                  5      n[         R                  R                  [        R
                  5      n[         R                  R                  [        R                  5      nU(       a  U(       a  [        X4U5      $ U R                  U5      nU R                  X&5      nU R                  X'U5      n[        UR                  S5      UR                  S5      UR                  S5      5      $ )NAccessKeyIdSecretAccessKeyToken)osenvironr7   r   AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYAWS_SESSION_TOKENr   _get_imdsv2_session_token_get_metadata_role_name"_get_metadata_security_credentials)	r   r   r   env_aws_access_key_idenv_aws_secret_access_keyenv_aws_session_tokenimdsv2_session_token	role_namecredentialss	            r   r   C_DefaultAwsSecurityCredentialsSupplier.get_aws_security_credentials  s    
 !#

/?/Q/Q R$&JJNN22%
! !#

/?/Q/Q R %>)%BW   $==gF00O	 == 4
 &OOM*OO-.OOG$
 	
r   c                    [         R                  R                  [        R                  5      nUb  U$ [         R                  R                  [        R
                  5      nUb  U$ U R                  (       d  [        R                  " S5      eS nU R                  U5      nUb  SU0nU" U R                  SUS9n[        UR                  S5      (       a  UR                  R                  S5      OUR                  nUR                  [        R                  :w  a%  [        R                  " SR!                  U5      5      eUS S $ )	NzUnable to determine AWS regionX-aws-ec2-metadata-tokenGETr'   decoder[   z!Unable to retrieve AWS region: {})r   r   r7   r   
AWS_REGIONAWS_DEFAULT_REGIONr   r   RefreshErrorr   hasattrr*   r   statushttp_clientOKrR   )r   r   r   env_aws_regionr)   r   responseresponse_bodys           r   r   5_DefaultAwsSecurityCredentialsSupplier.get_aws_region  s   
 (8(C(CD%!!(8(K(KL%!!))*JKK#==gF+13GHGt//wO
 x}}h// MM  ) 	 ??knn,))3::=I  Sb!!r   c                 
   Ub  U R                   bs  S[        0nU" U R                   SUS9nUR                  [        R                  :w  a/  [
        R                  " SR                  UR                  5      5      eUR                  $ g )Nz$X-aws-ec2-metadata-token-ttl-secondsPUTr'   z(Unable to retrieve AWS Session Token: {})	r   !_IMDSV2_SESSION_TOKEN_TTL_SECONDSr   r   r   r   r   rR   r*   )r   r   r)   imdsv2_session_token_responses       r   r   @_DefaultAwsSecurityCredentialsSupplier._get_imdsv2_session_token  s    4#A#A#M68YG -4225'-) -33{~~E -->EE5::  1555r   c                    SS0nUb  X4S'   U" SR                  U R                  U5      SUS9n[        UR                  S5      (       a  UR                  R	                  S5      OUR                  nUR
                  [        R                  :w  a%  [        R                  " S	R                  U5      5      e[        R                  " U5      nU$ )
a  Retrieves the AWS security credentials required for signing AWS
requests from the AWS metadata server.

Args:
    request (google.auth.transport.Request): A callable used to make
        HTTP requests.
    role_name (str): The AWS role name required by the AWS metadata
        server security_credentials endpoint in order to return the
        credentials.
    imdsv2_session_token (str): The AWS IMDSv2 session token to be added as a
        header in the requests to AWS metadata endpoint.

Returns:
    Mapping[str, str]: The AWS metadata server security credentials
        response.

Raises:
    google.auth.exceptions.RefreshError: If an error occurs while
        retrieving the AWS security credentials.
zContent-Typezapplication/jsonr   z{}/{}r   r'   r   r[   z/Unable to retrieve AWS security credentials: {})rR   r   r   r*   r   r   r   r   r   r   jsonloads)r   r   r   r   r)   r   r   credentials_responses           r   r   I_DefaultAwsSecurityCredentialsSupplier._get_metadata_security_credentials  s    . "#56+2F./t==yI
 x}}h// MM  ) 	 ??knn,))AHHW   $zz-8##r   c                    U R                   c  [        R                  " S5      eSnUb  SU0nU" U R                   SUS9n[        UR                  S5      (       a  UR                  R                  S5      OUR                  nUR                  [        R                  :w  a%  [        R                  " SR                  U5      5      eU$ )	a  Retrieves the AWS role currently attached to the current AWS
workload by querying the AWS metadata server. This is needed for the
AWS metadata server security credentials endpoint in order to retrieve
the AWS security credentials needed to sign requests to AWS APIs.

Args:
    request (google.auth.transport.Request): A callable used to make
        HTTP requests.
    imdsv2_session_token (str): The AWS IMDSv2 session token to be added as a
        header in the requests to AWS metadata endpoint.

Returns:
    str: The AWS role name.

Raises:
    google.auth.exceptions.RefreshError: If an error occurs while
        retrieving the AWS role name.
NzIUnable to determine the AWS metadata server security credentials endpointr   r   r'   r   r[   z#Unable to retrieve AWS role name {})
r   r   r   r   r*   r   r   r   r   rR   )r   r   r   r)   r   r   s         r   r   >_DefaultAwsSecurityCredentialsSupplier._get_metadata_role_name0  s    & ))1))[  +13GHG..ug
 x}}h// MM  ) 	 ??knn,))5<<]K  r   )r   r   r   N)rB   rC   rD   rE   rF   r   r   copy_docstringr   r   r   r   r   r   rG   rH   r   r   r   r     s]    
 ;<
 =
: ;<$" =$"L*/$b,r   r   c                      ^  \ rS rSrSr\R                  SS4U 4S jjrS rU 4S jr	S r
U 4S jr\U 4S	 j5       r\U 4S
 j5       rSrU =r$ )Credentialsi_  zAWS external account credentials.
This is used to exchange serialized AWS signature v4 signed requests to
AWS STS GetCallerIdentity service for Google access tokens.
Nc                   > [         [        U ]
  " UUUUUS.UD6  Uc  Uc  [        R                  " S5      eUb  Ub  [        R                  " S5      eU(       a  XPl        [        U l        OUR                  S5      =(       d    Sn[        U5      U l        UR                  S5      U l        [        R                  " SU5      n	U	(       a  U	R                  5       u  pOS	u  pU
S
:w  d  U R                  c  [        R                  " S5      eUb  [        U5      S:w  a%  [        R                  " SR                  U5      5      eXl        SU l        g)u  Instantiates an AWS workload external account credentials object.

Args:
    audience (str): The STS audience field.
    subject_token_type (str): The subject token type based on the Oauth2.0 token exchange spec.
        Expected values include::

            “urn:ietf:params:aws:token-type:aws4_request”

    token_url (Optional [str]): The STS endpoint URL. If not provided, will default to "https://sts.googleapis.com/v1/token".
    credential_source (Optional [Mapping]): The credential source dictionary used
        to provide instructions on how to retrieve external credential to be exchanged for Google access tokens.
        Either a credential source or an AWS security credentials supplier must be provided.

        Example credential_source for AWS credential::

            {
                "environment_id": "aws1",
                "regional_cred_verification_url": "https://sts.{region}.amazonaws.com?Action=GetCallerIdentity&Version=2011-06-15",
                "region_url": "http://169.254.169.254/latest/meta-data/placement/availability-zone",
                "url": "http://169.254.169.254/latest/meta-data/iam/security-credentials",
                imdsv2_session_token_url": "http://169.254.169.254/latest/api/token"
            }

    aws_security_credentials_supplier (Optional [AwsSecurityCredentialsSupplier]): Optional AWS security credentials supplier.
        This will be called to supply valid AWS security credentails which will then
        be exchanged for Google access tokens. Either an AWS security credentials supplier
        or a credential source must be provided.
    args (List): Optional positional arguments passed into the underlying :meth:`~external_account.Credentials.__init__` method.
    kwargs (Mapping): Optional keyword arguments passed into the underlying :meth:`~external_account.Credentials.__init__` method.

Raises:
    google.auth.exceptions.RefreshError: If an error is encountered during
        access token retrieval logic.
    ValueError: For invalid parameters.

.. note:: Typically one of the helper constructors
    :meth:`from_file` or
    :meth:`from_info` are used instead of calling the constructor directly.
)audiencesubject_token_type	token_urlr   NzPA valid credential source or AWS security credentials supplier must be provided.z]AWS credential cannot have both a credential source and an AWS security credentials supplier.environment_idr   regional_cred_verification_urlz^(aws)([\d]+)$)NNawsz)No valid AWS 'credential_source' provided   z7aws version '{}' is not supported in the current build.)superr   r   r   InvalidValue"_aws_security_credentials_supplier1_DEFAULT_AWS_REGIONAL_CREDENTIAL_VERIFICATION_URL_cred_verification_urlr7   r   rematchgroupsr3   intrR   _target_resource_request_signer)r   r   r   r   r   !aws_security_credentials_supplierargskwargsr   matchesenv_idenv_version	__class__s               r   r   Credentials.__init__e  sr   d 	k4)
 	 1/		
 	
 $)J)R))b  )1=))o  -6W3 B ' /223CDJN6\!7D3 +<*?*?0+D'
 hh0.AG&-nn&6#&2#$"="="E 00?  $K(8A(= --MTT#  !)#r   c                    U R                   cE  U R                  R                  U R                  U5      U l        [        U R                  5      U l         U R                  R                  U R                  U5      nU R                   R                  UU R                  R                  SU R                  5      S5      nUR                  S5      nU R                  US'   0 nUR                  S5      US'   UR                  S5      US'   / US'   UR                  5        H  nUS   R                  XdU   S.5        M     [        R                  R!                  ["        R$                  " USS	S
95      $ )a  Retrieves the subject token using the credential_source object.
The subject token is a serialized `AWS GetCallerIdentity signed request`_.

The logic is summarized as:

Retrieve the AWS region from the AWS_REGION or AWS_DEFAULT_REGION
environment variable or from the AWS metadata server availability-zone
if not found in the environment variable.

Check AWS credentials in environment variables. If not found, retrieve
from the AWS metadata server security-credentials endpoint.

When retrieving AWS credentials from the metadata server
security-credentials endpoint, the AWS role needs to be determined by
calling the security-credentials endpoint without any argument. Then the
credentials can be retrieved via: security-credentials/role_name

Generate the signed request to AWS STS GetCallerIdentity action.

Inject x-goog-cloud-target-resource into header and serialize the
signed request. This will be the subject-token to pass to GCP STS.

.. _AWS GetCallerIdentity signed request:
    https://cloud.google.com/iam/docs/access-resources-aws#exchange-token

Args:
    request (google.auth.transport.Request): A callable used to make
        HTTP requests.
Returns:
    str: The retrieved subject token.
z{region}POSTr)   zx-goog-cloud-target-resourcer(   r   )r>   value),:T)
separators	sort_keys)r   r   r   _supplier_context_regionr   r   r@   r   replacer7   r   rQ   rN   r+   r,   rM   r   dumps)r   r   r!   request_optionsrequest_headersaws_signed_reqr>   s          r   retrieve_subject_token"Credentials.retrieve_subject_token  s]   F 'BBQQ&&DL $1#>D  $(#J#J#g#g""G$
 
 ..BB$''//
DLLI
" *--i8
 ;?:O:O67  / 3 3E :u#2#6#6x#@x $&y!"'')C9%,,c&:; *
 ||!!JJ~*M
 	
r   c                 j   > [         [        U ]  5       nSUS'   U R                  5       (       a  SUS'   U$ )Nr   sourceprogrammatic)r   r   _create_default_metrics_options_has_custom_supplier)r   metrics_optionsr   s     r   r  +Credentials._create_default_metrics_options&  s;    TRT$)!$$&&(6OH%r   c                     U R                   S L $ )N)_credential_source)r   s    r   r   Credentials._has_custom_supplier-  s    &&$..r   c                    > [         [        U ]  5       nU R                  5       (       a  UR	                  SU R
                  05        U$ )Nr   )r   r   _constructor_argsr  updater   )r   r   r   s     r   r  Credentials._constructor_args0  sD    [$9;$$&&KK79`9`
 r   c                 v   > UR                  S5      nUR                  SU05        [        [        U ]  " U40 UD6$ )aZ  Creates an AWS Credentials instance from parsed external account info.

Args:
    info (Mapping[str, str]): The AWS external account info in Google
        format.
    kwargs: Additional arguments to pass to the constructor.

Returns:
    google.auth.aws.Credentials: The constructed credentials.

Raises:
    ValueError: For invalid parameters.
r   )r7   r  r   r   	from_info)clsinfor   r   r   s       r   r  Credentials.from_info;  sG     -1HH/-
) 	02ST	
 [#0@@@r   c                 .   > [         [        U ]
  " U40 UD6$ )a  Creates an AWS Credentials instance from an external account json file.

Args:
    filename (str): The path to the AWS external account json file.
    kwargs: Additional arguments to pass to the constructor.

Returns:
    google.auth.aws.Credentials: The constructed credentials.
)r   r   	from_file)r  filenamer   r   s      r   r  Credentials.from_fileR  s     [#0DVDDr   )r   r   r   r   r   )rB   rC   rD   rE   rF   r	   _DEFAULT_TOKEN_URLr   r   r  r  r  classmethodr  r  rG   __classcell__)r   s   @r   r   r   _  sb     #55*.h$TU
n/	 A A, 
E 
Er   r   )(rF   r   dataclassesr   r_   r\   http.clientclientr   r   r   r.   r   typingr   r+   urllib.parser   google.authr   r   r   r	   rw   rv   r:   r8   r   r   objectr   r5   rc   rl   r4   r   ABCMetar   r   r   rH   r   r   <module>r#     s   4  !   !  	  	       ( " ( $ # 3   U 2 %* !SF Sl!/HG8 o!d ( ( (,&s{{ ,&^C-K CL~E".. ~Er   