Skip to main content

StreamedVerifyOptions

Struct StreamedVerifyOptions 

Source
pub struct StreamedVerifyOptions<'a> {
    pub required_scope: String,
    pub challenge_store: Option<Box<dyn ChallengeStore + 'a>>,
    pub session_context: Vec<u8>,
    pub stream: Option<StreamContext>,
    pub now: Option<i64>,
}
Expand description

The verifier-side controls that apply to a streamed-turn presentation (SPEC §5.13). Deliberately NOT the full VerifyOptions: a streamed turn re-verifies liveness and bindings, not the chain, so revocation, policy, constraint, audit, and anchor options have no field here and can never be passed and silently ignored. Callers who need fresh revocation or policy semantics — including high-value operations the spec directs to force_revocation_check — MUST run full verify_bundle instead.

Fields§

§required_scope: String

Must be present in token.granted_scope for the turn to be valid; empty skips the check. The token stores the verified chain’s effective scope lex-sorted for exactly this check.

§challenge_store: Option<Box<dyn ChallengeStore + 'a>>

Makes the per-turn challenge single-use: consulted (without consuming) after the session token’s HMAC authenticates the presentation and before the per-turn hybrid challenge signature is verified; atomically consumed after that signature verifies — before the scope check. Store failures normalize to the canonical unknown_challenge result.

§session_context: Vec<u8>

Verifier-side session binding; when set, the turn’s presented session_context must match byte-for-byte.

§stream: Option<StreamContext>

Verifier-side stream state (stream_id match; stream_seq must be exactly last_seen_seq+1, else stream_seq_replay / stream_seq_skip).

This is a caller-owned SNAPSHOT: the verifier only reads it and never advances it. Two concurrent turns carrying distinct valid challenges and the same stream_seq will BOTH verify against the same snapshot. Concurrency-safe sequence enforcement is the caller’s responsibility: atomically compare-and-advance your tracked last-seen sequence to turn.stream_seq when (and only when) verification succeeds, and build the snapshot from that tracked state.

§now: Option<i64>

Clock override (unix seconds); None uses the system clock (std builds only — no_std callers MUST set it).

Trait Implementations§

Source§

impl<'a> Default for StreamedVerifyOptions<'a>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.