Skip to main content

ApiKeyGetter

Trait ApiKeyGetter 

Source
pub trait ApiKeyGetter: Send + Sync {
    // Required method
    fn get_key(
        &self,
        context: &ApiKeyCallbackContext<'_>,
    ) -> AuthResult<Option<String>>;
}
Expand description

Application lookup replaces configured API-key headers entirely.

None or an empty string leaves normal session authentication in control. A matching getter is called again when the authentication hook executes, following upstream’s matcher/handler ordering. Errors during matching become the hook matcher’s public 500 response; errors from the subsequent handler preserve the application API error.

Required Methods§

Source

fn get_key( &self, context: &ApiKeyCallbackContext<'_>, ) -> AuthResult<Option<String>>

Look up the actual request’s credential.

§Errors

Returns an application failure from credential lookup.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§