| Server IP : 61.19.30.66 / Your IP : 216.73.216.15 Web Server : Apache/2.2.22 (Ubuntu) System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64 User : www-data ( 33) PHP Version : 5.3.10-1ubuntu3.48 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /usr/lib/python2.7/dist-packages/twisted/cred/ |
Upload File : |
ó
[³XMc @ s d Z d d l m Z d d l m Z d d l m Z m Z d d l m Z d d l
m Z m Z d e f d „ ƒ YZ
d d d
„ ƒ YZ d S(
s=
The point of integration of application and authentication.
iÿÿÿÿ( t defer( t
maybeDeferred( t failuret reflect( t error( t
providedByt Interfacet IRealmc B s e Z d Z d „ Z RS( s[
The realm connects application-specific objects to the
authentication system.
c G s d S( sí
Return avatar which provides one of the given interfaces.
@param avatarId: a string that identifies an avatar, as returned by
L{ICredentialsChecker.requestAvatarId<twisted.cred.checkers.ICredentialsChecker.requestAvatarId>}
(via a Deferred). Alternatively, it may be
C{twisted.cred.checkers.ANONYMOUS}.
@param mind: usually None. See the description of mind in
L{Portal.login}.
@param interfaces: the interface(s) the returned avatar should
implement, e.g. C{IMailAccount}. See the description of
L{Portal.login}.
@returns: a deferred which will fire a tuple of (interface,
avatarAspect, logout), or the tuple itself. The interface will be
one of the interfaces passed in the 'interfaces' argument. The
'avatarAspect' will implement that interface. The 'logout' object
is a callable which will detach the mind from the avatar.
N( ( t avatarIdt mindt
interfaces( ( s7 /usr/lib/python2.7/dist-packages/twisted/cred/portal.pyt
requestAvatar s ( t __name__t
__module__t __doc__R ( ( ( s7 /usr/lib/python2.7/dist-packages/twisted/cred/portal.pyR s t Portalc B s5 e Z d Z d d „ Z d „ Z d „ Z d „ Z RS( sé
A mediator between clients and a realm.
A portal is associated with one Realm and zero or more credentials checkers.
When a login is attempted, the portal finds the appropriate credentials
checker for the credentials given, invokes it, and if the credentials are
valid, retrieves the appropriate avatar from the Realm.
This class is not intended to be subclassed. Customization should be done
in the realm object and in the credentials checker objects.
c C s4 | | _ i | _ x | D] } | j | ƒ q Wd S( s1
Create a Portal to a L{IRealm}.
N( t realmt checkerst registerChecker( t selfR R t checker( ( s7 /usr/lib/python2.7/dist-packages/twisted/cred/portal.pyt __init__9 s
c C s
| j j ƒ S( sR
Return list of credentials interfaces that can be used to login.
( R t keys( R ( ( s7 /usr/lib/python2.7/dist-packages/twisted/cred/portal.pyt listCredentialsInterfacesB s c G s4 | s | j } n x | D] } | | j | <q Wd S( N( t credentialInterfacesR ( R R R t credentialInterface( ( s7 /usr/lib/python2.7/dist-packages/twisted/cred/portal.pyR H s
c G s“ xL | j D]A } | j | ƒ r
t | j | j | ƒ j | j j | | Œ Sq
Wt | ƒ } t j t j
t j d d j
t t j | ƒ ƒ ƒ ƒ ƒ S( sã
@param credentials: an implementor of
L{twisted.cred.credentials.ICredentials}
@param mind: an object which implements a client-side interface for
your particular realm. In many cases, this may be None, so if the
word 'mind' confuses you, just ignore it.
@param interfaces: list of interfaces for the perspective that the mind
wishes to attach to. Usually, this will be only one interface, for
example IMailAccount. For highly dynamic protocols, however, this
may be a list like (IMailAccount, IUserChooser, IServiceInfo). To
expand: if we are speaking to the system over IMAP, any information
that will be relayed to the user MUST be returned as an
IMailAccount implementor; IMAP clients would not be able to
understand anything else. Any information about unusual status
would have to be relayed as a single mail message in an
otherwise-empty mailbox. However, in a web-based mail system, or a
PB-based client, the ``mind'' object inside the web server
(implemented with a dynamic page-viewing mechanism such as a
Twisted Web Resource) or on the user's client program may be
intelligent enough to respond to several ``server''-side
interfaces.
@return: A deferred which will fire a tuple of (interface,
avatarAspect, logout). The interface will be one of the interfaces
passed in the 'interfaces' argument. The 'avatarAspect' will
implement that interface. The 'logout' object is a callable which
will detach the mind from the avatar. It must be called when the
user has conceptually disconnected from the service. Although in
some cases this will not be in connectionLost (such as in a
web-based session), it will always be at the end of a user's
interactive session.
s No checker for %ss , ( R R R t requestAvatarIdt addCallbackR R R t failR t FailureR t UnhandledCredentialst joint mapR t qual( R t credentialsR R
t it ifac( ( s7 /usr/lib/python2.7/dist-packages/twisted/cred/portal.pyt loginN s #( ( R R
R R R R R% ( ( ( s7 /usr/lib/python2.7/dist-packages/twisted/cred/portal.pyR - s
N( ( R t twisted.internetR t twisted.internet.deferR t twisted.pythonR R t twisted.credR t zope.interfaceR R R R ( ( ( s7 /usr/lib/python2.7/dist-packages/twisted/cred/portal.pyt <module> s