3 Ú¯a ã @ sj d Z ddlmZ ddlmZ G dd„ dƒZG dd„ deƒZG dd „ d eƒZeeeeeef d œdd„Zd S )z0Useful mixins for Challenge and Resource objectsé )ÚAny)ÚDictc sR e Zd ZdZeedœdd„ƒZejeddœdd„ƒZee ddœ‡ fd d „Z ‡ ZS )ÚVersionedLEACMEMixinzEThis mixin stores the version of Let's Encrypt's endpoint being used.)Úreturnc C s 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_version s z$VersionedLEACMEMixin.le_acme_versionN)Úversionr c C s t j| d|ƒ d S )Nr )ÚobjectÚ__setattr__)r r r r r r s )ÚkeyÚvaluer c s* |dkrt j| ||ƒ ntƒ j||ƒ d S )Nr )r r Úsuper)r r r )Ú __class__r r r s z VersionedLEACMEMixin.__setattr__)Ú__name__Ú __module__Ú__qualname__Ú__doc__ÚpropertyÚintr ÚsetterÚstrr r Ú __classcell__r r )r r r s r c sH e Zd ZdZeeef dœ‡ fdd„Zeeef dœ‡ fdd„Z‡ Z S )Ú ResourceMixinz… This mixin generates a RFC8555 compliant JWS payload by removing the `resource` field if needed (eg. ACME v2 protocol). )r c s t tƒ ddƒS )z/See josepy.JSONDeserializable.to_partial_json()Úto_partial_jsonÚresource)Ú_safe_jobj_compliancer )r )r r r r ! s zResourceMixin.to_partial_jsonc s t tƒ ddƒS )z8See josepy.JSONObjectWithFields.fields_to_partial_json()Úfields_to_partial_jsonr )r r )r )r r r r! &