pub enum InvalidationKind {
Expired,
NonceMismatch,
NonceReplayed,
SessionBindingMiss,
ContractMissing,
NotApplicable,
}Expand description
Coarse-grained kind tag for InvalidationReason.
The kind is the stable, wire-level enum (snake_case)
that downstream consumers (alerting, dashboards, audit log
routers) can switch on without inspecting the full
InvalidationReason. The full reason carries the
diagnostic context (vendor family, challenge class,
supplied vs. expected values); the kind is the routing key.
§Example
use stygian_charon::token_lifecycle::InvalidationKind;
let k = InvalidationKind::NonceReplayed;
assert_eq!(k.label(), "nonce_replayed");Variants§
Expired
Token TTL elapsed. The
InvalidationReason::Expired
variant carries the vendor family, challenge class,
observed age, and the TTL that was crossed.
NonceMismatch
Submission’s nonce does not match the contract’s nonce.
The
InvalidationReason::NonceMismatch
variant carries both nonces.
NonceReplayed
A single-use nonce was observed more than once. The
InvalidationReason::NonceReplayed
variant carries the observation count from the nonce
book.
SessionBindingMiss
Submission’s session id does not match the contract’s
bound_session.
ContractMissing
No contract was supplied alongside the token. The validator returns this when the caller bypasses the contract path.
NotApplicable
The token’s challenge class is not applicable for the
supplied vendor family (e.g. Cloudflare is asked to
validate a ProofOfWork token — Cloudflare does not
issue PoW tokens).
Implementations§
Source§impl InvalidationKind
impl InvalidationKind
Sourcepub const fn label(self) -> &'static str
pub const fn label(self) -> &'static str
Stable, lower-case wire label.
§Example
use stygian_charon::token_lifecycle::InvalidationKind;
assert_eq!(InvalidationKind::Expired.label(), "expired");
assert_eq!(InvalidationKind::NonceMismatch.label(), "nonce_mismatch");
assert_eq!(InvalidationKind::NonceReplayed.label(), "nonce_replayed");
assert_eq!(InvalidationKind::SessionBindingMiss.label(), "session_binding_miss");
assert_eq!(InvalidationKind::ContractMissing.label(), "contract_missing");
assert_eq!(InvalidationKind::NotApplicable.label(), "not_applicable");Trait Implementations§
Source§impl Clone for InvalidationKind
impl Clone for InvalidationKind
Source§fn clone(&self) -> InvalidationKind
fn clone(&self) -> InvalidationKind
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InvalidationKind
impl Debug for InvalidationKind
Source§impl<'de> Deserialize<'de> for InvalidationKind
impl<'de> Deserialize<'de> for InvalidationKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Hash for InvalidationKind
impl Hash for InvalidationKind
Source§impl PartialEq for InvalidationKind
impl PartialEq for InvalidationKind
Source§impl Serialize for InvalidationKind
impl Serialize for InvalidationKind
impl Copy for InvalidationKind
impl Eq for InvalidationKind
impl StructuralPartialEq for InvalidationKind
Auto Trait Implementations§
impl Freeze for InvalidationKind
impl RefUnwindSafe for InvalidationKind
impl Send for InvalidationKind
impl Sync for InvalidationKind
impl Unpin for InvalidationKind
impl UnsafeUnpin for InvalidationKind
impl UnwindSafe for InvalidationKind
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.