File manager - Edit - /usr/lib/python3/dist-packages/twisted/cred/__pycache__/checkers.cpython-310.pyc
Back
o �bI+ � @ s� d Z ddlZddlmZmZmZ ddlmZmZ ddl m Z ddlmZ ddl mZ G dd � d e�Zd Zee�G dd� d��Zee�G d d� d��Zee�G dd� d��ZeZdS )zf Basic credential checkers @var ANONYMOUS: An empty tuple used to represent the anonymous avatar ID. � N)� Attribute� Interface�implementer)�credentials�error)�defer)�Logger)�failurec @ 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 �7/usr/lib/python3/dist-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 G s z$AllowAnonymousAccess.requestAvatarIdN)r r r r r � IAnonymousr r r r r r r = s r c @ s<