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

Class AuthTokenGenerator

source code


Generates authentication tokens for AuthDigestMiddleware. The interface consists of beeing callable with a username and having a realm attribute being a string.

Instance Methods [hide private]
 
__init__(self, realm, getpass)
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

Inherited from AbstractTokenGenerator: check_password

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

Instance Variables [hide private]

Inherited from AbstractTokenGenerator: realm

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, realm, getpass)
(Constructor)

source code 

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

Parameters:
  • realm (str) - is a string according to RFC2617.
  • getpass (str -> (str or None)) - this function is called with a username and password is expected as result. None may be used as an invalid password. An example for getpass would be {username: password}.get.
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
Overrides: AbstractTokenGenerator.__call__
(inherited documentation)