U
    ÝÁ]X  ã                   @   s`   d Z ddlZddlZddlmZ e e¡ZG dd„ dej	ƒZ
G dd„ de
ƒZG dd	„ d	e
ƒZdS )
a0  Client 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)Ú
challengesc                   @   s    e Zd ZdZdZeZdd„ ZdS )ÚAnnotatedChallengez®Client annotated challenge.

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

    :ivar challb: Wrapped `~.ChallengeBody`.

    )Úchallbc                 C   s   t | j|ƒS )N)Úgetattrr   )ÚselfÚname© r   ú5/usr/lib/python3/dist-packages/certbot/achallenges.pyÚ__getattr__,   s    zAnnotatedChallenge.__getattr__N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__ÚNotImplementedÚ	acme_typer
   r   r   r   r	   r       s   r   c                   @   s   e Zd ZdZdZdd„ ZdS )Ú"KeyAuthorizationAnnotatedChallengez7Client annotated `KeyAuthorizationChallenge` challenge.)r   ÚdomainÚaccount_keyc                 O   s   | j jj| jf|ž|ŽS )z!Generate response and validation.)r   ZchallÚresponse_and_validationr   )r   ÚargsÚkwargsr   r   r	   r   4   s    ÿÿÿz:KeyAuthorizationAnnotatedChallenge.response_and_validationN)r   r   r   r   r   r   r   r   r   r	   r   0   s   r   c                   @   s   e Zd ZdZdZejZdS )ÚDNSz&Client annotated "dns" ACME challenge.)r   r   N)r   r   r   r   r   r   r   r   r   r   r   r	   r   :   s   r   )r   ZloggingZjosepyZjoseZacmer   Z	getLoggerr   ZloggerZImmutableMapr   r   r   r   r   r   r	   Ú<module>   s   

