| Server IP : 3.96.16.70 / Your IP : 216.73.216.15 Web Server : Apache System : Linux ip-172-31-26-103.ca-central-1.compute.internal 6.1.163-186.299.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Feb 24 16:35:42 UTC 2026 x86_64 User : ec2-user ( 1000) PHP Version : 8.4.18 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /lib/python3.9/site-packages/cfnbootstrap/__pycache__/ |
Upload File : |
a
��0i�$ � @ s� d Z ddlmZ ddlmZ ddlmZmZ ddlmZ ddl m
Z
ddlZddlZddl
mZmZ e�d �ZG d
d� dej�ZG dd
� d
e�ZdS )z�
SQS client-related classes
Classes:
SQSClient - an HTTP client that makes API calls against SQS
Message - a message from an SQS queue
� )�
aws_client)�V4Signer)�retry_on_failure�timeout)�
endpoint_tool)�ElementTreeN)�StringIO�BytesIOz
cfn.clientc s� e Zd ZdZdZde Zd� fdd� Zdd � Zed
d� �Z edd
� �Z
eej
�e�d�ed�ddd���Zedej
�e�d�e� ddd���Zeej
�e�d�e� ddd���Z� ZS )� SQSClientaO
Makes API calls against SQS
Notes:
- Public methods of this class have a 1-to-1 equivalence to published SQS APIs.
- Calls are retried internally when appropriate; callers should not retry.
Attributes:
_apiVersion - the SQS API version
_xmlns - the XML namespace for the SQS API version in use
z
2012-11-05�"http://queue.amazonaws.com/doc/%s/N� us-east-1c sp |st �|�}n
| �|�}|s(t �|�}|s4td��t|d�}tt | �j|d||dt j |d� t �
d|� d S )Nz(Region is required for AWS V4 SignaturesZsqsFr )�signer�xmlns� proxyinfoz'SQS client initialized with endpoint %s)r
�endpointForRegion�
_fix_endpoint�regionForEndpoint�
ValueErrorr �super�__init__�_apiVersion�log�debug)�selfZcredentials�url�regionr �endpointr
�� __class__� �;/usr/lib/python3.9/site-packages/cfnbootstrap/sqs_client.pyr 5 s
�zSQSClient.__init__c C s� t �tj|�pt �tj|�}|r�t�d�D ]V}|j|�d�kr*|j}|� d�rj|�d��
d�rj|d d� }d||�d�f S q*dtj|�d�|�d�f S |S )N� AmazonSQS� �.cn� ���zhttps://%s%s�https://)�re�matchr �SQS_PATTERN�SQS_LEGACY_PATTERN�get_endpoints_for_servicer �group�hostname�endswith�
startswith�
SQS_FORMAT)r Zunparsed_url�mr Zfixed_hostnamer r r r J s �zSQSClient._fix_endpointc C sH t �d�D ]}|j|kr
d|j S q
dt j||�d�r>dndf S )Nr! �
https://%sr&