pub trait AuthResolver: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn resolve<'life0, 'life1, 'async_trait>(
&'life0 self,
metadata: &'life1 MetadataMap,
) -> Pin<Box<dyn Future<Output = Result<Option<ResolvedIdentity>, AuthError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Trait for pluggable auth resolvers.
Each resolver examines gRPC metadata and returns:
Ok(Some(identity))— positive verification, chain stopsOk(None)— not my credential type, chain continuesErr(e)— credential is mine but invalid, chain stops with error
Required Methods§
fn name(&self) -> &str
fn resolve<'life0, 'life1, 'async_trait>(
&'life0 self,
metadata: &'life1 MetadataMap,
) -> Pin<Box<dyn Future<Output = Result<Option<ResolvedIdentity>, AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".