pub struct PasswordParams<'a> {
pub username: &'a str,
pub password: &'a str,
pub uri: &'a str,
pub method: &'a str,
pub body: Option<&'a [u8]>,
}
Expand description
Parameters for responding to a password challenge.
This is cheap to construct; callers generally use a fresh PasswordParams
for each request.
The caller is responsible for supplying parameters in the correct
format. Servers may expect character data to be in Unicode Normalization
Form C as noted in RFC 7617 section
2.1 for the
Basic
scheme and RFC 7616 section
4 for the Digest
scheme.
Note that most of these fields are only needed for [DigestClient
]. Callers
that only care about the Basic
challenge scheme can use
[BasicClient::respond
] directly with only username and password.
Fields§
§username: &'a str
§password: &'a str
§uri: &'a str
The URI from the Request-URI of the Request-Line, as described in RFC 2617 section 3.2.2.
RFC 2617 section 3.2.2.5, which says the following:
This may be
*
, anabsoluteURL
or anabs_path
as specified in section 5.1.2 of RFC 2616, but it MUST agree with the Request-URI. In particular, it MUST be anabsoluteURL
if the Request-URI is anabsoluteURL
.
RFC 7616 section 3.4 describes this as the “Effective Request URI”, which is always an absolute form. This may be a mistake. Section 3.4.6 matches RFC 2617 section 3.2.2.5, and Appendix A doesn’t mention a change from RFC 2617.
method: &'a str
The HTTP method, such as GET
.
When using the http
crate, use the return value of
[http::Method::as_str
].
body: Option<&'a [u8]>
The entity body, if available. Use Some(&[])
for HTTP methods with no
body.
When None
, Digest
challenges will only be able to use
[crate::digest::Qop::Auth
], not
[crate::digest::Qop::AuthInt
].
Trait Implementations§
Source§impl<'a> Clone for PasswordParams<'a>
impl<'a> Clone for PasswordParams<'a>
Source§fn clone(&self) -> PasswordParams<'a>
fn clone(&self) -> PasswordParams<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more