HEX
Server: LiteSpeed
System: Linux us-phx-web1284.main-hosting.eu 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: u300739242 (300739242)
PHP: 8.2.30
Disabled: system, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/alt/python311/lib/python3.11/site-packages/botocore/__pycache__/endpoint.cpython-311.pyc
�

/�;f9@�� �ddlZddlZddlZddlZddlZddlZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZddlmZddlmZdd	lmZdd
lmZmZmZeje��Ze
��ZdZdZd
�Z Gd�d��Z!Gd�d��Z"dS)�N)�parsers)�create_request_object)�HTTPClientError)�get_global_history_recorder)�first_non_none_response)�handle_checksum_body)�URLLib3Session)�
StreamingBody)�get_environ_proxies�is_valid_endpoint_url�is_valid_ipv6_endpoint_url�<�
c��|j|jd|jid�}|ddkr|j|d<nW|jr|j|d<nE|jr4|d�d��}t|j|��|d<n
|j|d<|S)a�Convert an HTTP response object to a request dict.

    This converts the requests library's HTTP response object to
    a dictionary.

    :type http_response: botocore.vendored.requests.model.Response
    :param http_response: The HTTP response from an AWS service request.

    :rtype: dict
    :return: A response dictionary which will contain the following keys:
        * headers (dict)
        * status_code (int)
        * body (string or file-like object)

    �operation_name)�headers�status_code�contextr�,�bodyrzcontent-length)	rr�name�content�has_event_stream_output�raw�has_streaming_output�getr
)�
http_response�operation_model�
response_dict�lengths    �D/opt/alt/python311/lib/python3.11/site-packages/botocore/endpoint.py�convert_to_response_dictr"*s���"!�(�$�0��o�2�
���M��]�#�s�*�*� -� 5�
�f���	�	0�6� -� 1�
�f���	�	-�6��y�)�-�-�.>�?�?�� -�m�.?�� H� H�
�f��� -� 5�
�f����c��eZdZdZ		dd�Zd�Zd�Zd�Zdd�Zd�Z	d	�Z
d
�Zd�Zdd�Z
d
�Zd�Zd�Zd�Z		dd�Zd�ZdS)�Endpointa,
    Represents an endpoint for a particular service in a specific
    region.  Only an endpoint can make requests.

    :ivar service: The Service object that describes this endpoints
        service.
    :ivar host: The fully qualified endpoint hostname.
    :ivar session: The session object.
    Nc���||_||_||_tj��|_|�t
j��}||_||_	|j	�t��|_	dSdS�N)�_endpoint_prefix�_event_emitter�host�	threading�Lock�_lockr�ResponseParserFactory�_response_parser_factory�http_sessionr	)�selfr*�endpoint_prefix�
event_emitter�response_parser_factoryr0s      r!�__init__zEndpoint.__init__Xst��!0���+�����	��^�%�%��
�"�*�&-�&C�&E�&E�#�(?��%�(�����$� .� 0� 0�D����%�$r#c�&�|j�d|j�d�S)N�(�))r(r*�r1s r!�__repr__zEndpoint.__repr__ks���'�6�6�$�)�6�6�6�6r#c�8�|j���dSr')r0�closer9s r!r<zEndpoint.closens������!�!�!�!�!r#c�f�t�d||��|�||��S)Nz%Making request for %s with params: %s)�logger�debug�
_send_request)r1r�request_dicts   r!�make_requestzEndpoint.make_requestqs9�����3���	
�	
�	
�
�!�!�,��@�@�@r#c�J�t|��}|r|t|j|jg��|_|jj���}d�||j	���}|j
�|||j	���|�|��}|S)Nz&request-created.{service_id}.{op_name})�
service_id�op_name)�requestr)
r�anyrr�
stream_output�
service_modelrD�	hyphenize�formatrr)�emit�prepare_request)r1�paramsrrFrD�
event_name�prepared_requests       r!�create_requestzEndpoint.create_requestys���'��/�/���	�$'�#�8�#�;��%�%�G�!�)�6�A�K�K�M�M�J�A�H�H�%��/C�I���J�
��$�$���.�3�
%�
�
�
�
 �/�/��8�8���r#c��|���D]2\}}t|t��r|�d��||<�3dS)Nzutf-8)�items�
isinstance�str�encode)r1r�key�values    r!�_encode_headerszEndpoint._encode_headers�sO��!�-�-�/�/�	5�	5�J�C���%��%�%�
5�$�|�|�G�4�4�����	5�	5r#c�^�|�|j��|���Sr')rYr�prepare�r1rFs  r!rMzEndpoint.prepare_request�s(�����W�_�-�-�-���� � � r#c���tj���}tj�|d��}||z
}|tj|���z|z}|�d��S)Nz%a, %d %b %Y %H:%M:%S %Z)�secondsz%Y%m%dT%H%M%SZ)�datetime�utcnow�strptime�	timedelta�strftime)r1�response_received_timestamp�date_header�read_timeout�local_timestamp�date_conversion�estimated_skew�ttls        r!�_calculate_ttlzEndpoint._calculate_ttl�s~��#�+�2�2�4�4��"�+�4�4��3�
�
��)�+F�F���� ��6�6�6�
7��
�	�
�|�|�,�-�-�-r#c�L�|dj�d��}|�d��}|rj|sj	tj���}|�|||��|d<dS#t
$r t�dd���YdSwxYwdSdS)Nr�Date�has_streaming_inputrjz9Exception received when updating retries context with TTLT��exc_info)rrr_r`rk�	Exceptionr>r?)r1�retries_contextrf�success_response�response_date_headerrnrds       r!�_set_ttlzEndpoint._set_ttl�s���/��2�:�>�>�v�F�F��-�1�1�2G�H�H���	�(;�	�
�.6�.?�.F�.F�.H�.H�+�)-�)<�)<�/�(� �*�*���&�&�&��
�
�
�
����O�!��������
����	�	�	�	s�8A5�5&B�Bc���|�di��}||d<d|vr#ttj����|d<|r&|dj}|�|||��dSdS)N�retries�attemptz
invocation-id�
client_config)�
setdefaultrU�uuid�uuid4rfru)r1rrxrsrrrfs      r!�_update_retries_contextz Endpoint._update_retries_context�s���!�,�,�Y��;�;��%,��	�"��/�1�1�/2�4�:�<�<�/@�/@�O�O�,��	K�"�?�3�@�L��M�M�/�<�9I�J�J�J�J�J�	K�	Kr#c��d}|d}|�||��|�||��}|�|||��\}}|�|||||��ry|dz
}|�|||��|���|�||��}|�|||��\}}|�|||||���y|� d|dvr|dz
}||ddd<|�|�|S)N�r�ResponseMetadata�
RetryAttempts)r}rQ�
_get_response�_needs_retry�reset_stream)	r1rAr�attemptsrrFrs�	exception�
total_retriess	         r!r@zEndpoint._send_request�ss�����y�)���$�$�W�h�7�7�7��%�%�l�O�D�D��&*�&8�&8��_�g�'
�'
�#��)���������
�
�	�
��M�H��(�(��(�<L�M�M�M�

� � �"�"�"��)�)�,��H�H�G�*.�*<�*<���'�+�+�'��i�!��������
�
�	�(
�(�"�&6�q�&9�9�9�%�q�L�M��
�Q�� 2�3��
�� ��O�#�#r#c��|�|||��\}}dd||d�}|�|\}}||d<t||��|d<|jj���}	|jjd|	�d|j��fi|��||fS)N)r�parsed_responserr�r�rzresponse-received.�.)�_do_get_responser"rIrDrJr)rLr)
r1rFrrrsr��kwargs_to_emitrr�rDs
          r!r�zEndpoint._get_response�s���'+�&;�&;��_�g�'
�'
�#��)�"�#��"�	
�
���'�-=�*�M�?�0?�N�,�-�.F���/�/�N�?�+�%�2�=�G�G�I�I�
� ��� �D��D�D�o�.B�D�D�	
�	
��	
�	
�	
� ��*�*r#c	���	t�d|��t�d|j|j|j|j|jd���|j	j
���}d|�d|j��}|j
�||���}t|��}|�|�|��}nM#t"$r}d|fcYd}~Sd}~wt$$r*}t�dd�	��d|fcYd}~Sd}~wwxYwt'||��}	t)||	||��|	���}
|j|
d
<t�d|
��|jd}|j�|��}|�|	|j��}
|jd
kr|�|	|
||��t�d|
��||
fdfS)NzSending http request: %s�HTTP_REQUEST)�methodr�	streaming�urlrzbefore-send.r�)rFz-Exception received when sending HTTP request.Tror��
HTTP_RESPONSE�protocolr�PARSED_RESPONSE)r>r?�history_recorder�recordr�rrnr�rrIrDrJrr)rLr�_sendrrqr"r�copyr�metadatar/�
create_parser�parse�output_shaper�_add_modeled_error_fields)r1rFrrrDrO�	responsesr�er�http_response_record_dictr��parserr�s              r!r�zEndpoint._do_get_responsesh��	��L�L�3�W�=�=�=��#�#��%�n�&��!0�!D�"�;�#�L���	
�	
�	
�)�6�A�K�K�M�M�J�K�
�K�K�_�5I�K�K�J��+�0�0��W�0�M�M�I�3�I�>�>�M��$� $�
�
�7� 3� 3�
����	�	�	��!�9������������	�	�	��L�L�?�$�
�
�
�
��!�9�����������		����1��?�
�
�
�	�����		
�	
�	
�%2�$6�$6�$8�$8�!�
�0�	"��	
�	����1J�K�K�K�"�+�J�7���.�<�<�X�F�F�� �,�,��?�7�
�
���$��+�+��*�*�����	
�
�
�	��� 1�?�C�C�C���/��5�5s0�CC�
D�C�D�
D�%D
�D�
Dc��|�di���d��}|�dS|j}|�|��}|�dS|�||��}|�|��dS)N�Error�Code)rrI�shape_for_error_coder��update)	r1rr�rr��
error_coderI�error_shape�
modeled_parses	         r!r�z"Endpoint._add_modeled_error_fieldsFs���%�(�(��"�5�5�9�9�&�A�A�
����F�'�5�
�#�8�8��D�D�����F����]�K�@�@�
����}�-�-�-�-�-r#c	�"�|jj���}d|�d|j��}|j�|||||||���}t
|��}	|	�dSt�d|	��tj
|	��dS)Nzneeds-retry.r�)�response�endpoint�	operationr��caught_exceptionrAFz3Response received to retry, sleeping for %s secondsT)rIrDrJrr)rLrr>r?�time�sleep)
r1r�rrAr�r�rDrOr��handler_responses
          r!r�zEndpoint._needs_retryXs���%�2�=�G�G�I�I�
�G�J�G�G��1E�G�G�
��'�,�,����%��-�%�-�
�
�	�3�9�=�=���#��5�
�L�L�E� �
�
�
�
�J�'�(�(�(��4r#c�6�|j�|��Sr')r0�sendr\s  r!r�zEndpoint._sendxs��� �%�%�g�.�.�.r#)NNr')�__name__�
__module__�__qualname__�__doc__r5r:r<rBrQrYrMrkrur}r@r�r�r�r�r��r#r!r%r%Ms<��������!%��
1�1�1�1�&7�7�7�"�"�"�A�A�A� � � � �*5�5�5�!�!�!�
.�
.�
.����"K�K�K�K�'$�'$�'$�R+�+�+�8=6�=6�=6�~.�.�.�.��
����@/�/�/�/�/r#r%c	�:�eZdZd�Zddeeeddddf	d�Zd�Zd�Z	dS)�EndpointCreatorc��||_dSr')r))r1r3s  r!r5zEndpointCreator.__init__}s��+����r#Nc
	�R�t|��s!t|��std|z���|	�|�|��}	|j}
t
�d|
|��|||	|�|��||
||���}t||
|j	||���S)NzInvalid endpoint: %szSetting %s timeout as %s)�timeout�proxies�verify�max_pool_connections�socket_options�client_cert�proxies_config)r2r3r4r0)
rr
�
ValueError�_get_proxiesr2r>r?�_get_verify_valuer%r))r1rI�region_name�endpoint_urlr�r4r�r��http_session_clsr�r�r�r�r2r0s               r!�create_endpointzEndpointCreator.create_endpoint�s���%��
�
�	D�,�\�:�:�	D��3�l�B�C�C�C��?��'�'��5�5�G�'�7�����/��'�J�J�J�'�'����)�)�&�1�1�!5�)�#�)�
�
�
����+��-�$;�%�
�
�
�	
r#c� �t|��Sr')r)r1r�s  r!r�zEndpointCreator._get_proxies�s��#�3�'�'�'r#c�J�|�|Stj�dd��S)N�REQUESTS_CA_BUNDLET)�os�environr)r1r�s  r!r�z!EndpointCreator._get_verify_value�s(�����M��z�~�~�2�D�9�9�9r#)
r�r�r�r5�DEFAULT_TIMEOUT�MAX_POOL_CONNECTIONSr	r�r�r�r�r#r!r�r�|ss������,�,�,�� $��1�'�����)
�)
�)
�)
�V(�(�(�
:�:�:�:�:r#r�)#r_�loggingr�r+r�r{�botocorer�botocore.awsrequestr�botocore.exceptionsr�botocore.historyr�botocore.hooksr�botocore.httpchecksumr�botocore.httpsessionr	�botocore.responser
�botocore.utilsrrr
�	getLoggerr�r>r�r�r�r"r%r�r�r#r!�<module>r�s�����������	�	�	�	�������������������5�5�5�5�5�5�/�/�/�/�/�/�8�8�8�8�8�8�2�2�2�2�2�2�6�6�6�6�6�6�/�/�/�/�/�/�+�+�+�+�+�+�����������
��	�8�	$�	$��.�.�0�0������ � � �Fl/�l/�l/�l/�l/�l/�l/�l/�^	?:�?:�?:�?:�?:�?:�?:�?:�?:�?:r#