Skip to main content

WebSocketAuthPlugin

Trait WebSocketAuthPlugin 

Source
pub trait WebSocketAuthPlugin:
    Send
    + Sync
    + Any {
    // Required methods
    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;
    fn as_any(&self) -> &dyn Any;

    // Provided methods
    fn audit_logger(&self) -> Option<&dyn SecurityAuditLogger> { ... }
    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 { ... }
    fn auth_metrics(&self) -> Option<&AuthMetrics> { ... }
}

Required Methods§

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

Provided Methods§

Source

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

Get the audit logger 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

Source

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

Get auth metrics if configured

Implementors§