ó
    õ]Ëg  ã                   ó²   • S r SSKrSSKrSSKJr  SSKJrJrJ	r	J
r
Jr  SqSq\R                  " 5       rSrS rS rS rS	 rS
 r " S S5      rS rS rS rg)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Úboto3c                 ó$   • USUS.n[        S0 UD6$ )z‡Create a CRT S3 Client for file transfer.

Instantiating many of these may lead to degraded performance or
system resource exhaustion.
T)ÚregionÚuse_sslÚcrt_credentials_provider© )r   )ÚsessionÚconfigÚregion_nameÚcred_providerÚcreate_crt_client_kwargss        Ú+/usr/lib/python3/dist-packages/boto3/crt.pyÚ_create_crt_clientr   *   s&   € ð ØØ$1ñ Ðô
  Ñ;Ð":Ñ;Ð;ó    c                 ó   • [        XS S.5      $ )N)r   Úendpoint_url)r   )r   r   s     r   Ú_create_crt_request_serializerr   8   s   € Ü'Ø¸dÑCóð r   c                 óh   • [        U5      nUR                  5       n[        [        XX'5      UUU5      $ )zFCreate boto3 wrapper class to manage crt lock reference and S3 client.)r   Úto_crt_credentials_providerÚCRTS3Clientr   )r   r   r   ÚcredentialsÚlockÚkwargsÚcred_wrapperr   s           r   Ú_create_crt_s3_clientr!   >   s<   € ô 1°Ó=€LØ ×<Ñ<Ó>€MÜÜ˜7¨KÓGØØØó	ð r   c                 ó¾   • [        [        5      nUc  g[        5       nU R                  R                  nU R                  5       n[        X45      n[        X1XEU5      nXg4$ )N)NN)r   ÚPROCESS_LOCK_NAMEr   Úmetar   Ú_get_credentialsr   r!   )Úclientr   r   r   r   r   Ú
serializerÚ	s3_clients           r   Ú#_initialize_crt_transfer_primativesr)   L   sa   € Ü&Ô'8Ó9€DØ�|ð ä‹i€GØ—+‘+×)Ñ)€KØ×)Ñ)Ó+€Kä/°ÓE€JÜ%Ø˜°4ó€Ið Ð Ð r   c                 óˆ   • [            [        c  [        X5      u  p#UqUqS S S 5        [        $ ! , (       d  f       [        $ = f©N)ÚCLIENT_CREATION_LOCKÚCRT_S3_CLIENTr)   ÚBOTOCORE_CRT_SERIALIZER)r&   r   r'   r(   s       r   Úget_crt_s3_clientr/   _   sH   € ö 
ÜÑ Ü$GØó%Ñ!ˆJð '1Ð#Ø%ˆM÷ 
ô Ð÷ 
Ô	ô Ðús	   ‡.®
Ac                   ó   • \ rS rSrSrS rSrg)r   én   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                 ó4   • Xl         X l        X0l        X@l        g r+   )Ú
crt_clientÚprocess_lockr   r   )Úselfr3   r4   r   r   s        r   Ú__init__ÚCRTS3Client.__init__x   s   € Ø$ŒØ(ÔØŒØ*Õr   )r   r3   r4   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r6   Ú__static_attributes__r   r   r   r   r   n   s   † ñõ+r   r   c                 óÖ   • Uc  gU R                  5       nUc  g[        UR                  5       UR                  5      nU R                  R
                  UR                  :H  nU=(       a    U$ )zz
Boto3 client must use same signing region and credentials
as the CRT_S3_CLIENT singleton. Otherwise fallback to classic.
F)r%   Úcompare_identityÚget_frozen_credentialsr   r$   r   r   )r&   Úcrt_s3_clientÚboto3_credsÚis_same_identityÚis_same_regions        r   Úis_crt_compatible_requestrE      sk   € ð
 ÑØà×)Ñ)Ó+€KØÑØä'Ø×*Ñ*Ó,¨m×.IÑ.IóÐð —[‘[×,Ñ,°×0DÑ0DÑD€NØ×.Ð.Ð.r   c                 ó  •  U" 5       nU R                  UR                  :H  =(       a9    U R
                  UR                  :H  =(       a    U R                  UR                  :H  nU$ ! [         R                  R                   a     gf = f)NF)	ÚbotocoreÚ
exceptionsÚNoCredentialsErrorÚ
access_keyÚaccess_key_idÚ
secret_keyÚsecret_access_keyÚtokenÚsession_token)rB   Úcrt_s3_credsÚ	crt_credsÚis_matching_identitys       r   r?   r?   ’   sƒ   € ðÙ “Nˆ	ð
 	×Ñ )×"9Ñ"9Ñ9÷ 	9Ø×"Ñ" i×&AÑ&AÑA÷	9à×Ñ ×!8Ñ!8Ñ8ð ð
  Ðøô ×Ñ×1Ñ1ó Ùðús   ‚A$ Á$BÂBc                 ón   • [        X5      n[        X5      (       a  [        UR                  [        5      $ g)z8Create a CRTTransferManager for optimized data transfer.N)r/   rE   r   r3   r.   )r&   r   rA   s      r   Úcreate_crt_transfer_managerrT       s5   € ä% fÓ5€MÜ  ×7Ñ7Ü!Ø×$Ñ$Ô&=ó
ð 	
ð r   )r<   Ú	threadingÚbotocore.exceptionsrG   Úbotocore.sessionr   Ús3transfer.crtr   r   r   r   r   r-   r.   ÚLockr,   r#   r   r   r!   r)   r/   r   rE   r?   rT   r   r   r   Ú<module>rZ      sq   ðñó ã Ý $÷õ ð €ØÐ à —~’~Ó'Ð ØÐ ò<òòò!ò&÷+ñ +ò"/ò& ór   