
    M/e
              
       "   d Z ddlZddlmZ ddlmZ ddlmZ ddlZddlm	Z	 ddlm
Z
 ddlmZ dd	lmZ ej                  j!                   ej"                  d
            Z ej$                  d
      Z e	j(                  d      Z e	j*                  d      Z e	j*                  d      ZeegZde	j0                  de
j2                  de
j4                  fdZ eee
j8                        Z eee
j8                        Z eee
j8                        ZeegZ  ejB                  eed      Z" ejB                  eed      Z# ejB                  eed      Z$e"e#gZ%de
j2                  de&dee	j0                     dee
j2                     de
jN                  f
dZ(y)zACME utilities for testing.    N)Any)Dict)Iterable)
challenges)messages)auth_handler)utilzrsa512_key.pems+   evaGxfADs6pSRb2LAv9IZf17Dt3juxGJ+PCt92wr+oA)tokens    17817c66b60ce2e4012dfad92657527as    cafecafecafecafecafecafe0feedbacchallstatusreturnc                     | | j                   dz   |d}|t        j                  k(  r/|j                  dt        j                  j                         i       t        j                  di |S )z$Return ChallengeBody from Challenge._uri)r   urir   	validated )typr   STATUS_VALIDupdatedatetimenowChallengeBody)r   r   kwargss      9/usr/lib/python3/dist-packages/certbot/tests/acme_util.pychall_to_challbr      sa     yy6!F &&&{H$5$5$9$9$;<=!!+F++    zexample.comzexample.orgzesimerkki.example.orgauthz_statusdomainchallsstatusesc                    t        d t        ||      D              }t        j                  t        j                  |      |d}| t        j
                  k(  rH|j                  | t        j                  j                         t        j                  d      z   d       n|j                  d| i       t        j                  dt        j                  d
i |	      S )zGenerate 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

    c              3   :   K   | ]  \  }}t        ||        y w)N)r   ).0r   r   s      r   	<genexpr>zgen_authzr.<locals>.<genexpr>B   s#      E6 	v&s   )r   value)
identifierr      )days)r   expiresr   z%https://trusted.ca/new-authz-resource)r   bodyr   )tuplezipr   
IdentifierIDENTIFIER_FQDNr   r   r   r   	timedeltaAuthorizationResourceAuthorization)r   r   r   r    challbsauthz_kwargss         r   
gen_authzrr4   8   s       2 G
 ))((8$L
 x,,,"((,,.1C1C1LL
 	
 	l
 	 ))3##3l3 r   ))__doc__r   typingr   r   r   josepyjoseacmer   r   certbot._internalr   certbot.testsr	   JWKloadload_vectorload_rsa_private_keyKEYHTTP01DNS01DNS01_2
CHALLENGES	ChallengeStatusr   r   STATUS_PENDINGHTTP01_PDNS01_P	DNS01_P_2CHALLENGES_Pchallb_to_achallHTTP01_ADNS01_A	DNS01_A_2ACHALLENGESstrr0   r4   r   r   r   <module>rR      s   !        * 
hhmm$D$$%567d 01 
		
8
:
BC
*

!D
Ee_
,:// , ,XMcMc , 68#:#:;
%!8!8
9GX%<%<=	'" )<((3F
',
'
'm
D)L)))S:QR	! X__  c  8JL`L`Ca  !(//2 7?7U7U r   