pub struct JwksKeySource { /* private fields */ }Expand description
JWKS-backed key source with issuer-and-kid-based resolution.
Replaces ClusterKeySource with standards-aligned JWKS key lookup:
- Caches keys by
(issuer, kid)after fetching from the JWKS endpoint - On cache miss, refetches JWKS (primary invalidation mechanism)
- Issuer-scoped negative cache prevents DoS from random kid spam (5s TTL)
- Semaphore bounds concurrent JWKS fetches
Implementations§
Source§impl JwksKeySource
impl JwksKeySource
pub fn new( mode: JwksMode, local_issuer_url: String, fetcher: JwksFetcher, ) -> Self
Sourcepub fn with_ml_dsa_verifying_keys(
self,
vks: Arc<RwLock<Vec<MlDsaVerifyingKey>>>,
) -> Self
pub fn with_ml_dsa_verifying_keys( self, vks: Arc<RwLock<Vec<MlDsaVerifyingKey>>>, ) -> Self
Set the shared ML-DSA-65 verifying key list for PQ-hybrid JWT verification.
Sourcepub fn with_local_ca_key(self, ca_vk: VerifyingKey) -> Self
pub fn with_local_ca_key(self, ca_vk: VerifyingKey) -> Self
Provide the authoritative local CA verifying key for offline resolution
of local-issuer (service) JWTs. See the local_ca_key field docs.
Sourcepub fn with_local_ca_composite(
self,
ml_dsa_vk: MlDsaVerifyingKey,
ca_vk: VerifyingKey,
) -> Self
pub fn with_local_ca_composite( self, ml_dsa_vk: MlDsaVerifyingKey, ca_vk: VerifyingKey, ) -> Self
Bind the CA’s derived ML-DSA-65 verifying key so the CA composite kid
resolves to BOTH halves (this ML-DSA key + the CA Ed25519 key) for
hybrid service-JWT verification. Registered under the Policy role —
the CA / service-certification signing domain — exactly like
ClusterKeySource::with_ca_composite_key.
Trait Implementations§
Source§impl JwtKeySource for JwksKeySource
impl JwtKeySource for JwksKeySource
Source§fn get_key<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
issuer: &'life1 str,
kid: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<VerifyingKey>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_key<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
issuer: &'life1 str,
kid: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<VerifyingKey>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Get the verifying key for a given issuer and optional kid. Read more
Source§fn get_keys<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
issuer: &'life1 str,
kid: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<VerifyingKey>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_keys<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
issuer: &'life1 str,
kid: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<VerifyingKey>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Resolve all algorithm-compatible candidates for an issuer/kid pair. Read more
Source§fn is_trusted(&self, issuer: &str) -> bool
fn is_trusted(&self, issuer: &str) -> bool
Check if an issuer is trusted (before attempting key fetch). Read more
Source§fn local_issuers(&self) -> &[String]
fn local_issuers(&self) -> &[String]
List of issuer URLs considered “local” (for subject formatting). Read more
Source§fn ml_dsa_verifying_keys(&self) -> Vec<MlDsaVerifyingKey> ⓘ
fn ml_dsa_verifying_keys(&self) -> Vec<MlDsaVerifyingKey> ⓘ
Get all current ML-DSA-65 verifying keys for PQ-hybrid JWT verification. Read more
Source§fn composite_pair(&self, kid: &str) -> Option<CompositeKeyPair>
fn composite_pair(&self, kid: &str) -> Option<CompositeKeyPair>
Resolve the exact composite verification pair for a JOSE
kid. Read moreSource§fn composite_key_set(&self) -> Arc<CompositeKeySet> ⓘ
fn composite_key_set(&self) -> Arc<CompositeKeySet> ⓘ
Return the authoritative exact-pair composite key ledger.
Auto Trait Implementations§
impl !Freeze for JwksKeySource
impl !RefUnwindSafe for JwksKeySource
impl Send for JwksKeySource
impl Sync for JwksKeySource
impl Unpin for JwksKeySource
impl UnsafeUnpin for JwksKeySource
impl !UnwindSafe for JwksKeySource
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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ServiceExt for T
impl<T> ServiceExt for T
§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Apply a transformation to the response body. Read more
§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using HTTP status codes. Read more
§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using gRPC headers. Read more