pub struct LocalJwtValidator { /* private fields */ }Expand description
Production JWT validator backed by a dynamic JWKS provider.
Delegates Principal construction to a configurable ClaimsMapper,
allowing provider-specific claim shapes without hardcoding extraction logic.
Implementations§
Source§impl LocalJwtValidator
impl LocalJwtValidator
pub fn new( audience: Vec<String>, issuer: String, jwks: Arc<dyn JwksProvider>, mapper: Arc<dyn ClaimsMapper>, ) -> Self
Trait Implementations§
Source§impl JwtValidator for LocalJwtValidator
impl JwtValidator for LocalJwtValidator
fn validate<'life0, 'life1, 'async_trait>(
&'life0 self,
token: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Principal, AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn validate_signature<'life0, 'life1, 'async_trait>(
&'life0 self,
token: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Principal, AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn validate_signature<'life0, 'life1, 'async_trait>(
&'life0 self,
token: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Principal, AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Signature-only verification: constructor keyset verification, NO
issuer/audience check. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for LocalJwtValidator
impl !UnwindSafe for LocalJwtValidator
impl Freeze for LocalJwtValidator
impl Send for LocalJwtValidator
impl Sync for LocalJwtValidator
impl Unpin for LocalJwtValidator
impl UnsafeUnpin for LocalJwtValidator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> TokenAuthenticator for Twhere
T: JwtValidator,
impl<T> TokenAuthenticator for Twhere
T: JwtValidator,
Source§fn authenticate_bearer<'life0, 'life1, 'async_trait>(
&'life0 self,
token: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Principal, CamelError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait,
fn authenticate_bearer<'life0, 'life1, 'async_trait>(
&'life0 self,
token: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Principal, CamelError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait,
Authenticate a Bearer token and return the associated
Principal.Source§fn authenticate<'life0, 'life1, 'async_trait>(
&'life0 self,
req: AuthnRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Principal, CamelError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait,
fn authenticate<'life0, 'life1, 'async_trait>(
&'life0 self,
req: AuthnRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Principal, CamelError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait,
Authenticate a token against per-request audience/issuer constraints. Read more