Skip to main content

CookieCacheSigner

Trait CookieCacheSigner 

Source
pub trait CookieCacheSigner<S: AuthSchema>: Send + Sync {
    // Required methods
    fn sign<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        payload: Value,
        max_age: f64,
        ctx: &'life1 AuthContext<S>,
        transaction: Option<&'life2 dyn AuthTransaction<S>>,
    ) -> Pin<Box<dyn Future<Output = AuthResult<String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn verify<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        token: &'life1 str,
        ctx: &'life2 AuthContext<S>,
    ) -> Pin<Box<dyn Future<Output = AuthResult<Option<Value>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Managed JWT plugin signing/verification for the core cookie-cache lifecycle.

Required Methods§

Source

fn sign<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, payload: Value, max_age: f64, ctx: &'life1 AuthContext<S>, transaction: Option<&'life2 dyn AuthTransaction<S>>, ) -> Pin<Box<dyn Future<Output = AuthResult<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

§Errors

Propagates managed key resolution and signing failures.

Source

fn verify<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, token: &'life1 str, ctx: &'life2 AuthContext<S>, ) -> Pin<Box<dyn Future<Output = AuthResult<Option<Value>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

§Errors

Invalid tokens and unavailable verification keys return None.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§