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

« back to all changes in this revision

Viewing changes to twisted/web2/auth/interfaces.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:
 
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
        """