Skip to main content

AuthenticationProvider

Trait AuthenticationProvider 

Source
pub trait AuthenticationProvider:
    Send
    + Sync
    + 'static {
    // Required methods
    fn begin_login<'life0, 'async_trait>(
        &'life0 self,
        req: BeginLoginRequest,
    ) -> Pin<Box<dyn Future<Output = Result<BeginLoginResponse>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn complete_login<'life0, 'async_trait>(
        &'life0 self,
        req: CompleteLoginRequest,
    ) -> Pin<Box<dyn Future<Output = Result<AuthenticatedUser>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn configure<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _name: &'life1 str,
        _config: Map<String, Value>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn metadata(&self) -> Option<RuntimeMetadata> { ... }
    fn warnings(&self) -> Vec<String> { ... }
    fn health_check<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn start<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn close<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn validate_external_token<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _token: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<AuthenticatedUser>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn session_ttl(&self) -> Option<Duration> { ... }
}
Expand description

Lifecycle and login contract for Gestalt authentication providers.

Required Methods§

Source

fn begin_login<'life0, 'async_trait>( &'life0 self, req: BeginLoginRequest, ) -> Pin<Box<dyn Future<Output = Result<BeginLoginResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Starts an interactive login flow.

Source

fn complete_login<'life0, 'async_trait>( &'life0 self, req: CompleteLoginRequest, ) -> Pin<Box<dyn Future<Output = Result<AuthenticatedUser>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Finishes an interactive login flow.

Provided Methods§

Source

fn configure<'life0, 'life1, 'async_trait>( &'life0 self, _name: &'life1 str, _config: Map<String, Value>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Configures the provider before it starts serving requests.

Source

fn metadata(&self) -> Option<RuntimeMetadata>

Returns runtime metadata that should augment the static manifest.

Source

fn warnings(&self) -> Vec<String>

Returns non-fatal warnings the host should surface to users.

Source

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

Performs an optional health check.

Source

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

Starts provider-owned background work after configuration.

Source

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

Shuts the provider down before the runtime exits.

Source

fn validate_external_token<'life0, 'life1, 'async_trait>( &'life0 self, _token: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<AuthenticatedUser>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Validates an externally minted token when supported.

Source

fn session_ttl(&self) -> Option<Duration>

Returns the TTL the host should use for persisted sessions.

Implementors§