Skip to main content

Flow

Trait Flow 

Source
pub trait Flow: Send + Sync {
    // Required methods
    fn id(&self) -> &str;
    fn execute<'life0, 'async_trait>(
        &'life0 self,
        ctx: FlowContext,
    ) -> Pin<Box<dyn Future<Output = Result<FlowResult, AuthError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Orchestrates the steps of an authentication protocol (e.g., OAuth2, Device Flow).

Required Methods§

Source

fn id(&self) -> &str

Returns the unique identifier for the flow.

Source

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

Executes the flow with the given context.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<P: OAuthProvider + 'static, M: UserMapper + 'static> Flow for OAuth2Flow<P, M>