#[non_exhaustive]pub enum Error {
ChallengeParse(String),
ResponseCompute(String),
SignedUrlKeyTooShort {
kid: String,
min: usize,
actual: usize,
},
UnknownSignedUrlKeyId(String),
InvalidBearerToken,
}Expand description
Errors produced by challenge parsing / response computation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ChallengeParse(String)
The WWW-Authenticate challenge value could not be parsed (RFC 7235 /
RFC 2326 §14 for a Basic or Digest challenge).
ResponseCompute(String)
The Authorization response value could not be computed from the
parsed challenge and credentials (e.g. an unsupported Digest
algorithm/qop).
SignedUrlKeyTooShort
crate::SignedUrlKeySet::new rejected a key whose secret is shorter
than the required minimum (issue #747) — a setup-time error, never
returned from request verification. The kid is included since this
is a config-diagnostic error, not an attacker-facing one.
Fields
UnknownSignedUrlKeyId(String)
crate::SignedUrlKeySet::sign was asked to mint a token for a kid
the keyset has no secret for. Only reachable from the signing helper
(used by tests/operators minting URLs) — never from
crate::Verifier::verify, which folds every signed-URL rejection
reason into the same crate::AuthResult::Unauthorized (see that
module’s docs).
InvalidBearerToken
A Bearer token cannot be carried in an Authorization header value —
it contains a byte outside visible ASCII (control character, CR/LF, or
non-ASCII) — so no header was produced rather than a corrupt or
injectable one.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()