pub struct HttpJwtValidator { /* private fields */ }Expand description
HTTP-based implementation of JwtValidator using jsonwebtoken crate.
Validates JWT tokens by:
- Extracting JWT header to get kid and alg
- Fetching JWKS from issuer via injected JwksClient
- Matching kid to find the appropriate key
- Building Validation struct with explicit algorithm and claims validation
- Calling jsonwebtoken::decode() with full validation
- Returning claims as JSON value
Implementations§
Source§impl HttpJwtValidator
impl HttpJwtValidator
Sourcepub fn new(jwks_client: Arc<dyn JwksClient>) -> Self
pub fn new(jwks_client: Arc<dyn JwksClient>) -> Self
Create a new HttpJwtValidator with the given JWKS client.
§Args
jwks_client: JWKS client for fetching and caching public keys
Trait Implementations§
Source§impl JwtValidator for HttpJwtValidator
impl JwtValidator for HttpJwtValidator
Source§fn validate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
token: &'life1 str,
config: &'life2 OidcValidationConfig,
now: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<Value, OidcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn validate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
token: &'life1 str,
config: &'life2 OidcValidationConfig,
now: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<Value, OidcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Validate and extract claims from a JWT token. Read more
Auto Trait Implementations§
impl Freeze for HttpJwtValidator
impl !RefUnwindSafe for HttpJwtValidator
impl Send for HttpJwtValidator
impl Sync for HttpJwtValidator
impl Unpin for HttpJwtValidator
impl UnsafeUnpin for HttpJwtValidator
impl !UnwindSafe for HttpJwtValidator
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