class documentation

class DigestAuth(Auth): (source)

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 _last_challenge Undocumented
Instance Variable _nonce_count 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): (source)

Undocumented

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

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): (source)

Undocumented

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

Undocumented

Parameters
nonce_count:intUndocumented
nonce:bytesUndocumented
Returns
bytesUndocumented
def _get_header_value(self, header_fields): (source)

Undocumented

Parameters
header_fields:typing.Dict[str, bytes]Undocumented
Returns
strUndocumented
def _parse_challenge(self, request, response, auth_header): (source)

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): (source)

Undocumented

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

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,
...
_last_challenge = (source)

Undocumented

_nonce_count: int = (source)

Undocumented

_password = (source)

Undocumented

_username = (source)

Undocumented