https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/boto/vendored/regions/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/boto/vendored/regions/__pycache__/regions.cpython-310.pyc
o

ckF[� �@sZdZddlZddlZddlmZe�e�ZdZdiiZ	Gdd�de
�ZGdd	�d	e�ZdS)
z�Resolves regions and endpoints.

This module implements endpoint resolution, including resolving endpoints for a
given service and region and resolving the available endpoints for a service
in a specific AWS partition.
�N)�
NoRegionErrorz{service}.{region}.{dnsSuffix}�	endpointsc@s0eZdZdZddd�Zdd�Z		dd	d
�ZdS)
�BaseEndpointResolverz3Resolves regions and endpoints. Must be subclassed.NcC�t�)a7Resolves an endpoint for a service and region combination.

        :type service_name: string
        :param service_name: Name of the service to resolve an endpoint for
            (e.g., s3)

        :type region_name: string
        :param region_name: Region/endpoint name to resolve (e.g., us-east-1)
            if no region is provided, the first found partition-wide endpoint
            will be used if available.

        :rtype: dict
        :return: Returns a dict containing the following keys:
            - partition: (string, required) Resolved partition name
            - endpointName: (string, required) Resolved endpoint name
            - hostname: (string, required) Hostname to use for this endpoint
            - sslCommonName: (string) sslCommonName to use for this endpoint.
            - credentialScope: (dict) Signature version 4 credential scope
              - region: (string) region name override when signing.
              - service: (string) service name override when signing.
            - signatureVersions: (list<string>) A list of possible signature
              versions, including s3, v4, v2, and s3v4
            - protocols: (list<string>) A list of supported protocols
              (e.g., http, https)
            - ...: Other keys may be included as well based on the metadata
        ��NotImplementedError)�self�service_name�region_name�r�?/usr/lib/python3/dist-packages/boto/vendored/regions/regions.py�construct_endpointsz'BaseEndpointResolver.construct_endpointcCr)z�Lists the partitions available to the endpoint resolver.

        :return: Returns a list of partition names (e.g., ["aws", "aws-cn"]).
        r)rrrr�get_available_partitions<sz-BaseEndpointResolver.get_available_partitions�awsFcCr)a�Lists the endpoint names of a particular partition.

        :type service_name: string
        :param service_name: Name of a service to list endpoint for (e.g., s3)

        :type partition_name: string
        :param partition_name: Name of the partition to limit endpoints to.
            (e.g., aws for the public AWS endpoints, aws-cn for AWS China
            endpoints, aws-us-gov for AWS GovCloud (US) Endpoints, etc.

        :type allow_non_regional: bool
        :param allow_non_regional: Set to True to include endpoints that are
             not regional endpoints (e.g., s3-external-1,
             fips-us-gov-west-1, etc).
        :return: Returns a list of endpoint names (e.g., ["us-east-1"]).
        r)rr	�partition_name�allow_non_regionalrrr�get_available_endpointsCsz,BaseEndpointResolver.get_available_endpoints�N�rF)�__name__�
__module__�__qualname__�__doc__r
rrrrrrrs
�rc@s`eZdZdZdd�Zdd�Z		ddd	�Zddd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zd
S)�EndpointResolverz7Resolves endpoints based on partition endpoint metadatacCsd|vrtd��||_dS)zA
        :param endpoint_data: A dict of partition data.
        �
partitionsz%Missing "partitions" in endpoint dataN)�
ValueError�_endpoint_data)r�
endpoint_datarrr�__init__Zs
zEndpointResolver.__init__cCs&g}|jdD]	}|�|d�q|S)Nr�	partition�r�append)r�resultrrrrrbsz)EndpointResolver.get_available_partitionsrFcCsdg}|jdD](}|d|krq|d}||vrq||dD]}|s)||dvr.|�|�qq|S)Nrr�servicesr�regionsr )rr	rrr"rr#�
endpoint_namerrrrhs
��z(EndpointResolver.get_available_endpointsNcCs.|jdD]}|�|||�}|r|SqdS)Nr)r�_endpoint_for_partition)rr	r
rr"rrrr
vs���z#EndpointResolver.construct_endpointcCs�|d�|t�}|durd|vr|d}nt��||dvr&|�||||�S|�||�rZ|�d�}|�dd�}|rK|sKt�d|||�|�||||�St�d||�|�||||�SdS)Nr#�partitionEndpointr�isRegionalizedTz'Using partition endpoint for %s, %s: %sz*Creating a regex based endpoint for %s, %s)�get�DEFAULT_SERVICE_DATAr�_resolve�
_region_match�LOG�debug)rrr	r
�service_data�partition_endpoint�is_regionalizedrrrr&~s8�
�
�����z(EndpointResolver._endpoint_for_partitioncCs0||dvrdSd|vrt�|d��|�SdS)Nr$T�regionRegexF)�re�compile�match)rrr
rrrr,�s
zEndpointResolver._region_matchcCs�|d�|i�}|d|d<||d<|�|�di�|�|�|�di�|�|�dt�}|�||d||�|d<d|vrH|�||d||�|d<|d|d<|S)Nrr�endpointName�defaults�hostname�
sslCommonName�	dnsSuffix)r)�_merge_keys�DEFAULT_URI_TEMPLATE�_expand_template)rrr	r/r%r"r8rrrr+�s �
�zEndpointResolver._resolvecCs"|D]}||vr||||<qdSrr)r�	from_datar"�keyrrrr;�s
��zEndpointResolver._merge_keyscCs|j|||dd�S)Nr:)�service�regionr:)�format)rr�templater	r%rrrr=�s�z!EndpointResolver._expand_templaterr)
rrrrrrrr
r&r,r+r;r=rrrrrXs
�
r)
r�loggingr3� boto.vendored.regions.exceptionsr�	getLoggerrr-r<r*�objectrrrrrr�<module>s
;

https://t.me/RX1948 - 2025