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

Class AuthTokenGenerator

source code

Generates authentification 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) source code
str or None
__call__(self, username, algo='md5')
Generates an authentification token from a username.
source code
Method Details [hide private]

__init__(self, realm, getpass)
(Constructor)

source code 
Parameters:
  • realm (str) - is a string according to RFC2617.
  • getpass (str -> str) - this function is called with a username and password is expected as result. None may be used as an invalid password.

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

source code 

Generates an authentification token from a username.

Parameters:
  • username (str)
Returns: str or None