pub enum ChallengeClass {
None,
Interstitial,
Captcha,
ProofOfWork,
IntegrityCheck,
CookieRefresh,
Unknown,
}Expand description
Stable label for the kind of challenge a token is bound to.
The taxonomy mirrors the surfaces a challenge token can be
issued for. It is intentionally smaller than the
ChallengeOutcome
enum (T83) because outcomes describe what the runner
observed on the wire, while ChallengeClass describes what
the token is for. A Captcha outcome and a
Captcha token challenge class are paired by construction —
but a Captcha token can also be observed against an
IntegrityCheck outcome when the vendor re-checks the
captcha solution during a follow-up request.
§Example
use stygian_charon::token_lifecycle::ChallengeClass;
let c = ChallengeClass::Captcha;
assert_eq!(c.label(), "captcha");
assert!(c.requires_nonce());Variants§
None
No challenge — token is a session cookie or bearer-style bearer that does not gate a specific challenge artefact.
Interstitial
Soft / interstitial challenge (e.g. cf-chl-bypass for
Cloudflare’s “Just a moment…” page).
Captcha
Captcha challenge (reCAPTCHA, hCaptcha, DataDome
captcha-delivery, etc.).
ProofOfWork
Proof-of-work challenge (e.g. Akamai _abck
derivation).
IntegrityCheck
JS integrity check (e.g. PerimeterX _px3 payload).
CookieRefresh
Cookie refresh / sticky session roll-over.
Unknown
Catch-all when the challenge class cannot be classified.
Implementations§
Source§impl ChallengeClass
impl ChallengeClass
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::ChallengeClass;
assert_eq!(ChallengeClass::Interstitial.label(), "interstitial");
assert_eq!(ChallengeClass::Captcha.label(), "captcha");
assert_eq!(ChallengeClass::ProofOfWork.label(), "proof_of_work");
assert_eq!(ChallengeClass::IntegrityCheck.label(), "integrity_check");
assert_eq!(ChallengeClass::CookieRefresh.label(), "cookie_refresh");
assert_eq!(ChallengeClass::None.label(), "none");
assert_eq!(ChallengeClass::Unknown.label(), "unknown");Sourcepub const fn requires_nonce(self) -> bool
pub const fn requires_nonce(self) -> bool
Whether the validator must enforce nonce binding for tokens of this challenge class.
Every class except None requires a
nonce. None is the “session cookie” path — the cookie
itself is the contract and nonce binding is meaningless.
§Example
use stygian_charon::token_lifecycle::ChallengeClass;
assert!(!ChallengeClass::None.requires_nonce());
assert!(ChallengeClass::Interstitial.requires_nonce());
assert!(ChallengeClass::Captcha.requires_nonce());Sourcepub const fn requires_session_binding(self) -> bool
pub const fn requires_session_binding(self) -> bool
Whether the validator must enforce session binding for tokens of this challenge class.
Only the cookie-refresh / sticky-session class is sensitive to session binding by default; all other classes are session-agnostic. Per-vendor policy overrides can still require session binding for any class.
§Example
use stygian_charon::token_lifecycle::ChallengeClass;
assert!(ChallengeClass::CookieRefresh.requires_session_binding());
assert!(!ChallengeClass::Interstitial.requires_session_binding());Trait Implementations§
Source§impl Clone for ChallengeClass
impl Clone for ChallengeClass
Source§fn clone(&self) -> ChallengeClass
fn clone(&self) -> ChallengeClass
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ChallengeClass
impl Debug for ChallengeClass
Source§impl<'de> Deserialize<'de> for ChallengeClass
impl<'de> Deserialize<'de> for ChallengeClass
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 ChallengeClass
impl Hash for ChallengeClass
Source§impl PartialEq for ChallengeClass
impl PartialEq for ChallengeClass
Source§impl Serialize for ChallengeClass
impl Serialize for ChallengeClass
impl Copy for ChallengeClass
impl Eq for ChallengeClass
impl StructuralPartialEq for ChallengeClass
Auto Trait Implementations§
impl Freeze for ChallengeClass
impl RefUnwindSafe for ChallengeClass
impl Send for ChallengeClass
impl Sync for ChallengeClass
impl Unpin for ChallengeClass
impl UnsafeUnpin for ChallengeClass
impl UnwindSafe for ChallengeClass
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.