class documentation

class DigestAuth(Auth):

View In Hierarchy

Undocumented

Method __init__ Undocumented
Method auth​_flow Execute the authentication flow.
Method ​_build​_auth​_header Undocumented
Method ​_get​_client​_nonce Undocumented
Method ​_get​_header​_value Undocumented
Method ​_parse​_challenge Returns a challenge from a Digest WWW-Authenticate header. These take the form of: Digest realm="realm@host.com",qop="auth,auth-int",nonce="abc",opaque="xyz"
Method ​_resolve​_qop Undocumented
Constant ​_ALGORITHM​_TO​_HASH​_FUNCTION Undocumented
Instance Variable ​_password Undocumented
Instance Variable ​_username Undocumented

Inherited from Auth:

Async Method async​_auth​_flow Execute the authentication flow asynchronously.
Method sync​_auth​_flow Execute the authentication flow synchronously.
Class Variable requires​_request​_body Undocumented
Class Variable requires​_response​_body Undocumented
def __init__(self, username, password):

Undocumented

Parameters
username:typing.Union[str, bytes]Undocumented
password:typing.Union[str, bytes]Undocumented
def auth_flow(self, request):

Execute the authentication flow.

To dispatch a request, yield it:

` yield request `

The client will .send() the response back into the flow generator. You can access it like so:

` response = yield request `

A return (or reaching the end of the generator) will result in the client returning the last response obtained from the server.

You can dispatch as many requests as is necessary.

Parameters
request:RequestUndocumented
Returns
typing.Generator[Request, Response, None]Undocumented
def _build_auth_header(self, request, challenge):

Undocumented

Parameters
request:RequestUndocumented
challenge:_DigestAuthChallengeUndocumented
Returns
strUndocumented
def _get_client_nonce(self, nonce_count, nonce):

Undocumented

Parameters
nonce​_count:intUndocumented
nonce:bytesUndocumented
Returns
bytesUndocumented
def _get_header_value(self, header_fields):

Undocumented

Parameters
header​_fields:typing.Dict[str, bytes]Undocumented
Returns
strUndocumented
def _parse_challenge(self, request, response, auth_header):
Returns a challenge from a Digest WWW-Authenticate header. These take the form of: Digest realm="realm@host.com",qop="auth,auth-int",nonce="abc",opaque="xyz"
Parameters
request:RequestUndocumented
response:ResponseUndocumented
auth​_header:strUndocumented
Returns
_DigestAuthChallengeUndocumented
def _resolve_qop(self, qop, request):

Undocumented

Parameters
qop:typing.Optional[bytes]Undocumented
request:RequestUndocumented
Returns
typing.Optional[bytes]Undocumented
_ALGORITHM_TO_HASH_FUNCTION: typing.Dict[str, typing.Callable] =

Undocumented

Value
{'MD5': hashlib.md5,
 'MD5-SESS': hashlib.md5,
 'SHA': hashlib.sha1,
 'SHA-SESS': hashlib.sha1,
 'SHA-256': hashlib.sha256,
 'SHA-256-SESS': hashlib.sha256,
 'SHA-512': hashlib.sha512,
...
_password =

Undocumented

_username =

Undocumented