Struct http_auth::digest::DigestClient[][src]

pub struct DigestClient { /* fields omitted */ }
This is supported on crate feature 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 the charset parameter. The RFC only allows that parameter to be set to UTF-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 perform O(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 acceptable qop (quality of protection) values.

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.

Responds using a fixed cnonce for testing only.

In production code, use DigestClient::respond instead, which generates a new random cnonce value.

Trait Implementations

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.