pub trait RequestContextExtractor: Send + Sync {
// Required method
fn extract<'life0, 'life1, 'async_trait>(
&'life0 self,
parts: &'life1 Parts,
) -> Pin<Box<dyn Future<Output = Result<RequestContext, RequestContextError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Extracts authenticated identity from HTTP request headers.
Implementations typically parse a Bearer token from the Authorization
header, validate it, and map claims to a RequestContext.
Required Methods§
Sourcefn extract<'life0, 'life1, 'async_trait>(
&'life0 self,
parts: &'life1 Parts,
) -> Pin<Box<dyn Future<Output = Result<RequestContext, RequestContextError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn extract<'life0, 'life1, 'async_trait>(
&'life0 self,
parts: &'life1 Parts,
) -> Pin<Box<dyn Future<Output = Result<RequestContext, RequestContextError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Extract identity from the request parts (headers, URI, etc.).