Trait SecurityProvider

Source
pub trait SecurityProvider:
    Debug
    + Send
    + Sync {
    // Required methods
    fn stage(&self) -> SecurityStage;
    fn name(&self) -> &str;

    // Provided methods
    fn pre<'life0, 'async_trait>(
        &'life0 self,
        request: ProxyRequest,
    ) -> Pin<Box<dyn Future<Output = Result<ProxyRequest, ProxyError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn post<'life0, 'async_trait>(
        &'life0 self,
        _request: ProxyRequest,
        response: ProxyResponse,
    ) -> Pin<Box<dyn Future<Output = Result<ProxyResponse, ProxyError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

A unit of security logic – e.g. BasicAuth, JWT, OIDC, mTLS …

Required Methods§

Source

fn stage(&self) -> SecurityStage

Which phase(s) does this provider participate in?

Source

fn name(&self) -> &str

Name shown in logs / error messages.

Provided Methods§

Source

fn pre<'life0, 'async_trait>( &'life0 self, request: ProxyRequest, ) -> Pin<Box<dyn Future<Output = Result<ProxyRequest, ProxyError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Optionally mutate/validate the inbound request before routing.

Source

fn post<'life0, 'async_trait>( &'life0 self, _request: ProxyRequest, response: ProxyResponse, ) -> Pin<Box<dyn Future<Output = Result<ProxyResponse, ProxyError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Optionally inspect/validate the response after the upstream call.

Implementors§