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__/macaroon.cpython-310.pyc
o

�%�Ya�@s�ddlmZddlZddlmZddlmZddlmZddl	m
Z
ddlmZm
Z
mZddlmZmZd	Zd
ZGdd�de�ZdS)
�)�unicode_literalsN)�standard_b64encode)�HashSignaturesBinder)�BinarySerializer)�MacaroonInitException)�convert_to_bytes�convert_to_string�create_initial_signature)�FirstPartyCaveatDelegate�ThirdPartyCaveatDelegate��c@s�eZdZdddddefdd�Zed%dd��Zedd��Zej	dd��Zed	d
��Z
edd��Zed
d��Zej	dd��Zedd��Z
e
j	dd��Z
edd��Zdd�Zd%dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�ZdS)&�MacaroonNcCsh|tkrt}||_|pg|_|pd|_|pd|_|pd|_t�|_t�|_	|r2t
t|�|j�|_dSdS)N�)
�MACAROON_V2�_version�caveats�location�
identifier�	signaturer
�first_party_caveat_delegater�third_party_caveat_delegater	r�identifier_bytes)�selfrr�keyrr�version�r�6/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|j�S�N)r�	_location�rrrrr5�
zMacaroon.locationcC�t|�|_dSr$)rr%�r�string_or_bytesrrrr9�cC�|jSr$)rr&rrrr=�zMacaroon.versioncCs|jtkr
t|j�S|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&rrr�signature_bytesWr-zMacaroon.signature_bytescCs
t�|�Sr$)�copy�deepcopyr&rrrr2[s
z
Macaroon.copycCs|pt�}|�|�Sr$)r�	serialize)rr"rrrr4^s

zMacaroon.serializec	Cs�dj|jd�}z|dj|jd�7}Wnty(|djtt|j��d�7}Ynw|jD]D}z
|djt|j�d�7}WntyQ|djtt|j	��d�7}Ynw|j
rp|jrptt|j
��}|d	j|d
�7}|dj|jd�7}q,|d
j|jd�7}|S)Nzlocation {loc}
)�loczidentifier {id}
)�idzidentifier64 {id}
z
cid {cid}
)�cidzcid64 {cid}
z
vid {vid}
)�vidzcl {cl}
)�clzsignature {sig})�sig)�formatrr�UnicodeEncodeErrorrrrr�	caveat_id�caveat_id_bytes�verification_key_idr)r�combined�caveatr8rrr�inspectbs6��
�����zMacaroon.inspectcC�dd�|jD�S)NcS�g|]}|��r|�qSr)�first_party��.0rArrr�
<listcomp>|�z0Macaroon.first_party_caveats.<locals>.<listcomp>�rr&rrr�first_party_caveats{�zMacaroon.first_party_caveatscCrC)NcSrDr)�third_partyrFrrrrHrIz0Macaroon.third_party_caveats.<locals>.<listcomp>rJr&rrr�third_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
        )r2r�bind)r�discharge_macaroon�	protectedrrr�prepare_for_request�s	zMacaroon.prepare_for_requestcKs|jj||fi|��Sr$)r�add_first_party_caveat)r�	predicate�kwargsrrrrS�s
��zMacaroon.add_first_party_caveatcKs|jj||||fi|��Sr$)r�add_third_party_caveat)rrr�key_idrUrrrrV�s
��zMacaroon.add_third_party_caveatr$)�__name__�
__module__�__qualname__r.r�classmethodr�propertyr�setterrrrrr1r2r4rBrKrNrRrSrVrrrrrsH
�	









r)�
__future__rr2�base64r�pymacaroons.bindersr�)pymacaroons.serializers.binary_serializerr�pymacaroons.exceptionsr�pymacaroons.utilsrrr	�pymacaroons.caveat_delegatesr
rr.r�objectrrrrr�<module>s

https://t.me/RX1948 - 2025