~landscape/zope3/newer-from-ztk

« back to all changes in this revision

Viewing changes to src/twisted/web2/auth/interfaces.py

  • Committer: Thomas Hervé
  • Date: 2009-07-08 13:52:04 UTC
  • Revision ID: thomas@canonical.com-20090708135204-df5eesrthifpylf8
Remove twisted copy

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
from zope.interface import Interface, Attribute
2
 
 
3
 
class ICredentialFactory(Interface):
4
 
    scheme = Attribute("string indicated the authentication scheme this factory is associated with.")
5
 
 
6
 
    def getChallenge(peer):
7
 
        """Generate a challenge the client may respond to.
8
 
 
9
 
        @type peer: L{twisted.internet.interfaces.IAddress}
10
 
        @param peer: The client's address
11
 
 
12
 
        @rtype: C{dict}
13
 
        @return: dictionary of challenge arguments
14
 
        """
15
 
 
16
 
    def decode(response, request):
17
 
        """Create a credentials object from the given response.
18
 
        May raise twisted.cred.error.LoginFailed if the response is invalid.
19
 
    
20
 
        @type response: C{str}
21
 
        @param response: scheme specific response string
22
 
 
23
 
        @type request: L{twisted.web2.server.Request}
24
 
        @param request: the request being processed
25
 
 
26
 
        @return: ICredentials
27
 
        """