Struct http_auth::digest::DigestClient [−][src]
pub struct DigestClient { /* fields omitted */ }
digest-scheme
only.Expand description
Client for a Digest
challenge, as in RFC 7616.
Most of the information here is taken from the WWW-Authenticate
or
Proxy-Authenticate
header. This also internally maintains a nonce counter.
Implementation notes:
- Always responds using
UTF-8
, and thus doesn’t use or keep around thecharset
parameter. The RFC only allows that parameter to be set toUTF-8
anyway. - Doesn’t support
userhash
. This option is simple enough for a client to implement, but I’d be surprised to see a server that uses it. It appears to require the server to performO(users)
cryptographic operations to find the correct user to operate on. Needless to say, that’s unrealistic with a large authentication database. - Supports RFC 2069 compatibility, even though RFC 7616 drops it.
Implementations
Returns a string to be displayed to users so they know which username and password to use.
This string should contain at least the name of
the host performing the authentication and might additionally
indicate the collection of users who might have access. An
example is registered_users@example.com
. (See Section 2.2 of
RFC 7235 for
more details.)
Returns the domain, a space-separated list of URIs, as specified in RFC 3986, that define the protection space.
If the domain parameter is absent, returns an empty string, which is semantically identical according to the RFC.
Returns the nonce, a server-specified string which should be uniquely generated each time a 401 response is made.
Returns string of data, specified by the server, that SHOULD be returned by the client unchanged in the Authorization header field of subsequent requests with URIs in the same protection space.
Currently an empty opaque
is treated as an absent one.
Returns a flag indicating that the previous request from the client was rejected because the nonce value was stale.
Returns true if using RFC 2069 compatibility mode, in which the
request-digest
is calculated without the nonce count, conce, or qop.
Returns the algorithm used to produce the digest and an unkeyed digest.
Returns the number of times the server-supplied nonce has been used by
DigestClient::respond
.
Responds to the challenge with the supplied parameters.
The caller should use the returned string as an Authorization
or
Proxy-Authorization
header value.
pub fn respond_with_testing_cnonce(
&mut self,
p: &PasswordParams<'_>,
cnonce: &str
) -> Result<String, String>
pub fn respond_with_testing_cnonce(
&mut self,
p: &PasswordParams<'_>,
cnonce: &str
) -> Result<String, String>
Responds using a fixed cnonce for testing only.
In production code, use DigestClient::respond
instead, which generates a new
random cnonce value.
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.