pub struct Presented {
pub username: String,
pub realm: String,
pub nonce: String,
pub uri: String,
pub response: String,
pub algorithm: Algorithm,
pub nonce_count: Option<u32>,
pub cnonce: Option<String>,
pub qop_auth: bool,
}Expand description
What a request presented in its Authorization or Proxy-Authorization.
Parsed but not trusted. Every field here is attacker-controlled; the only thing that makes any
of it meaningful is Authenticator::verify recomputing the response from a password.
Fields§
§username: StringWho the request claims to be.
realm: StringThe realm it answered.
nonce: StringThe nonce it answered.
uri: StringThe URI the digest covers — not necessarily the request’s own.
response: StringThe computed response.
algorithm: AlgorithmThe algorithm named, defaulting to MD5 when absent (RFC 7616 §3.4).
nonce_count: Option<u32>The nonce count, if qop was used.
cnonce: Option<String>The client nonce, if qop was used.
qop_auth: boolWhether qop=auth was claimed.
Implementations§
Source§impl Presented
impl Presented
Sourcepub fn from_request(request: &Request, proxy: bool) -> Option<Self>
pub fn from_request(request: &Request, proxy: bool) -> Option<Self>
Read the credentials out of a request.
proxy selects Proxy-Authorization over Authorization. Which one is right is not a
detail: a UAS challenges with 401 and reads Authorization, a proxy challenges with 407 and
reads Proxy-Authorization, and a server that reads the wrong one authenticates nobody
while looking like it works.
Trait Implementations§
impl Eq for Presented
impl StructuralPartialEq for Presented
Auto Trait Implementations§
impl Freeze for Presented
impl RefUnwindSafe for Presented
impl Send for Presented
impl Sync for Presented
impl Unpin for Presented
impl UnsafeUnpin for Presented
impl UnwindSafe for Presented
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more