+
     IiV  c                   s   R t ^ RIt^ RIt^ RIt^ RIHt ^ RIHtH	t	H
t
HtHt ^ RIHt ^ RIHt ^ RIHt ]P&                  ! ]4      tRsRs]P0                  ! 4       tRt0 RmtR tR	 tR
 tR tR t  ! R R4      t!R t"R t#R t$R t%R# )a6  
This file contains private functionality for interacting with the AWS
Common Runtime library (awscrt) in boto3.

All code contained within this file is for internal usage within this
project and is not intended for external consumption. All interfaces
contained within are subject to abrupt breaking changes.
N)Session)BotocoreCRTCredentialsWrapperBotocoreCRTRequestSerializerCRTTransferManageracquire_crt_s3_process_lockcreate_s3_crt_client)TRANSFER_CONFIG_SUPPORTS_CRT)InvalidCrtTransferConfigError)CRT_TRANSFER_CLIENTZboto3c                s(    RVRRRV/p\        R/ VB # )zCreate a CRT S3 Client for file transfer.

Instantiating many of these may lead to degraded performance or
system resource exhaustion.
regionZuse_sslTZcrt_credentials_provider )r   )sessionconfigregion_namecred_providerZcreate_crt_client_kwargss   &&&& ./usr/lib/python3.14/site-packages/boto3/crt.py_create_crt_clientr   :   s,     	+4"M 
  ;":;;    c                 s"    \        V R VRR/4      # )r   Zendpoint_urlN)r   )r   r   s   &&r   _create_crt_request_serializerr   H   s    '-ndC r   c                sh    \        V4      pVP                  4       p\        \        WW'4      VVV4      # )zFCreate boto3 wrapper class to manage crt lock reference and S3 client.)r   Zto_crt_credentials_providerCRTS3Clientr   )r   r   r   credentialslockZkwargsZcred_wrapperr   s   &&&&&,  r   _create_crt_s3_clientr   N   s<     1=L <<>M7KG	 r   c                 s    \        \        4      pVf   R# \        4       pV P                  P                  pV P                  4       p\        W44      p\        W1WEV4      pWg3# )N)NN)r   PROCESS_LOCK_NAMEr    metar   _get_credentialsr   r   )clientr   r   r   r   r   
serializer	s3_clients   &&      r   #_initialize_crt_transfer_primativesr   \   sd    &'89D| iG++))K))+K/EJ%4I   r   c                 s    \         ;_uu_ 4        \        f   \        W4      w  r#VsVsR R R 4       \        #   + '       g   i     \        # ; iN)CLIENT_CREATION_LOCKCRT_S3_CLIENTr   BOTOCORE_CRT_SERIALIZER)r   r   r   r      &&  r   get_crt_s3_clientr#   o   sK     
	 $G%!J '1#%M 
  
	 s	   7A	c                   s*   a  ] tR t^~t o RtR tRtV tR# )r   ak  
This wrapper keeps track of our underlying CRT client, the lock used to
acquire it and the region we've used to instantiate the client.

Due to limitations in the existing CRT interfaces, we can only make calls
in a single region and does not support redirects. We track the region to
ensure we don't use the CRT client when a successful request cannot be made.
c                s6    Wn         W n        W0n        W@n        R # r   )
crt_clientprocess_lockr	   r   )Zselfr$   r%   r	   r   s   &&&&&r   __init__ZCRTS3Client.__init__   s    $(*r   )r   r$   r%   r	   N)__name__Z
__module__Z__qualname__Z__firstlineno____doc__r&   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r   r   r   ~   s     + +r   r   c                s    Vf   R# V P                  4       pVf   R# \        VP                  4       VP                  4      pV P                  P
                  VP                  8H  pT;'       d    T# )zz
Boto3 client must use same signing region and credentials
as the CRT_S3_CLIENT singleton. Otherwise fallback to classic.
F)r   compare_identityZget_frozen_credentialsr   r   r   r	   )r   crt_s3_clientboto3_credsZis_same_identityZis_same_regions   &&   r   is_crt_compatible_requestr,      sn    
 ))+K'**,m.I.I [[,,0D0DDN....r   c                 s    V! 4       pT P                  TP                  8H  ;'       d;    T P
                  TP                  8H  ;'       d    T P                  TP                  8H  pT#   \         P                  P                   d     R # i ; i)F)	botocoreZ
exceptionsZNoCredentialsErrorZ
access_keyZaccess_key_idZ
secret_keyZsecret_access_keyZtokenZsession_token)r+   Zcrt_s3_credsZ	crt_credsZis_matching_identityr"   r   r)   r)      s     N	
 	)"9"99 	9 	9""i&A&AA	9 	9!8!88 
   11 s   A& &B	B	c                 sb   V f   R # V P                   \        8w  d   R # . pV P                  P                  4        FC  pV P	                  V4      pV\
        9  g   K!  W0P                  Jg   K2  VP                  V4       KE  	  \        V4      ^ 8  d   \        RRP                  V4       R24      hR # )Nz`The following transfer config options are invalid when preferred_transfer_client is set to crt: z, Z`)preferred_transfer_clientr   ZDEFAULTSZkeysZget_deep_attr$_ALLOWED_CRT_TRANSFER_CONFIG_OPTIONSZUNSET_DEFAULTZappendZlenr   Zjoin)r   Zinvalid_crt_argsZparamZvals   &   r   _validate_crt_transfer_configr0      s    ~ ''+>>%%'""5)==///##E* ( q +=yy)*+1.
 	
 !r   c                s   \        W4      p\        W4      '       dd   RVP                  R\        /p\        '       d   \        V4       WR&   \        '       g   V'       d   \        P                  R4       \        R/ VB # R# )z8Create a CRTTransferManager for optimized data transfer.r*   Zcrt_request_serializerr   zfUsing TransferConfig with CRT client requires s3transfer >= 0.16.0, configured values will be ignored.Nr
   )	r#   r,   r$   r!   r   r0   loggerZwarningr   )r   r   r*   Zcrt_transfer_manager_kwargsr"   r   create_crt_transfer_managerr2      sv    %f5M 77]55$&='
# (')&14:1++NNK "@$?@@r   >   Zmax_concurrencyZmultipart_chunksizeZmultipart_thresholdZmax_request_concurrencyr.   )&r(   ZloggingZ	threadingZbotocore.exceptionsr-   Zbotocore.sessionr    Zs3transfer.crtr   r   r   r   r   Zboto3.compatr   Zboto3.exceptionsr   Zboto3.s3.constantsr   Z	getLoggerr'   r1   r    r!   ZLockr   r   r/   r   r   r   r   r#   r   r,   r)   r0   r2   r
   r   r   <module>r3      s       $  6 : 2			8	$   ~~'  ( $<!&+ +"/& 
0r   