File: //usr/lib/python3/dist-packages/certbot/tests/__pycache__/acme_util.cpython-310.pyc
o
6��a � @ s d Z ddlZddlZddlmZ ddlmZ ddlmZ ddl m
Z
ej�e
�
d��Ze
�d�Zejdd �Zejd
d �Zejdd �ZeegZdd
� Zdd� Zeeej�Zeeej�Zeeej�ZeegZe�eed�Ze�eed�Ze�eed�ZeegZddd�Z dS )zACME utilities for testing.� N)�
challenges)�messages)�auth_handler)�utilzrsa512_key.pems+ evaGxfADs6pSRb2LAv9IZf17Dt3juxGJ+PCt92wr+oA)�tokens 17817c66b60ce2e4012dfad92657527as cafecafecafecafecafecafe0feedbacc C s t dd� t| �D ��S )z*Generate natural combinations for challbs.c s s � | ]\}}|fV qd S �N� )�.0�i�_r r �9/usr/lib/python3/dist-packages/certbot/tests/acme_util.py� <genexpr> s � zgen_combos.<locals>.<genexpr>)�tuple� enumerate)�challbsr r r �
gen_combos s r c C s@ | | j d |d�}|tjkr|�dtj�� i� tjdi |��S )z$Return ChallengeBody from Challenge.�_uri)�chall�uri�status� validatedNr )�typr �STATUS_VALID�update�datetime�now�
ChallengeBody)r r �kwargsr r r �chall_to_challb s �
r zexample.comzexample.orgzesimerkki.example.orgTc C s� t dd� t||�D ��}tjtj|d�|d�}|r"|�dt|�i� | tjkr9|�| tj� � tj
dd� d�� n|�d | i� tjd
tjd
i |��d�S )a& Generate an authorization resource.
:param authz_status: Status object
:type authz_status: :class:`acme.messages.Status`
:param list challs: Challenge objects
:param list statuses: status of each challenge object
:param bool combos: Whether or not to add combinations
c s s � | ]
\}}t ||�V qd S r )r )r r r r r r r
E s
� �
�zgen_authzr.<locals>.<genexpr>)r �value)�
identifierr �combinations� )�days)r �expiresr z%https://trusted.ca/new-authz-resource)r �bodyNr )
r �zipr �
Identifier�IDENTIFIER_FQDNr r r r r � timedelta�AuthorizationResource�
Authorization)�authz_status�domain�challs�statuses�combosr �authz_kwargsr r r �
gen_authzr; s,
���
���r2 )T)!�__doc__r �josepy�jose�acmer r �certbot._internalr �
certbot.testsr �JWK�load�load_vector�load_rsa_private_key�KEY�HTTP01�DNS01�DNS01_2�
CHALLENGESr r �STATUS_PENDING�HTTP01_P�DNS01_P� DNS01_P_2�CHALLENGES_P�challb_to_achall�HTTP01_A�DNS01_A� DNS01_A_2�ACHALLENGESr2 r r r r �<module> s4
�