Skip to main content

YAuthPlugin

Trait YAuthPlugin 

Source
pub trait YAuthPlugin:
    Send
    + Sync
    + 'static {
    // Required methods
    fn name(&self) -> &'static str;
    fn public_routes(
        &self,
        ctx: &PluginContext<'_>,
    ) -> Option<Router<YAuthState>>;
    fn protected_routes(
        &self,
        ctx: &PluginContext<'_>,
    ) -> Option<Router<YAuthState>>;

    // Provided methods
    fn on_event(
        &self,
        _event: &AuthEvent,
        _ctx: &PluginContext<'_>,
    ) -> EventResponse { ... }
    fn schema(&self) -> Vec<TableDef> { ... }
}

Required Methods§

Source

fn name(&self) -> &'static str

Source

fn public_routes(&self, ctx: &PluginContext<'_>) -> Option<Router<YAuthState>>

Source

fn protected_routes( &self, ctx: &PluginContext<'_>, ) -> Option<Router<YAuthState>>

Provided Methods§

Source

fn on_event( &self, _event: &AuthEvent, _ctx: &PluginContext<'_>, ) -> EventResponse

Source

fn schema(&self) -> Vec<TableDef>

Declare the tables this plugin needs. Default: empty (no tables).

Implementors§