Expand description
JWT key source abstraction for unified key resolution.
JwtKeySource provides a unified interface for resolving JWT verification keys,
abstracting the difference between:
- Regular services (trust only cluster CA)
- PolicyService (handles federation via ID-JAG, SPIFFE, OIDC)
§Trust Model
Services within a cluster all trust the same PolicyService. The CA verifying key
is derived from the cluster’s root signing key via HKDF:
derive_purpose_key(&root_key, "hyprstream-jwt-v1").verifying_key()
§Usage
Services receive a JwtKeySource at construction time, binding them to their
trust anchors. Most services use ClusterKeySource; PolicyService uses
FederatedKeySource for cross-cluster token exchange.
ⓘ
// In service factory:
let key_source = ctx.cluster_key_source();
let service = MyService::new(...).with_jwt_key_source(key_source);Structs§
- Cluster
KeySource - Key source for regular services — trusts only the cluster CA.
- Federated
KeySource - Key source that combines local cluster trust with federation.
- Jwks
KeySource - JWKS-backed key source with issuer-and-kid-based resolution.
Enums§
- Jwks
Mode - Deployment mode for JWKS-backed key resolution.
Traits§
- Issuer
Resolver - Resolves an issuer string to its JWKS endpoint URL.
- JwtKey
Source - Source of JWT verification keys.
Type Aliases§
- Jwks
Fetcher - Async function that fetches raw JWKS JSON from a URL.