Skip to main content

ApiKeyValidator

Trait ApiKeyValidator 

Source
pub trait ApiKeyValidator: Send + Sync {
    // Required method
    fn validate<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        context: &'life1 ApiKeyCallbackContext<'life2>,
        key: &'life3 str,
    ) -> Pin<Box<dyn Future<Output = AuthResult<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
}
Expand description

Trusted acceptance predicate, evaluated before key usage is consumed.

Explicitly scoped programmatic verification evaluates it before lookup; unscoped verification first resolves the persisted issuing configuration. A scoped callback error is returned directly. Unscoped verification catches it in the same validation phase as stored key errors.

Required Methods§

Source

fn validate<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, context: &'life1 ApiKeyCallbackContext<'life2>, key: &'life3 str, ) -> Pin<Box<dyn Future<Output = AuthResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Accept or reject a credential before consuming its usage.

§Errors

Returns an application failure from credential validation.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§