o 6a @spdZddlmZddlmZGdddZGdddeZGdd d eZd ed ed ed eeeffddZdS)z0Useful mixins for Challenge and Resource objects)Any)DictcsXeZdZdZedefddZejdeddfddZded e ddffd d Z Z S) VersionedLEACMEMixinzEThis mixin stores the version of Let's Encrypt's endpoint being used.returncCs t|ddS)z*Define the version of ACME protocol to use_le_acme_version)getattrselfr -/usr/lib/python3/dist-packages/acme/mixins.pyle_acme_versions z$VersionedLEACMEMixin.le_acme_versionversionNcCst|d|dS)Nr)object __setattr__)r rr r r r skeyvaluecs,|dkr t|||dSt||dS)Nr )rrsuper)r rr __class__r r rsz VersionedLEACMEMixin.__setattr__) __name__ __module__ __qualname____doc__propertyintr setterstrrr __classcell__r r rr rs"rcHeZdZdZdeeefffdd Zdeeefffdd ZZ S) ResourceMixinz This mixin generates a RFC8555 compliant JWS payload by removing the `resource` field if needed (eg. ACME v2 protocol). rcttddS)/See josepy.JSONDeserializable.to_partial_json()to_partial_jsonresource_safe_jobj_compliancerr rr r r#!zResourceMixin.to_partial_jsoncr!)8See josepy.JSONObjectWithFields.fields_to_partial_json()fields_to_partial_jsonr$r%r rr r r)&r'z$ResourceMixin.fields_to_partial_json rrrrrrrr#r)rr r rr r "r cr) TypeMixinz This mixin allows generation of a RFC8555 compliant JWS payload by removing the `type` field if needed (eg. ACME v2 protocol). rcr!)r"r#typer%r rr r r#1r'zTypeMixin.to_partial_jsoncr!)r(r)r-r%r rr r r)6r'z TypeMixin.fields_to_partial_jsonr*r r rr r,,r+r,instance jobj_methoduncompliant_fieldrcCs>t||rt||}|jdkr||d|Std|)Nz Method {0}() is not implemented.)hasattrrr popAttributeErrorformat)r.r/r0jobjr r r r&<s    r&N) rtypingrrrr r,rr&r r r r s