o
    ckb                     @   s  d Z ddlmZ ddl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	 ddlm
Z
 dd	lmZ dd
lm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 ddlmZ dZi ddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?	Zi d@dA e D ZdBedCefdDdEZG dFdG dGejeZ G dHdI dIe Z!e!d(Z"e!dJZ#G dKdL dLej$Z%G dMdN dNej$ej&Z&G dOdP dPe Z'e'dQZ(e'dRZ)e'dSZ*e'dTZ+e'dUZ,e'dVZ-e'dWZ.e'dXZ/G dYdZ dZejZ0G d[d\ d\ej$Z1G d]d^ d^e1Z2G d_d` d`ej$Z3G dadb dbZ4edcdddeZ5G dfdd dde3Z6G dgdh dhe6Z7G didj dje6Z8G dkdl dle2Z9G dmdn dne3Z:G dodp dpe1Z;G dqdr dre3Z<G dsdt dte<Z=G dudv dve<Z>G dwdx dxe2Z?G dydz dzej$Z@G d{d| d|e2ZAG d}d~ d~ej$ZBG dd de3ZCG dd de2ZDG dd deCZEdS )zACME protocol messages.    )HashableN)Any)Dict)Iterator)List)Mapping)MutableMapping)Optional)Tuple)Type)TypeVar)
challenges)errors)fields)jws)utilzurn:ietf:params:acme:error:accountDoesNotExistz4The request specified an account that does not existalreadyRevokedzOThe request specified a certificate to be revoked that has already been revokedbadCSRz2The CSR is unacceptable (e.g., due to a short key)badNoncez1The client sent an unacceptable anti-replay noncebadPublicKeyz>The JWS was signed by a public key the server does not supportbadRevocationReasonz;The revocation reason provided is not allowed by the serverbadSignatureAlgorithmz@The JWS was signed with an algorithm the server does not supportcaaz\Certification Authority Authorization (CAA) records forbid the CA from issuing a certificatecompoundzBSpecific error conditions are indicated in the "subproblems" array
connectionz?The server could not connect to the client to verify the domaindnszAThere was a problem with a DNS query during identifier validationdnssecz4The server could not validate a DNSSEC signed domainincorrectResponsez;Response received didn't match the challenge's requirementsinvalidEmailz1The provided email for a registration was invalidinvalidContactz$The provided contact URI was invalid	malformedz!The request message was malformedrejectedIdentifierz9The server will not issue certificates for the identifierzLThe request attempted to finalize an order that is not ready to be finalizedz,There were too many requests of a given typez(The server experienced an internal errorz=The server experienced a TLS error during domain verificationz)The client lacks sufficient authorizationz@A contact URL for an account used an unsupported protocol schemez*The server could not resolve a domain namez'An identifier is of an unsupported typez,The server requires external account binding)	orderNotReadyrateLimitedserverInternaltlsunauthorizedunsupportedContactunknownHostunsupportedIdentifierexternalAccountRequiredc                 C   s   i | ]	\}}t | |qS  )ERROR_PREFIX).0namedescr,   r,   :/opt/certbot/lib/python3.10/site-packages/acme/messages.py
<dictcomp>;   s    r2   errreturnc                 C   s"   t | tr| jdurt| jv S dS )z#Check if argument is an ACME error.NF)
isinstanceErrortypr-   )r3   r,   r,   r1   is_acme_error@   s   
r8   c                       s   e Zd ZU dZdZeZeed f e	d< deddf fddZ
defd	d
Zededd fddZdefddZdedefddZdefddZ  ZS )	_ConstantzACME constant.r/   POSSIBLE_NAMESr/   r4   Nc                    s   t    | | j|< || _d S N)super__init__r;   r/   selfr/   	__class__r,   r1   r>   L   s   


z_Constant.__init__c                 C      | j S r<   r:   r@   r,   r,   r1   to_partial_jsonQ   s   z_Constant.to_partial_jsonjobjc                 C   s&   || j vrt| j d| j | S )Nz not recognized)r;   joseDeserializationError__name__clsrF   r,   r,   r1   	from_jsonT   s   

z_Constant.from_jsonc                 C   s   | j j d| j dS )N())rB   rI   r/   rD   r,   r,   r1   __repr__Z   s   z_Constant.__repr__otherc                 C   s   t |t| o|j| jkS r<   )r5   typer/   )r@   rP   r,   r,   r1   __eq__]   s   z_Constant.__eq__c                 C   s   t | j| jfS r<   )hashrB   r/   rD   r,   r,   r1   __hash__`      z_Constant.__hash__)rI   
__module____qualname____doc__	__slots__NotImplementedr;   r   str__annotations__r>   rE   classmethodrL   rO   r   boolrR   intrT   __classcell__r,   r,   rA   r1   r9   G   s   
 r9   c                   @   &   e Zd ZU dZi Zeeef ed< dS )IdentifierTypezACME identifier type.r;   N	rI   rV   rW   rX   r;   r   r[   r9   r\   r,   r,   r,   r1   rb   d      
 rb   ipc                   @   s<   e Zd ZU dZejdejdZee	d< edZ
ee	d< dS )
IdentifierzJACME identifier.

    :ivar IdentifierType typ:
    :ivar str value:

    rQ   decoderr7   valueN)rI   rV   rW   rX   rG   fieldrb   rL   r7   r\   ri   r[   r,   r,   r,   r1   rf   m   s   
 rf   c                   @   s$  e Zd ZU dZejddddZeed< ejdddZ	eed< ejd	ddZ
eed	< ejd
ejddZed ed
< ejdddZeed  ed< ejdeeeef  ded fddZedededd fddZedee fddZedee fddZdededdfddZdefdd ZdS )!r6   a  ACME error.

    https://datatracker.ietf.org/doc/html/rfc7807

    Note: Although Error inherits from JSONObjectWithFields, which is immutable,
    we add mutability for Error to comply with the Python exception API.

    :ivar str typ:
    :ivar str title:
    :ivar str detail:
    :ivar Identifier identifier:
    :ivar tuple subproblems: An array of ACME Errors which may be present when the CA
            returns multiple errors related to the same request, `tuple` of `Error`.

    rQ   Tzabout:blank	omitemptydefaultr7   titlerl   detail
identifierrh   rl   rf   subproblems)r6   .ri   r4   c                 C      t dd | D S )Nc                 s       | ]}t |V  qd S r<   )r6   rL   )r.   
subproblemr,   r,   r1   	<genexpr>       z$Error.subproblems.<locals>.<genexpr>tupleri   r,   r,   r1   rs         zError.subproblemscodekwargsc                 K   s.   |t vr
td| t| }| dd|i|S )zCreate an Error instance with an ACME Error code.

        :str code: An ACME error code, like 'dnssec'.
        :kwargs: kwargs to pass to Error.

        z4The supplied code: %s is not a known ACME error coder7   Nr,   )ERROR_CODES
ValueErrorr-   )rK   r}   r~   r7   r,   r,   r1   	with_code   s   zError.with_codec                 C   s   t | jS )zHardcoded error description based on its type.

        :returns: Description if standard ACME error or ``None``.
        :rtype: str

        )ERROR_TYPE_DESCRIPTIONSgetr7   rD   r,   r,   r1   description   s   zError.descriptionc                 C   s(   t | jjdddd }|tv r|S dS )zACME error code.

        Basically self.typ without the ERROR_PREFIX.

        :returns: error code if standard ACME code or ``None``.
        :rtype: str

        :   )maxsplitN)r[   r7   rsplitr   )r@   r}   r,   r,   r1   r}      s   
z
Error.coder/   Nc                 C   s   t | ||S r<   )object__setattr__)r@   r/   ri   r,   r,   r1   r      s   zError.__setattr__c                 C   st   d dd | j| j| j| jfD  }| jr!d| jj d| }| jr8t	| jdkr8| jD ]	}|d| 7 }q.|S )Ns    :: c                 s   s$    | ]}|d ur| ddV  qd S )Nasciibackslashreplace)encode)r.   partr,   r,   r1   rw      s    

z Error.__str__.<locals>.<genexpr>zProblem for z: r   
)
joinr7   r   rp   rn   decoderq   ri   rs   len)r@   resultrv   r,   r,   r1   __str__   s   

zError.__str__)rI   rV   rW   rX   rG   rj   r7   r[   r\   rn   rp   rf   rL   rq   r	   rs   r
   rh   r   r   r   r]   r   propertyr   r}   r   r   r,   r,   r,   r1   r6   x   s&   
 $	r6   c                   @   ra   )StatuszACME "status" field.r;   Nrc   r,   r,   r,   r1   r      rd   r   unknownpending
processingvalidinvalidrevokedreadydeactivatedc                   @   s   e Zd ZdZG dd dejZdeee	f ddfddZ
d	ede	fd
dZd	ede	fddZdeee	f fddZedeee	f dd fddZdS )	DirectoryzmDirectory.

    Directory resources must be accessed by the exact field name in RFC8555 (section 9.7.5).
    c                       s   e Zd ZU dZejdddZeed< ejdddZ	eed< ejdddZ
ee ed< ejd	ddZeed
< deddf fddZedefddZdee f fddZdedefddZ  ZS )zDirectory.MetazDirectory Meta.termsOfServiceTro   _terms_of_servicewebsitecaaIdentitiescaa_identitiesr+   external_account_requiredr~   r4   Nc                    ,    fdd|  D }t jdi | d S )Nc                       i | ]
\}}  ||qS r,   _internal_namer.   kvrD   r,   r1   r2          z+Directory.Meta.__init__.<locals>.<dictcomp>r,   itemsr=   r>   r@   r~   rA   rD   r1   r>         zDirectory.Meta.__init__c                 C   rC   )zURL for the CA TOS)r   rD   r,   r,   r1   terms_of_service      zDirectory.Meta.terms_of_servicec                 #   s0    t   D ]}|dkr|dd  n|V  qd S )Nr   r   r=   __iter__r?   rA   r,   r1   r      s   zDirectory.Meta.__iter__r/   c                 C   s   |dkrd| S |S )Nr   _r,   r?   r,   r,   r1   r      s   zDirectory.Meta._internal_name)rI   rV   rW   rX   rG   rj   r   r[   r\   r   r   r   r   r^   r   r>   r   r   r   r   r   r`   r,   r,   rA   r1   Meta   s   
 r   rF   r4   Nc                 C   s
   || _ d S r<   )_jobjr@   rF   r,   r,   r1   r>      s   
zDirectory.__init__r/   c              
   C   s0   z| | W S  t y } ztt|d }~ww r<   )KeyErrorAttributeErrorr[   )r@   r/   errorr,   r,   r1   __getattr__   s   
zDirectory.__getattr__c                 C   s,   z| j | W S  ty   td| dw )NzDirectory field "z" not found)r   r   r?   r,   r,   r1   __getitem__  s
   zDirectory.__getitem__c                 C   s   t | jdd S )Nc                 S   s   | S r<   r,   )r   r,   r,   r1   <lambda>  s    z+Directory.to_partial_json.<locals>.<lambda>)r   map_keysr   rD   r,   r,   r1   rE        zDirectory.to_partial_jsonc                 C   s    | j |di |d< | |S )Nmeta)r   rL   poprJ   r,   r,   r1   rL     s   zDirectory.from_json)rI   rV   rW   rX   rG   JSONObjectWithFieldsr   r   r[   r   r>   r   r   r   rE   r]   r   rL   r,   r,   r,   r1   r      s     r   c                   @   s$   e Zd ZU dZedZded< dS )ResourcezOACME Resource.

    :ivar acme.messages.ResourceBody body: Resource body.

    bodyResourceBodyN)rI   rV   rW   rX   rG   rj   r   r\   r,   r,   r,   r1   r        
 r   c                   @   s$   e Zd ZU dZedZeed< dS )ResourceWithURIzKACME Resource with URI.

    :ivar str uri: Location of the resource.

    uriN)	rI   rV   rW   rX   rG   rj   r   r[   r\   r,   r,   r,   r1   r     r   r   c                   @      e Zd ZdZdS )r   zACME Resource Body.NrI   rV   rW   rX   r,   r,   r,   r1   r   '      r   c                   @   s<   e Zd ZdZedejdededede	ee
f f
ddZd	S )
ExternalAccountBindingzACME External Account Bindingaccount_public_keykidhmac_key	directoryr4   c           	      C   sR   t |  }tj|}|d }tj	|tj
j|dtjjd||}| S )zLCreate External Account Binding Resource from contact details, kid and hmac.
newAccount)keyN)jsondumpsrE   r   rG   b64	b64decoder   JWSsignjwkJWKOctjwaHS256)	rK   r   r   r   r   key_jsondecoded_hmac_keyurleabr,   r,   r1   	from_data.  s   z ExternalAccountBinding.from_dataN)rI   rV   rW   rX   r]   rG   JWKr[   r   r   r   r   r,   r,   r,   r1   r   +  s    
r   GenericRegistrationRegistration)boundc                       s  e Zd ZU dZejddejjdZeje	d< ejddddZ
eedf e	d< ejd	dd
Zee	d	< ejddd
Zee	d< ejddd
Zee	d< ejddd
Zee	d< ejddd
Zeeef e	d< dZdZe			d,dee dee dee deeeef  dedefddZdeddf fddZdedeedf fdd Zd!eeef deeef fd"d#Zdeeef f fd$d%Z deeef f fd&d'Z!e"deedf fd(d)Z#e"deedf fd*d+Z$  Z%S )-r   zRegistration Resource Body.

    :ivar jose.JWK key: Public key.
    :ivar tuple contact: Contact information following ACME spec,
        `tuple` of `str`.
    :ivar str agreement:

    r   Trl   rh   contactr,   rk   .	agreementro   statustermsOfServiceAgreedterms_of_service_agreedonlyReturnExistingonly_return_existingexternalAccountBindingexternal_account_bindingztel:zmailto:NrK   phoneemailr~   r4   c                    s   d|v }t |dd}|dur| j|  |dur+| fdd|dD  |s/|r5t||d< |r;||d<  di |S )a  
        Create registration resource from contact details.

        The `contact` keyword being passed to a Registration object is meaningful, so
        this function represents empty iterables in its kwargs by passing on an empty
        `tuple`.
        r   r,   Nc                    s   g | ]} j | qS r,   )email_prefix)r.   mailrK   r,   r1   
<listcomp>p  s    z*Registration.from_data.<locals>.<listcomp>,r   )listr   appendphone_prefixextendsplitrz   )rK   r   r   r   r~   contact_provideddetailsr,   r   r1   r   [  s   zRegistration.from_datac                    s8   d|v r|d durt | dd t jdi | dS )z;Note if the user provides a value for the `contact` member.r   N_add_contactTr,   )r   r   r=   r>   r   rA   r,   r1   r>   |  s   zRegistration.__init__prefixc                    s   t  fdd| jD S )Nc                 3   s*    | ]}|  r|t d  V  qd S r<   )
startswithr   )r.   rp   r  r,   r1   rw     s    
z/Registration._filter_contact.<locals>.<genexpr>)rz   r   )r@   r  r,   r  r1   _filter_contact  s   zRegistration._filter_contactrF   c                 C   s   t | ddr| d|d< |S )a  
        The `contact` member of Registration objects should not be required when
        de-serializing (as it would be if the Fields' `omitempty` flag were `False`), but
        it should be included in serializations if it was provided.

        :param jobj: Dictionary containing this Registrations' data
        :type jobj: dict

        :returns: Dictionary containing Registrations data to transmit to the server
        :rtype: dict
        r  Fr   )getattrr   r   r,   r,   r1   _add_contact_if_appropriate  s   z(Registration._add_contact_if_appropriatec                       t   }| |S )z2Modify josepy.JSONDeserializable.to_partial_json())r=   rE   r  r   rA   r,   r1   rE        

zRegistration.to_partial_jsonc                    r  )z;Modify josepy.JSONObjectWithFields.fields_to_partial_json())r=   fields_to_partial_jsonr  r   rA   r,   r1   r
    r	  z#Registration.fields_to_partial_jsonc                 C      |  | jS )z*All phones found in the ``contact`` field.)r  r   rD   r,   r,   r1   phones     zRegistration.phonesc                 C   r  )z*All emails found in the ``contact`` field.)r  r   rD   r,   r,   r1   emails  r  zRegistration.emails)NNN)&rI   rV   rW   rX   rG   rj   r   rL   r   r\   r   r
   r[   r   r   r   r   r^   r   r   r   r   r   r   r]   r   r   r	   r   r>   r  r  rE   r
  r   r  r  r`   r,   r,   rA   r1   r   A  sF   
 
  " c                   @   r   )NewRegistrationzNew registration.Nr   r,   r,   r,   r1   r    r   r  c                   @   r   )UpdateRegistrationzUpdate registration.Nr   r,   r,   r,   r1   r    r   r  c                   @   sV   e Zd ZU dZejdejdZee	d< ejdddZ
ee	d< ejdddZee	d< dS )	RegistrationResourcezRegistration Resource.

    :ivar acme.messages.Registration body:
    :ivar str new_authzr_uri: Deprecated. Do not use.
    :ivar str terms_of_service: URL for the CA TOS.

    r   rg   new_authzr_uriTro   r   N)rI   rV   rW   rX   rG   rj   r   rL   r   r\   r  r[   r   r,   r,   r,   r1   r    s
   
 r  c                       s>  e Zd ZU dZdZejddddZee	d< ejde
jded	Ze
e	d< ejd
ddZeje	d
< ejdejddd	Zee	d< deddf fddZdedef fddZdeeef f fddZedeeef deeef f fddZedefddZdedefddZdee f fddZ dedefdd Z!  Z"S )!ChallengeBodya>  Challenge Resource Body.

    .. todo::
       Confusingly, this has a similar name to `.challenges.Challenge`,
       as well as `.achallenges.AnnotatedChallenge`. Please use names
       such as ``challb`` to distinguish instances of this class from
       ``achall``.

    :ivar acme.challenges.Challenge: Wrapped challenge.
        Conveniently, all challenge fields are proxied, i.e. you can
        call ``challb.x`` to get ``challb.chall.x`` contents.
    :ivar acme.messages.Status status:
    :ivar datetime.datetime validated:
    :ivar messages.Error error:

    )challr   TNrk   _urlr   )rh   rl   rm   	validatedro   r   r~   r4   c                    r   )Nc                    r   r,   r   r   rD   r,   r1   r2     r   z*ChallengeBody.__init__.<locals>.<dictcomp>r,   r   r   rA   rD   r1   r>     r   zChallengeBody.__init__r/   c                    s   t  | |S r<   )r=   r   r   r?   rA   r,   r1   r     r   zChallengeBody.encodec                    s   t   }|| j  |S r<   )r=   rE   updater  r   rA   r,   r1   rE     s   
zChallengeBody.to_partial_jsonrF   c                    s    t  |}tj||d< |S )Nr  )r=   fields_from_jsonr   	ChallengerL   )rK   rF   jobj_fieldsrA   r,   r1   r    s   zChallengeBody.fields_from_jsonc                 C   rC   )zThe URL of this challenge.)r  rD   r,   r,   r1   r     r   zChallengeBody.uric                 C   s   t | j|S r<   )r  r  r?   r,   r,   r1   r     s   zChallengeBody.__getattr__c                 #   s(    t   D ]}|dkrdn|V  qd S )Nr  r   r   r?   rA   r,   r1   r     s   zChallengeBody.__iter__c                 C   s   |dkrdS |S )Nr   r  r,   r?   r,   r,   r1   r      rU   zChallengeBody._internal_name)#rI   rV   rW   rX   rY   rG   rj   r  r[   r\   r   rL   STATUS_PENDINGr   r   rfc3339r  datetimer6   r   r   r>   r   r   rE   r]   r   r  r   r   r   r   r   r   r`   r,   r,   rA   r1   r    s*   
 

(r  c                   @   sN   e Zd ZU dZejdejdZee	d< edZ
ee	d< edefddZdS )	ChallengeResourcezChallenge Resource.

    :ivar acme.messages.ChallengeBody body:
    :ivar str authzr_uri: URI found in the 'up' ``Link`` header.

    r   rg   
authzr_urir4   c                 C   s   | j jS )zThe URL of the challenge body.)r   r   rD   r,   r,   r1   r     s   zChallengeResource.uriN)rI   rV   rW   rX   rG   rj   r  rL   r   r\   r  r[   r   r   r,   r,   r,   r1   r    s   
 r  c                   @   s   e Zd ZU dZejdejddZee	d< ejdddZ
ee e	d< ejddejdZee	d< ejd	ddZeje	d	< ejd
ddZee	d
< e
jdeeeef  deedf fddZ
dS )AuthorizationzAuthorization Resource Body.

    :ivar acme.messages.Identifier identifier:
    :ivar list challenges: `list` of `.ChallengeBody`
    :ivar acme.messages.Status status:
    :ivar datetime.datetime expires:

    rq   Trr   r   ro   r   r   expireswildcardri   r4   .c                 C   rt   )Nc                 s   ru   r<   )r  rL   )r.   r  r,   r,   r1   rw   ,  rx   z+Authorization.challenges.<locals>.<genexpr>ry   r{   r,   r,   r1   r   *  r|   zAuthorization.challengesN)rI   rV   rW   rX   rG   rj   rf   rL   rq   r\   r   r   r  r   r   r   r  r!  r  r"  r^   rh   r   r[   r   r
   r,   r,   r,   r1   r     s   
 ,r   c                   @   r   )NewAuthorizationzNew authorization.Nr   r,   r,   r,   r1   r#  /  r   r#  c                   @   r   )UpdateAuthorizationzUpdate authorization.Nr   r,   r,   r,   r1   r$  3  r   r$  c                   @   s@   e Zd ZU dZejdejdZee	d< ejdddZ
ee	d< dS )AuthorizationResourcez~Authorization Resource.

    :ivar acme.messages.Authorization body:
    :ivar str new_cert_uri: Deprecated. Do not use.

    r   rg   new_cert_uriTro   N)rI   rV   rW   rX   rG   rj   r   rL   r   r\   r&  r[   r,   r,   r,   r1   r%  7  s   
 r%  c                   @   s0   e Zd ZU dZejdejejdZej	e
d< dS )CertificateRequestz~ACME newOrder request.

    :ivar jose.ComparableX509 csr:
        `OpenSSL.crypto.X509Req` wrapped in `.ComparableX509`

    csrrh   encoderN)rI   rV   rW   rX   rG   rj   
decode_csr
encode_csrr(  ComparableX509r\   r,   r,   r,   r1   r'  B  s   
 "r'  c                   @   s>   e Zd ZU dZedZeed< edZ	e
edf ed< dS )CertificateResourcea  Certificate Resource.

    :ivar josepy.util.ComparableX509 body:
        `OpenSSL.crypto.X509` wrapped in `.ComparableX509`
    :ivar str cert_chain_uri: URI found in the 'up' ``Link`` header
    :ivar tuple authzrs: `tuple` of `AuthorizationResource`.

    cert_chain_uriauthzrs.N)rI   rV   rW   rX   rG   rj   r/  r[   r\   r0  r
   r%  r,   r,   r,   r1   r.  L  s   
 r.  c                   @   sB   e Zd ZU dZejdejejdZej	e
d< edZee
d< dS )
RevocationzRevocation message.

    :ivar jose.ComparableX509 certificate: `OpenSSL.crypto.X509` wrapped in
        `jose.ComparableX509`

    certificater)  reasonN)rI   rV   rW   rX   rG   rj   decode_certencode_certr2  r-  r\   r3  r_   r,   r,   r,   r1   r1  Y  s   
 
r1  c                   @   s   e Zd ZU dZejdddZee e	d< ejde
jddZe
e	d< ejdddZee e	d< ejdddZee	d< ejd	ddZee	d	< ejd
ddZeje	d
< ejddejdZee	d< ejdeeeef  deedf fddZdS )Ordera_  Order Resource Body.

    :ivar identifiers: List of identifiers for the certificate.
    :vartype identifiers: `list` of `.Identifier`
    :ivar acme.messages.Status status:
    :ivar authorizations: URLs of authorizations.
    :vartype authorizations: `list` of `str`
    :ivar str certificate: URL to download certificate as a fullchain PEM.
    :ivar str finalize: URL to POST to to request issuance once all
        authorizations have "valid" status.
    :ivar datetime.datetime expires: When the order expires.
    :ivar ~.Error error: Any error that occurred during finalization, if applicable.
    identifiersTro   r   rr   authorizationsr2  finalizer!  r   r   ri   r4   .c                 C   rt   )Nc                 s   ru   r<   )rf   rL   )r.   rq   r,   r,   r1   rw     rx   z$Order.identifiers.<locals>.<genexpr>ry   r{   r,   r,   r1   r7  }  r|   zOrder.identifiersN)rI   rV   rW   rX   rG   rj   r7  r   rf   r\   r   rL   r   r8  r[   r2  r9  r   r  r!  r  r6   r   rh   r   r   r
   r,   r,   r,   r1   r6  e  s   
 ,r6  c                   @   s   e Zd ZU dZejdejdZee	d< ejdddZ
ee	d< edZee e	d< ejdddZee	d< ejd	ddZee e	d	< d
S )OrderResourcea  Order Resource.

    :ivar acme.messages.Order body:
    :ivar bytes csr_pem: The CSR this Order will be finalized with.
    :ivar authorizations: Fully-fetched AuthorizationResource objects.
    :vartype authorizations: `list` of `acme.messages.AuthorizationResource`
    :ivar str fullchain_pem: The fetched contents of the certificate URL
        produced once the order was finalized, if it's present.
    :ivar alternative_fullchains_pem: The fetched contents of alternative certificate
        chain URLs produced once the order was finalized, if present and requested during
        finalization.
    :vartype alternative_fullchains_pem: `list` of `str`
    r   rg   csr_pemTro   r8  fullchain_pemalternative_fullchains_pemN)rI   rV   rW   rX   rG   rj   r6  rL   r   r\   r;  bytesr8  r   r%  r<  r[   r=  r,   r,   r,   r1   r:    s   
 r:  c                   @   r   )NewOrderz
New order.Nr   r,   r,   r,   r1   r?    r   r?  )FrX   collections.abcr   r  r   typingr   r   r   r   r   r   r	   r
   r   r   josepyrG   acmer   r   r   r   r   r-   r   r   r   BaseExceptionr^   r8   JSONDeSerializabler9   rb   IDENTIFIER_FQDNIDENTIFIER_IPr   rf   r6   r   STATUS_UNKNOWNr  STATUS_PROCESSINGSTATUS_VALIDSTATUS_INVALIDSTATUS_REVOKEDSTATUS_READYSTATUS_DEACTIVATEDr   r   r   r   r   r   r   r  r  r  r  r  r   r#  r$  r%  r'  r.  r1  r6  r:  r?  r,   r,   r,   r1   <module>   s    	!W7		mA
