HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/CyberPanel/lib64/python3.10/site-packages/boto3/__pycache__/crt.cpython-310.pyc
o

�h�@s�dZddlZddlZddlmZddlmZmZm	Z	m
Z
mZdada
e��ZdZdd�Zdd	�Zd
d�Zdd
�Zdd�ZGdd�d�Zdd�Zdd�Zdd�ZdS)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�boto3cCs|d|d�}tdi|��S)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_providerN�)r)�session�config�region_name�
cred_provider�create_crt_client_kwargsrr�?/usr/local/CyberPanel/lib/python3.10/site-packages/boto3/crt.py�_create_crt_client*s
�rcCst||dd��S)N)r�endpoint_url)r)r
rrrr�_create_crt_request_serializer8s
�rcKs(t|�}|��}tt||||�|||�S)zFCreate boto3 wrapper class to manage crt lock reference and S3 client.)r�to_crt_credentials_provider�CRTS3Clientr)r
rr�credentials�lock�kwargs�cred_wrapperrrrr�_create_crt_s3_client>s�rcCsLtt�}|dur
dSt�}|jj}|��}t||�}t|||||�}||fS)N)NN)r�PROCESS_LOCK_NAMEr�metar�_get_credentialsrr)�clientrrr
rr�
serializer�	s3_clientrrr�#_initialize_crt_transfer_primativesLs

�r#cCsXt� tdurt||�\}}|a|aWd�tSWd�tS1s%wYtS�N)�CLIENT_CREATION_LOCK�
CRT_S3_CLIENTr#�BOTOCORE_CRT_SERIALIZER)r rr!r"rrr�get_crt_s3_client_s�
��
��r(c@seZdZdZdd�ZdS)ra�
    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.
    cCs||_||_||_||_dSr$)�
crt_client�process_lockr	r)�selfr)r*r	rrrr�__init__xs
zCRTS3Client.__init__N)�__name__�
__module__�__qualname__�__doc__r,rrrrrns	rcCsF|durdS|��}|durdSt|��|j�}|jj|jk}|o"|S)z�
    Boto3 client must use same signing region and credentials
    as the CRT_S3_CLIENT singleton. Otherwise fallback to classic.
    NF)r�compare_identity�get_frozen_credentialsrrrr	)r �
crt_s3_client�boto3_creds�is_same_identity�is_same_regionrrr�is_crt_compatible_requests
�r7cCsLz|�}WntjjyYdSw|j|jko#|j|jko#|j|jk}|S)NF)	�botocore�
exceptions�NoCredentialsError�
access_key�
access_key_id�
secret_key�secret_access_key�token�
session_token)r4�crt_s3_creds�	crt_creds�is_matching_identityrrrr1�s
�
�
�r1cCs$t||�}t||�rt|jt�SdS)z8Create a CRTTransferManager for optimized data transfer.N)r(r7rr)r')r rr3rrr�create_crt_transfer_manager�s

�rD)r0�	threading�botocore.exceptionsr8�botocore.sessionr�s3transfer.crtrrrrrr&r'�Lockr%rrrrr#r(rr7r1rDrrrr�<module>s$