Helpers to act as a minimal MD5 Digest client or server from Python.
Classes | |
| class | DigestAuthClient |
| Minimal stateful Digest client for functional tests. More... | |
Functions | |
| str | _md5 (str data) |
| dict | parse_directives (str header) |
| Parses a WWW-Authenticate or an Authorization header value. | |
| dict | construct_challenge (*, dict auth_directives, str|None nonce=None) |
| str | construct_header (*, str username, str password, dict challenge, str uri, str method) |
| Builds a single Authorization: Digest ... header value. | |
| str | calculate_response (*, str username, str password, str realm, str nonce, str nonce_count, str cnonce, str qop, str method, str uri) |
| Server side counterpart: the expected value of the response directive. | |
Variables | |
| _DIRECTIVE_RE = re.compile(r'(\w+)=("[^"]*"|[^,\s]+)') | |
|
protected |
Definition at line 13 of file httpdigest.py.
| str calculate_response | ( | * | , |
| str | username, | ||
| str | password, | ||
| str | realm, | ||
| str | nonce, | ||
| str | nonce_count, | ||
| str | cnonce, | ||
| str | qop, | ||
| str | method, | ||
| str | uri ) |
Server side counterpart: the expected value of the response directive.
Definition at line 56 of file httpdigest.py.
| dict construct_challenge | ( | * | , |
| dict | auth_directives, | ||
| str | None | nonce = None ) |
Definition at line 24 of file httpdigest.py.
| str construct_header | ( | * | , |
| str | username, | ||
| str | password, | ||
| dict | challenge, | ||
| str | uri, | ||
| str | method ) |
Builds a single Authorization: Digest ... header value.
Definition at line 47 of file httpdigest.py.
| dict parse_directives | ( | str | header | ) |
Parses a WWW-Authenticate or an Authorization header value.
Definition at line 17 of file httpdigest.py.
|
protected |
Definition at line 10 of file httpdigest.py.