#[non_exhaustive]pub enum AuthnRejection {
Unsupported {
authenticator: String,
presented: String,
},
Malformed(String),
Expired,
SignatureInvalid,
UnknownCredential,
Revoked,
Backend(String),
}Expand description
Why an Authenticator refused to vouch for a Presentation.
The distinction that matters most for a chain is
Unsupported versus everything else:
Unsupported means “not my credential kind, ask the next one”, while every
other variant means “this was mine and it failed”. A chain that treated
them alike would let a revoked API key fall through to a validator that
happened to accept it.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Unsupported
This authenticator does not handle this credential kind. Advisory — a chain moves on.
Fields
presented: StringThe presentation’s kind_label.
Malformed(String)
The material was structurally wrong: unparseable token, missing cookie, subject that does not fit the issuer’s grammar.
Expired
The material was well-formed and genuine but past its validity window.
SignatureInvalid
A signature or MAC did not verify. Distinct from Malformed so audit
can separate “garbage” from “forgery attempt”.
UnknownCredential
Well-formed material naming something the store has never seen.
Revoked
Known material that has been explicitly withdrawn.
Backend(String)
The authenticator could not reach the store, key set, or issuer it needed. Not an authentication failure — callers should surface this as a 5xx, not a 401.
Implementations§
Source§impl AuthnRejection
impl AuthnRejection
Sourcepub fn unsupported(
authenticator: impl Into<String>,
presented: &Presentation,
) -> Self
pub fn unsupported( authenticator: impl Into<String>, presented: &Presentation, ) -> Self
Build an Unsupported rejection.
Sourcepub fn is_unsupported(&self) -> bool
pub fn is_unsupported(&self) -> bool
Is this “wrong credential kind, try the next authenticator”?
Sourcepub fn is_backend_failure(&self) -> bool
pub fn is_backend_failure(&self) -> bool
Is this an infrastructure failure rather than a rejected caller?
Trait Implementations§
Source§impl Clone for AuthnRejection
impl Clone for AuthnRejection
Source§impl Debug for AuthnRejection
impl Debug for AuthnRejection
Source§impl Display for AuthnRejection
impl Display for AuthnRejection
impl Eq for AuthnRejection
Source§impl Error for AuthnRejection
impl Error for AuthnRejection
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()