Struct digest_auth::WwwAuthenticateHeader
source · pub struct WwwAuthenticateHeader {
pub domain: Option<Vec<String>>,
pub realm: String,
pub nonce: String,
pub opaque: Option<String>,
pub stale: bool,
pub algorithm: Algorithm,
pub qop: Option<Vec<Qop>>,
pub userhash: bool,
pub charset: Charset,
pub nc: u32,
}
Expand description
WWW-Authenticate header parsed from HTTP header value
Fields§
§domain: Option<Vec<String>>
Domain is a list of URIs that will accept the same digest. None if not given (i.e applies to all)
realm: String
Authorization realm (i.e. hostname, serial number…)
nonce: String
Server nonce
opaque: Option<String>
Server opaque string
stale: bool
True if the server nonce expired. This is sent in response to an auth attempt with an older digest. The response should contain a new WWW-Authenticate header.
algorithm: Algorithm
Hashing algo
qop: Option<Vec<Qop>>
Digest algorithm variant
userhash: bool
Flag that the server supports user-hashes
charset: Charset
Server-supported charset
nc: u32
nc - not part of the received header, but kept here for convenience and incremented each time a response is composed with the same nonce.
Implementations§
source§impl WwwAuthenticateHeader
impl WwwAuthenticateHeader
sourcepub fn respond(
&mut self,
secrets: &AuthContext<'_>
) -> Result<AuthorizationHeader>
pub fn respond( &mut self, secrets: &AuthContext<'_> ) -> Result<AuthorizationHeader>
Generate an AuthorizationHeader
to be sent to the server in a new request.
The self.nc
field is incremented.
Trait Implementations§
source§impl Clone for WwwAuthenticateHeader
impl Clone for WwwAuthenticateHeader
source§fn clone(&self) -> WwwAuthenticateHeader
fn clone(&self) -> WwwAuthenticateHeader
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for WwwAuthenticateHeader
impl Debug for WwwAuthenticateHeader
source§impl Display for WwwAuthenticateHeader
impl Display for WwwAuthenticateHeader
source§impl FromStr for WwwAuthenticateHeader
impl FromStr for WwwAuthenticateHeader
source§impl PartialEq<WwwAuthenticateHeader> for WwwAuthenticateHeader
impl PartialEq<WwwAuthenticateHeader> for WwwAuthenticateHeader
source§fn eq(&self, other: &WwwAuthenticateHeader) -> bool
fn eq(&self, other: &WwwAuthenticateHeader) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for WwwAuthenticateHeader
Auto Trait Implementations§
impl RefUnwindSafe for WwwAuthenticateHeader
impl Send for WwwAuthenticateHeader
impl Sync for WwwAuthenticateHeader
impl Unpin for WwwAuthenticateHeader
impl UnwindSafe for WwwAuthenticateHeader
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more