/usr/lib/python3/dist-packages/pymacaroons/__pycache__
NameSizeModeActions
caveat.cpython-310.pyc22580644editdlrm
exceptions.cpython-310.pyc11140644editdlrm
macaroon.cpython-310.pyc53100644editdlrm
utils.cpython-310.pyc37150644editdlrm
verifier.cpython-310.pyc33890644editdlrm
__init__.cpython-310.pyc5150644editdlrm
Edit: /usr/lib/python3/dist-packages/pymacaroons/__pycache__/macaroon.cpython-310.pyc (5310B)
o %Ya@sddlmZddlZddlmZddlmZddlmZddl m Z ddl m Z m Z mZddlmZmZd Zd ZGd d d eZdS) )unicode_literalsN)standard_b64encode)HashSignaturesBinder)BinarySerializer)MacaroonInitException)convert_to_bytesconvert_to_stringcreate_initial_signature)FirstPartyCaveatDelegateThirdPartyCaveatDelegatec@seZdZdddddefddZed%ddZeddZej ddZed d Z ed d Z ed dZ e j dd Z eddZ e j ddZ eddZddZd%ddZddZddZddZdd Zd!d"Zd#d$ZdS)&MacaroonNcCsh|tkrt}||_|p g|_|pd|_|pd|_|pd|_t|_t|_ |r2t t ||j |_dSdS)N) MACAROON_V2_versioncaveatslocation identifier signaturer first_party_caveat_delegater third_party_caveat_delegater ridentifier_bytes)selfrrkeyrrversionr6/usr/lib/python3/dist-packages/pymacaroons/macaroon.py__init__s      zMacaroon.__init__cCs |pt}|r ||Std)Nz Must supply serialized macaroon.)r deserializer)cls serialized serializerrrrr+s  zMacaroon.deserializecC t|jSN)r _locationrrrrr5 zMacaroon.locationcCt||_dSr$)rr%rstring_or_bytesrrrr9cC|jSr$)rr&rrrr=zMacaroon.versioncCs|jtkr t|jS|jSr$)r MACAROON_V1r _identifierr&rrrrAs  zMacaroon.identifiercCr,r$)r/r&rrrrGr-zMacaroon.identifier_bytescCr(r$)rr/r)rrrrKr+cCr#r$)r _signaturer&rrrrOr'zMacaroon.signaturecCr(r$)rr0r)rrrrSr+cCr,r$)r0r&rrrsignature_bytesWr-zMacaroon.signature_bytescCs t|Sr$)copydeepcopyr&rrrr2[s z Macaroon.copycCs|pt}||Sr$)r serialize)rr"rrrr4^s  zMacaroon.serializec Csdj|jd}z |dj|jd7}Wnty(|djtt|jd7}Ynw|jD]D}z |djt|jd7}WntyQ|djtt|j d7}Ynw|j rp|jrptt|j }|d j|d 7}|d j|jd 7}q,|d j|j d7}|S)Nzlocation {loc} )loczidentifier {id} )idzidentifier64 {id} z cid {cid} )cidz cid64 {cid} z vid {vid} )vidzcl {cl} )clzsignature {sig})sig) formatrrUnicodeEncodeErrorrrrr caveat_idcaveat_id_bytesverification_key_idr)rcombinedcaveatr8rrrinspectbs6    zMacaroon.inspectcCdd|jDS)NcSg|]}|r|qSr) first_party.0rArrr |z0Macaroon.first_party_caveats..rr&rrrfirst_party_caveats{zMacaroon.first_party_caveatscCrC)NcSrDr) third_partyrFrrrrHrIz0Macaroon.third_party_caveats..rJr&rrrthird_party_caveats~rLzMacaroon.third_party_caveatscCs|}t||S)a$ Return a new discharge macaroon bound to the receiving macaroon's current signature so that it can be used in a request. This must be done before a discharge macaroon is sent to a server. :param discharge_macaroon: :return: bound discharge macaroon )r2rbind)rdischarge_macaroon protectedrrrprepare_for_requests zMacaroon.prepare_for_requestcKs|jj||fi|Sr$)radd_first_party_caveat)r predicatekwargsrrrrSs zMacaroon.add_first_party_caveatcKs|jj||||fi|Sr$)radd_third_party_caveat)rrrkey_idrUrrrrVs zMacaroon.add_third_party_caveatr$)__name__ __module__ __qualname__r.r classmethodrpropertyrsetterrrrrr1r2r4rBrKrNrRrSrVrrrrrsH             r) __future__rr2base64rpymacaroons.bindersr)pymacaroons.serializers.binary_serializerrpymacaroons.exceptionsrpymacaroons.utilsrrr pymacaroons.caveat_delegatesr r r.robjectrrrrrs