Your IP : 216.73.216.52


Current Path : /snap/certbot/5451/lib/python3.12/site-packages/certbot/__pycache__/
Upload File :
Current File : //snap/certbot/5451/lib/python3.12/site-packages/certbot/__pycache__/achallenges.cpython-312.pyc

�

q[�il����dZddlZddlmZddlZddlZddlmZm	Z	ddl
mZddlm
Z
eje�ZGd�dej"�ZGd	�d
e�ZGd�de�ZGd
�de�Zy)a0Client annotated ACME challenges.

Please use names such as ``achall`` to distinguish from variables "of type"
:class:`acme.challenges.Challenge` (denoted by ``chall``)
and :class:`.ChallengeBody` (denoted by ``challb``)::

  from acme import challenges
  from acme import messages
  from certbot import achallenges

  chall = challenges.DNS(token='foo')
  challb = messages.ChallengeBody(chall=chall)
  achall = achallenges.DNS(chall=challb, domain='example.com')

Note, that all annotated challenges act as a proxy objects::

  achall.token == challb.token

�N)�Any)�
challenges�messages)�	Challenge)�errorsc���eZdZUdZdZeZeee	d<de
defd�Zde
def�fd�Z
def�fd�Zd	edef�fd
�Zdeddf�fd
�Z�xZS)�AnnotatedChallengez�Client annotated challenge.

    Wraps around server provided challenge and annotates with data
    useful for the client.

    :ivar ~.challb: Wrapped `~.ChallengeBody`.

    )�challb�
_acme_type�name�returnc�.�t|j|�S)N)�getattrr
)�selfrs  ��/build/snapcraft-certbot-8ace4148c346cc61c23dfdbf9a13f72e/parts/certbot/install/lib/python3.12/site-packages/certbot/achallenges.py�__getattr__zAnnotatedChallenge.__getattr__.s���t�{�{�D�)�)�c�`��|dk(rtjdt�t�|�|�S)N�domainz�The domain attribute is deprecated and will be removed in an upcoming release. Access the AnnotatedChallenge.identifier.value attribute instead)�warnings�warn�DeprecationWarning�super�__getattribute__)rr�	__class__s  �rrz#AnnotatedChallenge.__getattribute__1s3����8���M�M�,�+�
,��w�'��-�-rc���tj�5tjdd�t�|��cddd�S#1swYyxYw�N�ignorez"the domain attribute is deprecated)r�catch_warnings�filterwarningsr�__hash__)rrs �rr!zAnnotatedChallenge.__hash__9s@���
�
$�
$�
&�	&��#�#�H�.R�S��7�#�%�	&�	&�	&�s�$A�A
�otherc���tj�5tjdd�t�|�|�cddd�S#1swYyxYwr)rrr r�__eq__)rr"rs  �rr$zAnnotatedChallenge.__eq__>sA���
�
$�
$�
&�	)��#�#�H�.R�S��7�>�%�(�	)�	)�	)�s�%A�A�kwargsNc�h��d|vr3d|vrtjd��tjdt�d|vr+tjt
j|d��|d<d|vr8|djt
jk(r|dj|d<nd|d<t�|�,di|��y)Nr�
identifierz>AnnotatedChallenge takes either domain or identifier, not bothz�The domain attribute is deprecated and will be removed in an upcoming release. Replace domain=<domain> with identifier=messages.Identifier(typ=messages.IDENTIFIER_FQDN, value=<domain>))�typ�value�)r�Errorrrrr�
Identifier�IDENTIFIER_FQDNr(r)r�__init__)rr%rs  �rr.zAnnotatedChallenge.__init__Cs�����v���v�%��l�l�#c�d�d��M�M�,�-�	
.�
�v�%�#+�#6�#6��,�,�F�8�4D�$F�F�<� ��6�!��l�#�'�'�8�+C�+C�C�#)�,�#7�#=�#=��x� �#'��x� �
���"�6�"r)�__name__�
__module__�__qualname__�__doc__�	__slots__�NotImplementedr�typer�__annotations__�strrrr�intr!�boolr$r.�
__classcell__)rs@rr	r	"sz�����I�"0�J��Y��0�*��*��*�.�S�.�S�.�&�#�&�
)�C�)�D�)�
#��#��#�#rr	c�2�eZdZdZdZdedededeffd�Zy)	�"KeyAuthorizationAnnotatedChallengez7Client annotated `KeyAuthorizationChallenge` challenge.)r
r�account_keyr'�argsr%r
z,challenges.KeyAuthorizationChallengeResponsec�j�|jjj|jg|��i|��S)z!Generate response and validation.)r
�chall�response_and_validationr=)rr>r%s   rrAz:KeyAuthorizationAnnotatedChallenge.response_and_validation[s<��9�t�{�{� � �8�8����/�#�/�'-�/�	/rN)r/r0r1r2r3r�tuplerAr*rrr<r<Ws0��A�A�I�/�S�/�C�/�
�A�3�F�
G�/rr<c�,�eZdZdZdZejZy)�DNSz&Client annotated "dns" ACME challenge.�r
rr'N)r/r0r1r2r3rrD�	acme_typer*rrrDrDbs��0�2�I����IrrDc�,�eZdZdZdZejZy)�Otherz3Client annotated ACME challenge of an unknown type.rEN)r/r0r1r2r3rrrFr*rrrHrHgs��=�2�I��$�$�IrrH)r2�logging�typingrr�josepy�jose�acmerr�acme.challengesr�certbotr�	getLoggerr/�logger�ImmutableMapr	r<rDrHr*rr�<module>rSsm���&����%�%��	��	�	�8�	$��2#��*�*�2#�j/�);�/��
��
%��%r