/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__/verifier.cpython-310.pyc (3389B)
o BQ¼YQã@sŒddlZzddlmZWneyddlmZYnwddlmZddl m Z ddl m Z m Z ddlmZmZmZmZGdd „d eƒZdS) éN)Úcompare_digest)Úequals)ÚHashSignaturesBinder)Ú!MacaroonInvalidSignatureException)Ú FirstPartyCaveatVerifierDelegateÚ ThirdPartyCaveatVerifierDelegate)Úconvert_to_bytesÚconvert_to_stringÚgenerate_derived_keyÚ hmac_digestc@s`eZdZdd„Zdd„Zdd„Zdd„Zdd d „Zdd d „Zdd„Z dd„Z dd„Z dd„Z d S)ÚVerifiercCs*g|_|jg|_d|_tƒ|_tƒ|_dS©N)Ú predicatesÚ verify_exactÚ callbacksÚcalculated_signaturerÚ$first_party_caveat_verifier_delegaterÚ$third_party_caveat_verifier_delegate)Úself©rú6/usr/lib/python3/dist-packages/pymacaroons/verifier.pyÚ__init__s ÿÿzVerifier.__init__cCs$|durtdƒ‚|j t|ƒ¡dS)NzPredicate cannot be none.)Ú TypeErrorrÚappendr ©rÚ predicaterrrÚ satisfy_exact$szVerifier.satisfy_exactcCs"t|dƒs tdƒ‚|j |¡dS)NÚ__call__z*General caveat verifiers must be callable.)Úhasattrrrr)rÚfuncrrrÚsatisfy_general)s zVerifier.satisfy_generalcCs ||jvSr )rrrrrr.s zVerifier.verify_exactNcCstt|ƒƒ}| ||||¡Sr )r rÚverify_discharge)rÚmacaroonÚkeyÚdischarge_macaroonsrrrÚverify1s üzVerifier.verifycCs^t||jƒ}| ||||¡}||krt t|ƒ t |¡¡¡}| |j t |¡¡s-t dƒ‚dS)NzSignatures do not matchT) r Úidentifier_bytesÚ_verify_caveatsÚbinasciiÚ unhexlifyrÚbind_signatureÚhexlifyÚ_signatures_matchÚsignature_bytesr)rÚrootÚ discharger#r$rrrrr!:s$ÿÿÿÿþzVerifier.verify_dischargecCs.|jD]}| |||||¡r| ||¡}q|Sr )ÚcaveatsÚ _caveat_metÚ_update_signature)rr.r"r$Ú signatureÚcaveatrrrr'Qs ü €zVerifier._verify_caveatscCs.| ¡r |j |||¡S|j ||||||¡Sr )Ú first_partyrÚverify_first_party_caveatrÚverify_third_party_caveat)rr.r4r"r$r3rrrr1[s ýþýzVerifier._caveat_metcCs$| ¡r |j ||¡S|j ||¡Sr )r5rÚupdate_signaturer)rr4r3rrrr2msýýzVerifier._update_signaturecCstt|ƒt|ƒƒSr )Úconstant_time_comparer)rÚmacaroon_signatureÚcomputed_signaturerrrr,{sþzVerifier._signatures_matchr ) Ú__name__Ú __module__Ú __qualname__rrr rr%r!r'r1r2r,rrrrr s     r )r(Úhmacrr9Ú ImportErrorÚpymacaroons.utilsrÚpymacaroons.bindersrÚpymacaroons.exceptionsrÚpymacaroons.caveat_delegatesrrrr r r Úobjectr rrrrÚs ÿ