3 Ú¯a ã@sjdZddlmZddlmZGdd„dƒZGdd„deƒZGdd „d eƒZeeeeeefd œd d „Zd S)z0Useful mixins for Challenge and Resource objectsé)ÚAny)ÚDictcsReZdZdZeedœdd„ƒZejeddœdd„ƒZee ddœ‡fd d „ Z ‡Z S) ÚVersionedLEACMEMixinzEThis mixin stores the version of Let's Encrypt's endpoint being used.)ÚreturncCs t|ddƒS)z*Define the version of ACME protocol to useÚ_le_acme_versioné)Úgetattr)Úself©r ú/usr/lib/python3.6/mixins.pyÚle_acme_versionsz$VersionedLEACMEMixin.le_acme_versionN)ÚversionrcCstj|d|ƒdS)Nr)ÚobjectÚ __setattr__)r r r r r r s)ÚkeyÚvaluercs*|dkrtj|||ƒntƒj||ƒdS)Nr )rrÚsuper)r rr)Ú __class__r r rsz VersionedLEACMEMixin.__setattr__) Ú__name__Ú __module__Ú __qualname__Ú__doc__ÚpropertyÚintr ÚsetterÚstrrrÚ __classcell__r r )rr rs rcsHeZdZdZeeefdœ‡fdd„ Zeeefdœ‡fdd„ Z‡Z S)Ú ResourceMixinz… This mixin generates a RFC8555 compliant JWS payload by removing the `resource` field if needed (eg. ACME v2 protocol). )rcsttƒddƒS)z/See josepy.JSONDeserializable.to_partial_json()Úto_partial_jsonÚresource)Ú_safe_jobj_compliancer)r )rr r r!szResourceMixin.to_partial_jsoncsttƒddƒS)z8See josepy.JSONObjectWithFields.fields_to_partial_json()Úfields_to_partial_jsonr)r r)r )rr r r!&sz$ResourceMixin.fields_to_partial_json) rrrrrrrrr!rr r )rr rsrcsHeZdZdZeeefdœ‡fdd„ Zeeefdœ‡fdd„ Z‡Z S)Ú TypeMixinzŒ This mixin allows generation of a RFC8555 compliant JWS payload by removing the `type` field if needed (eg. ACME v2 protocol). )rcsttƒddƒS)z/See josepy.JSONDeserializable.to_partial_json()rÚtype)r r)r )rr r r1szTypeMixin.to_partial_jsoncsttƒddƒS)z8See josepy.JSONObjectWithFields.fields_to_partial_json()r!r#)r r)r )rr r r!6sz TypeMixin.fields_to_partial_json) rrrrrrrrr!rr r )rr r",sr")ÚinstanceÚ jobj_methodÚuncompliant_fieldrcCsBt||ƒr0t||ƒƒ}|jdkr,|j|dƒ|Stdj|ƒƒ‚dS)Néz Method {0}() is not implemented.)Úhasattrrr ÚpopÚAttributeErrorÚformat)r$r%r&Zjobjr r r r <s     r N) rZtypingrrrrr"rr r r r r Ús