Skip to main content

TokenAuthenticator

Trait TokenAuthenticator 

Source
pub trait TokenAuthenticator: Send + Sync {
    // Required method
    fn authenticate_bearer<'life0, 'life1, 'async_trait>(
        &'life0 self,
        token: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Principal, CamelError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Separates authentication (token → Principal) from authorization (SecurityPolicy check).

Provides a blanket implementation for any JwtValidator, converting provider-specific AuthError variants into domain-level CamelError variants.

Required Methods§

Source

fn authenticate_bearer<'life0, 'life1, 'async_trait>( &'life0 self, token: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Principal, CamelError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Authenticate a Bearer token and return the associated Principal.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§