| 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 : |
o
�6�\� � @ s` d dl Z ddlmZ ddlmZ ddlmZmZ ddlm Z ed�Z
dd � Zd
d� Zdd
� Z
dS )� N� )�
ContextKey)�parse_caveat)�COND_TIME_BEFORE�
STD_NAMESPACE)�condition_with_prefixztime-keyc C s |du r| S | � t|�S )a! Returns a copy of ctx with a key added that associates it with the
given clock implementation, which will be used by the time-before checker
to determine the current time.
The clock should have a utcnow method that returns the current time
as a datetime value in UTC.
N)�
with_value�TIME_KEY)�ctx�clock� r �?/usr/lib/python3/dist-packages/macaroonbakery/checkers/_time.py�context_with_clock
s r c C s: d}|D ]}t | |j�}|dur|du s||k r|}q|S )a Returns the minimum time of any time-before caveats found in the given
macaroons or None if no such caveats were found.
:param ns: a Namespace, used to resolve caveats.
:param ms: a list of pymacaroons.Macaroon
:return: datetime.DateTime or None.
N)�expiry_time�caveats)�ns�ms�t�m�etr r r
�macaroons_expiry_time s �r c C s� | � t�}t|t�}d}|D ]8}|�� sq|j�d�}t|�\}}||kr&qztj |dd�j
dd�}|du s:||k r<|}W q tyF Y qw |S )au Returns the minimum time of any time-before caveats found
in the given list or None if no such caveats were found.
The ns parameter is
:param ns: used to determine the standard namespace prefix - if
the standard namespace is not found, the empty prefix is assumed.
:param cavs: a list of pymacaroons.Caveat
:return: datetime.DateTime or None.
Nzutf-8T)�utc)�tzinfo)�resolver r r �first_party�caveat_id_bytes�decoder � pyrfc3339�parse�replace�
ValueError) r �cavs�prefix�time_before_condr �cav�name�restr r r r
r ( s*
���r )r �
_auth_contextr �_caveatr �_conditionsr r �_utilsr r r r r r r r r
�<module> s