PNG  IHDR* pHYs+ IDATx]n#; cdLb Ǚ[at¤_:uP}>!Usă cag޿ ֵNu`ݼTâabO7uL&y^wFٝA"l[|ŲHLN밪4*sG3|Dv}?+y߉{OuOAt4Jj.u]Gz*҉sP'VQKbA1u\`& Af;HWj hsO;ogTu uj7S3/QzUr&wS`M$X_L7r2;aE+ώ%vikDA:dR+%KzƉo>eOth$z%: :{WwaQ:wz%4foɹE[9<]#ERINƻv溂E%P1i01 |Jvҗ&{b?9g=^wζXn/lK::90KwrюO\!ջ3uzuGv^;騢wq<Iatv09:tt~hEG`v;3@MNZD.1]L:{ծI3`L(÷ba")Y.iljCɄae#I"1 `3*Bdz>j<fU40⨬%O$3cGt]j%Fߠ_twJ;ABU8vP3uEԑwQ V:h%))LfraqX-ۿX]v-\9I gl8tzX ]ecm)-cgʒ#Uw=Wlێn(0hPP/ӨtQ“&J35 $=]r1{tLuǮ*i0_;NƝ8;-vݏr8+U-kruȕYr0RnC]*ެ(M:]gE;{]tg(#ZJ9y>utRDRMdr9㪩̞zֹb<ģ&wzJM"iI( .ꮅX)Qw:9,i좜\Ԛi7&N0:asϓc];=ΗOӣ APqz93 y $)A*kVHZwBƺnWNaby>XMN*45~ղM6Nvm;A=jֲ.~1}(9`KJ/V F9[=`~[;sRuk]rєT!)iQO)Y$V ی ۤmzWz5IM Zb )ˆC`6 rRa}qNmUfDsWuˤV{ Pݝ'=Kֳbg,UҘVz2ﴻnjNgBb{? ߮tcsͻQuxVCIY۠:(V뺕 ٥2;t`@Fo{Z9`;]wMzU~%UA蛚dI vGq\r82iu +St`cR.6U/M9IENDB` REDROOM
PHP 5.6.40
Preview: mixins.py Size: 2.78 KB
/proc/thread-self/root/lib/python3.6/site-packages/acme/mixins.py

"""Useful mixins for Challenge and Resource objects"""
from typing import Any
from typing import Dict


class VersionedLEACMEMixin:
    """This mixin stores the version of Let's Encrypt's endpoint being used."""
    @property
    def le_acme_version(self) -> int:
        """Define the version of ACME protocol to use"""
        return getattr(self, '_le_acme_version', 1)

    @le_acme_version.setter
    def le_acme_version(self, version: int) -> None:
        # We need to use object.__setattr__ to not depend on the specific implementation of
        # __setattr__  in current class (eg. jose.TypedJSONObjectWithFields raises AttributeError
        # for any attempt to set an attribute to make objects immutable).
        object.__setattr__(self, '_le_acme_version', version)

    def __setattr__(self, key: str, value: Any) -> None:
        if key == 'le_acme_version':
            # Required for @property to operate properly. See comment above.
            object.__setattr__(self, key, value)
        else:
            super().__setattr__(key, value)  # pragma: no cover


class ResourceMixin(VersionedLEACMEMixin):
    """
    This mixin generates a RFC8555 compliant JWS payload
    by removing the `resource` field if needed (eg. ACME v2 protocol).
    """
    def to_partial_json(self) -> Dict[str, Any]:
        """See josepy.JSONDeserializable.to_partial_json()"""
        return _safe_jobj_compliance(super(),
                                     'to_partial_json', 'resource')

    def fields_to_partial_json(self) -> Dict[str, Any]:
        """See josepy.JSONObjectWithFields.fields_to_partial_json()"""
        return _safe_jobj_compliance(super(),
                                     'fields_to_partial_json', 'resource')


class TypeMixin(VersionedLEACMEMixin):
    """
    This mixin allows generation of a RFC8555 compliant JWS payload
    by removing the `type` field if needed (eg. ACME v2 protocol).
    """
    def to_partial_json(self) -> Dict[str, Any]:
        """See josepy.JSONDeserializable.to_partial_json()"""
        return _safe_jobj_compliance(super(),
                                     'to_partial_json', 'type')

    def fields_to_partial_json(self) -> Dict[str, Any]:
        """See josepy.JSONObjectWithFields.fields_to_partial_json()"""
        return _safe_jobj_compliance(super(),
                                     'fields_to_partial_json', 'type')


def _safe_jobj_compliance(instance: Any, jobj_method: str,
                          uncompliant_field: str) -> Dict[str, Any]:
    if hasattr(instance, jobj_method):
        jobj: Dict[str, Any] = getattr(instance, jobj_method)()
        if instance.le_acme_version == 2:
            jobj.pop(uncompliant_field, None)
        return jobj

    raise AttributeError('Method {0}() is not implemented.'.format(jobj_method))  # pragma: no cover

Directory Contents

Dirs: 1 × Files: 12

Name Size Perms Modified Actions
- drwxr-xr-x 2025-04-13 08:21:05
Edit Download
21.19 KB lrw-r--r-- 2021-12-07 22:02:45
Edit Download
52.86 KB lrw-r--r-- 2021-12-07 22:02:45
Edit Download
16.34 KB lrw-r--r-- 2022-11-09 23:17:36
Edit Download
4.21 KB lrw-r--r-- 2021-12-07 22:02:45
Edit Download
1.84 KB lrw-r--r-- 2021-12-07 22:02:45
Edit Download
2.33 KB lrw-r--r-- 2021-12-07 22:02:45
Edit Download
595 B lrw-r--r-- 2021-12-07 22:02:45
Edit Download
24.74 KB lrw-r--r-- 2021-12-07 22:02:45
Edit Download
2.78 KB lrw-r--r-- 2021-12-07 22:02:45
Edit Download
12.83 KB lrw-r--r-- 2021-12-07 22:02:45
Edit Download
303 B lrw-r--r-- 2021-12-07 22:02:45
Edit Download
726 B lrw-r--r-- 2021-12-07 22:02:45
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).
© 2026 REDROOM — Secure File Manager. All rights reserved. Built with ❤️ & Red Dark UI