Skip to main content

AuditSink

Trait AuditSink 

Source
pub trait AuditSink:
    Debug
    + Send
    + Sync {
    // Required method
    fn record_failure<'life0, 'async_trait>(
        &'life0 self,
        event: AuditEvent,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
}
Expand description

Audit emission port for verify-failure events (M48).

One method, no Result: M48 is observability, NOT auth-flow critical. Adapters that fail to persist MUST log internally via tracing::error! and continue — the verify hot path NEVER bubbles audit failures into the auth contract. The trait surface enforces this by giving the caller no error to propagate in the first place.

&self not &mut self: a single verifier emits concurrently across many request handlers; interior mutability lives inside each adapter (e.g. [MemoryAuditSink] uses Mutex).

Send + Sync bounds: required for Arc<dyn AuditSink> use in Axum handlers and tokio tasks.

Required Methods§

Source

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

Implementors§