Skip to main content

EdgeVerifier

Struct EdgeVerifier 

Source
pub struct EdgeVerifier<V, Rd> { /* private fields */ }
Expand description

Edge facade: verify a token, then check it hasn’t been revoked.

Holds a TokenVerifier and a RevocationReader — and nothing else. There is no TokenMinter in this type, so an edge built on it cannot forge sessions even if compromised; that absence is the whole point of the asymmetric codec split. Generic (not dyn) so the “no minter” property is a fact about the type, not a runtime convention. Pair a PasetoV4PublicVerifier with a CF-KV-backed RevocationReader.

Implementations§

Source§

impl<V, Rd> EdgeVerifier<V, Rd>

Source

pub fn new(verifier: V, revoked: Rd) -> EdgeVerifier<V, Rd>

Source

pub async fn verify_at(&self, token: &str, now: i64) -> Result<Claims, Error>

Verify token against now, then reject it if its jti is revoked.

Two stages, cheapest first: cryptographic verification (stateless, local to the edge) gates the revocation read, so a forged or expired token never reaches the revocation set. A token that verifies but whose jti is revoked returns Error::Revoked.

Auto Trait Implementations§

§

impl<V, Rd> Freeze for EdgeVerifier<V, Rd>
where V: Freeze, Rd: Freeze,

§

impl<V, Rd> RefUnwindSafe for EdgeVerifier<V, Rd>

§

impl<V, Rd> Send for EdgeVerifier<V, Rd>
where V: Send, Rd: Send,

§

impl<V, Rd> Sync for EdgeVerifier<V, Rd>
where V: Sync, Rd: Sync,

§

impl<V, Rd> Unpin for EdgeVerifier<V, Rd>
where V: Unpin, Rd: Unpin,

§

impl<V, Rd> UnsafeUnpin for EdgeVerifier<V, Rd>
where V: UnsafeUnpin, Rd: UnsafeUnpin,

§

impl<V, Rd> UnwindSafe for EdgeVerifier<V, Rd>
where V: UnwindSafe, Rd: UnwindSafe,

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, <T as TryFrom<U>>::Error>

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.