#[non_exhaustive]pub enum IdentityError {
Show 24 variants
Malformed(String),
MissingKid,
UnknownKid(String),
AlgorithmRejected {
alg: String,
kid: String,
},
Verification(String),
TtlTooLong(u64),
BadTimestamps {
iat: u64,
exp: u64,
},
FutureIat {
iat: u64,
now: u64,
},
Expired {
exp: u64,
now: u64,
},
EmptyField(&'static str),
FieldTooLong {
field: &'static str,
max: usize,
},
SpoofingCharacter(&'static str),
BadIssuer(String),
Jwks(String),
ScopeEscalation {
scope: String,
},
ExpEscalation {
child: u64,
parent: u64,
},
IatEscalation {
child: u64,
parent: u64,
},
NbfEscalation {
child: u64,
parent: u64,
},
ChainTooDeep(usize),
Revoked(String),
InstanceRevoked {
instance_uid: String,
cutoff: u64,
},
RevocationUnavailable(String),
SubjectNotHuman,
SubjectPattern(String),
}Expand description
Identity validation failures.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Malformed(String)
Token structurally malformed.
MissingKid
Header lacks a kid.
UnknownKid(String)
No key registered for this kid.
AlgorithmRejected
Token alg is not accepted, or does not match the key type for its
kid (algorithm-confusion defense).
Verification(String)
Signature invalid / expired / nbf future / wrong audience — collapsed by jsonwebtoken; the detail string preserves the cause.
TtlTooLong(u64)
exp - iat exceeds the 15-minute NHI cap.
BadTimestamps
exp ≤ iat or other timestamp nonsense.
FutureIat
iat is unreasonably far in the future.
Expired
Token expired — with enough context to tell a stale token from a skewed validator clock. Round-106/107 drills: a +6h host rejects every honest client with a bare “ExpiredSignature”, sending the operator hunting client TTLs instead of their own NTP. An “expiry” further in the past than the maximum issuable TTL can only mean the validating host’s clock is ahead.
EmptyField(&'static str)
Required identity field empty.
FieldTooLong
Identity field longer than its documented cap.
SpoofingCharacter(&'static str)
Field carries a bidi override or zero-width character that would spoof how the identity renders in a log or audit view.
BadIssuer(String)
Issuer not in the allowlist.
Jwks(String)
JWKS document was malformed or contained no supported signing keys.
ScopeEscalation
Child scopes exceed parent scopes.
ExpEscalation
Child outlives parent.
IatEscalation
Child claims to be issued before its parent (the delegator).
A backdated child forges audit-trail causality: consumers that
treat claims.iat as “when this identity became authorized”
see the child asserting authority before the parent that
granted it existed.
NbfEscalation
Child’s effective start (nbf when set, else iat) is
earlier than the parent’s effective start (nbf when set,
else iat) — same forgery class as IatEscalation. The
carried child and parent values are the compared
EFFECTIVE starts, not the raw nbf fields (which may be
absent). See IdentityValidator::validate for the full
case matrix.
Fields
ChainTooDeep(usize)
Delegation chain deeper than permitted.
Revoked(String)
Token’s JTI (or the JTI of a token in its delegation chain) appears in the revocation store.
InstanceRevoked
Tokens issued by this instance at or before the cutoff were revoked.
The revocation store could not be read. The token is refused because it might be revoked; this is an availability fault, not a credential fault.
SubjectNotHuman
The token’s sub does not match the configured human-principal
pattern, so the identity is not attributable to a human.
SubjectPattern(String)
The human-principal pattern itself is invalid.
Trait Implementations§
Source§impl Debug for IdentityError
impl Debug for IdentityError
Source§impl Display for IdentityError
impl Display for IdentityError
Source§impl Error for IdentityError
impl Error for IdentityError
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()
Source§impl From<IdentityError> for ExchangeError
impl From<IdentityError> for ExchangeError
Source§fn from(source: IdentityError) -> Self
fn from(source: IdentityError) -> Self
Source§impl PartialEq for IdentityError
impl PartialEq for IdentityError
Source§fn eq(&self, other: &IdentityError) -> bool
fn eq(&self, other: &IdentityError) -> bool
self and other values to be equal, and is used by ==.impl Eq for IdentityError
impl StructuralPartialEq for IdentityError
Auto Trait Implementations§
impl Freeze for IdentityError
impl RefUnwindSafe for IdentityError
impl Send for IdentityError
impl Sync for IdentityError
impl Unpin for IdentityError
impl UnsafeUnpin for IdentityError
impl UnwindSafe for IdentityError
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
§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.