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

Class HtdigestTokenGenerator

source code


Reads authentication tokens for AuthDigestMiddleware from an apache htdigest file.

Instance Methods [hide private]
 
__init__(self, realm, htdigestfile, ignoreparseerrors=False)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
readhtdigest(self, htdigestfile, ignoreparseerrors=False) source code
str or None
__call__(self, user, 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, htdigestfile, ignoreparseerrors=False)
(Constructor)

source code 

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

Parameters:
  • htdigestfile (str) - path to the .htdigest file
  • ignoreparseerrors (bool) - passed to readhtdigest
  • realm (str)
Raises:
  • IOError
  • ValueError
Overrides: object.__init__

readhtdigest(self, htdigestfile, ignoreparseerrors=False)

source code 
Parameters:
  • ignoreparseerrors (bool) - do not raise ValueErrors for bad files
  • htdigestfile (str)
Raises:
  • IOError
  • ValueError

__call__(self, user, 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)