~certify-web-dev/twisted/certify-trunk

« back to all changes in this revision

Viewing changes to twisted/cred/checkers.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-01-17 14:52:35 UTC
  • mfrom: (1.1.5 upstream) (2.1.2 etch)
  • Revision ID: james.westby@ubuntu.com-20070117145235-btmig6qfmqfen0om
Tags: 2.5.0-0ubuntu1
New upstream version, compatible with python2.5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 
7
7
import os
8
8
 
9
 
from zope import interface
 
9
from zope.interface import implements, Interface
10
10
 
11
11
from twisted.internet import defer
12
 
from twisted.python import components, failure, log
 
12
from twisted.python import failure, log
13
13
from twisted.cred import error, credentials
14
14
 
15
15
try:
17
17
except ImportError: # PyPAM is missing
18
18
    pamauth = None
19
19
 
20
 
class ICredentialsChecker(components.Interface):
 
20
class ICredentialsChecker(Interface):
21
21
    """I check sub-interfaces of ICredentials.
22
22
 
23
23
    @cvar credentialInterfaces: A list of sub-interfaces of ICredentials which
24
24
    specifies which I may check.
25
25
    """
26
26
 
27
 
    def requestAvatarId(self, credentials):
 
27
    def requestAvatarId(credentials):
28
28
        """
29
29
        @param credentials: something which implements one of the interfaces in
30
30
        self.credentialInterfaces.
49
49
 
50
50
 
51
51
class AllowAnonymousAccess:
52
 
    interface.implements(ICredentialsChecker)
 
52
    implements(ICredentialsChecker)
53
53
    credentialInterfaces = credentials.IAnonymous,
54
54
 
55
55
    def requestAvatarId(self, credentials):
67
67
    see L{FilePasswordDB}.
68
68
    """
69
69
 
70
 
    interface.implements(ICredentialsChecker)
 
70
    implements(ICredentialsChecker)
71
71
 
72
72
    credentialInterfaces = (credentials.IUsernamePassword,
73
73
        credentials.IUsernameHashedPassword)
107
107
    IUsernameHashedPassword credentials will be checkable as well.
108
108
    """
109
109
 
110
 
    interface.implements(ICredentialsChecker)
 
110
    implements(ICredentialsChecker)
111
111
 
112
112
    cache = False
113
113
    _credCache = None
242
242
                    ).addCallback(self._cbPasswordMatch, u)
243
243
 
244
244
class PluggableAuthenticationModulesChecker:
245
 
    interface.implements(ICredentialsChecker)
 
245
    implements(ICredentialsChecker)
246
246
    credentialInterfaces = credentials.IPluggableAuthenticationModules,
247
247
    service = 'Twisted'
248
248