ó
Á£ô_c           @   sU   d  Z  d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d „  Z d S(	   s0   Useful mixins for Challenge and Resource objectst   VersionedLEACMEMixinc           B   s8   e  Z d  Z e d „  ƒ Z e j d „  ƒ Z d „  Z RS(   sE   This mixin stores the version of Let's Encrypt's endpoint being used.c         C   s   t  |  d d ƒ S(   s*   Define the version of ACME protocol to uset   _le_acme_versioni   (   t   getattr(   t   self(    (    s/   /usr/lib/python2.7/site-packages/acme/mixins.pyt   le_acme_version   s    c         C   s   t  j |  d | ƒ d  S(   NR   (   t   objectt   __setattr__(   R   t   version(    (    s/   /usr/lib/python2.7/site-packages/acme/mixins.pyR      s    c         C   s?   | d k r" t  j |  | | ƒ n t t |  ƒ j | | ƒ d  S(   NR   (   R   R   t   superR    (   R   t   keyt   value(    (    s/   /usr/lib/python2.7/site-packages/acme/mixins.pyR      s    (   t   __name__t
   __module__t   __doc__t   propertyR   t   setterR   (    (    (    s/   /usr/lib/python2.7/site-packages/acme/mixins.pyR       s   t   ResourceMixinc           B   s    e  Z d  Z d „  Z d „  Z RS(   s…   
    This mixin generates a RFC8555 compliant JWS payload
    by removing the `resource` field if needed (eg. ACME v2 protocol).
    c         C   s   t  t t |  ƒ d d ƒ S(   s/   See josepy.JSONDeserializable.to_partial_json()t   to_partial_jsont   resource(   t   _safe_jobj_complianceR   R   (   R   (    (    s/   /usr/lib/python2.7/site-packages/acme/mixins.pyR      s    c         C   s   t  t t |  ƒ d d ƒ S(   s8   See josepy.JSONObjectWithFields.fields_to_partial_json()t   fields_to_partial_jsonR   (   R   R   R   (   R   (    (    s/   /usr/lib/python2.7/site-packages/acme/mixins.pyR   $   s    (   R   R   R   R   R   (    (    (    s/   /usr/lib/python2.7/site-packages/acme/mixins.pyR      s   	t	   TypeMixinc           B   s    e  Z d  Z d „  Z d „  Z RS(   sŒ   
    This mixin allows generation of a RFC8555 compliant JWS payload
    by removing the `type` field if needed (eg. ACME v2 protocol).
    c         C   s   t  t t |  ƒ d d ƒ S(   s/   See josepy.JSONDeserializable.to_partial_json()R   t   type(   R   R   R   (   R   (    (    s/   /usr/lib/python2.7/site-packages/acme/mixins.pyR   /   s    c         C   s   t  t t |  ƒ d d ƒ S(   s8   See josepy.JSONObjectWithFields.fields_to_partial_json()R   R   (   R   R   R   (   R   (    (    s/   /usr/lib/python2.7/site-packages/acme/mixins.pyR   4   s    (   R   R   R   R   R   (    (    (    s/   /usr/lib/python2.7/site-packages/acme/mixins.pyR   *   s   	c         C   s`   t  |  | ƒ rG t |  | ƒ ƒ  } |  j d k rC | j | d  ƒ n  | St d j | ƒ ƒ ‚ d  S(   Ni   s    Method {0}() is not implemented.(   t   hasattrR   R   t   popt   Nonet   AttributeErrort   format(   t   instancet   jobj_methodt   uncompliant_fieldt   jobj(    (    s/   /usr/lib/python2.7/site-packages/acme/mixins.pyR   :   s    N(   R   R   R    R   R   R   (    (    (    s/   /usr/lib/python2.7/site-packages/acme/mixins.pyt   <module>   s   