Package wsgitools :: Module digest :: Class AbstractTokenGenerator
[hide private]
[frames] | no frames]

Class AbstractTokenGenerator

source code


Interface class for generating authentication tokens for AuthDigestMiddleware.

Instance Methods [hide private]
 
__init__(self, realm)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
str or None
__call__(self, username, algo='md5')
Generates an authentication token from a username.
source code
bool
check_password(self, username, password, environ=None)
This function implements the interface for verifying passwords used by BasicAuthMiddleware.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Instance Variables [hide private]
str realm
is a string according to RFC2617.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, realm)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • realm (str)
Overrides: object.__init__

__call__(self, username, algo='md5')
(Call operator)

source code 

Generates an authentication token from a username.

Parameters:
Returns: str or None
a valid token or None to signal that authentication should fail

check_password(self, username, password, environ=None)

source code 

This function implements the interface for verifying passwords used by BasicAuthMiddleware. It works by computing a token from the user and comparing it to the token returned by the __call__ method.

Parameters:
  • environ - ignored
  • password (str)
  • username (str)
Returns: bool