
    i%                     R   S 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J	r	  SSK
JrJrJr  SSKJr  SSKJr  SSKJrJrJrJrJrJrJrJrJrJrJrJrJrJ r   SS	K!J"r"  SS
K#J$r$J%r%  \RL                  " \'5      r(Sr)S0 0r* " S S5      r+ " S S\+5      r, " S S\-\5      r. " S S5      r/g)zResolves regions and endpoints.

This module implements endpoint resolution, including resolving endpoints for a
given service and region and resolving the available endpoints for a service
in a specific AWS partition.
    N)Enum)UNSIGNED
xform_name)AUTH_TYPE_MAPSHAS_CRTresolve_auth_scheme_preferenceCRT_SUPPORTED_AUTH_TYPES)EndpointProvider)EndpointProviderErrorEndpointVariantError!InvalidEndpointConfigurationErrorInvalidHostLabelErrorMissingDependencyExceptionNoRegionErrorParamValidationError$UnknownEndpointResolutionBuiltInNameUnknownRegionErrorUnknownSignatureVersionError*UnsupportedS3AccesspointConfigurationErrorUnsupportedS3ConfigurationErrorUnsupportedS3ControlArnError&UnsupportedS3ControlConfigurationError)register_feature_id)ensure_booleaninstance_cachez{service}.{region}.{dnsSuffix}	endpointsc                   4    \ rS rSrSrSS jrS r S	S jrSrg)
BaseEndpointResolver;   z3Resolves regions and endpoints. Must be subclassed.Nc                     [         e)a  Resolves an endpoint for a service and region combination.

:type service_name: string
:param service_name: Name of the service to resolve an endpoint for
    (e.g., s3)

:type region_name: string
:param region_name: Region/endpoint name to resolve (e.g., us-east-1)
    if no region is provided, the first found partition-wide endpoint
    will be used if available.

:rtype: dict
:return: Returns a dict containing the following keys:
    - partition: (string, required) Resolved partition name
    - endpointName: (string, required) Resolved endpoint name
    - hostname: (string, required) Hostname to use for this endpoint
    - sslCommonName: (string) sslCommonName to use for this endpoint.
    - credentialScope: (dict) Signature version 4 credential scope
      - region: (string) region name override when signing.
      - service: (string) service name override when signing.
    - signatureVersions: (list<string>) A list of possible signature
      versions, including s3, v4, v2, and s3v4
    - protocols: (list<string>) A list of supported protocols
      (e.g., http, https)
    - ...: Other keys may be included as well based on the metadata
NotImplementedError)selfservice_nameregion_names      M/home/kali/Scout2/scout2-env/lib/python3.13/site-packages/botocore/regions.pyconstruct_endpoint'BaseEndpointResolver.construct_endpoint>   s
    6 "!    c                     [         e)zLists the partitions available to the endpoint resolver.

:return: Returns a list of partition names (e.g., ["aws", "aws-cn"]).
r"   )r$   s    r'   get_available_partitions-BaseEndpointResolver.get_available_partitions[   s
    
 "!r*   c                     [         e)ar  Lists the endpoint names of a particular partition.

:type service_name: string
:param service_name: Name of a service to list endpoint for (e.g., s3)

:type partition_name: string
:param partition_name: Name of the partition to limit endpoints to.
    (e.g., aws for the public AWS endpoints, aws-cn for AWS China
    endpoints, aws-us-gov for AWS GovCloud (US) Endpoints, etc.

:type allow_non_regional: bool
:param allow_non_regional: Set to True to include endpoints that are
     not regional endpoints (e.g., s3-external-1,
     fips-us-gov-west-1, etc).
:return: Returns a list of endpoint names (e.g., ["us-east-1"]).
r"   )r$   r%   partition_nameallow_non_regionals       r'   get_available_endpoints,BaseEndpointResolver.get_available_endpointsb   s
    & "!r*    N)awsF)	__name__
__module____qualname____firstlineno____doc__r(   r,   r1   __static_attributes__r3   r*   r'   r   r   ;   s    =":" FK"r*   r   c                       \ rS rSrSrSS/rSS jrSS jrS r   SS	 jr	 SS
 jr
    SS jrS r SS jrS rS rS rS rS rS rS rSrg)EndpointResolverx   z7Resolves endpoints based on partition endpoint metadatazaws-isoz	aws-iso-bc                 >    SU;  a  [        S5      eXl        X l        g)z
:type endpoint_data: dict
:param endpoint_data: A dict of partition data.

:type uses_builtin_data: boolean
:param uses_builtin_data: Whether the endpoint data originates in the
    package's data directory.

partitionsz%Missing "partitions" in endpoint dataN)
ValueError_endpoint_datauses_builtin_data)r$   endpoint_datarC   s      r'   __init__EndpointResolver.__init__}   s$     },DEE+!2r*   c                 l    U R                   S    H!  nUS   U:w  a  M  US   nX;  a  M  XA   S   s  $    g )Nr@   	partitionservicesr   )rB   )r$   r%   r/   rH   rI   s        r'   get_service_endpoints_data+EndpointResolver.get_service_endpoints_data   sH    ,,\:I%7 ,H+)+66 ;r*   c                 ^    / nU R                   S    H  nUR                  US   5        M     U$ )Nr@   rH   )rB   append)r$   resultrH   s      r'   r,   )EndpointResolver.get_available_partitions   s2    ,,\:IMM)K01 ;r*   Nc                 P   / nU R                   S    H  nUS   U:w  a  M  US   nX;  a  M  Xq   S   nU Hi  n	XS   ;   n
U(       a7  U
(       a0  U R                  X   U5      nU(       a  UR                  U	5        MF  MH  U(       d	  U
(       d  MX  UR                  U	5        Mk     M     U$ )Nr@   rH   rI   r   regions)rB   _retrieve_variant_datarM   )r$   r%   r/   r0   endpoint_variant_tagsrN   rH   rI   service_endpointsendpoint_nameis_regional_endpointvariant_datas               r'   r1   (EndpointResolver.get_available_endpoints   s     ,,\:I%7 ,H+ ( 6{ C!2'4)8L'L$(-A#'#>#>)8:O$L $m4 $'+?+?MM-0 "3 ;$ r*   c                     U R                   S    HS  nUS   U:X  d  M  U(       a9  U R                  UR                  S5      U5      nU(       a  SU;   a  US   s  $ ML  MN  US   s  $    g )Nr@   rH   defaults	dnsSuffix)rB   rR   get)r$   r/   rS   rH   variants        r'   get_partition_dns_suffix)EndpointResolver.get_partition_dns_suffix   sx     ,,\:I%7("99!j13HG ;'#9&{33 $:w %[11 ; r*   c                 T   US:X  a  U(       a  Uc  SnUbA  S nU R                   S    H  nUS   U:X  d  M  UnM     Ub  U R                  UUUUUS5      nU$ g U R                   S    H?  nU(       a  US   U R                  ;   a  M  U R                  UUUUU5      nU(       d  M=  Us  $    g )Ns3z	us-east-1r@   rH   T)rB   _endpoint_for_partition!_UNSUPPORTED_DUALSTACK_PARTITIONS)	r$   r%   r&   r/   use_dualstack_endpointuse_fips_endpointvalid_partitionrH   rN   s	            r'   r(   #EndpointResolver.construct_endpoint   s     D &#%K%"O!00>	[)^;&/O ? *55# *%  ,,\:I%+&99: 11&!F v ;r*   c                 |    U R                   S    H   nU R                  X!5      (       d  M  US   s  $    [        USS9e)Nr@   rH   z,No partition found for provided region_name.)r&   	error_msg)rB   _region_matchr   )r$   r&   rH   s      r'   get_partition_for_region)EndpointResolver.get_partition_for_region   sH    ,,\:I!!)99 -- ; !#D
 	
r*   c                 P   US   nU(       a   XpR                   ;   a  SU S3n[        S/US9eUS   R                  U[        5      n	Uc  SU	;   a  U	S   nO
[	        5       eUUU	UUUS.n
X9S	   ;   a  U R
                  " S0 U
D6$ U R                  X5      (       d  U(       a  U	R                  S5      nU	R                  S
S5      nU(       a5  U(       d.  [        R                  SUUU5        XS'   U R
                  " S0 U
D6$ [        R                  SUU5        U R
                  " S0 U
D6$ g )NrH   z4Dualstack endpoints are currently not supported for z
 partition	dualstacktagsri   rI   partitionEndpoint)rH   r%   service_datarU   rd   re   r   isRegionalizedTz'Using partition endpoint for %s, %s: %srU   z*Creating a regex based endpoint for %s, %sr3   )	rc   r   r\   DEFAULT_SERVICE_DATAr   _resolverj   LOGdebug)r$   rH   r%   r&   rd   re   force_partitionr/   ri   rr   resolve_kwargspartition_endpointis_regionalizeds                r'   rb   (EndpointResolver._endpoint_for_partition   sb    #;/""H"HH&'z3  '[MYOO !,00.
 "l2*+>?#o% #(((&<!2
 {33==2>22 i55!-!1!12E!F*../?FO!/		= &	 3E/}}6~66II<
 ==2>22% :Ir*   c                 r    X!S   ;   a  gSU;   a(  [         R                  " US   5      R                  U5      $ g)NrQ   TregionRegexF)recompilematch)r$   rH   r&   s      r'   rj   EndpointResolver._region_matchA  s:    I..I%::i67==kJJr*   c                     UR                  S/ 5      nU H2  n[        US   5      [        U5      :X  d  M   UR                  5       nUs  $    g )Nvariantsrp   )r\   setcopy)r$   rD   rp   r   r]   rN   s         r'   rR   'EndpointResolver._retrieve_variant_dataH  sC     $$Z4G76?#s4y0   r*   c                 j    / nU(       a  UR                  S5        U(       a  UR                  S5        U$ )Nrn   fips)rM   )r$   rd   re   rp   s       r'   _create_tag_list!EndpointResolver._create_tag_listO  s*    !KK$KKr*   c                 v    0 nX#U4 H.  nU R                  Xa5      nU(       d  M  U R                  Xu5        M0     U$ r4   )rR   _merge_keys)r$   rp   rD   service_defaultspartition_defaultsrN   r   r]   s           r'   _resolve_variant!EndpointResolver._resolve_variantW  sD     &:LMH11(AGw  1 N r*   c                    UR                  S0 5      R                  U0 5      nUR                  S5      (       a  [        R                  SU5        UR                  S0 5      nUR                  S0 5      n	U R                  XV5      n
U
(       a;  U R	                  XX5      nU0 :X  a  SU SU 3n[        XS9eU R                  X{5        OUnSU;  a  US   US'   US	   US	'   XKS
'   U R                  X5        U R                  X5        U R                  UUS   UUUS   5      US'   SU;   a  U R                  UUS   UUUS   5      US'   U$ )Nr   
deprecatedz5Client is configured with the deprecated endpoint: %srZ   zEndpoint does not exist for z in region ro   r[   rH   endpointNamehostnamesslCommonName)r\   rv   warningr   r   r   r   _expand_template)r$   rH   r%   rr   rU   rd   re   rD   r   r   rp   rN   ri   s                r'   ru   EndpointResolver._resolvea  s    %((b9==2
 \**KKG
 (++J;&]]:r:$$%;O**%5F |2<. A!!.1  +JJ]3"F f$"+K"8F;'4{!.~ 	)2+4!22:;
z f$&*&;&;'{#'F?# r*   c                 0    U H  nX2;  d  M
  X   X#'   M     g r4   r3   )r$   	from_datarN   keys       r'   r   EndpointResolver._merge_keys  s    C 'n r*   c                 "    UR                  X4US9$ )N)serviceregionr[   )format)r$   rH   templater%   rU   r[   s         r'   r   !EndpointResolver._expand_template  s      )  
 	
r*   )rB   rC   )F)r5   )r5   FNr4   )NNFF)r6   r7   r8   r9   r:   rc   rE   rJ   r,   r1   r^   r(   rk   rb   rj   rR   r   r   ru   r   r   r;   r3   r*   r'   r=   r=   x   s    A)2K(@%37  ": 59$ $0d
  ?3B@D-

r*   r=   c                   L    \ rS rSrSrSrSrSrSrSr	Sr
S	rS
rSrSrSrSrSrSrg)EndpointResolverBuiltinsi  zAWS::RegionzAWS::UseFIPSzAWS::UseDualStackzAWS::STS::UseGlobalEndpointzAWS::S3::UseGlobalEndpointzAWS::S3::AcceleratezAWS::S3::ForcePathStylezAWS::S3::UseArnRegionz$AWS::S3::DisableS3ExpressSessionAuthzAWS::S3Control::UseArnRegionz'AWS::S3::DisableMultiRegionAccessPointszSDK::EndpointzAWS::Auth::AccountIdz AWS::Auth::AccountIdEndpointModer3   N)r6   r7   r8   r9   
AWS_REGIONAWS_USE_FIPSAWS_USE_DUALSTACKAWS_STS_USE_GLOBAL_ENDPOINTAWS_S3_USE_GLOBAL_ENDPOINTAWS_S3_ACCELERATEAWS_S3_FORCE_PATH_STYLEAWS_S3_USE_ARN_REGION#AWS_S3_DISABLE_EXPRESS_SESSION_AUTHAWS_S3CONTROL_USE_ARN_REGIONAWS_S3_DISABLE_MRAPSDK_ENDPOINT
ACCOUNT_IDACCOUNT_ID_ENDPOINT_MODEr;   r3   r*   r'   r   r     sd    J "L , #@ ">-7 4 	/ (
 $B C"L'JAr*   r   c                       \ rS rSrSr   SS jrS rS rS rS r	S	 r
S
 rS rS r\S 5       r\S 5       r\S 5       rS rS rS rS rS rS rSrg)EndpointRulesetResolveri  z5Resolves endpoints using a service's endpoint rulesetNc
                     [        UUS9U l        U R                  R                  R                  U l        X0l        X@l        XPl        X`l        Xpl	        Xl
        Xl        0 U l        g )N)ruleset_datapartition_data)r   	_providerruleset
parameters_param_definitions_service_model	_builtins_client_context_event_emitter_use_ssl_requested_auth_scheme_auth_scheme_preference_instance_cache)
r$   endpoint_ruleset_datar   service_modelbuiltinsclient_contextevent_emitteruse_sslrequested_auth_schemeauth_scheme_preferences
             r'   rE    EndpointRulesetResolver.__init__  s`     *.)
 #'.."8"8"C"C+!-+&;#'=$!r*   c           	      l   Uc  0 nUc  0 nU R                  XU5      n[        R                  SU5         U R                  R                  " S0 UD6n[        R                  SUR                  5        U R                  (       dE  UR                  R                  S5      (       a%  SU;  a  UR                  SUR                  SS  3S9nUR                  UR                  R                  5        VV	s0 s H
  u  pXS	   _M     sn	nS
9nU$ ! [
         a  nU R                  Xd5      nUc  e XveSnAff = fs  sn	nf )zAInvokes the provider with params defined in the service's rulesetNz-Calling endpoint provider with parameters: %szEndpoint provider result: %szhttps://Endpointzhttp://   )urlr   )headersr3   )_get_provider_paramsrv   rw   r   resolve_endpointr   #ruleset_error_to_botocore_exceptionr   r   
startswith_replacer   items)
r$   operation_model	call_argsrequest_contextprovider_paramsprovider_resultexbotocore_exceptionr   vals
             r'   r(   *EndpointRulesetResolver.construct_endpoint  sX    I" O33
 			;_	
	1"nn== !O 			0/2E2EF ##..z::/1-66o11!"567 7 O *22,;,C,C,I,I,K,KV,K 3 
 ; % 	1!%!I!I" ")(0	10s   D .D0

D-D((D-c                    0 nU R                  XU5      nU R                  R                  5        HZ  u  pgU R                  UUUS9nUc'  UR                  b  U R                  UR                  US9nUc  ME  XU'   U R                  Xh5        M\     U$ )aU  Resolve a value for each parameter defined in the service's ruleset

The resolution order for parameter values is:
1. Operation-specific static context values from the service definition
2. Operation-specific dynamic context values from API parameters
3. Client-specific context parameters
4. Built-in values such as region, FIPS usage, ...
)
param_namer   r   )builtin_namer   )_get_customized_builtinsr   r   _resolve_param_from_contextbuiltin_resolve_param_as_builtin_register_endpoint_feature_ids)	r$   r   r   r   r   customized_builtinsr   	param_def	param_vals	            r'   r   ,EndpointRulesetResolver._get_provider_params+  s      #;;
 &*%<%<%B%B%D!J88% /# 9 I
  Y%6%6%B ::!*!2!20 ; 	 $.7
+33JJ &E r*   c                     U R                  X5      nUb  U$ U R                  XU5      nUb  U$ U R                  XU5      nUb  U$ U R                  U5      $ r4   )&_resolve_param_as_static_context_param'_resolve_param_as_dynamic_context_param)_resolve_param_as_operation_context_param&_resolve_param_as_client_context_param)r$   r   r   r   staticdynamicoperation_context_paramss          r'   r   3EndpointRulesetResolver._resolve_param_from_contextM  s}     <<
 M>>
 N::Y 	!
 $/++:::FFr*   c                 F    U R                  U5      nUR                  U5      $ r4   )_get_static_context_paramsr\   )r$   r   r   static_ctx_paramss       r'   r   >EndpointRulesetResolver._resolve_param_as_static_context_paramc  s&     !;;OL $$Z00r*   c                 Z    U R                  U5      nX;   a  XA   nUR                  U5      $ g r4   )_get_dynamic_context_paramsr\   )r$   r   r   r   dynamic_ctx_paramsmember_names         r'   r   ?EndpointRulesetResolver._resolve_param_as_dynamic_context_parami  s7     "==oN+,8K==-- ,r*   c                 l    U R                  5       nX;   a  X!   nU R                  R                  U5      $ g r4   )_get_client_context_paramsr   r\   )r$   r   client_ctx_paramsclient_ctx_varnames       r'   r   >EndpointRulesetResolver._resolve_param_as_client_context_paramq  s=     ;;=*!2!>''++,>?? +r*   c                 `    UR                   nX;   a  XA   S   n[        R                  " XS5      $ g )Npath)operation_context_parametersjmespathsearch)r$   r   r   r   operation_ctx_paramsr  s         r'   r   AEndpointRulesetResolver._resolve_param_as_operation_context_paramw  s7      /KK-'3F;D??433 .r*   c                     U[         R                  R                  5       ;  a	  [        US9eUR	                  U5      n[        U5      (       a  U" 5       $ U$ )N)name)r   __members__valuesr   r\   callable)r$   r   r   r   s       r'   r   1EndpointRulesetResolver._resolve_param_as_builtin  sK    7CCJJLL6LII,,|,G9r*   c                 p    UR                    Vs0 s H  nUR                  UR                  _M     sn$ s  snf )z=Mapping of param names to static param value for an operation)static_context_parametersr  valuer$   r   params      r'   r   2EndpointRulesetResolver._get_static_context_params  s<    
 )BB
B JJ#B
 	
 
   !3c                 p    UR                    Vs0 s H  nUR                  UR                  _M     sn$ s  snf )z7Mapping of param names to member names for an operation)context_parametersr  r   r  s      r'   r   3EndpointRulesetResolver._get_dynamic_context_params  s>    
 );;
; JJ)));
 	
 
r  c                     U R                   R                   Vs0 s H#  nUR                  [        UR                  5      _M%     sn$ s  snf )z7Mapping of param names to client configuration variable)r   client_context_parametersr  r   )r$   r  s     r'   r  2EndpointRulesetResolver._get_client_context_params  sG    
 ,,FF
F JJ
5::..F
 	
 
s   *Ac                     U R                   R                  R                  5       n[        R                  " U R                  5      nU R
                  R                  SU 3UUUUS9  U$ )Nzbefore-endpoint-resolution.)r   modelparamscontext)r   
service_id	hyphenizer   r   r   emit)r$   r   r   r   r#  r   s         r'   r   0EndpointRulesetResolver._get_customized_builtins  sh     ((33==?
"ii7  )*6(!# 	! 	
 #"r*   c                 v  ^  [        U[        5      (       a  [        U5      S:X  a  [        S5      e[        R                  SSR                  U Vs/ s H  nSUR                  S5       S3PM     sn5      T R                  5        T R                  [        :X  a  S0 4$ U Vs/ s H  o"S   R                  S5      S	   PM     nnU Vs/ s H  n0 UEST R                  US   5      0EPM     nnT R                  b   [        U 4S jU 5       5      u  pTOT R                  bb  T R                  R                  S5      nU Vs0 s H*  nT R                  US   R                  S5      S	   5      U_M,     nn[        Xc5      nXu   nO [        S U 5       5      u  pT0 n
SU;   a	  US   U
S'   O/SU;   a)  [        US   5      S:  a  SR                  US   5      U
S'   SU;   a  U
R)                  US   S9  SU;   a  [+        US   5      U
S'   [        R                  SUS   UU
5        XZ4$ s  snf s  snf s  snf ! [         a    S
0 4s $ f = fs  snf ! [         ab    SnU Vs/ s H  o"S   PM	     Os  snf n	n[         (       d  [#        S U	 5       5      nU(       a	  [%        SS9e['        SR                  U	5      S9ef = f)a  Convert an Endpoint's authSchemes property to a signing_context dict

:type auth_schemes: list
:param auth_schemes: A list of dictionaries taken from the
    ``authSchemes`` property of an Endpoint object returned by
    ``EndpointProvider``.

:rtype: str, dict
:return: Tuple of auth type string (to be used in
    ``request_context['auth_type']``) and signing context dict (for use
    in ``request_context['signing']``).
r   z&auth_schemes must be a non-empty list.z_Selecting from endpoint provider's list of auth schemes: %s. User selected auth scheme is: "%s"z, "r  none#Nc              3      >#    U  H9  nTR                  TR                  US    5      (       d  M)  TR                  U4v   M;     g7fr  N)._does_botocore_authname_match_ruleset_authnamer   ).0sr$   s     r'   	<genexpr>FEndpointRulesetResolver.auth_schemes_to_signing_ctx.<locals>.<genexpr>  sB      $)JJ33QvY 5T00!4)s
   (AA,c              3   N   #    U  H  nUS    [         ;   d  M  US    U4v   M     g7fr-  )r   )r/  r0  s     r'   r1  r2    s-      $)yN2 #QvYN)s   %%Fc              3   4   #    U  H  nU[         ;   v   M     g 7fr4   r	   )r/  schemes     r'   r1  r2    s      +&7F "::&7s   zbThis operation requires an additional dependency. Use pip install botocore[crt] before proceeding.msg)signature_versionsigningRegionr   signingRegionSetsigningName)signing_namedisableDoubleEncodingz?Selected auth type "%s" as "%s" with signing context params: %s)
isinstancelistlen	TypeErrorrv   rw   joinr\   r   r   split_strip_sig_prefixnextStopIterationr   r   r   anyr   r   updater   )r$   auth_schemesr0  available_ruleset_namesr6  r  prefsauth_schemes_by_auth_typefixable_with_crtauth_type_optionssigning_contexts   `          r'   auth_schemes_to_signing_ctx3EndpointRulesetResolver.auth_schemes_to_signing_ctx  s9    ,--\1Ba1GDEE		1II\B\155=/+\BC''		
 &&(22: /;#
.:fIOOC $l 	  #

 '
& GvFvt55fVnEF& 	 
 &&2   $ $)$  f ))50066s;E &)%A &&qys';B'?@!C% & ) 2D /4F# $)$  6 f$(.(?OH%6)6,-.2,/HH-.-) F"""}0E"F"f,7E./8O34 			M6N		
 $$w C#

  !   Rx	 ) !  $) 8D$E1vY$E!$Ew'* +&7+ ($
 $4L 
 7*.))4E*F %sC   H$! H)$H.;H3 ?1II 3IIJ8I+*AJ8c                 <    UR                  S5      (       a  USS $ U$ )z6Normalize auth type names by removing any "sig" prefixsig   N)r   )r$   	auth_names     r'   rE  )EndpointRulesetResolver._strip_sig_prefix  s#     ) 4 4U ; ;y}JJr*   c                     U R                  U5      nUR                  S5      S   nUS:w  a  UR                  S5      (       a  USS nX!:H  $ )a  
Whether a valid string provided as signature_version parameter for
client construction refers to the same auth methods as a string
returned by the endpoint ruleset provider. This accounts for:

* The ruleset prefixes auth names with "sig"
* The s3 and s3control rulesets don't distinguish between v4[a] and
  s3v4[a] signers
* The v2, v3, and HMAC v1 based signers (s3, s3-*) are botocore legacy
  features and do not exist in the rulesets
* Only characters up to the first dash are considered

Example matches:
* v4, sigv4
* v4, v4
* s3v4, sigv4
* s3v7, sigv7 (hypothetical example)
* s3v4a, sigv4a
* s3v4-query, sigv4

Example mismatches:
* v4a, sigv4
* s3, sigv4
* s3-presign-post, sigv4
-r   ra      N)rE  rD  r   )r$   botonamersnames      r'   r.  FEndpointRulesetResolver._does_botocore_authname_match_ruleset_authname"  sS    4 ''/>>#&q)t 3 3D 9 9|H!!r*   c                    UR                   R                  S5      nUc  gUR                  S5      (       a   UR                  S5      S   n[        US9$ U R                  R                  nUS:X  a  US:X  d  US	:X  a	  [        US
9$ UR                  S5      (       dn  UR                  S5      (       dX  UR                  S5      (       dB  UR                  S5      (       d,  UR                  S5      (       d  UR                  S5      (       a	  [        US
9$ UR                  5       R                  S5      (       a	  [        US9$ US:X  at  UR                  S5      (       a  UR                  S5      n[        XcS9$ UR                  S5      (       d  UR                  S5      (       a	  [        US
9$ US:X  a	  [        US9$ US:X  a.  UR                  S5      (       a	  [        US
9$ US:X  a	  [        US
9$ g! [         a    Un GNf = f)ztAttempts to translate ruleset errors to pre-existing botocore
exception types by string matching exception strings.
r8  NzInvalid region in ARN: `   )labelra   z/S3 Object Lambda does not support S3 Acceleratez#Accelerate cannot be used with FIPSr7  zS3 Outposts does not supportzS3 MRAP does not supportz!S3 Object Lambda does not supportzAccess Points do not supportzInvalid configuration:z#Client was configured for partitionzinvalid arn:)report	s3controlzInvalid ARN:Bucket)arnr8  z!AccountId is required but not seteventszUInvalid Configuration: FIPS is not supported with EventBridge multi-region endpoints.z&EndpointId must be a valid host label.)kwargsr\   r   rD  
IndexErrorr   r   r%   r   r   lowerr   r   r   r   )r$   ruleset_exceptionr!  r8  ra  r%   re  s          r'   r   ;EndpointRulesetResolver.ruleset_error_to_botocore_exceptionB  s     &&**51;>>344		#q) )u55**774HH??63??=>>>>"<==>>"EFF>>"@AA>>":;;>>"GHHAcJJyy{%%n55+377;&~~n--jj*3EE~~6773>>5< < >#FF99+3778#~~6  9SAA>>8SAAQ  s   G. .G>=G>c                 n    US:X  a  [        SUR                  5        35        g US:X  a  [        S5        g g )NAccountIdEndpointModeACCOUNT_ID_MODE_	AccountIdRESOLVED_ACCOUNT_ID)r   upper)r$   r   r   s      r'   r   6EndpointRulesetResolver._register_endpoint_feature_idsy  s9    00"29??3D2E FG;& 56 'r*   )
r   r   r   r   r   r   r   r   r   r   )TNN)r6   r7   r8   r9   r:   rE   r(   r   r   r   r   r   r   r   r   r   r   r  r   rQ  rE  r.  r   r   r;   r3   r*   r'   r   r     s    ? "#"44l DG,1.@4 
 
 
 
 
 
#n%`K"@5n7r*   r   )0r:   r   loggingr   enumr   r  botocorer   r   botocore.authr   r   r   botocore.crtr
   botocore.endpoint_providerr   botocore.exceptionsr   r   r   r   r   r   r   r   r   r   r   r   r   r   botocore.useragentr   botocore.utilsr   r   	getLoggerr6   rv   DEFAULT_URI_TEMPLATErt   r   r=   strr   r   r3   r*   r'   <module>r     s      	   ) 
 2 7     3 9!7 #R( :" :"zu
+ u
p	%BsD %BPe7 e7r*   