module documentation

HTTP authentication module.

Class HttpServerRequestAuthentication No class docstring; 0/3 constant, 7/7 methods documented
Class PasswordFileUser Data structure for users from password file.
Function ParsePasswordFile Parses the contents of a password file.
Constant HTTP_BASIC_AUTH Undocumented
Constant HTTP_DIGEST_AUTH Undocumented
Function _FormatAuthHeader Formats WWW-Authentication header value as per RFC2617, section 1.2
Constant _NOQUOTE Undocumented
def ParsePasswordFile(contents):

Parses the contents of a password file.

Lines in the password file are of the following format:

    <username> <password> [options]

Fields are separated by whitespace. Username and password are mandatory, options are optional and separated by comma (','). Empty lines and comments ('#') are ignored.

Parameters
contents:strContents of password file
Returns
dictDictionary containing PasswordFileUser instances
HTTP_BASIC_AUTH: str =

Undocumented

Value
'Basic'
HTTP_DIGEST_AUTH: str =

Undocumented

Value
'Digest'
def _FormatAuthHeader(scheme, params):

Formats WWW-Authentication header value as per RFC2617, section 1.2

Parameters
scheme:strAuthentication scheme
params:dictAdditional parameters
Returns
strFormatted header value
_NOQUOTE =

Undocumented

Value
re.compile(r'^[-_a-z0-9]+$',
           re.I)