Skip to main content

AuthPlugin

Trait AuthPlugin 

Source
pub trait AuthPlugin: Send + Sync {
    // Required methods
    fn provider_id(&self) -> ProviderId;
    fn supported_methods(&self) -> Vec<AuthMethod>;
    fn create_flow(
        &self,
        storage: Arc<dyn AuthStorage>,
    ) -> Option<Box<dyn DynAuthenticationFlow>>;
    fn resolve_auth<'life0, 'async_trait>(
        &'life0 self,
        storage: Arc<dyn AuthStorage>,
    ) -> Pin<Box<dyn Future<Output = Result<Option<AuthDirective>, AuthError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn is_authenticated<'life0, 'async_trait>(
        &'life0 self,
        storage: Arc<dyn AuthStorage>,
    ) -> Pin<Box<dyn Future<Output = Result<bool, AuthError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;

    // Provided method
    fn model_visibility(&self) -> Option<Box<dyn ModelVisibilityPolicy>> { ... }
}

Required Methods§

Source

fn provider_id(&self) -> ProviderId

Source

fn supported_methods(&self) -> Vec<AuthMethod>

Source

fn create_flow( &self, storage: Arc<dyn AuthStorage>, ) -> Option<Box<dyn DynAuthenticationFlow>>

Source

fn resolve_auth<'life0, 'async_trait>( &'life0 self, storage: Arc<dyn AuthStorage>, ) -> Pin<Box<dyn Future<Output = Result<Option<AuthDirective>, AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Source

fn is_authenticated<'life0, 'async_trait>( &'life0 self, storage: Arc<dyn AuthStorage>, ) -> Pin<Box<dyn Future<Output = Result<bool, AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Provided Methods§

Implementations on Foreign Types§

Source§

impl AuthPlugin for AnthropicAuthPlugin

Source§

fn provider_id(&self) -> ProviderId

Source§

fn supported_methods(&self) -> Vec<AuthMethod>

Source§

fn create_flow( &self, storage: Arc<dyn AuthStorage>, ) -> Option<Box<dyn DynAuthenticationFlow>>

Source§

fn resolve_auth<'life0, 'async_trait>( &'life0 self, storage: Arc<dyn AuthStorage>, ) -> Pin<Box<dyn Future<Output = Result<Option<AuthDirective>, AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait, AnthropicAuthPlugin: 'async_trait,

Source§

fn is_authenticated<'life0, 'async_trait>( &'life0 self, storage: Arc<dyn AuthStorage>, ) -> Pin<Box<dyn Future<Output = Result<bool, AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait, AnthropicAuthPlugin: 'async_trait,

Source§

impl AuthPlugin for OpenAiAuthPlugin

Source§

fn provider_id(&self) -> ProviderId

Source§

fn supported_methods(&self) -> Vec<AuthMethod>

Source§

fn create_flow( &self, storage: Arc<dyn AuthStorage>, ) -> Option<Box<dyn DynAuthenticationFlow>>

Source§

fn resolve_auth<'life0, 'async_trait>( &'life0 self, storage: Arc<dyn AuthStorage>, ) -> Pin<Box<dyn Future<Output = Result<Option<AuthDirective>, AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait, OpenAiAuthPlugin: 'async_trait,

Source§

fn is_authenticated<'life0, 'async_trait>( &'life0 self, storage: Arc<dyn AuthStorage>, ) -> Pin<Box<dyn Future<Output = Result<bool, AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait, OpenAiAuthPlugin: 'async_trait,

Source§

fn model_visibility(&self) -> Option<Box<dyn ModelVisibilityPolicy>>

Implementors§