403Webshell
Server IP : 209.205.66.10  /  Your IP : 216.73.216.173
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux ammon 5.15.0-186-generic #196-Ubuntu SMP Sat Jun 20 16:09:34 UTC 2026 x86_64
User :  ( 1006)
PHP Version : 8.5.8
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/macaroonbakery/checkers/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/macaroonbakery/checkers/__pycache__/_caveat.cpython-310.pyc
o

�6�\r�@s�ddlZddlZddlmZmZmZmZmZmZGdd�de�	dd��Z
dd�Zd	d
�Zdd�Z
d
d�Zdd�Zdd�Zdd�Zdd�ZdS)�N�)�
COND_ALLOW�
COND_DECLARED�	COND_DENY�
COND_ERROR�COND_TIME_BEFORE�
STD_NAMESPACEcs&eZdZdZdZd�fdd�	Z�ZS)�Caveata�Represents a condition that must be true for a check to complete
    successfully.

    If location is provided, the caveat must be discharged by
    a third party at the given location (a URL string).

    The namespace parameter holds the namespace URI string of the
    condition - if it is provided, it will be converted to a namespace prefix
    before adding to the macaroon.
    �Ncstt|��||||�S)N)�superr	�__new__)�cls�	condition�location�	namespace��	__class__r
�A/usr/lib/python3/dist-packages/macaroonbakery/checkers/_caveat.pyrszCaveat.__new__)NN)�__name__�
__module__�__qualname__�__doc__�	__slots__r�
__classcell__r
r
rrr	s
r	zcondition location namespacecCs6|�d�dks|dkrtd�|��Stt|d|�S)a�Returns a "declared" caveat asserting that the given key is
    set to the given value.

    If a macaroon has exactly one first party caveat asserting the value of a
    particular key, then infer_declared will be able to infer the value, and
    then the check will allow the declared value if it has the value
    specified here.

    If the key is empty or contains a space, it will return an error caveat.
    � r�z"invalid caveat 'declared' key "{}")�find�error_caveat�format�_first_partyr)�key�valuer
r
r�declared_caveat!sr"cC�
tt|�S)a4Returns a caveat that will never be satisfied, holding f as the text of
    the caveat.

    This should only be used for highly unusual conditions that are never
    expected to happen in practice, such as a malformed key that is
    conventionally passed as a constant. It's not a panic but you should
    only use it in cases where a panic might possibly be appropriate.

    This mechanism means that caveats can be created without error
    checking and a later systematic check at a higher level (in the
    bakery package) can produce an error instead.
    )rr)�fr
r
rr1s

rcCs&|dus
t|�dkrtd�Stt|�S)z� Returns a caveat that will deny attempts to use the macaroon to perform
    any operation other than those listed. Operations must not contain a space.
    Nrzno operations allowed)�lenr�_operation_caveatr��opsr
r
r�allow_caveatAs
r)cCr#)z�Returns a caveat that will deny attempts to use the macaroon to perform
    any of the listed operations. Operations must not contain a space.
    )r&rr'r
r
r�deny_caveatJs
r*cCs:|D]}|�d�dkrtd�|��Sqt|d�|��S)z| Helper for allow_caveat and deny_caveat.

    It checks that all operation names are valid before creating the caveat.
    r���zinvalid operation name "{}")rrrr�join)�condr(�opr
r
rr&Qs
�r&cCstttj|ddd��S)z�Return a caveat that specifies that the time that it is checked at
    should be before t.
    :param t is a a UTC date in - use datetime.utcnow, not datetime.now
    T)�accept_naive�microseconds)rr�	pyrfc3339�generate)�tr
r
r�time_before_caveat\s
��r4cCsf|dkrtd��z|�d�}Wn
ty|dfYSw|dkr%td��|d|�||dd�fS)a Parses a caveat into an identifier, identifying the checker that should
    be used, and the argument to the checker (the rest of the string).

    The identifier is taken from all the characters before the first
    space character.
    :return two string, identifier and arg
    rzempty caveatrrz"caveat starts with space characterrN)�
ValueError�index)�cav�ir
r
r�parse_caveatgs�r9cCs$|}|dkr|d|7}t|td�S)Nrr)rr)r	r)�name�argrr
r
rrzs�r)�collectionsr1�_conditionsrrrrrr�
namedtupler	r"rr)r*r&r4r9rr
r
r
r�<module>s 
	

Youez - 2016 - github.com/yon3zu
LinuXploit