HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/awscli/customizations/__pycache__/cloudfront.cpython-310.pyc
o

.&�aT)�@s�ddlZddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZddlm
Z
dd�Zdd
d�Zdd
�ZGdd�de	�ZGdd�de	�ZGdd�de�ZGdd�de�ZGdd�de�Zdd�ZGdd�de
�ZGdd�de�ZdS)�N)�parse_to_aware_datetime)�CloudFrontSigner)�CustomArgument)�#validate_mutually_exclusive_handler)�BasicCommandcs�|�dt�|�dt�|�dtdgdg��|�dtddgd	g��|�d
dd��|�d
d
d��i�|jd�jdd�|�dtdgd	g��|�d�fdd��dS)Nz!building-command-table.cloudfrontz6building-argument-table.cloudfront.create-invalidationz4operation-args-parsed.cloudfront.create-invalidation�invalidation_batch�pathsz4operation-args-parsed.cloudfront.create-distribution�default_root_object�origin_domain_name�distribution_configz6building-argument-table.cloudfront.create-distributionc[�|�dt|��S)N�origin-domain-name)�__setitem__�OriginDomainName��argument_table�kwargs�r�B/usr/lib/python3/dist-packages/awscli/customizations/cloudfront.py�<lambda>+��zregister.<locals>.<lambda>c[r)N�default-root-object)r�CreateDefaultRootObjectrrrrr/rztop-level-args-parsed�
cloudfront)�	unique_idz4operation-args-parsed.cloudfront.update-distributionz6building-argument-table.cloudfront.update-distributioncs|�dt�|d��S)Nr)�contextr)r�UpdateDefaultRootObjectr�rrrr;s
��)�register�	_add_sign�
_add_pathsr�update)�
event_handlerrrrrsJ���������
�r�clicCsd|tt���t�dd�fS)Nz%s-%s-%s�i@B)�int�time�random�randint��prefixrrr�
unique_string@sr+cKsd|d_t�|d<dS)NFzinvalidation-batchr)�required�
PathsArgumentrrrrr Ds
r c�$eZdZ�fdd�Zdd�Z�ZS)r-csd}tt|�jdd|d�dS)NzlThe space-separated paths to be invalidated. Note: --invalidation-batch and --paths are mututally exclusive.r�+)�nargs�	help_text)�superr-�__init__)�self�doc��	__class__rrr3Ks�zPathsArgument.__init__cCs*|durt�t|�|d�d�|d<dSdS)N��Quantity�Items)�CallerReference�Paths�InvalidationBatch)r+�len�r4�
parameters�valuerrr�
add_to_paramsRs
��zPathsArgument.add_to_params��__name__�
__module__�__qualname__r3rB�
__classcell__rrr6rr-Isr-cs,eZdZdZ	d�fdd�	Zdd�Z�ZS)	�ExclusiveArgumentz2%s This argument and --%s are mututally exclusive.�distribution-config�cs,d||_tt|�j||j||fd�dS)NF�r1)r,r2rHr3�DOC)r4�namer�exclusive_tor1r6rrr3]s


�zExclusiveArgument.__init__cCs4t�dgd�ddddid�ddd�d	dd
�ddd
�S)Nrr8�placeholderF�Forward�none)�QueryString�Cookies)�Enabledr9z	allow-all)�TargetOriginId�ForwardedValues�TrustedSigners�ViewerProtocolPolicy�MinTTLTrJ)r;�Origins�DefaultCacheBehaviorrT�Comment)r+)r4rrr�distribution_config_templatecs���
�z.ExclusiveArgument.distribution_config_template)rIrJ)rDrErFrLr3r]rGrrr6rrHZs
�rHcr.)rcstt|�jd|dd�dS)Nr
z The domain name for your origin.rK)r2rr3)r4rr6rrr3zs

�zOriginDomainName.__init__cCs�|durdS|�d|���t|d�}||dd�}|d�d�r'ddi|d<nd	d
dd�|d
<d|gd�|dd<||ddd<dS)N�DistributionConfigr)rJ)�Id�
DomainName�
OriginPathr`z.s3.amazonaws.com�OriginAccessIdentity�S3OriginConfig�Pi�z	http-only)�HTTPPort�	HTTPSPort�OriginProtocolPolicy�CustomOriginConfigr$r8rZr[rU)�
setdefaultr]r+�endswith)r4r@rA�	origin_id�itemrrrrBs$�

��
��zOriginDomainName.add_to_paramsrCrrr6rrysrcs&eZdZd�fdd�	Zdd�Z�ZS)rrJcstt|�jd||p
dd�dS)NrzvThe object that you want CloudFront to return (for example, index.html) when a viewer request points to your root URL.rK)r2rr3)r4rr1r6rrr3�s

�z CreateDefaultRootObject.__init__cCs,|dur|�d|���||dd<dSdS)Nr^�DefaultRootObject)rir]r?rrrrB�s��z%CreateDefaultRootObject.add_to_params)rJrCrrr6rr�srcr.)rcstt|�j|dd�||_dS)Nz�The object that you want CloudFront to return (for example, index.html) when a viewer request points to your root URL. CLI will automatically make a get-distribution-config call to load and preserve your other settings.rK)r2rr3r)r4rrr6rrr3�s

�
z UpdateDefaultRootObject.__init__cCst|dur8|jdjd|jdj|jdj|jdjd�}|j|dd�}|d|d<|d	|d	<||d	d
<dSdS)N�sessionr�parsed_args)�region_name�endpoint_url�verifyr_)r_�ETag�IfMatchr^rm)r�
create_client�regionrq�
verify_ssl�get_distribution_config)r4r@rA�client�responserrrrB�s



��z%UpdateDefaultRootObject.add_to_paramsrCrrr6rr�s	rcKst|�|d<dS)N�sign)�SignCommand)�
command_tablernrrrrr��rc@sfeZdZdZdZdZddddd�ddd	d
�dddd
�d
dded
�dded�ddd�gZdd�ZdS)r|r{zSign a given url.aOSupported formats include:
        YYYY-MM-DD (which means 0AM UTC of that day),
        YYYY-MM-DDThh:mm:ss (with default timezone as UTC),
        YYYY-MM-DDThh:mm:ss+hh:mm or YYYY-MM-DDThh:mm:ss-hh:mm (with offset),
        or EpochTime (which always means UTC).
        Do NOT use YYYYMMDD, because it will be treated as EpochTime.�urlTzThe URL to be signed)rM�no_paramfiler,r1zkey-pair-idz_The active CloudFront key pair Id for the key pair that you're using to generate the signature.)rMr,r1zprivate-keyz#file://path/to/your/private-key.pemzdate-less-thanz*The expiration date and time for the URL. zdate-greater-thanz-An optional start date and time for the URL. )rMr1z
ip-addressztAn optional IP address or IP address range to allow client making the GET request from. Format: x.x.x.x/x or x.x.x.xcCs�t|jt|j�j�}t|j�}|j}|durt|�}|dus#|jdur<|j	|j
|||jd�}tj�
|j|j
|d��dStj�
|j|j
|d��dS)N)�date_greater_than�
ip_address)�policy)�date_less_thanr)r�key_pair_id�	RSASigner�private_keyr{rr�r�r��build_policyr�sys�stdout�write�generate_presigned_url)r4�args�parsed_globals�signerr�r�r�rrr�	_run_main�s(�
�
�
��zSignCommand._run_mainN)rDrErF�NAME�DESCRIPTION�DATE_FORMAT�	ARG_TABLEr�rrrrr|�s8�������%r|c@seZdZdd�Zdd�ZdS)r�cCstj�|�d��|_dS)N�utf8)�rsa�
PrivateKey�
load_pkcs1�encode�priv_key)r4r�rrrr3szRSASigner.__init__cCst�||jd�S)NzSHA-1)r�r{r�)r4�messagerrrr{r~zRSASigner.signN)rDrErFr3r{rrrrr��sr�)r#)r�r&r'r��botocore.utilsr�botocore.signersr�awscli.argumentsr�awscli.customizations.utilsr�awscli.customizations.commandsrrr+r r-rHrrrrr|�objectr�rrrr�<module>s(
&A