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§
Sourcefn stage(&self) -> SecurityStage
fn stage(&self) -> SecurityStage
Which phase(s) does this provider participate in?
Provided Methods§
Sourcefn 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 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.
Sourcefn 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,
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.