Skip to main content

SignedSessionAuthPlugin

Struct SignedSessionAuthPlugin 

Source
pub struct SignedSessionAuthPlugin { /* private fields */ }

Implementations§

Source§

impl SignedSessionAuthPlugin

Source

pub fn new(verifier: TokenVerifier) -> Self

Create a new signed session auth plugin

Source

pub fn new_with_async_verifier(verifier: AsyncVerifier) -> Self

Create a signed session auth plugin backed by an async verifier, such as JWKS.

Source

pub fn new_with_multi_key_verifier(verifier: MultiKeyVerifier) -> Self

Create a signed session auth plugin backed by a multi-key verifier for key rotation.

Source

pub fn with_query_param_name(self, name: impl Into<String>) -> Self

Set a custom query parameter name for the token

Source

pub fn with_origin_validation(self) -> Self

Require origin validation (defense-in-depth for browser clients)

Source

pub fn with_audit_logger(self, logger: Arc<dyn SecurityAuditLogger>) -> Self

Set an audit logger for security events

Source

pub fn with_metrics(self, metrics: Arc<AuthMetrics>) -> Self

Set metrics collector for auth operations

Source

pub fn metrics_snapshot(&self) -> Option<AuthMetricsSnapshot>

Get metrics snapshot if metrics are enabled

Source

pub async fn verify_refresh_token( &self, token: &str, ) -> Result<AuthContext, AuthDeny>

Verify a token for in-band refresh and return the auth context

This is used when a client wants to refresh their auth without reconnecting. The origin is NOT validated here - we assume the client has already proven origin at connection time, and we’re just refreshing the session token.

Trait Implementations§

Source§

impl WebSocketAuthPlugin for SignedSessionAuthPlugin

Source§

fn authorize<'life0, 'life1, 'async_trait>( &'life0 self, request: &'life1 ConnectionAuthRequest, ) -> Pin<Box<dyn Future<Output = AuthDecision> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn as_any(&self) -> &dyn Any

Source§

fn audit_logger(&self) -> Option<&dyn SecurityAuditLogger>

Get the audit logger if configured
Source§

fn auth_metrics(&self) -> Option<&AuthMetrics>

Get auth metrics if configured
Source§

fn log_audit<'life0, 'async_trait>( &'life0 self, event: SecurityAuditEvent, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Log a security audit event if audit logging is enabled

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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 = Infallible

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more