Your IP : 216.73.216.213
B
���]N+ � @ s� d Z ddlmZmZ ddlZddlmZmZmZ ddl m
Z
ddlmZ ddl
mZ ddlmZmZ G d d
� d
e�ZdZee�G dd
� d
��Zee�G dd� de��Zee�G dd� d��ZeZdS )zf
Basic credential checkers
@var ANONYMOUS: An empty tuple used to represent the anonymous avatar ID.
� )�division�absolute_importN)�implementer� Interface� Attribute)�Logger)�defer)�failure)�error�credentialsc @ s e Zd ZdZed�Zdd� ZdS )�ICredentialsCheckerzE
An object that can check sub-interfaces of L{ICredentials}.
zNA list of sub-interfaces of L{ICredentials} which specifies which I may check.c C s dS )a
Validate credentials and produce an avatar ID.
@param credentials: something which implements one of the interfaces in
C{credentialInterfaces}.
@return: a L{Deferred} which will fire with a L{bytes} that identifies
an avatar, an empty tuple to specify an authenticated anonymous user
(provided as L{twisted.cred.checkers.ANONYMOUS}) or fail with
L{UnauthorizedLogin}. Alternatively, return the result itself.
@see: L{twisted.cred.credentials}
N� )r r
r
�H/opt/alt/python37/lib64/python3.7/site-packages/twisted/cred/checkers.py�requestAvatarId# s
z#ICredentialsChecker.requestAvatarIdN)�__name__�
__module__�__qualname__�__doc__r �credentialInterfacesr r
r
r
r r s r r
c @ s e Zd ZdZejfZdd� ZdS )�AllowAnonymousAccessz�
A credentials checker that unconditionally grants anonymous access.
@cvar credentialInterfaces: Tuple containing L{IAnonymous}.
c C s
t �t�S )z�
Succeed with the L{ANONYMOUS} avatar ID.
@return: L{Deferred} that fires with L{twisted.cred.checkers.ANONYMOUS}
)r �succeed� ANONYMOUS)�selfr r
r
r r K s z$AllowAnonymousAccess.requestAvatarIdN)r r r r r Z
IAnonymousr r r
r
r
r r B s r c @ s<