Current File : //proc/self/root/lib/python3/dist-packages/botocore/__pycache__/utils.cpython-312.pyc
�

P��e��	�V	�ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlmZddlmZddlmZddlmZmZddlZddlmZddlmZddlZddlZddl Zddl!m"Z"dd	l!m#Z#dd
l!m$Z$ddl!m%Z%ddl!m&Z&dd
l!m'Z'ddl!m(Z(ddl!m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6ddl7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z?m@Z@mAZAmBZBmCZCmDZDmEZEmFZFmGZGmHZHmIZImJZJmKZKmLZLmMZMmNZNej�eP�ZQdZRdZSdZTdZUdZVej�d�ZXeGe<e:e;fZYdgZZidd�dd�dd�dd�dd �d!d"�d#d$�d%d&�d'd(�d)d*�d+d,�d-d.�d/d0�d1d2�d3d4�d5d6�d7d8�id9d:�d;d<�d=d>�d?d@�dAdB�dCdD�dEdF�dGdH�dIdJ�dKdL�dMdN�dOdP�dQdR�dSdT�dUdV�dWdR�dXdY��idZd[�d\d]�d^d_�d`da�dbda�dcd8�ddd:�dedB�dfdg�dhdi�djdk�dldm�dndo�dpdq�drds�dtd]�dudv��idwdx�dydx�dzd{�d|dm�d}d~�dd��d�d��d�dg�d�d��d�d��d�d��d�do�d�d��d�d��d�d��d�d��d�d���d�d�d�dLd�d���Z[ej�d�ej����Z]d��Z^d��Z_d��Z`d��Zad��Zbd��Zcd��Zdd��Zed��Zf�dd��Zgd��ZhGd��d�ei�ZjGd��d�ei�ZkGd��d��ZlGd��d�el�ZmGd��d��ZnGd��d�el�Zo�dd��Zpd��Zqerfd��Zsd��ZteVfd��ZueVfd��Zvd��Zwd��Zxd��Zyd��Zz�dd��Z{�dd��Z|d��Z}d��Z~Gd��d��ZGd��d«Z�dÄZ�dĄZ�dńZ�dƄZ�dDŽZ�dȄZ�	�ddɄZ�	�ddʄZ�d˄Z�d̄Z�d̈́Z�d΄Z�dτZ��ddЄZ��ddфZ�d҄Z�dӄZ�GdԄdիZ�Gdքd�e��Z�Gd؄d٫Z�Gdڄd۫Z�Gd܄dݫZ�Gdބd�e��Z�Gd�d�Z�Gd�d�Z�Gd�d�Z�Gd�d�Z�Gd�d�Z�Gd�d�e��Z�Gd�d�Z�d�Z�d�Z�d�Z��dd�Z�d�Z�d�Z�d�Z�d��Z�d��Z�d��Z�d��Z�d��Z�Gd��d��Z�Gd��d��Z�Gd��d��Z��d�Z�G�d��d�Z��d�Z�d�d�iZ�idd�d!d"�d#d$��d�d�d'd(�d)d*�d+d,�d-d.�d/d0�d1d2�d3d4�d5d6�d=d>�dCdD�d?d@�dEdF�dGdH�idIdJ�dKdL�dMdN�dUdV�dWdR�dXdY�d^d_�d`da��d�d�dcd8�ddd:�dedB�dfdg��d�d	��d
�d��d�d
�dhdi��i�d�d�djdk�dldm��d�d�dndo��d�d�dpdq�drds�dudv�dtd]�dydx�dzd{��d�d�d�d��d�d��d�d���d�d��d�d�d�d��dd�d��d��Z�y(�N)�datetime)�
ip_address)�Path)�
getproxies�proxy_bypass)�tzutc)�LocationParseError)�HEX_PAT)�IPV4_PAT)�IPV6_ADDRZ_PAT)�IPV6_PAT)�LS32_PAT)�UNRESERVED_PAT)�ZONE_ID_PAT)�HAS_CRT�IPV4_RE�
IPV6_ADDRZ_RE�
MD5_AVAILABLE�UNSAFE_URL_CHARS�OrderedDict�get_md5�get_tzinfo_options�json�quote�urlparse�urlsplit�
urlunsplit�zip_longest)�ClientError�ConfigNotFound�ConnectionClosedError�ConnectTimeoutError�EndpointConnectionError�HTTPClientError�InvalidDNSNameError�!InvalidEndpointConfigurationError�InvalidExpressionError�InvalidHostLabelError�InvalidIMDSEndpointError�InvalidIMDSEndpointModeError�InvalidRegionError�MetadataRetrievalError�MissingDependencyException�ReadTimeoutError�SSOTokenLoadError�UnsupportedOutpostResourceError�*UnsupportedS3AccesspointConfigurationError�UnsupportedS3ArnError�UnsupportedS3ConfigurationError�UnsupportedS3ControlArnError�&UnsupportedS3ControlConfigurationError�zhttp://169.254.169.254/zhttp://[fd00:ec2::254]/)�ipv4�ipv6z-._~z-z0-9][a-z0-9\-]*[a-z0-9]�	dualstack�a4bzalexa-for-business�alexaforbusinesszapi.mediatailor�mediatailorzapi.pricing�pricingz
api.sagemaker�	sagemaker�
apigatewayzapi-gatewayzapplication-autoscalingzapplication-auto-scaling�
appstream2�	appstream�autoscalingzauto-scalingzautoscaling-planszauto-scaling-plans�cez
cost-explorer�
cloudhsmv2zcloudhsm-v2�cloudsearchdomainzcloudsearch-domainzcognito-idpzcognito-identity-provider�configzconfig-service�curzcost-and-usage-report-servicezdata.iotziot-data-planez
data.jobs.iotziot-jobs-data-planezdata.mediastorezmediastore-data�datapipelinez
data-pipeline�
devicefarmzdevice-farmzdevices.iot1clickziot-1click-devices-service�
directconnectzdirect-connect�	discoveryzapplication-discovery-service�dmszdatabase-migration-service�dszdirectory-service�dynamodbstreamszdynamodb-streams�elasticbeanstalkzelastic-beanstalk�elasticfilesystem�efs�elasticloadbalancingzelastic-load-balancing�elasticmapreduce�emr�elastictranscoderzelastic-transcoder�elb�elbv2zelastic-load-balancing-v2�email�seszentitlement.marketplacezmarketplace-entitlement-service�eszelasticsearch-service�events�eventbridgezcloudwatch-eventsziot-dataz
iot-jobs-dataziot1click-devicesziot1click-projectsziot-1click-projects�kinesisanalyticszkinesis-analytics�kinesisvideoz
kinesis-videoz
lex-modelszlex-model-building-servicezlex-runtimezlex-runtime-service�logszcloudwatch-logs�machinelearningzmachine-learningzmarketplace-entitlement�marketplacecommerceanalyticszmarketplace-commerce-analyticszmetering.marketplacezmarketplace-metering�meteringmarketplace�mghz
migration-hubz
models.lex�
monitoring�
cloudwatchzmturk-requester�mturkzopsworks-cm�
opsworkscmzprojects.iot1click�resourcegroupstaggingapizresource-groups-tagging-api�route53zroute-53�route53domainszroute-53-domainszruntime.lexzruntime.sagemakerzsagemaker-runtime�sdb�simpledb�secretsmanagerzsecrets-manager�serverlessrepo�serverlessapplicationrepository�servicecatalogzservice-catalog�sfnzstorage-gateway)�states�
stepfunctions�storagegatewayzstreams.dynamodb�taggingz^X-Amz-Checksum-([a-z0-9]*)$)�flagsc�n�t|t�r|St|t�r|j�dk(Sy)z~Ensures a boolean value if a string or boolean is provided

    For strings, the value for True/False is case insensitive
    �trueF)�
isinstance�bool�str�lower��vals �0/usr/lib/python3/dist-packages/botocore/utils.py�ensure_booleanr��s1��
�#�t���
�	�C��	��y�y�{�f�$�$��c��|jd�}|�.|j�}|tvr|td�}tdi|���|S|jd�ryy)z�Resolving IMDS endpoint mode to either IPv6 or IPv4.

    ec2_metadata_service_endpoint_mode takes precedence over imds_use_ipv6.
    �"ec2_metadata_service_endpoint_mode)�mode�valid_modes�
imds_use_ipv6r8r7�)�get_config_variabler|�METADATA_ENDPOINT_MODESr*)�session�
endpoint_mode�lendpoint_mode�error_msg_kwargss    r�resolve_imds_endpoint_moder��so��
�/�/�,��M�� �&�,�,�.���!8�8�%�6� ��/�B�1A�B�B���	�	$�	$�_�	5��r�c��t|d�xrM|jjdd�xr/|jjd�dk(xr|jdk(S)z�Determines if the provided shape is the special header type jsonvalue.

    :type shape: botocore.shape
    :param shape: Shape to be inspected for the jsonvalue trait.

    :return: True if this type is a jsonvalue, False otherwise
    :rtype: Bool
    �
serialization�	jsonvalueF�location�header�string)�hasattrr��get�	type_name)�shapes r�is_json_value_headerr��s_��	���'�	(����#�#�K��7�	(����#�#�J�/�8�;�	(�
�O�O�x�'�	r�c���|�yt|tjj�r||vS|j	�|j�D�cgc]}|j	���c}vScc}w)z&Case-insensitive check for header key.F)ry�botocore�
awsrequest�HeadersDictr|�keys)�header_name�headers�keys   r�
has_headerr��sZ�����	�G�X�0�0�<�<�	=��g�%�%�� � �"�g�l�l�n�&M�s�s�y�y�{�&M�M�M��&Ms�
A(c��|jjd|jjd|j��}|jdd�}|jdd�}t	j
dd|�}|S)zvReturns the module name for a service

    This is the value used in both the documentation and client class name
    �serviceAbbreviation�serviceFullName�Amazon��AWSz\W+)�metadatar��service_name�replace�re�sub)�
service_model�names  r�get_service_module_namer�su��
�!�!�%�%�����"�"��}�9�9�	
��D��<�<��"�%�D��<�<��r�"�D�
�6�6�&�"�d�#�D��Kr�c��|syt|�S)N�/)�remove_dot_segments��paths r�normalize_url_pathr�s�����t�$�$r�c� �|�|St|�S)zLReturns None if val is None, otherwise ensure value
    converted to boolean)r�r}s r�normalize_booleanr�s���{��
��c�"�"r�c��|sy|jd�}g}|D]5}|s�|dk7s�|dk(r|s�|j��%|j|��7|ddk(rd}nd}|ddk(r|rd}nd}|dj|�z|zS)Nr�r��.z..r���)�split�pop�append�join)�url�	input_url�output_list�x�first�lasts      rr�r�!s������	�	�#��I��K�
�&����c���D�y���O�O�%��"�"�1�%�
&��1�v��}�����
�2�w�#�~�+������3�8�8�K�(�(�4�/�/r�c�X�|r|dk(rt|���dD]}||vs�t|���y)Nr���
expression)�[�]�*)r')r��invalids  r�validate_jmespath_for_setr�<s=����s�*�$�
�;�;�"�@���j� �(�J�?�?�@r�c���|rt|�|jdd�}|dt|�dkDr|dnd}}|st|���|r||vri||<t	||||d��S|||<y)Nr�r6rr�r�F)�is_first)r�r��lenr'�set_value_from_jmespath)�sourcer��valuer��bits�current_key�	remainders       rr�r�Gs����!�*�-����C��#�D�!�!�W��T��Q��d�1�g�B��K��$�
�;�;���f�$�#%�F�;��&��;���E�E�
�	
�
 �F�;�r�c�R�|jdi�}|jd�dk(}|S)z9Determine if request is intended for an MRAP accesspoint.�s3_accesspoint�regionr��r�)�contextr��	is_globals   r�is_global_accesspointr�es.���[�[�!1�2�6�N��"�"�8�,��2�I��r�c��eZdZdZy)�_RetriesExceededErrorz@Internal exception used when the number of retries are exceeded.N)�__name__�
__module__�__qualname__�__doc__r�r�rr�r�ls��J�r�r�c��eZdZd�Zy)�BadIMDSRequestErrorc��||_y�N��request��selfr�s  r�__init__zBadIMDSRequestError.__init__ss	����r�N)r�r�r�r�r�r�rr�r�rs��r�r�c�x�eZdZeZdZdZededddfd�Z	d�Z
d�Zd�Zd	�Z
dd
�Zd�Zd�Zd
�Zd�Zd�Zd�Zdd�Zy)�IMDSFetcherzlatest/api/token�21600r6Nc��||_||_|�i}|j||�|_||_|�t
jj�}|jdd�j�dk(|_
|jd�|_||_tjj|jt!|j���|_y)N�AWS_EC2_METADATA_DISABLED�falserx�ec2_metadata_v1_disabled)�timeout�proxies)�_timeout�
_num_attempts�_select_base_url�	_base_url�_config�os�environ�copyr�r|�	_disabled�_imds_v1_disabled�_user_agentr��httpsession�URLLib3Session�get_environ_proxies�_session)r�r��num_attempts�base_url�env�
user_agentrFs       rr�zIMDSFetcher.__init__|s��� ��
�)����>��F��.�.�x��@�������;��*�*�/�/�#�C��G�G�/��9�?�?�A�V�K�	
��"(���,F�!G���%��� �,�,�;�;��M�M�'����7�<�
��
r�c��|jSr�)r��r�s r�get_base_urlzIMDSFetcher.get_base_url�s���~�~�r�c�,�|�i}|jd�dk(}|jd�}|r|rtjd�d}|tk7r|}n|r|}n|rt}nt}tjd|z�t
|�st|���|S)Nr�r8�ec2_metadata_service_endpointzFCustom endpoint and IMDS_USE_IPV6 are both set. Using custom endpoint.zIMDS ENDPOINT: %s)�endpoint)r��logger�warning�METADATA_BASE_URL�METADATA_BASE_URL_IPv6�debug�is_valid_urir))r�rrF�
requires_ipv6�custom_metadata_endpoint�chosen_base_urls      rr�zIMDSFetcher._select_base_url�s����>��F�
�J�J�;�<��F�	�$*�:�:�.M�#N� ��5��N�N�X�
����(�(�&�O�
%�6�O�
�4�O�/�O����(�?�:�;��O�,�*�O�D�D��r�c�|�d}|jr|jjd�sd}|j�|�|��S)Nr�r�)r��endswith)r�r��seps   r�_construct_urlzIMDSFetcher._construct_url�s<�����>�>�$�.�.�"9�"9�#�">��C��.�.�!�#��t�f�-�-r�c���|j�|j|j�}d|ji}|j	|�t
jjd||��}t|j�D]r}	|jj|j��}|jdk(r|jcS|jdvry|jdvrt|���ty#t $rYyt"$r#}t$j'd||d�	�Yd}~��d}~wt($r<}t+|j,j/d
�t0�r
t3||����d}~wwxYw)Nz$x-aws-ec2-metadata-token-ttl-seconds�PUT��methodr�r���)i�i�i�)i��OCaught retryable HTTP exception while making metadata service request to %s: %sT��exc_info�error)rr$)�_assert_enabledr�_TOKEN_PATH�
_TOKEN_TTL�_add_user_agentr�r��
AWSRequest�ranger�r�send�prepare�status_code�textr�r.�RETRYABLE_HTTP_ERRORSrrr$ry�kwargsr�r	r))r�r�r�r��i�response�es       r�_fetch_metadata_tokenz!IMDSFetcher._fetch_metadata_token�sb�������!�!�$�"2�"2�3��2�D�O�O�
��	
���W�%��%�%�0�0��c�7�1�
���t�)�)�*�	�A�
��=�=�-�-�g�o�o�.?�@���'�'�3�.�#�=�=�(��)�)�_�<���)�)�V�3�-�g�6�6�4�	�0��$�
��(�
����0���!�����#�
��a�h�h�l�l�7�3�5G�H�2�C�q�I�I���	
�s7�AC8�C8�C8�8	E2�E2�D*�*E2�67E-�-E2c��|j�|s|j�|�|j}|j|�}i}|�||d<|j	|�t|j�D]Z}	tjjd||��}|jj|j��}||�s|cS�\|j!��#t$r#}	tjd||	d��Yd}	~	��d}	~	wwxYw)aZMake a get request to the Instance Metadata Service.

        :type url_path: str
        :param url_path: The path component of the URL to make a get request.
            This arg is appended to the base_url that was provided in the
            initializer.

        :type retry_func: callable
        :param retry_func: A function that takes the response as an argument
             and determines if it needs to retry. By default empty and non
             200 OK responses are retried.

        :type token: str
        :param token: Metadata token to send along with GET requests to IMDS.
        Nzx-aws-ec2-metadata-token�GETrr!Tr")r%�_assert_v1_enabled�_default_retryrr(r*r�r�r�r)rr+r,r/rr�_RETRIES_EXCEEDED_ERROR_CLS)
r��url_path�
retry_func�tokenr�r�r1r�r2r3s
          r�_get_requestzIMDSFetcher._get_request�s�� 	
������#�#�%����,�,�J��!�!�(�+������27�G�.�/����W�%��t�)�)�*�	�A�
�"�-�-�8�8� �c�7�9��� �=�=�-�-�g�o�o�.?�@��!�(�+�#�O�,�
	� �.�.�0�0��)�
����0���!�����
�s�5AC�	D
�'D�D
c�<�|j�|j|d<yy)Nz
User-Agent)r)r�r�s  rr(zIMDSFetcher._add_user_agents#�����'�$(�$4�$4�G�L�!�(r�c�f�|jr%tjd�|j��y)Nz)Access to EC2 metadata has been disabled.)r�rrr9r
s rr%zIMDSFetcher._assert_enableds*���>�>��L�L�D�E��2�2�4�4�r�c�4�|jrtd���y)NzLUnable to retrieve token for use in IMDSv2 call and IMDSv1 has been disabled��	error_msg)r�r,r
s rr7zIMDSFetcher._assert_v1_enableds ���!�!�(�h��
�"r�c�J�|j|�xs|j|�Sr���_is_non_ok_response�	_is_empty�r�r2s  rr8zIMDSFetcher._default_retry�!���'�'��1�M�T�^�^�H�5M�Mr�c�L�|jdk7r|j|dd��yy)Nr znon-200T��log_bodyF)r-�_log_imds_responserGs  rrEzIMDSFetcher._is_non_ok_response"s+�����3�&��#�#�H�i�$�#�G��r�c�F�|js|j|dd��yy)Nzno bodyTrJF)�contentrLrGs  rrFzIMDSFetcher._is_empty(s&������#�#�H�i�$�#�G��r�c��d}||j|jg}|r |dz
}|j|j�t	j
|g|���y)NzHMetadata service returned %s response with status code of %s for url: %sz, content body: %s)r-r�r�rNrr)r�r2�
reason_to_logrK�	statement�logger_argss      rrLzIMDSFetcher._log_imds_response.sW��
1�	�%�h�&:�&:�H�L�L�I����-�-�I����x�/�/�0����Y�-��-r�r��F)r�r�r�r�r9r&r'� DEFAULT_METADATA_SERVICE_TIMEOUTrr�rr�rr4r=r(r%r7r8rErFrLr�r�rr�r�wsj��"7��$�K��J�1��"����
�8��>.�"�H*1�X5�5�
�N���	.r�r�c�L�eZdZdZgd�Zd�Zdd�Zdd�Zd�Zd�Z	d	�Z
d
�Zd�Zy)
�InstanceMetadataFetcherz*latest/meta-data/iam/security-credentials/)�AccessKeyId�SecretAccessKey�Token�
Expirationc���	|j�}|j|�}|j||�}|j|�r'||d|d|d|dd�}|j	|�|Sd|vrd|vrt
j
d|�iS#|j$r$t
j
d	|j�YiSt$r+}t
j
d
|j�Yd}~iSd}~wwxYw)NrWrXrYrZ)�	role_name�
access_key�
secret_keyr<�expiry_time�Code�Messagez7Error response received when retrievingcredentials: %s.�\Max number of attempts exceeded (%s) when attempting to retrieve data from metadata service.zBad IMDS request: %s)r4�
_get_iam_role�_get_credentials�_contains_all_credential_fields�_evaluate_expirationrrr9r�r�r�)r�r<r\�credentialsr3s     r�retrieve_iam_role_credentialsz5InstanceMetadataFetcher.retrieve_iam_role_credentialsCs��%	<��.�.�0�E��*�*�5�1�I��/�/�	�5�A�K��3�3�K�@�!*�"-�m�"<�"-�.?�"@�(��1�#.�|�#<����)�)�+�6�"�"��[�(�Y�+�-E��L�L�+�#��
�	���/�/�	��L�L�E��"�"�
��	�#�	<��L�L�/����;�;��	��	<�s$�A*B
�-B
�
/C2�?C2� C-�-C2Nc�f�|j|j|j|��jS�N�r:r;r<)r=�	_URL_PATH�_needs_retry_for_role_namer.)r�r<s  rrcz%InstanceMetadataFetcher._get_iam_rolels4��� � ��^�^��6�6��!�
��$�		r�c��|j|j|z|j|��}tj|j
�Srj)r=rl�_needs_retry_for_credentialsr�loadsr.)r�r\r<�rs    rrdz(InstanceMetadataFetcher._get_credentialsssD������^�^�i�/��8�8��
�
��
�z�z�!�&�&�!�!r�c��	tj|j�y#t$r|j	|d�YywxYw)NFzinvalid jsonT)rrpr.�
ValueErrorrLrGs  r�_is_invalid_jsonz(InstanceMetadataFetcher._is_invalid_json{s<��	��J�J�x�}�}�%����	��#�#�H�n�=��	�s�"�A�Ac�J�|j|�xs|j|�Sr�rDrGs  rrmz2InstanceMetadataFetcher._needs_retry_for_role_name�rHr�c�p�|j|�xs$|j|�xs|j|�Sr�)rErFrtrGs  rroz4InstanceMetadataFetcher._needs_retry_for_credentials�s9���$�$�X�.�
/��~�~�h�'�
/��$�$�X�.�	
r�c�^�|jD]}||vs�tjd|�yy)Nz3Retrieved credentials is missing required field: %sFT)�_REQUIRED_CREDENTIAL_FIELDSrr)r�rg�fields   rrez7InstanceMetadataFetcher._contains_all_credential_fields�s;���5�5�	�E��K�'����I����
	�r�c��|jd�}|�y	tjj|d�}|jjdd�}t	j
dd�}||z}tjj
�}tj|��}||z
}||k\r7||z}	|	jd�|d<tjd|dzd	�d
��yy#t$rtjd|d���YywxYw)Nr_z%Y-%m-%dT%H:%M:%SZ�ec2_credential_refresh_windowiX�x��secondsz�Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted again within the next �<z.0fz	 minutes.zUnable to parse expiry_time in )
r�r�strptimer��random�randint�utcnow�	timedelta�strftimer�inforsr)
r�rg�
expiration�refresh_interval�jitter�refresh_interval_with_jitter�current_time�refresh_offset�extension_time�new_times
          rrfz,InstanceMetadataFetcher._evaluate_expiration�s,�� �_�_�]�3�
����	�!�*�*�3�3��0��J� $�|�|�/�/�/�� ���^�^�C��-�F�+;�f�+D�(�#�,�,�3�3�5�L�%�/�/�4��N�(�.�8�N��~�-�'�.�8��-5�->�->�(�.��M�*���� �!=�R� ?��D�I�O��.���	��L�L�1�+�m�2L�1M�N�
�	�s�CC#�#$D
�	D
r�)
r�r�r�rlrxrhrcrdrtrmrorerfr�r�rrVrV:s9��<�I�#��'�R�"��N�
�� r�rVc�,�eZdZdd�Zd�Zd�Zd�Zd�Zy)�IMDSRegionProviderNc�R�||_|�tj}||_||_y)aUInitialize IMDSRegionProvider.
        :type session: :class:`botocore.session.Session`
        :param session: The session is needed to look up configuration for
            how to contact the instance metadata service. Specifically the
            whether or not it should use the IMDS region at all, and if so how
            to configure the timeout and number of attempts to reach the
            service.
        :type environ: None or dict
        :param environ: A dictionary of environment variables to use. If
            ``None`` is the argument then ``os.environ`` will be used by
            default.
        :type fecther: :class:`botocore.utils.InstanceMetadataRegionFetcher`
        :param fetcher: The class to actually handle the fetching of the region
            from the IMDS. If not provided a default one will be created.
        N)rr�r��_environ�_fetcher)r�r�r��fetchers    rr�zIMDSRegionProvider.__init__�s'��  ��
��?��j�j�G���
���
r�c�&�|j�}|S)z#Provide the region value from IMDS.)�_get_instance_metadata_region)r��instance_regions  r�providezIMDSRegionProvider.provide�s���<�<�>���r�c�F�|j�}|j�}|Sr�)�_get_fetcher�retrieve_region)r�r�r�s   rr�z0IMDSRegionProvider._get_instance_metadata_region�s#���#�#�%���(�(�*���
r�c�\�|j�|j�|_|jSr�)r��_create_fetcherr
s rr�zIMDSRegionProvider._get_fetcher�s&���=�=� � �0�0�2�D�M��}�}�r�c�l�|jjd�}|jjd�}|jjd�t|j�|jjd�d�}t|||j|jj�|��}|S)N�metadata_service_timeout�metadata_service_num_attemptsr
r�)r
r�r�)r�rrrrF)rr�r��InstanceMetadataRegionFetcherr�r)r��metadata_timeout�metadata_num_attempts�imds_configr�s     rr�z"IMDSRegionProvider._create_fetcher�s����=�=�<�<�&�
��!%�
�
� A� A�+�!
��.2�]�]�-N�-N�/�.�3M��
�
�3�)-�
�
�(I�(I�*�)�

��0�$�.��
�
��}�}�/�/�1��
���r��NN)r�r�r�r�r�r�r�r�r�r�rr�r��s�� �,�
�
�
r�r�c��eZdZdZd�Zd�Zy)r�z-latest/meta-data/placement/availability-zone/c��	|j�}|S#|j$r#tjd|j�YywxYw)aRGet the current region from the instance metadata service.
        :rvalue: str
        :returns: The region the current instance is running in or None
            if the instance metadata service cannot be contacted or does not
            give a valid response.
        :rtype: None or str
        :returns: Returns the region as a string if it is configured to use
            IMDS as a region source. Otherwise returns ``None``. It will also
            return ``None`` if it fails to get the region from IMDS due to
            exhausting its retries or not being able to connect.
        rbN)�_get_regionr9rrr�)r�r�s  rr�z-InstanceMetadataRegionFetcher.retrieve_region�sO��	��%�%�'�F��M���/�/�	��L�L�E��"�"�
�
�
	�s��/A�Ac��|j�}|j|j|j|��}|j}|dd}|S)Nrkr�)r4r=rlr8r.)r�r<r2�availability_zoner�s     rr�z)InstanceMetadataRegionFetcher._get_regionsU���*�*�,���$�$��^�^��*�*��%�
��
%�M�M��"�3�B�'���
r�N)r�r�r�rlr�r�r�r�rr�r��s��?�I��.	r�r�c�*�|D]�}t||t�r$||vr||vrt||||��1||||<�:t||t�r:|r8||vr+t||t�r||j	||��~||||<��||||<��y)z�Given two dict, merge the second dict into the first.

    The dicts can have arbitrary nesting.

    :param append_lists: If true, instead of clobbering a list with the new
        value, append all of the new values onto the original list.
    N)ry�dict�merge_dicts�list�extend)�dict1�dict2�append_listsr�s    rr�r�"s����$���e�C�j�$�'��e�|��u���E�#�J��c�
�3�"�3�Z��c�
���c�
�D�
)�l��e�|�
�5��:�t� <��c�
�!�!�%��*�-�"�3�Z��c�
��s��E�#�J�%$r�c�D�i}|D]}||||j�<�|S)zDCopies the given dictionary ensuring all keys are lowercase strings.)r|)�originalr�r�s   r�lowercase_dictr�?s/��
�D��*��$�S�M��S�Y�Y�[��*��Kr�c��	||�5}|j�}t|�cddd�S#1swYyxYw#t$r
t|���wxYw)Nr�)�read�parse_key_val_file_contents�OSErrorr )�filename�_open�f�contentss    r�parse_key_val_filer�GsS��,�
�8�_�	9���v�v�x�H�.�x�8�	9�	9�	9���,��(�+�+�,�s�;�/�	;�8�;�;�Ac��i}|j�D]A}d|vr�|jdd�\}}|j�}|j�}|||<�C|S)N�=r6)�
splitlinesr��strip)r��final�liner�r~s     rr�r�Pse��
�E��#�#�%����d�?���:�:�c�1�%���S��i�i�k���i�i�k����c�
�
��Lr�c	�J�g}t|d�r|j�}n|}|D]m\}}t|t�r0|D]*}|j	t|��dt|�����,�F|j	t|��dt|�����odj
|�S)afUrlencode a dict or list into a string.

    This is similar to urllib.urlencode except that:

    * It uses quote, and not quote_plus
    * It has a default list of safe chars that don't need
      to be encoded, which matches what AWS services expect.

    If any value in the input ``mapping`` is a list type,
    then each list element wil be serialized.  This is the equivalent
    to ``urlencode``'s ``doseq=True`` argument.

    This function should be preferred over the stdlib
    ``urlencode()`` function.

    :param mapping: Either a dict to urlencode or a list of
        ``(key, value)`` pairs.

    �itemsr��&)r�r�ryr�r��percent_encoder�)�mapping�safe�
encoded_pairs�pairsr�r��elements       r�percent_encode_sequencer�_s���(�M��w�� ��
�
������	�
��U��e�T�"� �
���$�$�%�c�*�+�1�^�G�-D�,E�F��
�

� � �!�#�&�'�q���)>�(?�@�
�	��8�8�M�"�"r�c��t|ttf�st|�}t|t�s|jd�}t	||��S)a�Urlencodes a string.

    Whereas percent_encode_sequence handles taking a dict/sequence and
    producing a percent encoded string, this function deals only with
    taking a string (not a dict/sequence) and percent encoding it.

    If given the binary type, will simply URL encode it. If given the
    text type, will produce the binary type by UTF-8 encoding the
    text. If given something else, will convert it to the text type
    first.
    �utf-8)r�)ry�bytesr{�encoder)�	input_strr�s  rr�r��sB���i�%���.��	�N�	��i��'��$�$�W�-�	����&�&r�c
��tjddddddt���}|j|��}|tj|��zS)a�Parse numerical epoch timestamps (seconds since 1970) into a
    ``datetime.datetime`` in UTC using ``datetime.timedelta``. This is intended
    as fallback when ``fromtimestamp`` raises ``OverflowError`` or ``OSError``.

    :type value: float or int
    :param value: The Unix timestamps as number.

    :type tzinfo: callable
    :param tzinfo: A ``datetime.tzinfo`` class or compatible callable.
    �r6r��tzinfor})rr�
astimezoner�)r�r��
epoch_zero�epoch_zero_localizeds    r�_epoch_seconds_to_datetimer��sK���"�"�4��A�q�!�Q�u�w�G�J�%�0�0���:���(�"4�"4�U�"C�C�Cr�c��t|ttf�r%tjj	||��S	tjj	t|�|��S#t
tf$rYnwxYw	tjj|dt�i��S#t
tf$r}t
d|�d|����d}~wwxYw)z.Parse timestamp with pluggable tzinfo options.�GMT)�tzinfoszInvalid timestamp "z": N)ry�int�floatr�
fromtimestamp�	TypeErrorrs�dateutil�parser�parser)r�r�r3s   r�_parse_timestamp_with_tzinfor��s����%�#�u��&�� � �.�.�u�f�h�?�?�	��$�$�2�2�5��<���J�J���:�&�	��	��>����$�$�U�U�E�G�4D�$�E�E���z�"�>��.�u�g�S���<�=�=��>�s)�-A+�+A=�<A=�*B,�,C�;C�Cc���t�}|D]}	t||�cS	t|�}	|D]}t||��cS	td|z��#ttf$r,}tjd|j|��Yd}~�zd}~wwxYw#ttf$r,}tjdj|��Yd}~��d}~wwxYw#ttf$rY��wxYw)z�Parse a timestamp into a datetime object.

    Supported formats:

        * iso8601
        * rfc822
        * epoch (value is an integer)

    This will return a ``datetime.datetime`` object.

    z2Unable to parse timestamp with "%s" timezone info.r"Nr�zHUnable to parse timestamp using fallback method with "%s" timezone info.z4Unable to calculate correct timezone offset for "%s")rr�r��
OverflowErrorrrr�r�r�r�rs�RuntimeError)r��tzinfo_optionsr�r3�
numeric_values     r�parse_timestampr��s��(�)�N� ���	�/��v�>�>����e��
�		�(�
P��1�-��O�O�
P��>��F����7��'�	��L�L�D�����
�
�
��	��(��'�	��L�L�!�����	
�
�
��	��

�z�"�
��
�sE�A�C
�B�B�B� "B�B�C
�"C�C
�
C�Cc���t|t�r|}nt|�}|j�|j	t���}|S|j
t��}|S)a�Converted the passed in value to a datetime object with tzinfo.

    This function can be used to normalize all timestamp inputs.  This
    function accepts a number of different types of inputs, but
    will always return a datetime.datetime object with time zone
    information.

    The input param ``value`` can be one of several types:

        * A datetime object (both naive and aware)
        * An integer representing the epoch time (can also be a string
          of the integer, i.e '0', instead of 0).  The epoch time is
          considered to be UTC.
        * An iso8601 formatted timestamp.  This does not need to be
          a complete timestamp, it can contain just the date portion
          without the time component.

    The returned value will be a datetime object that will have tzinfo.
    If no timezone info was provided in the input value, then UTC is
    assumed, not local time.

    r�)ry�_DatetimeClassr�r�r�rr�)r��datetime_objs  r�parse_to_aware_datetimer��sd��6�%��(���
'�u�-�����"�
$�+�+�5�7�+�;����$�.�.�u�w�7���r�c���tjddd�}|j�|�
t�}|j|��}|jd��|j	�z
|z
}|j�S)awCalculate the timestamp based on the given datetime instance.

    :type dt: datetime
    :param dt: A datetime object to be converted into timestamp
    :type default_timezone: tzinfo
    :param default_timezone: If it is provided as None, we treat it as tzutc().
                             But it is only used when dt is a naive datetime.
    :returns: The timestamp
    r�r6Nr�)rr�rr��	utcoffset�
total_seconds)�dt�default_timezone�epoch�ds    r�datetime2timestampr�sn��
���d�A�q�)�E�	�y�y���#�$�w��
�Z�Z�/�Z�
0��
�
�
�$�
��"�,�,�.�0�5�8�A��?�?��r�c���tj�}t�fd�d�D]}|j|��|r|j	�S|j�S)a�Calculate a sha256 checksum.

    This method will calculate the sha256 checksum of a file like
    object.  Note that this method will iterate through the entire
    file contents.  The caller is responsible for ensuring the proper
    starting position of the file and ``seek()``'ing the file back
    to its starting location if other consumers need to read from
    the file like object.

    :param body: Any file like object.  The file must be opened
        in binary mode such that a ``.read()`` call returns bytes.
    :param as_hex: If True, then the hex digest is returned.
        If False, then the digest (as binary bytes) is returned.

    :returns: The sha256 checksum

    c�&���jd�S�N��r�)�bodys�r�<lambda>z"calculate_sha256.<locals>.<lambda>@s���d�i�i��4�r�r�)�hashlib�sha256�iter�update�	hexdigest�digest)r��as_hex�checksum�chunks`   r�calculate_sha256r	-sS���$�~�~��H��4�c�:���������
��!�!�#�#���� � r�c����g}d�tj}t��fd�d�D]'}|j||�j	���)|s|d�j�St
|�dkDrbg}t|�D]A\}}|�)|j|||z�j	���1|j|��C|}t
|�dkDr�btj|d�jd�S)a\Calculate a tree hash checksum.

    For more information see:

    http://docs.aws.amazon.com/amazonglacier/latest/dev/checksum-calculations.html

    :param body: Any file like object.  This has the same constraints as
        the ``body`` param in calculate_sha256

    :rtype: str
    :returns: The hex version of the calculated tree hash

    r�c�&���j��Sr�r�)r��required_chunk_sizes��rr�z%calculate_tree_hash.<locals>.<lambda>Ys���d�i�i�(;�<�r�r�r6r�ascii)rrrr�rrr��	_in_pairs�binascii�hexlify�decode)r��chunksrr�
new_chunksr��secondrs`      @r�calculate_tree_hashrHs�����F�%��
�^�^�F��<�c�B�.���
�
�f�U�m�*�*�,�-�.���c�{�$�$�&�&�

�f�+��/��
�&�v�.�	)�M�E�6��!��!�!�&����"8�"?�"?�"A�B��!�!�%�(�	)����f�+��/����F�1�I�&�-�-�g�6�6r�c�0�t|�}t||�Sr�)rr)�iterable�shared_iters  rrris���x�.�K�
�{�K�0�0r�c��eZdZdZd�Zd�Zy)�CachedPropertyz�A read only property that caches the initially computed value.

    This descriptor will only call the provided ``fget`` function once.
    Subsequent access to this property will return the cached value.

    c��||_yr�)�_fget)r��fgets  rr�zCachedProperty.__init__�s	����
r�c�v�|�|S|j|�}||j|jj<|Sr�)r�__dict__r�)r��obj�cls�computed_values    r�__get__zCachedProperty.__get__�s7���;��K�!�Z�Z��_�N�0>�C�L�L����,�,�-�!�!r�N)r�r�r�r�r�r#r�r�rrrzs����"r�rc�8�eZdZdZd	d�Zd�Zd
d�Zd�Zd�Zd�Z	y)�ArgumentGeneratoraGenerate sample input based on a shape model.

    This class contains a ``generate_skeleton`` method that will take
    an input/output shape (created from ``botocore.model``) and generate
    a sample dictionary corresponding to the input/output shape.

    The specific values used are place holder values. For strings either an
    empty string or the member name can be used, for numbers 0 or 0.0 is used.
    The intended usage of this class is to generate the *shape* of the input
    structure.

    This can be useful for operations that have complex input shapes.
    This allows a user to just fill in the necessary data instead of
    worrying about the specific structure of the input arguments.

    Example usage::

        s = botocore.session.get_session()
        ddb = s.get_service_model('dynamodb')
        arg_gen = ArgumentGenerator()
        sample_input = arg_gen.generate_skeleton(
            ddb.operation_model('CreateTable').input_shape)
        print("Sample input for dynamodb.CreateTable: %s" % sample_input)

    c��||_yr�)�_use_member_names)r��use_member_namess  rr�zArgumentGenerator.__init__�s
��!1��r�c�*�g}|j||�S)z�Generate a sample input.

        :type shape: ``botocore.model.Shape``
        :param shape: The input shape.

        :return: The generated skeleton input corresponding to the
            provided input shape.

        )�_generate_skeleton)r�r��stacks   r�generate_skeletonz#ArgumentGenerator.generate_skeleton�s�����&�&�u�e�4�4r�c���|j|j�	|jdk(r"|j||�|j	�S|jdk(r"|j||�|j	�S|jdk(r"|j
||�|j	�S|jdk(rk|jr||j	�S|jr/tj|j�|j	�S	|j	�y|jdvr	|j	�y|jdvr	|j	�y	|jd
k(r	|j	�y|jdk(r*tjd
ddddd�|j	�S	|j	�y#|j	�wxYw)N�	structurer��mapr�r�)�integer�longr)r��doubleg�booleanT�	timestampr�r6)r�r�r��_generate_type_structurer��_generate_type_list�_generate_type_mapr'�enumr��choicer�r�r�r+r�s    rr*z$ArgumentGenerator._generate_skeleton�s���
���U�Z�Z� �	����+�-��4�4�U�E�B�(
�I�I�K�'���F�*��/�/��u�=�$
�I�I�K�#���E�)��.�.�u�e�<� 
�I�I�K����H�,��)�)��
�I�I�K��:�:�!�=�=����4�
�I�I�K��
�I�I�K����$7�7��
�I�I�K����$7�7��
�I�I�K����I�-��
�I�I�K����K�/��(�(��q�!�Q��1�=��I�I�K�0�
�I�I�K��E�I�I�K�s;� G� G�? G�0G�*G�*G�
G�*G�(G�G(c���|j|j�dkDriSt�}|jj	�D]\}}|j|||��||<�|S)Nr6)r�)�countr�r�membersr�r*)r�r�r+�skeleton�member_name�member_shapes      rr5z*ArgumentGenerator._generate_type_structure�sl���;�;�u�z�z�"�Q�&��I��=��).���)<�)<�)>�	�%�K��$(�$;�$;��e�+�%<�%�H�[�!�	��r�c��d}|jr|jj}|j|j||�gS)Nr�)r'�memberr�r*r:s    rr6z%ArgumentGenerator._generate_type_list�sA�����!�!��<�<�$�$�D��#�#�E�L�L�%��>�
�	
r�c��|j}|j}|jdk(sJ�td|j	||�fg�S)Nr��KeyName)r�r�r�rr*)r�r�r+�	key_shape�value_shapes     rr7z$ArgumentGenerator._generate_type_map�sO���I�I�	��k�k���"�"�h�.�.�.���D�3�3�K��G�H�
�
�	
r�NrS)r�)
r�r�r�r�r�r,r*r5r6r7r�r�rr%r%�s%���42�5��4�
�
r�r%c��tj|�rydt|�j�d�}t	j
|�duS)NFr�r�)r�intersectionr�hostnamer�match��endpoint_urlrIs  r�is_valid_ipv6_endpoint_urlrM�sC���$�$�\�2���8�L�)�2�2�3�1�5�H����x�(��4�4r�c�Z�t|�j}tj|�duSr�)rrIrrJrKs  r�is_valid_ipv4_endpoint_urlrO�s&����%�.�.�H��=�=��"�$�.�.r�c��tj|�ryt|�}|j}|�yt	|�dkDry|ddk(r|dd}tjdt
j�}|j|�S)z�Verify the endpoint_url is valid.

    :type endpoint_url: string
    :param endpoint_url: An endpoint_url.  Must have at least a scheme
        and a hostname.

    :return: True if the endpoint url is valid. False otherwise.

    FN�r�r�z;^((?!-)[A-Z\d-]{1,63}(?<!-)\.)*((?!-)[A-Z\d-]{1,63}(?<!-))$)	rrHrrIr�r��compile�
IGNORECASErJ)rL�partsrI�alloweds    r�is_valid_endpoint_urlrV�s����$�$�\�2���\�"�E��~�~�H����
�8�}�s�����|�s���C�R�=���j�j�F�
�
�
��G��=�=��"�"r�c�2�t|�xst|�Sr�)rVrM)rLs rrrs�� ��.��2L��3�r�c�r�|�ytjd�}|j|�}|st|���y)z0Provided region_name must be a valid host label.Nz)^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{,63}(?<!-)$)�region_name)r�rRrJr+)rY�valid_host_label�valids   r�validate_region_namer\!s>������z�z�"N�O���"�"�;�/�E�� �[�9�9�r�c��d|vryt|�}|dks|dkDrytj|�}|�|j�t|�k7ryy)a�
    Check to see if the ``bucket_name`` complies with the
    restricted DNS naming conventions necessary to allow
    access via virtual-hosting style.

    Even though "." characters are perfectly valid in this DNS
    naming scheme, we are going to punt on any name containing a
    "." character because these will cause SSL cert validation
    problems if we try to use virtual-hosting style addressing.
    r�F��?T)r��LABEL_RErJ�end)�bucket_name�nrJs   r�check_dns_namerd+sT���k����K��A��1�u��B����N�N�;�'�E��}��	�	��s�;�'7�7��r�c���|jjdd�rd}	t|||�y#t$r/}|jd}t
j
d|�Yd}~yd}~wwxYw)ar
    This handler looks at S3 requests just before they are signed.
    If there is a bucket name on the path (true for everything except
    ListAllBuckets) it checks to see if that bucket name conforms to
    the DNS naming conventions.  If it does, it alters the request to
    use ``virtual hosting`` style addressing rather than ``path-style``
    addressing.

    �use_global_endpointFzs3.amazonaws.comrbz2Not changing URI, bucket is not DNS compatible: %sN)r�r��switch_to_virtual_host_styler%r0rr)r��signature_versionrY�default_endpoint_urlr0r3rbs       r�fix_s3_hostrjBsk�� �����0�%�8�1��
�$��&�(<�	
���
��h�h�}�-�����@�+�	
�	
��
�s�
.�	A&�%A!�!A&c���|j�yt|�rtjd�yt	|j
�}|j|_|jjd�}|�|j}t|�dkDr�|d}|sytjd|j
�t|�r�t|�dk(r'|jddk7r|xjdz
c_|j|�dj|�xsd}|}|dz|z}	|j|	||jd	f}
t|
�}||_tjd
|�yt!|���y)a)
    This is a handler to force virtual host style s3 addressing no matter
    the signature version (which is taken in consideration for the default
    case). If the bucket is not DNS compatible an InvalidDNSName is thrown.

    :param request: A AWSRequest object that is about to be sent.
    :param signature_version: The signature version to sign with
    :param default_endpoint_url: The endpoint to use when switching to a
        virtual style. If None is supplied, the virtual host will be
        constructed from the url of the request.
    NzKRequest is GetBucketLocation operation, not checking for DNS compatibility.r�r6z*Checking for DNS compatible bucket for: %s�r�r�r�zURI updated to: %s)rb)�	auth_path�_is_get_bucket_location_requestrrrr�r�r��netlocr�rd�remover��scheme�queryrr%)r�rhrir0rT�
path_partsrbr��global_endpoint�host�	new_tuple�new_uris            rrgrg_s^�����$�	�	(��	1�	���
%�	
�	��W�[�[�!�E��
�
�G�����!�!�#�&�J��#�$�|�|��
�:���� ��m���
����A�7�;�;�O��+�&��:��!�#��$�$�R�(�C�/��%�%��,�%����k�*��8�8�J�'�.�3�D�2�O���$��6�D����t�T�5�;�;��C�I� ��+�G�!�G�K��L�L�-�w�7�%�+�>�>�3r�c�8�|jjd�S)Nz	?location)r�rr�s rrnrn�s���;�;����,�,r�c�^����j�tj����fd��}|S)aMethod decorator for caching method calls to a single instance.

    **This is not a general purpose caching decorator.**

    In order to use this, you *must* provide an ``_instance_cache``
    attribute on the instance.

    This decorator is used to cache method calls.  The cache is only
    scoped to a single instance though such that multiple instances
    will maintain their own cache.  In order to keep things simple,
    this decorator requires that you provide an ``_instance_cache``
    attribute on your instance.

    c�����|f}|r'tt|j���}�||f}|jj	|�}|�|S�|g|��i|��}||j|<|Sr�)�tuple�sortedr��_instance_cacher�)r��argsr0�	cache_key�kwarg_items�result�func�	func_names      ��r�_cache_guardz$instance_cache.<locals>._cache_guard�s{�����%�	����v�|�|�~� 6�7�K�"�D�+�6�I��%�%�)�)�)�4�����M��d�,�T�,�V�,��*0����Y�'��
r�)r��	functools�wraps)r�r�r�s` @r�instance_cacher��s1����
�
�I��_�_�T��
��
��r�c������fd�}|S)a
    Version of functools.lru_cache that stores a weak reference to ``self``.

    Serves the same purpose as :py:func:`instance_cache` but uses Python's
    functools implementation which offers ``max_size`` and ``typed`` properties.

    lru_cache is a global cache even when used on a method. The cache's
    reference to ``self`` will prevent garbace collection of the object. This
    wrapper around functools.lru_cache replaces the reference to ``self`` with
    a weak reference to not interfere with garbage collection.
    c�����tj�i����fd���tj���fd��}�j|_|S)Nc�&���|�g|��i|��Sr�r�)�weakref_to_selfr~r0r�s   �r�func_with_weakrefz=lru_cache_weakref.<locals>.wrapper.<locals>.func_with_weakref�s�����)�;�D�;�F�;�;r�c�B���tj|�g|��i|��Sr�)�weakref�ref)r�r~r0r�s   �r�innerz1lru_cache_weakref.<locals>.wrapper.<locals>.inner�s!���$�W�[�[��%6�H��H��H�Hr�)r��	lru_cacher��
cache_info)r�r�r��
cache_args�cache_kwargss` @��r�wrapperz"lru_cache_weakref.<locals>.wrapper�sY���	�	�	�j�	9�L�	9�	<�
:�	<�
����	�	I�
�	I�-�7�7����r�r�)r�r�r�s`` r�lru_cache_weakrefr��s���
��Nr�c��t|j�jjd�}|D�cgc]
}|tvs�|��}}d}t|�dkDr|dj
|�dzz
}|dz
}|dvryt||d��ycc}w)	z?Switches the current s3 endpoint with an S3 Accelerate endpointr�zhttps://s3-accelerate.r�
amazonaws.com)�ListBuckets�CreateBucket�DeleteBucketNF)�use_new_scheme)rr�ror��S3_ACCELERATE_WHITELISTr�r��
_switch_hosts)r��operation_namer0rT�prs      r�switch_host_s3_accelerater��s���
�W�[�[�!�(�(�.�.�s�3�E��>�1��&=�!=�Q�>�E�>�'�H�
�5�z�A�~��C�H�H�U�O�c�)�)�����H��H�H���'�8�E�:��
?s�
B�Bc��tj|jjd��}|j	|�r||}t||�yy)zBSwitches the host using a parameter value from a JSON request bodyr�N)rrp�datarr�r�)r��
param_name�request_json�new_endpoints    r�switch_host_with_paramr��sF���:�:�g�l�l�1�1�'�:�;�L����
�#�#�J�/���g�|�,�$r�c�@�t|j||�}||_yr�)�_get_new_endpointr�)r�r�r��final_endpoints    rr�r��s ��&����\�>��N�!�G�Kr�c��t|�}t|�}|j}|r|j}||j|j|jdf}t|�}tjd|�d|���|S�Nr�zUpdating URI from � to )rrqror�rrrrr)�original_endpointr�r��new_endpoint_components�original_endpoint_componentsrq�final_endpoint_componentsr�s        rr�r�s���&�|�4��#+�,=�#>� �
)�
0�
0�F��(�/�/����&�&�$�)�)�$�*�*�
�!�� � 9�:�N�
�L�L�%�&7�%8��^�<L�M�N��r�c��|D]G}||vr9t||t�r&t||t�rt||||��@||||<�Iy)z�Deeply two dictionaries, overriding existing keys in the base.

    :param base: The base dictionary which will be merged into.
    :param extra: The dictionary to merge into the base. Keys from this
        dictionary will take precedence.
    N)ryr��
deep_merge)�base�extrar�s   rr�r�s\�����
�4�K��4��9�d�+��5��:�t�,��t�C�y�%��*�-���#�J��S�	�r�c�B�|jdd�j�S)zcTranslate the form used for event emitters.

    :param service_id: The service_id to convert.
    � �-)r�r|)�
service_ids r�hyphenize_service_idr�)s ��
���c�3�'�-�-�/�/r�c�&�eZdZdZdZd�Zd�Zd�Zy)�
IdentityCachez�Base IdentityCache implementation for storing and retrieving
    highly accessed credentials.

    This class is not intended to be instantiated in user code.
    �base_identity_cachec� �||_||_yr���_client�_credential_cls�r��client�credential_clss   rr�zIdentityCache.__init__:������-��r�c��|jdi|��}|�}|jj|||jdd��}|S)N�-�
)r��
refresh_usingr�advisory_timeout�mandatory_timeoutr�)�build_refresh_callbackr��create_from_metadata�METHOD)r�r0�callbackr��credential_entrys     r�get_credentialszIdentityCache.get_credentials>sV��.�4�.�.�8��8���:���/�/�D�D��"��;�;�� �E�
�� �r�c��t��)z�Callback to be implemented by subclasses.

        Returns a set of metadata to be converted into a new
        credential instance.
        )�NotImplementedError)r0s rr�z$IdentityCache.build_refresh_callbackJs
��"�#�#r�N)r�r�r�r�r�r�r�r�r�r�rr�r�1s���#�F�.�
 �$r�r�c�f��eZdZdZdZd�Zejd���fd��Zd�Z	d	d�Z
�xZS)
�S3ExpressIdentityCachez�S3Express IdentityCache for retrieving and storing
    credentials from CreateSession calls.

    This class is not intended to be instantiated in user code.
    �	s3expressc� �||_||_yr�r�r�s   rr�zS3ExpressIdentityCache.__init__\r�r��d)�maxsizec�$��t�|�|��S)N��bucket)�superr�)r�r��	__class__s  �rr�z&S3ExpressIdentityCache.get_credentials`s����w�&�f�&�5�5r�c������fd�}|S)Nc����jj���}|d}�j|dd��}|d|d|d|d	�S)
N��Bucket�CredentialsrZT)�isorWrX�SessionToken)r]r^r<r_)r��create_session�_serialize_if_needed)r2�credsr�r�r�s   ��r�	refresherz@S3ExpressIdentityCache.build_refresh_callback.<locals>.refresheresk����|�|�2�2�&�2�A�H��]�+�E��2�2��l�#��3��J�$�M�2�#�$5�6��~�.�)�	�
r�r�)r�r�r�s`` rr�z-S3ExpressIdentityCache.build_refresh_callbackds���	��r�c�l�t|t�r#|r|j�S|jd�S|S�Nz%Y-%m-%dT%H:%M:%S%Z�ryr��	isoformatr��r�r�r�s   rr�z+S3ExpressIdentityCache._serialize_if_neededt�1���e�^�,�����(�(��>�>�"7�8�8��r�rS)r�r�r�r�r�r�r�r�r�r�r��
__classcell__)r�s@rr�r�Ss?�����F�.��Y����%�6�&�6�� r�r�c�.�eZdZdd�Zdd�Zd�Zd�Zd�Zy)�S3ExpressIdentityResolverNc�v�tj|�|_|�t|j|�}||_yr�)r��proxyr�r��_cache)r�r�r��caches    rr�z"S3ExpressIdentityResolver.__init__}s.���}�}�V�,����=�*�4�<�<��H�E���r�c��tjd�|xs |jjj}|jd|j�|jd|j�|jd|j�y)Nz'Registering S3Express Identity Resolver�before-parameter-build.s3�before-call.s3�before-sign.s3)	rrr��metar[�register�inject_signing_cache_key�apply_signing_cache_key�resolve_s3express_identity�r��
event_emitter�emitters   rr�z"S3ExpressIdentityResolver.register�sr�����>�?��;�4�<�<�#4�#4�#;�#;�����'��)F�)F�	
�	���)�4�+G�+G�H����)�4�+J�+J�Kr�c�"�d|vrd|di|d<yy)Nr�rb�	S3Expressr�)r��paramsr�r0s    rr�z2S3ExpressIdentityResolver.inject_signing_cache_key�s#���v��$1�6�(�3C�#D�G�K� �r�c���|jdi�}|jdd�}|jdi�jd�}|dk(r|�|jdi�||dd<yyy)N�endpoint_properties�backendrrb�signingr)r��
setdefault)r�rr�r0rrrbs       rr�z1S3ExpressIdentityResolver.apply_signing_cache_key�sw��%�k�k�*?��D��%�)�)�)�T�:���k�k�+�r�2�6�6�}�E���k�!�k�&=����y�"�-�.9�G�I��{�+�'>�!r�c�2�|jjdi�}|jd�}|dk(re|jd�rS|j|d<d|vr?|jjdi�jdi�jd	�|d<yyyy)
Nr	�signing_namer�zv4-s3express�identity_cacher�s3_redirectrr�)r�r��
startswithr�)	r�r�rrYrh�request_signerr�r0�signing_contexts	         rr�z4S3ExpressIdentityResolver.resolve_s3express_identity�s���"�/�/�-�-�i��<��&�*�*�>�:���;�&�+<�+G�+G��,
�15���O�,�-��/�1��O�O�'�'�
�r�:��S��2�&��S��]� ��,�2�	,
�&r�r�)r�r�r�r�r�r�r�r�r�r�rr�r�|s���L�E�:�r�r�c�>�eZdZdZd
d�Zd
d�Zd�Zd�Zd�Zd�Z	d	�Z
y)�S3RegionRedirectorv2a
Updated version of S3RegionRedirector for use when
    EndpointRulesetResolver is in use for endpoint resolution.

    This class is considered private and subject to abrupt breaking changes or
    removal without prior announcement. Please do not use it directly.
    Nc�N�|xsi|_tj|�|_yr�)r�r�r�r��r��endpoint_bridger�r�s    rr�zS3RegionRedirectorv2.__init__�s���k�r����}�}�V�,��r�c��tjd�|xs |jjj}|jd|j�|jd|j�|jd|j�y)Nz(Registering S3 region redirector handler�needs-retry.s3r�zbefore-endpoint-resolution.s3)	rrr�r�r[r��redirect_from_error�annotate_request_context�redirect_from_cachers   rr�zS3RegionRedirectorv2.register�st�����?�@��;�4�<�<�#4�#4�#;�#;�����)�4�+C�+C�D����'��)F�)F�	
�	���+�T�-E�-E�	
r�c	���|�y|jdi�jdi�}tj|jd��rtj	d�y|jd�rtj	d�y|djd	i�}|jd
�}|djdi�}|dvxr|j
d
k(}	|dvxr%|j
dk(xrd|jdi�v}
|dk(xrd|v}|dduxr|djdv}|dk(}
t|	||
|
|g�sy|ddd}|djd�}|j||�}|�tj	d|�d|�d��ytj	d|�d|�d|�d��||j|<|jj}|j||ddd|d��}|j|d|j�|d<d|ddd<|jjd �}|�=|j!|�}|\}}||dd!<i|djd"i��|�|dd"<y)#�
        An S3 request sent to the wrong region will return an error that
        contains the endpoint the request should be sent to. This handler
        will add the redirect information to the signing context and then
        redirect the request.
        Nr�rr�zBS3 request was previously for an Accesspoint ARN, not redirecting.�
redirected�6S3 request was previously redirected, not redirecting.r6�Errorr`�ResponseMetadata��301�400�
HeadObject�
HeadBucket�x-amz-bucket-region�HTTPHeaders�AuthorizationHeaderMalformed�Regionr�i-i.i3�PermanentRedirect�
client_region� S3 client configured for region � but the bucket �S is not in that region and the proper region could not be automatically determined.� is in region �b; Please configure the proper region to avoid multiple unnecessary redirects and signing attempts.r)�operation_model�	call_args�request_contextr�T�authSchemes�	auth_typer	)r��	ArnParser�is_arnrrr�r-�any�get_bucket_regionr�r��_ruleset_resolver�construct_endpoint�set_request_urlr��
properties�auth_schemes_to_signing_ctx)r��request_dictr2�	operationr0�redirect_ctxr$�
error_code�response_metadata�is_special_head_object�is_special_head_bucket�is_wrong_signing_region�is_redirect_status�is_permanent_redirectr�r-�
new_region�ep_resolver�ep_info�auth_schemes�	auth_infor7rs                       rrz(S3RegionRedirectorv2.redirect_from_error�s����
�#�'�'�	�2�6�:�:�=�"�M�����L�,�,�X�6�7��L�L��
�
����L�)��L�L�H�
�
��������,���Y�Y�v�&�
�$�Q�K�O�O�,>��C��
�.�(�K�Y�^�^�|�-K�	�
�.�(�
8����,�.�
8�%� �$�$�]�B�7�8�	�
�8�8�N�X��=N�	 �&�a�[��4�)��
�:
�
�+��:)��!+�.A� A���&�'�%�&�"�
�
�
��i�(��7��A��$�Y�/�3�3�O�D�
��+�+�F�H�=�
����L�L�0=�f�F�
�

�����f�j�
2�	
�)����F���l�l�4�4���0�0�%�"�9�-�m�<�X�F�(��3�1�
��
#�2�2�������
��U��@D��Y��
�.�|�<��)�)�-�-�m�<���#�#�?�?��M�I�)2�&�I��3<�L��#�K�0�2��y�)�-�-�i��<�2�!�2�L��#�I�.�r�c�<�|d}|dd}d|vr|dS|jdi�jdd�}|�|S	|jj|��}|dd}|jdd�}|S#t$r}|jdd}Yd}~�4d}~wwxYw�	a.
        There are multiple potential sources for the new region to redirect to,
        but they aren't all universally available for use. This will try to
        find region from response elements, but will fall back to calling
        HEAD on the bucket if all else fails.

        :param bucket: The bucket to find the region for. This is necessary if
            the region is not available in the error response.
        :param response: A response representing a service request that failed
            due to incorrect region configuration.
        r6r!r(r'r r*Nr��r�r��head_bucketrr2�r�r�r2�service_response�response_headersr�r�r3s        rr;z&S3RegionRedirectorv2.get_bucket_region6����$�A�;��+�,>�?�
�N�� �$4�4�#�$9�:�:�"�%�%�g�r�2�6�6�x��F�����M�	D��|�|�/�/�v�/�>�H��1�2�=�A�G����2�D�9���
��	�	D��j�j�!3�4�]�C�G��	D���$A6�6	B�?B�Bc��t||d�S)z�
        Splice a new endpoint into an existing URL. Note that some endpoints
        from the the endpoint provider have a path component which will be
        discarded by this function.
        F)r�)r��old_urlr�r0s    rr>z$S3RegionRedirectorv2.set_request_urlWs��!��,��>�>r�c��|jd�}|�0||jvr!|jj|�}||d<yyy)a
        If a bucket name has been redirected before, it is in the cache. This
        handler will update the AWS::Region endpoint resolver builtin param
        to use the region from cache instead of the client region to avoid the
        redirect.
        r�NzAWS::Region)r�r�)r��builtinsrr0r�rKs      rrz(S3RegionRedirectorv2.redirect_from_cache_sG�����H�%����&�D�K�K�"7�������0�J�&0�H�]�#�#8�r�c�8�|jd�}d||d�|d<y)z�Store the bucket name in context for later use when redirecting.
        The bucket name may be an access point ARN or alias.
        r�F)rr�rrNr�)r�rr�r0r�s     rrz-S3RegionRedirectorv2.annotate_request_contextks'�����H�%�����"
��
�r�r�)r�r�r�r�r�r�rr;r>rrr�r�rrr�s-���-�	
�j�X�B?�
1�	
r�rc�>�eZdZdZd
d�Zd
d�Zd�Zd�Zd�Zd�Z	d	�Z
y)�S3RegionRedirectorz�This handler has been replaced by S3RegionRedirectorv2. The original
    version remains in place for any third-party libraries that import it.
    Nc��||_||_|j�i|_tj|�|_tjdt��y)Nz�The S3RegionRedirector class has been deprecated for a new internal replacement. A future version of botocore may remove this class.��category)�_endpoint_resolverr�r�r�r��warnings�warn�
FutureWarningrs    rr�zS3RegionRedirector.__init__|sJ��"1�������;�;���D�K��}�}�V�,����
�
�
�#�		
r�c���|xs |jjj}|jd|j�|jd|j
�|jd|j�y)Nrr�r�)r�r�r[r�rr>rrs   rr�zS3RegionRedirector.register�sa���;�4�<�<�#4�#4�#;�#;�����)�4�+C�+C�D����)�4�+?�+?�@����4�d�6N�6N�Or�c	���|�y|j|jdi��rtjd�y|jdi�jd�rtjd�y|djdi�}|jd�}|djd	i�}|d
vxr|jdk(}|d
vxr%|jdk(xrd
|jdi�v}	|dk(xrd|v}
|dduxr|dj
dv}|dk(}t
||
||	|g�sy|ddd}
|djd�}|j|
|�}|�tjd|�d|
�d��ytjd|�d|
�d|�d��|jjd|�}|d}||
|d�}||dd<||j|
<|j||d�d|dd<y) rNr�z=S3 request was previously to an accesspoint, not redirecting.�
s3_redirectedrr6r r`r!r"r%r&r'r(r)r*rr+r,r	r�r-r.r/r0r1r2�s3rL)r�r�rT)�_is_s3_accesspointr�rrr�r-r:r;rc�resolver�r>)r�rAr2rBr0r$rDrErFrGrHrIrJr�r-rKrrs                  rrz&S3RegionRedirector.redirect_from_error�sk����
��"�"�<�#3�#3�I�r�#B�C��L�L�O�
�
����I�r�*�.�.��?��L�L�H�
�
��������,���Y�Y�v�&�
�$�Q�K�O�O�,>��C��
�.�(�K�Y�^�^�|�-K�	�
�.�(�
8����,�.�
8�%� �$�$�]�B�7�8�	�
�8�8�N�X��=N�	 �&�a�[��4�)��
�:
�
�+��:)��!+�.A� A���&�'�%�&�"�
�
�
��i�(��3�H�=��$�Y�/�3�3�O�D�
��+�+�F�H�=�
����L�L�0=�f�F�
�

�����f�j�
2�	
��*�*�2�2�4��D���N�+��!�� �
��
.=��Y��	�*�-����F�����\�<�	�+B�C�37��Y���0�r�c�<�|d}|dd}d|vr|dS|jdi�jdd�}|�|S	|jj|��}|dd}|jdd�}|S#t$r}|jdd}Yd}~�4d}~wwxYwrQrRrTs        rr;z$S3RegionRedirector.get_bucket_region�rWrXc�t�|jdi�jdd�}|�t|d|d�|d<yy)Nr	rr�F)r�r��r�rr�r0rs     rr>z"S3RegionRedirector.set_request_urls@���;�;�y�"�-�1�1�*�d�C����-�f�U�m�X�u�M�F�5�M� r�c��|j|�ry|jd�}|jj|�}|�||d<yd|i|d<y)z�
        This handler retrieves a given bucket's signing context from the cache
        and adds it into the request context.
        Nr�r	r�)rkr�r�)r�rr�r0r�rs      rrz&S3RegionRedirector.redirect_from_cachesT��
�"�"�7�+�����H�%���+�+�/�/�&�1���&�!0�G�I��"*�F�!3�G�I�r�c�
�d|vS�Nr�r�)r�r�s  rrkz%S3RegionRedirector._is_s3_accesspoint&s
���7�*�*r�r�)r�r�r�r�r�r�rr;r>rrkr�r�rr_r_ws/���
�"P�]�~�BN�
4�+r�r_c��eZdZy)�InvalidArnExceptionN)r�r�r�r�r�rrtrt*s��r�rtc�"�eZdZd�Zed��Zy)r8c��|jdd�}t|�dkrtd|z��|d|d|d|d|dd	�S)
N�:��zUProvided ARN: %s must be of the format: arn:partition:service:region:account:resourcer6rlr^�)�	partition�servicer��account�resource)r�r�rt)r��arn�	arn_partss   r�	parse_arnzArnParser.parse_arn/si���I�I�c�1�%�	��y�>�A��%�@�BE�F��
�
#�1�� ��|���l� ��|�!�!��
�	
r�c��t|t�r|jd�syt�}	|j	|�y#t
$rYywxYw)Nzarn:FT)ryr{rr8r�rt)r��
arn_parsers  rr9zArnParser.is_arn>sK���%��%�U�-=�-=�f�-E���[�
�	�� � ��'���"�	��	�s�A�	A�AN)r�r�r�r��staticmethodr9r�r�rr8r8.s��

����r�r8c��eZdZejd�Zejd�ZdgZdd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zy)
�S3ArnParamHandlerzA^(?P<resource_type>accesspoint|outpost)[/:](?P<resource_name>.+)$zc^(?P<outpost_name>[a-zA-Z0-9\-]{1,63})[/:]accesspoint[/:](?P<accesspoint_name>[a-zA-Z0-9\-]{1,63}$)r�Nc�6�||_|�t�|_yyr���_arn_parserr8�r�r�s  rr�zS3ArnParamHandler.__init__T���%�����(�{�D��r�c�<�|jd|j�y)Nr��r��
handle_arn�r�rs  rr�zS3ArnParamHandler.registerYs�����:�D�O�O�Lr�c���|j|jvry|j|�}|�y|ddk(r|j|||�y|ddk(r|j	|||�yy)N�
resource_type�accesspoint�outpost)r��_BLACKLISTED_OPERATIONS�"_get_arn_details_from_bucket_param�_store_accesspoint�_store_outpost)r�r�modelr�r0�arn_detailss      rr�zS3ArnParamHandler.handle_arn\ss���:�:��5�5�5���=�=�f�E�������'�=�8��#�#�F�G�[�A�
��
)�Y�
6�������=�7r�c��d|vr5	|d}|jj|�}|j||�|Sy#t$rYywxYw)Nr�)r�r��_add_resource_type_and_namert)r�rrr�s    rr�z4S3ArnParamHandler._get_arn_details_from_bucket_paramgsa���v��
��X�&��"�.�.�8�8��=���0�0��k�B�"�"���'�
���
�s�3;�	A�Ac��|jj|d�}|r)|jd�|d<|jd�|d<yt|���)Nr~r��
resource_name)r)�_RESOURCE_REGEXrJ�groupr2)r�rr�rJs    rr�z-S3ArnParamHandler._add_resource_type_and_namersQ���$�$�*�*�;�z�+B�C���+0�;�;��+G�K��(�+0�;�;��+G�K��(�'�C�0�0r�c�H�|d|d<|d|d|d|d|dd�|d<y)	Nr�r�r}r{r�r|)r�r}r{r�r|r�r��r�rr�r�s    rr�z$S3ArnParamHandler._store_accesspointzsH��'��7��x����0�"�9�-�$�[�1�!�(�+�"�9�-�%
�� �!r�c���|d}|jj|�}|st|���|jd�}||d<|jd�||d|d|d|d	d
�|d<y)Nr�)r��accesspoint_namer��outpost_namer}r{r�r|)r�r�r}r{r�r|r�)�_OUTPOST_RESOURCE_REGEXrJr0r�)r�rr�r�r�rJr�s       rr�z S3ArnParamHandler._store_outpost�s���#�O�4�
��,�,�2�2�=�A���1�
�N�N�!�;�;�'9�:��+��x��!�K�K��7�$�"�9�-�$�[�1�!�(�+�"�9�-�
%
�� �!r�r�)r�r�r�r�rRr�r�r�r�r�r�r�r�r�r�r�r�rr�r�Js\�� �b�j�j�L��O�)�b�j�j�	6��� .�.��+�
M�	>�	�1�
�"
r�r�c���eZdZdZdZ					dd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�Zd�Z
d
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zed��Zed��Zed��Zy)�S3EndpointSetter�awsr�Nc��||_||_||_||_|�i|_||_||_|�|j|_yyr��rc�_region�
_s3_config�_use_fips_endpoint�
_endpoint_url�
_partition�_DEFAULT_PARTITION�r��endpoint_resolverr��	s3_configrLr{�use_fips_endpoints       rr�zS3EndpointSetter.__init__�sV��#4������#���"3����� �D�O�)���#�����"�5�5�D�O�r�c��|jd|j�|jd|j�|jd|j�y)Nr�zchoose-signer.s3z%before-call.s3.WriteGetObjectResponse)r��set_endpoint�
set_signer�#update_endpoint_to_s3_object_lambdar�s  rr�zS3EndpointSetter.register�sH�����/��1B�1B�C����1�4�?�?�C����3��4�4�	
r�c��|jrtd���|j|d�|jry|j}|jd|j�}dj|d|d��}t|d|d	�|d<y)
NzOS3 client does not support accelerate endpoints for S3 Object Lambda operations��msg�s3-object-lambdazhttps://{host_prefix}{hostname}�host_prefixrI)r�rIr�F)	�_use_accelerate_endpointr3�_override_signing_namer�rcr=r��formatr�)r�rr�r0�resolver�resolvedr�s       rr�z4S3EndpointSetter.update_endpoint_to_s3_object_lambda�s����(�(�1�e��
�	
�#�#�G�-?�@������*�*���.�.�����
��9�?�?��}�-��j�)�@�
��
*�&��-��u�M��u�
r�c��|j|�rh|j|�|j|�|j|�|j	|�}|j|�|j
||�y|jr2|jrtd|jz���tdd|i|��|jr|jdd|i|��yy)Nz{Client is configured to use the FIPS psuedo region for "%s", but S3 Accelerate does not have any FIPS compatible endpoints.r�r�r�)
�_use_accesspoint_endpoint�_validate_accesspoint_supported�_validate_fips_supported�_validate_global_regions�(_resolve_region_for_accesspoint_endpoint�._resolve_signing_name_for_accesspoint_endpoint�_switch_to_accesspoint_endpointr�r�r3r�r��_s3_addressing_handler)r�r�r0rYs    rr�zS3EndpointSetter.set_endpoint�s����)�)�'�2��0�0��9��)�)�'�2��)�)�'�2��G�G���K�
�?�?��H��0�0��+�F���(�(��&�&�5�0�37�<�<�A���
&�@�g�@��@��&�&�'�D�'�'�B��B�6�B�'r�c��d|jvSrr�r�r�s  rr�z*S3EndpointSetter._use_accesspoint_endpoint�s���7�?�?�2�2r�c�j�|jsyd|jddvr
tdh���d|jdvrtd|jz���|jdd}||jk7r:|jjdd	�std
|j�d|�d����yy)
N�fipsr�r��,Invalid ARN, FIPS region not allowed in ARN.r�r�zhClient is configured to use the FIPS psuedo-region "%s", but outpost ARNs do not support FIPS endpoints.�use_arn_regionTz8Client is configured to use the FIPS psuedo-region for "z1", but the access-point ARN provided is for the "zn" region. For clients using a FIPS psuedo-region calls to access-point ARNs in another region are not allowed.)r�r�r1r�r�r��r�r��accesspoint_regions   rr�z)S3EndpointSetter._validate_fips_supported�s����&�&���W�_�_�%5�6�x�@�@�<�C�D��
��W�_�_�-=�>�>�<�F��|�|�%��
�%�_�_�-=�>�x�H������-��?�?�&�&�'7��>�A� �<�<�);�=�	�	�?�.r�c��|jjdd�ry|jdvrtd|jz���y)Nr�T)z
aws-globalz
s3-external-1z�Client is configured to use the global psuedo-region "%s". When providing access-point ARNs a regional endpoint must be specified.r�)r�r�r�r1r�s  rr�z)S3EndpointSetter._validate_global_regions	sK���?�?���/��6���<�<�:�:�<�2�48�L�L�A��
�;r�c���|jrtd���|jdd}||jk7rtd|j�d|�d����|jdj	d�}|d	k(r'|j
j	d
�rtd���|jdj	d�}|r'|j
j	d
�rtd
���|j
|�y)NzZClient does not support s3 accelerate configuration when an access-point ARN is specified.r�r�r{�Client is configured for "z3" partition, but access-point ARN provided is for "zE" partition. The client and  access-point partition must be the same.r|r��use_dualstack_endpointzjClient does not support s3 dualstack configuration when an S3 Object Lambda access point ARN is specified.r�zTClient does not support s3 dualstack configuration when an outpost ARN is specified.)r�r1r�r�r�r��_validate_mrap_s3_config)r�r��request_partition�
s3_servicer�s     rr�z0S3EndpointSetter._validate_accesspoint_supported"	s����(�(�<�=��
�$�O�O�,<�=�k�J������/�<�
���(9�;��
��_�_�%5�6�:�:�9�E�
��+�+����0C�0C�$�1
�=�N��
����'7�8�<�<�^�L���D�O�O�/�/�0H�I�<�8��
�	
�%�%�g�.r�c���t|j�sy|jjd�rt	d���|jjd�rt	d���y)N�$s3_disable_multiregion_access_pointszCInvalid configuration, Multi-Region Access Point ARNs are disabled.r�r�zeClient does not support s3 dualstack configuration when a Multi-Region Access Point ARN is specified.)r�r�r�r�r1r�s  rr�z)S3EndpointSetter._validate_mrap_s3_configH	sc��$�W�_�_�5���?�?���E�F�<�)��
��_�_�
 �
 �!9�
:�<�I��
�;r�c��t|j�r|j|d�|j
S|jj	dd�r&|jdd}|j||�|S|j
S)Nr�r�Tr�r�)r�r��_override_signing_regionr�r�r�r�s   rr�z9S3EndpointSetter._resolve_region_for_accesspoint_endpointZ	sy�� ����1��)�)�'�3�7��|�|���_�_�
 �
 �!1�4�
8�!(���1A�!B�8�!L��
�)�)�'�3E�F�%�%��|�|�r�c�@�t|�rtrytd���y)N�s3v4azzUsing S3 with an MRAP arn requires an additional dependency. You will need to pip install botocore[crt] before proceeding.r�)r�rr-)r�r�r0s   rr�zS3EndpointSetter.set_signerg	s'�� ��)���0�7���	*r�c�`�|jdd}|j|j|�y)Nr�r|�r�r�)r�r��accesspoint_services   rr�z?S3EndpointSetter._resolve_signing_name_for_accesspoint_endpointr	s,��%�o�o�.>�?�	�J���#�#�G�O�O�5H�Ir�c�J�t|j�}t|j|j	|j
|�|j
|j|j
�|jdf�}tjd|j�d|���||_yr�)rr�rrq�_get_netlocr��_get_accesspoint_pathr�rrrr)r�r�rY�original_components�accesspoint_endpoints     rr�z0S3EndpointSetter._switch_to_accesspoint_endpointv	s���&�w�{�{�3��)�#�*�*�� � ����+�>��*�*�'�,�,�g�o�o��$�)�)��
�
 
��	��� ����
�T�2F�1G�H�	
�+��r�c�^�t|�r|j|�S|j||�Sr�)r��_get_mrap_netloc�_get_accesspoint_netloc)r�r5rYs   rr�zS3EndpointSetter._get_netloc�	s.�� ��1��(�(��9�9��/�/���M�Mr�c��|d}d}|dg}|jr1t|j�j}|j|�n(|d}|j	d||j|�g�dj
|�S)Nr�z	s3-globalr�r{r�r�)r�rror�r��_get_partition_dns_suffixr�)r�r5r�rY�mrap_netloc_components�endpoint_url_netlocr{s       rr�z!S3EndpointSetter._get_mrap_netloc�	s���(�)9�:��!��"0��"8�!9�����"*�4�+=�+=�">�"E�"E��"�)�)�*=�>�&�{�3�I�"�)�)�!���2�2�9�=��
��x�x�.�/�/r�c��|d}dj|d|d�g}|jd�}|jrD|r|j|�t	|j�j
}|j|�n�|r|dg}|j
|�nO|ddk(r$|jd|�}|j|�n#|jd	|�}|j|�|jjd
�r|jd�|j
||j|�g�dj|�S)
Nr�z{}-{}r�r}r��s3-outpostsr|r�zs3-accesspointr�r9r�)r�r�r�r�rror��_inject_fips_if_neededr��_get_dns_suffixr�)	r�r5rYr��accesspoint_netloc_componentsr�r��outpost_host�	components	         rr�z(S3EndpointSetter._get_accesspoint_netloc�	sF��(�)9�:���N�N�>�&�1�>�)�3L�M�)
�%�&�)�)�.�9������-�4�4�\�B�"*�4�+=�+=�">�"E�"E��)�0�0�1D�E�� ,�m�<��-�4�4�\�B��	�*�.@�@� �7�7�&���	�.�4�4�Y�?� �7�7�$�o��	�.�4�4�Y�?����"�"�#;�<�-�4�4�[�A�)�0�0��d�2�2�;�?�@�
��x�x�5�6�6r�c�(�|jrd|zS|S)Nz%s-fips�r�)r�r�r5s   rr�z'S3EndpointSetter._inject_fips_if_needed�	s���"�"��y�(�(��r�c�F�|dd}|jd|zdd�xsdS)Nr�r�r�r�r6)r�)r��
original_pathr5r�s    rr�z&S3EndpointSetter._get_accesspoint_path�	s2��
�/�0��8���$�$�S�4�Z��Q�7�>�3�>r�c�X�|jj|�}|�|j}|Sr�)rc�get_partition_dns_suffix�_DEFAULT_DNS_SUFFIX)r��partition_name�
dns_suffixs   rr�z*S3EndpointSetter._get_partition_dns_suffix�	s4���,�,�E�E��
�
����1�1�J��r�c�l�|jjd|�}|j}|r	d|vr|d}|S�Nrj�	dnsSuffix�rcr=r��r�rYr�r�s    rr�z S3EndpointSetter._get_dns_suffix�	�D���*�*�=�=��+�
���-�-�
���x�/�!�+�.�J��r�c�d�|jjdi�}||d<||jd<y�Nr	r��r�r��r�r�rYrs    rr�z)S3EndpointSetter._override_signing_region�	�2��!�/�/�-�-�i��<��
%0���!�%4����	�"r�c�<�|jdi�}||d<||d<y�Nr	rr�)r�r�rrs    rr�z'S3EndpointSetter._override_signing_name�	s(��!�+�+�i��4��
+7���'�,��	�r�c�Z�|jjd�ry|j�yt|j�j}|jd�sy|j
d�}|ddk7ry|dd	}t|�tt|��k7rytd
�|D��S)N�use_accelerate_endpointTFr�r�r�
s3-accelerater6���c3�,K�|]}|tv���y�wr��r���.0r�s  r�	<genexpr>z<S3EndpointSetter._use_accelerate_endpoint.<locals>.<genexpr>
s����G�A�1�/�/�G���)
r�r�r�rrorr�r��set�all)r�rorT�
feature_partss    rr�z)S3EndpointSetter._use_accelerate_endpoint�	s����?�?���8�9�����%���$�,�,�-�4�4������/�����S�!����8��&���a���
��}���S��%7�!8�8���G��G�G�Gr�c�\�|jry|jjd�}|r|Sy)N�virtual�addressing_style)r�r�r�)r��configured_addressing_styles  r�_addressing_stylez"S3EndpointSetter._addressing_style
s6���(�(��'+�o�o�&9�&9�:L�&M�#�&�.�.�'r�c���|jdk(rtjd�tS|jdk(s|j�tjd�ytjd�t
S)Nrz'Using S3 virtual host style addressing.r�zUsing S3 path style addressing.zSDefaulting to S3 virtual host style addressing with path style addressing fallback.)rrrrgr�rjr
s rr�z'S3EndpointSetter._s3_addressing_handler 
si���!�!�Y�.��L�L�B�C�/�/��!�!�V�+�t�/A�/A�/M��L�L�:�;�����
.�	
��r��NNNNF)r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�rr�r�r�rr�r��s�����)��
�����6�*
�N�6C�03��@
�$/�L�$�	�J�+�$N�0�$7�@�
?���5�-�� H�� H�D�	/��	/����r�r�c���eZdZdZdZejd�Z					dd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zy)�S3ControlEndpointSetterr�r�z^[a-zA-Z0-9\-]{1,63}$Nc��||_||_||_||_|�i|_||_||_|�|j|_yyr�r�r�s       rr�z S3ControlEndpointSetter.__init__>
sV��#4������#���"3����� �D�O�)���#�����"�5�5�D�O�r�c�<�|jd|j�y)Nzbefore-sign.s3-control)r�r�r�s  rr�z S3ControlEndpointSetter.registerR
s�����7��9J�9J�Kr�c��|j|�rW|j|�|j|�}|j|�|j	||�|j|�y|j
|�rQ|j|�|j|d�|j|j�}|j||�yy�Nr�)�_use_endpoint_from_arn_details�-_validate_endpoint_from_arn_details_supported� _resolve_region_from_arn_details�&_resolve_signing_name_from_arn_details�"_resolve_endpoint_from_arn_details�_add_headers_from_arn_details�_use_endpoint_from_outpost_id�#_validate_outpost_redirection_validr��_construct_outpost_endpointr��_update_request_netloc)r�r�r0rY�
new_netlocs     rr�z$S3ControlEndpointSetter.set_endpointU
s����.�.�w�7��>�>�w�G��?�?��H�K��7�7��@��3�3�G�[�I��.�.�w�7�
�
/�
/��
8��4�4�W�=��'�'���?��9�9�$�,�,�G�J��'�'���<�	9r�c��d|jvS)Nr�r�r�s  rr'z6S3ControlEndpointSetter._use_endpoint_from_arn_detailsb
s������/�/r�c��d|jvS)N�
outpost_idr�r�s  rr-z5S3ControlEndpointSetter._use_endpoint_from_outpost_ide
s���w���.�.r�c�.�d|jddvrt|jddd���|jjdd�s@|jdd}||jk7rd	|�d
|j�d�}t|���|jdd
}||jk7rtd|j�d|�d����|jjd�rtd���d|jdvr|j|�yy)Nr�r�r�r�r��rr�r�FzCThe use_arn_region configuration is disabled but received arn for "z(" when the client is configured to use "�"r�r{r�z&" partition, but arn provided is for "z;" partition. The client and arn partition must be the same.r�7S3 control client does not support accelerate endpointsr�)r�r4r�r�r�r5r�r.)r�r��
arn_regionrB�request_partions     rr(zES3ControlEndpointSetter._validate_endpoint_from_arn_details_supportedh
s���W�_�_�]�3�H�=�=�.��O�O�M�2�:�>�B��
����"�"�#3�U�;� ����7��A�J��T�\�\�)�
 ����	/�	�
=��K�K�!�/�/�-�8��E���d�o�o�-�8�
����9��
��?�?���8�9�8�M��
��W�_�_�]�;�;��4�4�W�=�<r�c�R�|jjd�rtd���y)Nr�zPClient does not support s3 dualstack configuration when an outpost is specified.r�)r�r�r5r�s  rr.z;S3ControlEndpointSetter._validate_outpost_redirection_valid�
s,���?�?���7�8�8�4��
�9r�c��|jjdd�r&|jdd}|j||�|S|jS)Nr�Fr�r�)r�r�r�r�r�)r�r�r9s   rr)z8S3ControlEndpointSetter._resolve_region_from_arn_details�
sL���?�?���/��7� ����7��A�J�
�)�)�'�:�>����|�|�r�c�N�|jdd}|j||�|S)Nr�r|r�)r�r��arn_services   rr*z>S3ControlEndpointSetter._resolve_signing_name_from_arn_details�
s+���o�o�m�4�Y�?���#�#�G�[�9��r�c�L�|j||�}|j||�yr�)� _resolve_netloc_from_arn_detailsr0)r�r�rYr1s    rr+z:S3ControlEndpointSetter._resolve_endpoint_from_arn_details�
s)���:�:��[�
�
�	
�#�#�G�Z�8r�c���t|j�}t|j||j|j
df�}tjd|j�d|���||_yr�)rr�rrqr�rrrr)r�r�r1r��arn_details_endpoints     rr0z.S3ControlEndpointSetter._update_request_netloc�
so��&�w�{�{�3��)�#�*�*��#�(�(�#�)�)��
� 
��	��� ����
�T�2F�1G�H�	
�+��r�c�x�|jd}d|vr|j|�S|d}|j||�S)Nr�r�r})r�r/�_construct_s3_control_endpoint)r�r�rYr�r}s     rr@z8S3ControlEndpointSetter._resolve_netloc_from_arn_details�
sF���o�o�m�4���[�(��3�3�K�@�@��i�(���2�2�;��H�Hr�c�8�|jj|�Sr�)�_HOST_LABEL_REGEXrJ)r��labels  r�_is_valid_host_labelz,S3ControlEndpointSetter._is_valid_host_label�
s���%�%�+�+�E�2�2r�c�L�|D]}|j|�r�t|���y)N)rG)rHr()r��labelsrGs   r�_validate_host_labelsz-S3ControlEndpointSetter._validate_host_labels�
s*���	9�E��,�,�U�3�+�%�8�8�	9r�c��|j||�|jr$t|j�j}||g}n9|dg}|j	|�|j|�}|j
||g�|j|�S)N�
s3-control)rKr�rro�_add_dualstackr�r��_construct_netloc)r�rYr}r�ror�s      rrDz6S3ControlEndpointSetter._construct_s3_control_endpoint�
s����"�"�;��8����"*�4�+=�+=�">�"E�"E���2�3�F����F�
����'��-�-�k�:�J��M�M�;�
�3�4��%�%�f�-�-r�c���|j|�|jrt|j�jSd||j	|�g}|j|�|j
|�Sr&)rKr�rror��	_add_fipsrO)r�rYros   rr/z3S3ControlEndpointSetter._construct_outpost_endpoint�
sl���"�"�;�/�����D�.�.�/�6�6�6����$�$�[�1��F�

�N�N�6�"��%�%�f�-�-r�c�$�dj|�S)Nr�)r��r�ros  rrOz)S3ControlEndpointSetter._construct_netloc�
s���x�x���r�c�4�|jr|ddz|d<yy)Nrz-fipsr�rSs  rrQz!S3ControlEndpointSetter._add_fips�
s"���"�"��q�	�G�+�F�1�I�#r�c�^�|jjd�r|jd�yy)Nr�r9)r�r�r�rSs  rrNz&S3ControlEndpointSetter._add_dualstack�
s&���?�?���7�8��M�M�+�&�9r�c�l�|jjd|�}|j}|r	d|vr|d}|Srrrs    rr�z'S3ControlEndpointSetter._get_dns_suffix�
rr�c�d�|jjdi�}||d<||jd<yrrr	s    rr�z0S3ControlEndpointSetter._override_signing_region�
r
r�c�d�|jjdi�}||d<||jd<yrr)r�r�rrs    rr�z.S3ControlEndpointSetter._override_signing_name�
s2��!�/�/�-�-�i��<��
+7���'�%4����	�"r�c�n�|jd}|jd�}|r|j||�yy)Nr�r�)r�r��_add_outpost_id_header)r�r�r�r�s    rr,z5S3ControlEndpointSetter._add_headers_from_arn_detailss6���o�o�m�4��"���~�6����'�'���>�r�c�"�||jd<y)Nzx-amz-outpost-id)r�)r�r�r�s   rrZz.S3ControlEndpointSetter._add_outpost_id_headers��.:����*�+r�r ) r�r�r�r�r�r�rRrFr�r�r�r'r-r(r.r)r*r+r0r@rHrKrDr/rOrQrNr�r�r�r,rZr�r�rr"r"9
s�����)��"��
�
�#;�<��
�����6�(L�=�0�/�>�@���
9�+� I�3�9�

.�.� �,�'��5�5�?�;r�r"c��eZdZdZej
d�Zdd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Zd�Zd�Zy)�S3ControlArnParamHandlerz�This handler has been replaced by S3ControlArnParamHandlerv2. The
    original version remains in place for any third-party importers.
    z[/:]Nc�j�||_|�t�|_tjdt��y)Nz�The S3ControlArnParamHandler class has been deprecated for a new internal replacement. A future version of botocore may remove this class.ra)r�r8rdrerfr�s  rr�z!S3ControlArnParamHandler.__init__s0��%�����(�{�D���
�
�
�#�		
r�c�<�|jd|j�y)Nz!before-parameter-build.s3-controlr�r�s  rr�z!S3ControlArnParamHandler.register"s�����/��O�O�	
r�c��|jdvr|j|||�y|j|||�|j|||�y)N)r��ListRegionalBuckets)r��_handle_outpost_id_param�_handle_name_param�_handle_bucket_param)r�rr�r�r0s     rr�z#S3ControlArnParamHandler.handle_arn(sG���:�:�@�@�
�)�)�&�%��A��#�#�F�E�7�;��%�%�f�e�W�=r�c��||vry	||}|jj|�}||d<|j|�|d<|S#t$rYywxYw)Nr��	resources)r�r��_split_resourcert)r�rr�rr�s     r�_get_arn_details_from_paramz4S3ControlArnParamHandler._get_arn_details_from_param2si���V�#��	���$�C��*�*�4�4�S�9�K�&)�K�
�#�'+�';�';�K�'H�K��$����"�	��	�s�:A�	A�
Ac�>�|jj|d�S)Nr~)�_RESOURCE_SPLIT_REGEXr�)r�r�s  rrgz(S3ControlArnParamHandler._split_resource>s���)�)�/�/��J�0G�H�Hr�c�`�|d}d|vr |d|k7rd|dz}t|d|���||d<y)Nr}�	AccountIdzGAccount ID in arn does not match the AccountId parameter provided: "%s"r�r6)r4)r�rr��
account_idrBs     r�_override_account_id_paramz3S3ControlArnParamHandler._override_account_id_paramAsZ�� ��+�
��&� �V�K�%8�J�%F�!��{�#�$�I�/��
�+���
�)��{�r�c��d|vry|d|d<y)N�	OutpostIdr4r�)r�rr�r�s    rrbz1S3ControlArnParamHandler._handle_outpost_id_paramNs���f�$�� &�{� 3���r�c��|jdk(ry|j|d�}|�y|j|�r|j|||�yd}t	|d|����N�CreateAccessPoint�Namez4The Name parameter does not support the provided ARNr�r6)r�rh�_is_outpost_accesspoint�_store_outpost_accesspointr4�r�rr�r�r�rBs      rrcz+S3ControlArnParamHandler._handle_name_paramSsj���:�:�,�,���6�6�v�v�F������'�'��4��+�+�F�G�[�I�N�I�.��
�+���
r�c�`�|ddk7ry|d}t|�dk7ry|ddk(xr|dd	k(S)
Nr|r�Frfrzrr�rlr��r��r�r�rfs   rruz0S3ControlArnParamHandler._is_outpost_accesspointcsH���y�!�]�2����,�	��y�>�Q�����|�y�(�J�Y�q�\�]�-J�Jr�c�l�|j||�|dd}||d<||d<|dd|d<||d<y)Nrfr^rtr�r6r�r��rn)r�rr�r�r�s     rrvz3S3ControlArnParamHandler._store_outpost_accesspointlsT���'�'���<�&�{�3�A�6��)��v��*:��&�'�&1�+�&>�q�&A��N�#�!,��
�r�c��|j|d�}|�y|j|�r|j|||�yd}t|d|����Nr�z6The Bucket parameter does not support the provided ARNr�r6)rh�_is_outpost_bucket�_store_outpost_bucketr4rws      rrdz-S3ControlArnParamHandler._handle_bucket_paramtsb���6�6�v�x�H������"�"�;�/��&�&�v�w��D�I�
�/��
�+���
r�c�`�|ddk7ry|d}t|�dk7ry|ddk(xr|dd	k(S)
Nr|r�Frfrzrr�rlr�ryrzs   rrz+S3ControlArnParamHandler._is_outpost_bucket�sH���y�!�]�2����,�	��y�>�Q�����|�y�(�E�Y�q�\�X�-E�Er�c�l�|j||�|dd}||d<||d<|dd|d<||d<y)Nrfr^r�rbr6r�r�r|)r�rr�r�rbs     rr�z.S3ControlArnParamHandler._store_outpost_bucket�sS���'�'���<�!�+�.�q�1��&��x��%0��M�"�&1�+�&>�q�&A��N�#�!,��
�r�r�)r�r�r�r�r�rRrjr�r�r�rhrgrnrbrcrurvrdrr�r�r�rr]r]s^���'�B�J�J�w�/��	
�
�>�
�I�)�4�
� K�-�
�F�-r�r]c�B�eZdZdZdd�Zd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zy)�S3ControlArnParamHandlerv2aUpdated version of S3ControlArnParamHandler for use when
    EndpointRulesetResolver is in use for endpoint resolution.

    This class is considered private and subject to abrupt breaking changes or
    removal without prior announcement. Please do not use it directly.
    Nc�6�||_|�t�|_yyr�r�r�s  rr�z#S3ControlArnParamHandlerv2.__init__�r�r�c�<�|jd|j�y)Nz%before-endpoint-resolution.s3-controlr�r�s  rr�z#S3ControlArnParamHandlerv2.register�s�����3��O�O�	
r�c��|jdk(ry|j|d�}|�y|j|�|j|�|j	|�r|j|||�yd}t
|d|���rr)r�rh�_raise_for_fips_pseudo_region�_raise_for_accelerate_endpointrurvr4rws      rrcz-S3ControlArnParamHandlerv2._handle_name_param�s����:�:�,�,���6�6�v�v�F������*�*�;�7��+�+�G�4��'�'��4��+�+�F�G�[�I�N�I�.��
�+���
r�c�(�|j||�yr�r|r�s    rrvz5S3ControlArnParamHandlerv2._store_outpost_accesspoint�����'�'���<r�c���|j|d�}|�y|j|�|j|�|j|�r|j	|||�yd}t|d|���r~)rhr�r�rr�r4rws      rrdz/S3ControlArnParamHandlerv2._handle_bucket_param�s~���6�6�v�x�H������*�*�;�7��+�+�G�4��"�"�;�/��&�&�v�w��D�I�
�/��
�+���
r�c�(�|j||�yr�r|r�s    rr�z0S3ControlArnParamHandlerv2._store_outpost_bucket�r�r�c�r�|d}|jd�s|jd�rt|dd���y)Nr�zfips-r�r�r6)rrr4)r�r�r9s   rr�z8S3ControlArnParamHandlerv2._raise_for_fips_pseudo_region�sE�� ��*�
�� � ��)�Z�-@�-@��-I�.��
�+�B��
�.Jr�c�d�|djxsi}|jd�rtd���y)N�
client_configrr8r�)rjr�r5)r�r�r�s   rr�z9S3ControlArnParamHandlerv2._raise_for_accelerate_endpoint�s9���O�,�/�/�5�2�	��=�=�2�3�8�M��
�4r�r�)r�r�r�r�r�r�rcrvrdr�r�r�r�r�rr�r��s/���+�

��$=��"=��r�r�c�|�eZdZdZdZdZdZedddgZdejfd	�Z
dd
�Zd�Zd�Z
d
�Zd�Zdd�Zd�Zd�Zy)�ContainerMetadataFetcherrlr^r6z
169.254.170.2z169.254.170.23zfd00:ec2::23�	localhostNc�x�|�*tjj|j��}||_||_y)N)r�)r�rr�TIMEOUT_SECONDSr�_sleep)r�r��sleeps   rr�z!ContainerMetadataFetcher.__init__�s;���?��*�*�9�9��,�,�:��G� ��
���r�c�H�|j|�|j||�S)z�Retrieve JSON metadata from container metadata.

        :type full_url: str
        :param full_url: The full URL of the metadata service.
            This should include the scheme as well, e.g
            "http://localhost:123/foo"

        )�_validate_allowed_url�_retrieve_credentials)r��full_urlr�s   r�retrieve_full_uriz*ContainerMetadataFetcher.retrieve_full_uri�s%��	
�"�"�8�,��)�)�(�G�<�<r�c��tjj|�}|j|j�ry|j|j�}|s4t
d|j�ddj|j�����y)NzUnsupported host 'zN'.  Can only retrieve metadata from a loopback address or one of these hosts: z, )	r��compatr�_is_loopback_addressrI�_check_if_whitelisted_hostrsr��_ALLOWED_HOSTS)r�r��parsed�is_whitelisted_hosts    rr�z.ContainerMetadataFetcher._validate_allowed_urls������)�)�(�3���$�$�V�_�_�5��"�=�=�f�o�o�N��"��$�V�_�_�$5�6B�BF�)�)�D�L_�L_�B`�Aa�c��
�#r�c�P�	t|�}|jS#t$rYywxYw)NF)r�is_loopbackrs)r�rI�ips   rr�z-ContainerMetadataFetcher._is_loopback_address
s-��	��H�%�B��>�>�!���	��	�s��	%�%c�"�||jvryy)NTF)r�)r�rus  rr�z3ContainerMetadataFetcher._check_if_whitelisted_hosts���4�&�&�&��r�c�F�|j|�}|j|�S)z�Retrieve JSON metadata from container metadata.

        :type relative_uri: str
        :param relative_uri: A relative URI, e.g "/foo/bar?id=123"

        :return: The parsed JSON response.

        )r�r�)r��relative_urir�s   r�retrieve_uriz%ContainerMetadataFetcher.retrieve_uris#���=�=��.���)�)�(�3�3r�c�0�ddi}|�|j|�d}		|j|||j�S#t$rR}tjd|d��|j
|j�|dz
}||jk\r�Yd}~nd}~wwxYw�})N�Acceptzapplication/jsonrTzAReceived error when attempting to retrieve container metadata: %sr"r6)	r�
_get_responser�r,rrr��
SLEEP_TIME�RETRY_ATTEMPTS)r�r��
extra_headersr��attemptsr3s      rr�z.ContainerMetadataFetcher._retrieve_credentials%s����/�0���$��N�N�=�)����
��)�)��g�t�';�';����*�

����-��!�	�����D�O�O�,��A�
���t�2�2�2��3��

��s�9�	B�AB�Bc��	tjj}|d||��}|jj	|j��}|jjd�}|jdk7rtd|j�d|�����	tj|�S#t$r&d}tjd	||�t|���wxYw#t$r}	d
|	��}t|���d}	~	wwxYw)Nr6rr�r zReceived non 200 response z from container metadata: rAz>Unable to parse JSON returned from container metadata servicesz%s:%sz?Received error when attempting to retrieve container metadata: )r�r�r)rr+r,rNrr-r,rrprsrrr/)
r�r�r�r�r)r�r2�
response_textrBr3s
          rr�z&ContainerMetadataFetcher._get_response;s	��	>�!�,�,�7�7�J� ��8�W�M�G��}�}�)�)�'�/�/�*;�<�H�$�,�,�3�3�G�<�M��#�#�s�*�,�4�X�5I�5I�4J�K4�4A�?�D���
B��z�z�-�0�0���
B�\�	����W�i��?�,�y�A�A�
B��%�	>�'�'(�c�+�
�)�9�=�=��	>�s*�BC�B,�,/C�C�	C=�'C8�8C=c�$�d|j�|��S)Nzhttp://)�
IP_ADDRESS)r�r�s  rr�z!ContainerMetadataFetcher.full_urlUs������)�,��8�8r�r�)r�r�r�r�r�r�r�r��timer�r�r�r�r�r�r�r�r�r�r�r�rr�r��sa���O��N��J� �J�����	�N� $�4�:�:��
=�	���

4��,>�49r�r�c�0�t|�riSt�Sr�)�should_bypass_proxiesr�r�s rrrYs���S�!��	��|�r�c��	tt|�j�ry	y#ttj
f$rYywxYw)z:
    Returns whether we should bypass proxies or not.
    TF)rrror��socket�gaierrorr�s rr�r�`sF��
����
�,�,�-��.�
��
�v���'�
���
�s�#�?�?c�@�|sy	t|�S#ttf$rYnwxYwt|d�rnt|d�rb	|j	�}|jdd�|j	�}|j|�||z
S#tj$rYywxYwy)Nr�seek�tellrl)r��AttributeErrorr�r�r�r��io�UnsupportedOperation)r��orig_pos�end_file_poss   r�determine_content_lengthr�us�����
��4�y����I�&�
��
���t�V����v�!6�	��y�y�{�H��I�I�a��O��9�9�;�L��I�I�h���(�*�*���&�&�	�

��	��s�
�"�"�AB�B�Bc��|jd�}|sytjj�}||d<|j	d�}|�|Sd|vr|Sy)z�Returns encodings from given HTTP Header Dict.

    :param headers: dictionary to extract encoding from.
    :param default: default encoding if the content-type is text
    zcontent-typeN�charsetr.)r�rX�messagera�	get_param)r��default�content_typer�r�s     r�get_encoding_from_headersr��sa���;�;�~�.�L����m�m�#�#�%�G�*�G�N�����	�*�G�����
�����r�c��t|ttf�rt|�}nt	|�}tj|�jd�S)Nr
)ryr��	bytearray�_calculate_md5_from_bytes�_calculate_md5_from_file�base64�	b64encoder)r�r0�
binary_md5s   r�
calculate_md5r��sA���$��	�*�+�.�t�4�
�-�d�3�
����J�'�.�.�w�7�7r�c�8�t|�}|j�Sr�)rr)�
body_bytes�md5s  rr�r��s��
�*�
�C��:�:�<�r�c�����j�}t�}t�fd�d�D]}|j|���j	|�|j�S)Nc�&���jd�Sr�r�)�fileobjs�rr�z*_calculate_md5_from_file.<locals>.<lambda>�s���g�l�l�;�7�r�r�)r�rrrr�r)r��start_positionr�rs`   rr�r��sP����\�\�^�N�
�)�C��7��=����
�
�5����L�L�� ��:�:�<�r�c�n�|jdi�jdi�}|jd�dk(S)Nr�rrrr�)rrs  r�_is_s3express_requestr��s;�� �*�*�Y��3�7�7��r����"�"�9�-��<�<r�c�T�|d}d|vry|D]}tj|�s�yy)Nr��Content-MD5TF)�CHECKSUM_HEADER_PATTERNrJ)rr�r�s   r�_has_checksum_headerr��s@���Y��G��������"�(�(��0���r�c�L�t|�st|fi|��t|fi|��yyr�)r��conditionally_calculate_md5�conditionally_enable_crc32)rr0s  r� conditionally_calculate_checksumr��s)����'�#�F�5�f�5�"�6�4�V�4�(r�c��|jdi�jdi�}|jd�}t|�r|d�|dvrddddd	�i|dd<yyyy)
Nr�r�request_algorithmr�)N�conditional-md5�crc32r�zx-amz-checksum-crc32)�	algorithm�inr�)r�r�)rr0�checksum_context�checksum_algorithms    rr�r��s����z�z�)�R�0�4�4�Z��D��)�-�-�.A�B���f�%��6�N�&��";�;�
 �$��.�"�)
��y��*�%�
<�
'�	&r�c���|d}|jdi�jdi�}|jd�}|r|dk7ryt|�ryt|�rytr|�t	|fi|��}||dd<yyy)	z1Only add a Content-MD5 if the system supports it.r�r�rr�r�Nr�r�)r�r�r�rr�)rr0r�r�r��
md5_digests      rr�r��s����&�>�D��z�z�)�R�0�4�4�Z��D��)�-�-�.A�B���0�4E�E���F�#���V�$����)�"�4�2�6�2�
�+5��y��-�(�*�}r�c��eZdZefd�Zd�Zy)�FileWebIdentityTokenLoaderc� �||_||_yr�)�_web_identity_token_pathr�)r��web_identity_token_pathr�s   rr�z#FileWebIdentityTokenLoader.__init__
s��(?��%���
r�c��|j|j�5}|j�cddd�S#1swYyxYwr�)r�r�r�)r��
token_files  r�__call__z#FileWebIdentityTokenLoader.__call__
s5��
�Z�Z��5�5�
6�	%�*��?�?�$�	%�	%�	%�s�6�?N)r�r�r��openr�r�r�r�rr�r�
s��6:��%r�r�c�*�eZdZdd�Zd�Zdd�Zdd�Zy)�SSOTokenLoaderNc��|�i}||_yr�)r�)r�r�s  rr�zSSOTokenLoader.__init__
s���=��E���r�c�r�|}|�|}tj|jd��j�S)Nr�)r�sha1r�r)r��	start_url�session_namer�s    r�_generate_cache_keyz"SSOTokenLoader._generate_cache_key
s5���	��#�$�I��|�|�I�,�,�W�5�6�@�@�B�Br�c�F�|j||�}||j|<yr�)rr�)r�r�r<r�rs     r�
save_tokenzSSOTokenLoader.save_token
s"���,�,�Y��E�	�!&����I�r�c��|j||�}tjd|���||jvr|}|�|}d|�d�}t	|���|j|}d|vsd|vrd|�d�}t	|���|S)NzChecking for cached token at: z
Token for z does not existrA�accessToken�	expiresAtz is invalid)rrrr�r/)r�r�r�rr�rBr<s       rr�zSSOTokenLoader.__call__
s����,�,�Y��E�	����5�i�[�A�B��D�K�K�'��D��'�#��$�T�F�/�:�I�#�i�8�8����I�&����%��E�)A�$�Y�K�{�;�I�#�i�8�8��r�r�)r�r�r�r�rrr�r�r�rr�r�

s���
C�'�r�r�c�6�eZdZdZdZd	d�Zd�Zd�Zd�Zd
d�Z	y)�EventbridgeSignerSetterr�r�Nc�.�||_||_||_yr�)rcr�r�)r�r�r�rLs    rr�z EventbridgeSignerSetter.__init__2
s��"3������)��r�c�t�|jd|j�|jd|j�y)Nz'before-parameter-build.events.PutEventszbefore-call.events.PutEvents)r��check_for_global_endpoint�set_endpoint_urlr�s  rr�z EventbridgeSignerSetter.register7
s7�����5��*�*�	
�	���*�D�,A�,A�	
r�c�^�d|vr)|d}tjd|d�d|���||d<yy)N�eventbridge_endpointzRewriting URL from r�r�)rrros     rrz(EventbridgeSignerSetter.set_endpoint_url@
sA��!�W�,��5�6�H��L�L�.�v�e�}�o�T�(��L�M�$�F�5�M�-r�c��|jd�}|�yt|�dk(rtd���tst	d���|jd�}d}|�'|j
rtd���|jrdg}|j�=td	|���}|j|k7rtd
���|j||��}n|j}||d<d
|d<y)N�
EndpointIdrz+EndpointId must not be a zero length stringr�zqUsing EndpointId requires an additional dependency. You will need to pip install botocore[crt] before proceeding.r�z>FIPS is not supported with EventBridge multi-region endpoints.r9�https://z-EndpointId is not a valid hostname component.��endpoint_variant_tagsr
�v4ar7)r�r�r&rr-r�r�r�rrI�_get_global_endpoint)	r�rr�r0rrFrrT�resolved_endpoints	         rr
z1EventbridgeSignerSetter.check_for_global_endpointF
s���:�:�l�+������x�=�A��3�A��
��,�3��
����_�-�� $�����'�'�7�.����,�,�)4�
�%����%��x��z�2�3�E��~�~��)�7�G���!%� 9� 9��0E�!:�!��!%� 2� 2��*;��&�'�$���r�c��|j}|j|j�}|�|j}|j	||��}|�|j
}d|�d|�d�S)Nrrz.endpoint.events.r�)rc�get_partition_for_regionr�r�r�r�)r�rrr�r{r�s      rrz,EventbridgeSignerSetter._get_global_endpointr
sv���*�*���5�5�d�l�l�C�	����/�/�I��6�6��-B�7�
�
����1�1�J��(��#4�Z�L��B�Br�r�r�)
r�r�r�r�r�r�r�rr
rr�r�rrr.
s)����)��*�

�%�*%�XCr�rc�*�|�yt|�}|jjd�r|jdvry|jj	d�}|ddk7ry|dd}t|�tt
|��k7rytd	�|D��S)
z�Does the URL match the S3 Accelerate endpoint scheme?

    Virtual host naming style with bucket names in the netloc part of the URL
    are not allowed by this function.
    Fr�)�https�httpr�rrr6rc3�,K�|]}|tv���y�wr�rrs  rrz'is_s3_accelerate_url.<locals>.<genexpr>�
s����C��q�+�+�C�r)rrorrqr�r�rr)r��	url_partsrTrs    r�is_s3_accelerate_urlr�
s����{����
�I����$�$���	�	�	�!2�	2��
���"�"�3�'�E��Q�x�?�"���!�B�K�M��=��S��]�!3�4�4���C�]�C�C�Cr�c��eZdZdZej
j
ej
jdddd��Zedfd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zdd�Zy)�
JSONFileCachez�JSON file cache.
    This provides a dict like interface that stores JSON serializable
    objects.
    The objects are serialized to JSON and stored in a file.  These
    values can be retrieved at a later time.
    �~z.aws�botor�Nc�<�||_|�|j}||_yr�)�_working_dir�_default_dumps�_dumps)r��working_dir�
dumps_funcs   rr�zJSONFileCache.__init__�
s"��'������,�,�J� ��r�c�D�tj||j��S)N)r�)r�dumpsr�)r�r s  rr$zJSONFileCache._default_dumps�
s���z�z�#�t�'@�'@�A�Ar�c�b�|j|�}tjj|�Sr�)�_convert_cache_keyr�r��isfile)r�r�
actual_keys   r�__contains__zJSONFileCache.__contains__�
s%���,�,�Y�7�
��w�w�~�~�j�)�)r�c���|j|�}	t|�5}tj|�cddd�S#1swYyxYw#tt
f$rt
|��wxYw)z Retrieve value from a cache key.N)r+r�r�loadr�rs�KeyError)r�rr-r�s    r�__getitem__zJSONFileCache.__getitem__�
s_���,�,�Y�7�
�	&��j�!�
$�Q��y�y��|�
$�
$�
$����$�	&��9�%�%�	&�s%�A	�=�	A	�A�A	�A	�	A$c��|j|�}	t|�}|j�y#t$rt	|��wxYwr�)r+r�unlink�FileNotFoundErrorr1)r�rr-�key_paths    r�__delitem__zJSONFileCache.__delitem__�
sE���,�,�Y�7�
�	&��J�'�H��O�O��� �	&��9�%�%�	&�s	�/�Ac��|j|�}	|j|�}tj
j
|j�st	j|j�t	jt	j|tjtjzd�d�5}|j�|j|�ddd�y#ttf$rtd|����wxYw#1swYyxYw)Nz3Value cannot be cached, must be JSON serializable: i��w)r+r%r�rsr�r��isdirr#�makedirs�fdopenr��O_WRONLY�O_CREAT�truncate�write)r�rr��full_key�file_contentr�s      r�__setitem__zJSONFileCache.__setitem__�
s����*�*�9�5��	��;�;�u�-�L��w�w�}�}�T�.�.�/��K�K��)�)�*�
�Y�Y��G�G�H�b�k�k�B�J�J�6��>��
�	"�
�
�J�J�L�
�G�G�L�!�		"�	"���:�&�	��&�&+�W�.��
�	��	"�	"�s�C!�6"D�!C?�Dc�`�tjj|j|dz�}|S)Nz.json)r�r�r�r#)r�r�	full_paths   rr+z JSONFileCache._convert_cache_key�
s'���G�G�L�L��!2�!2�I��4G�H�	��r�c�l�t|t�r#|r|j�S|jd�S|Sr�r�r�s   rr�z"JSONFileCache._serialize_if_needed�
r�r�rS)r�r�r�r�r�r��
expanduserr��	CACHE_DIRr�r$r.r2r7rCr+r�r�r�rrr�
s^������"�"�2�7�7�<�<��V�V�W�#M�N�I�#,��!�B�*�&�&�"�"�r�rc�*�|�y|jd�S)NFz--x-s3)rr�s r�is_s3express_bucketrJ�
s��
�~���?�?�8�$�$r��appmeshzapp-mesh�globalacceleratorzglobal-acceleratorziotevents-dataziot-events-data�	ioteventsz
iot-events�iotwirelessziot-wireless�kinesisanalyticsv2zkinesis-analytics-v2zlexv2-modelsz
lex-models-v2z
lexv2-runtimezlex-runtime-v2z	sms-voicezpinpoint-sms-voice�	s3controlrMzservice-catalog-appregistry)rkrmrnrpzservicecatalog-appregistryrsrt)TrSr�)z
ISO-8859-1)�r�rr�
email.messagerXr�rr��loggingr�r�r�r�r�rdr�r��	ipaddressr�pathlibr�urllib.requestrr�dateutil.parserr��dateutil.tzr�urllib3.exceptionsr	r��botocore.awsrequest�botocore.httpsession�botocore.compatr
rrr
rrrrrrrrrrrrrrrrr�botocore.exceptionsrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5�	getLoggerr�rrTrrr��
SAFE_CHARSrRr`r/r��
EVENT_ALIASESrSr�r�r�r�r�r�r�r�r�r�r�r��	Exceptionr�r�r�rVr�r�r�r�r�r�r�r�r�r�r�r�r�r�r	rrrr%rMrOrVrr\rdrjrgrnr�r�r�r�r�r�r�r�r�r�r�rr_rsrtr8r�r�r"r]r�r�rr�r�r�r�r�r�r�r�r�r�r�r�r�rrrrJ�SERVICE_NAME_ALIASES�.CLIENT_NAME_TO_HYPHENIZED_SERVICE_ID_OVERRIDESr�r�r�<module>rcs�
��������	��	�
�	�
����/� ��3���1����$�$�*�$�$�*�'����� �������4
��	�	�8�	$��#$� �-��2��*���
��2�:�:�4�5������	��'�-��J�	��J��,�J��}�J��9�	J�
�[�J��-�
J��9�J��+�J��>�J��-�J�	�/�J��-�J��-�J��.�J�
��J� 
�*�!J�"� �#J�$�*�%J�&�(�'J�(�O�)J�*�-�+J�,�5�-J�.�%�/J�0�0�1J�2
�'�3J�4	�
�5J�6�)�7J�8�+�9J�:��;J�<�4�=J�>��?J�@�-�AJ�B
�#�CJ�D�
(�EJ�F�U�GJ�H�@�IJ�J	�
!�KJ�L
�m�MJ�N��OJ�P� �QJ�R�*�SJ�T�5�UJ�V�/�WJ�X�+�YJ�Z�O�[J�\�.�]J�^�(�_J�`��aJ�b�)�cJ�d�@�eJ�f#�$D�gJ�h�2�iJ�j�1�kJ�l
�?�mJ�n�.�oJ�p�,�qJ�r�w�sJ�t�<�uJ�v�/�wJ�x� =�yJ�z�z�{J�|�(�}J�~�(�J�@�,�AJ�B
�:�CJ�D�'�EJ�F�7�GJ�H�'�IJ�J��'�*�,�SJ�
�\%�"�*�*�#�
�-�-���
��,�"N��"%�#�0�6@� �<�	�I�	��)��
@.�@.�F}�k�}�@?�?�D#�K�#�L$�:�(,�,��+5�##�L$.�'�*
D� >�&-�`*�Z�&!�67�B1�""�"�(a
�a
�H5�/�
#�:�:��6�	
�<6:�=?�@-��B�8;�&-�!��$�*0�$�$�D&�]�&�R4�4�nA
�A
�Hp+�p+�f	�*�	���8R
�R
�jW�W�tT;�T;�nB-�B-�JJ�!9�J�Zt9�t9�n��*�:�.8��
�=�
� 5�
�"6�,%�%���BPC�PC�fD�BB�B�J%�,�-@�A��<2��,�<2��-�<2��9�	<2�
�z�<2��>�
<2��-�<2�	�/�<2��-�<2��-�<2��.�<2�
��<2�
�*�<2��O�<2��%�<2� �-�!<2�"�0�#<2�$
�'�%<2�&	�
�'<2�(�)�)<2�*�+�+<2�,�-�-<2�.
�#�/<2�0�
(�1<2�2	�
!�3<2�4
�m�5<2�6�-�7<2�8� �9<2�:�*�;<2�<�5�=<2�>�/�?<2�@�'�A<2�B��C<2�D�>�E<2�F�+�G<2�H�0�I<2�J�O�K<2�L�.�M<2�N�O�O<2�P�(�Q<2�R�%�S<2�T��U<2�V�)�W<2�X#�$D�Y<2�Z�@�[<2�\�1�]<2�^
�?�_<2�`�%�a<2�b� =�c<2�d�z�e<2�f�(�g<2�h��i<2�j�'�7�'�"?��'�w<2�.r�
¿Qué es la limpieza dental de perros? - Clínica veterinaria


Es la eliminación del sarro y la placa adherida a la superficie de los dientes mediante un equipo de ultrasonidos que garantiza la integridad de las piezas dentales a la vez que elimina en profundidad cualquier resto de suciedad.

A continuación se procede al pulido de los dientes mediante una fresa especial que elimina la placa bacteriana y devuelve a los dientes el aspecto sano que deben tener.

Una vez terminado todo el proceso, se mantiene al perro en observación hasta que se despierta de la anestesia, bajo la atenta supervisión de un veterinario.

¿Cada cuánto tiempo tengo que hacerle una limpieza dental a mi perro?

A partir de cierta edad, los perros pueden necesitar una limpieza dental anual o bianual. Depende de cada caso. En líneas generales, puede decirse que los perros de razas pequeñas suelen acumular más sarro y suelen necesitar una atención mayor en cuanto a higiene dental.


Riesgos de una mala higiene


Los riesgos más evidentes de una mala higiene dental en los perros son los siguientes:

  • Cuando la acumulación de sarro no se trata, se puede producir una inflamación y retracción de las encías que puede descalzar el diente y provocar caídas.
  • Mal aliento (halitosis).
  • Sarro perros
  • Puede ir a más
  • Las bacterias de la placa pueden trasladarse a través del torrente circulatorio a órganos vitales como el corazón ocasionando problemas de endocarditis en las válvulas. Las bacterias pueden incluso acantonarse en huesos (La osteomielitis es la infección ósea, tanto cortical como medular) provocando mucho dolor y una artritis séptica).

¿Cómo se forma el sarro?

El sarro es la calcificación de la placa dental. Los restos de alimentos, junto con las bacterias presentes en la boca, van a formar la placa bacteriana o placa dental. Si la placa no se retira, al mezclarse con la saliva y los minerales presentes en ella, reaccionará formando una costra. La placa se calcifica y se forma el sarro.

El sarro, cuando se forma, es de color blanquecino pero a medida que pasa el tiempo se va poniendo amarillo y luego marrón.

Síntomas de una pobre higiene dental
La señal más obvia de una mala salud dental canina es el mal aliento.

Sin embargo, a veces no es tan fácil de detectar
Y hay perros que no se dejan abrir la boca por su dueño. Por ejemplo…

Recientemente nos trajeron a la clínica a un perro que parpadeaba de un ojo y decía su dueño que le picaba un lado de la cara. Tenía molestias y dificultad para comer, lo que había llevado a sus dueños a comprarle comida blanda (que suele ser un poco más cara y llevar más contenido en grasa) durante medio año. Después de una exploración oftalmológica, nos dimos cuenta de que el ojo tenía una úlcera en la córnea probablemente de rascarse . Además, el canto lateral del ojo estaba inflamado. Tenía lo que en humanos llamamos flemón pero como era un perro de pelo largo, no se le notaba a simple vista. Al abrirle la boca nos llamó la atención el ver una muela llena de sarro. Le realizamos una radiografía y encontramos una fístula que llegaba hasta la parte inferior del ojo.

Le tuvimos que extraer la muela. Tras esto, el ojo se curó completamente con unos colirios y una lentilla protectora de úlcera. Afortunadamente, la úlcera no profundizó y no perforó el ojo. Ahora el perro come perfectamente a pesar de haber perdido una muela.

¿Cómo mantener la higiene dental de tu perro?
Hay varias maneras de prevenir problemas derivados de la salud dental de tu perro.

Limpiezas de dientes en casa
Es recomendable limpiar los dientes de tu perro semanal o diariamente si se puede. Existe una gran variedad de productos que se pueden utilizar:

Pastas de dientes.
Cepillos de dientes o dedales para el dedo índice, que hacen más fácil la limpieza.
Colutorios para echar en agua de bebida o directamente sobre el diente en líquido o en spray.

En la Clínica Tus Veterinarios enseñamos a nuestros clientes a tomar el hábito de limpiar los dientes de sus perros desde que son cachorros. Esto responde a nuestro compromiso con la prevención de enfermedades caninas.

Hoy en día tenemos muchos clientes que limpian los dientes todos los días a su mascota, y como resultado, se ahorran el dinero de hacer limpiezas dentales profesionales y consiguen una mejor salud de su perro.


Limpiezas dentales profesionales de perros y gatos

Recomendamos hacer una limpieza dental especializada anualmente. La realizamos con un aparato de ultrasonidos que utiliza agua para quitar el sarro. Después, procedemos a pulir los dientes con un cepillo de alta velocidad y una pasta especial. Hacemos esto para proteger el esmalte.

La frecuencia de limpiezas dentales necesaria varía mucho entre razas. En general, las razas grandes tienen buena calidad de esmalte, por lo que no necesitan hacerlo tan a menudo e incluso pueden pasarse la vida sin requerir una limpieza. Sin embargo, razas pequeñas como el Yorkshire o el Maltés, deben hacérselas todos los años desde cachorros si se quiere conservar sus piezas dentales.

Otro factor fundamental es la calidad del pienso. Algunas marcas han diseñado croquetas que limpian la superficie del diente y de la muela al masticarse.

Ultrasonido para perros

¿Se necesita anestesia para las limpiezas dentales de perros y gatos?

La limpieza dental en perros no es una técnica que pueda practicarse sin anestesia general , aunque hay veces que los propietarios no quieren anestesiar y si tiene poco sarro y el perro es muy bueno se puede intentar…… , pero no se va a poder pulir ni acceder a todas la zona de la boca …. Además los limpiadores dentales van a irrigar agua y hay riesgo de aspiración a vías respiratorias si no se realiza una anestesia correcta con intubación traqueal . En resumen , sin anestesia no se va hacer una correcta limpieza dental.

Tampoco sirve la sedación ya que necesitamos que el animal esté totalmente quieto, y el veterinario tenga un acceso completo a todas sus piezas dentales y encías.

Alimentos para la limpieza dental

Hay que tener cierto cuidado a la hora de comprar determinados alimentos porque no todos son saludables. Algunos tienen demasiado contenido graso, que en exceso puede causar problemas cardiovasculares y obesidad.

Los mejores alimentos para los dientes son aquellos que están elaborados por empresas farmacéuticas y llevan componentes químicos con tratamientos específicos para el diente del perro. Esto implica no solo limpieza a través de la acción mecánica de morder sino también un tratamiento antibacteriano para prevenir el sarro.

Conclusión

Si eres como la mayoría de dueños, por falta de tiempo , es probable que no estés prestando la suficiente atención a la limpieza dental de tu perro. Por eso te animamos a que comiences a limpiar los dientes de tu perro y consideres atender a su higiene bucal con frecuencia.

Estas simples medidas pueden conllevar a que tu perro tenga una vida más larga y mucho más saludable.

Si te resulta imposible introducir un cepillo de dientes a tu perro en la boca, pásate con él por clínica Tus Veterinarios y te explicamos cómo hacerlo.

Necesitas hacer una limpieza dental profesional a tu mascota?
Llámanos al 622575274 o contacta con nosotros

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

¡Hola!