pub struct ClusterKeySource { /* private fields */ }Expand description
Key source for regular services — trusts only the cluster CA.
This is the common case: all services in a cluster trust one PolicyService,
identified by its OAuth issuer URL. JWTs with empty iss or matching the
local issuer URL are verified against the CA key.
§NOT a mesh authority (#328)
ClusterKeySource holds a SINGLE shared CA key and treats an empty iss as
always-trusted/local. That is correct for the in-cluster bare-sub token
plane, but it MUST NOT be the verification authority for networked mesh
peers: a single shared key cannot distinguish per-host peers, and the
empty-iss shortcut would let a networked peer inherit local trust. Mesh
peer identity is established by the per-host key roster (Ed25519 signer →
service:inference:host-<label>, resolved fail-closed via
RequestService::resolve_key_subject), and the empty-iss shortcut is
confined to genuine in-process callers in verify_claims
(EnvelopeContext::is_local_caller). For kid-routed multi-key verification
prefer JwksKeySource, which honors the kid hint.
Implementations§
Source§impl ClusterKeySource
impl ClusterKeySource
Sourcepub fn new(ca_verifying_key: VerifyingKey, local_issuer_url: String) -> Self
pub fn new(ca_verifying_key: VerifyingKey, local_issuer_url: String) -> Self
Create a new cluster key source.
§Arguments
ca_verifying_key- The cluster’s CA verifying key (from PolicyService)local_issuer_url- The OAuth issuer URL (e.g., “http://127.0.0.1:9080”)
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.
The Arc is shared with the rotation task so keys stay current.
Sourcepub fn with_composite_key_set(self, keys: Arc<CompositeKeySet>) -> Self
pub fn with_composite_key_set(self, keys: Arc<CompositeKeySet>) -> Self
Override the composite key ledger, primarily for isolated service instances.
Sourcepub fn with_ca_composite_key(self, ml_dsa_vk: MlDsaVerifyingKey) -> Self
pub fn with_ca_composite_key(self, ml_dsa_vk: MlDsaVerifyingKey) -> 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).
This is how hybrid service WITs — signed by the exact pair
(derived ML-DSA, CA Ed25519) — verify on the dispatch plane. The
pair is registered under the Policy role: it belongs to the CA /
service-certification signing domain, so role-constrained consumers
(service-key certification, announcements) accept it while the
OAuth-role token-issuance domain stays separate.
Sourcepub fn ca_verifying_key(&self) -> VerifyingKey
pub fn ca_verifying_key(&self) -> VerifyingKey
Get the CA verifying key.
Trait Implementations§
Source§impl Clone for ClusterKeySource
impl Clone for ClusterKeySource
Source§fn clone(&self) -> ClusterKeySource
fn clone(&self) -> ClusterKeySource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl JwtKeySource for ClusterKeySource
impl JwtKeySource for ClusterKeySource
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,
Source§fn is_trusted(&self, issuer: &str) -> bool
fn is_trusted(&self, issuer: &str) -> bool
Source§fn local_issuers(&self) -> &[String]
fn local_issuers(&self) -> &[String]
Source§fn ml_dsa_verifying_keys(&self) -> Vec<MlDsaVerifyingKey> ⓘ
fn ml_dsa_verifying_keys(&self) -> Vec<MlDsaVerifyingKey> ⓘ
Source§fn composite_key_set(&self) -> Arc<CompositeKeySet> ⓘ
fn composite_key_set(&self) -> Arc<CompositeKeySet> ⓘ
Source§fn composite_pair(&self, kid: &str) -> Option<CompositeKeyPair>
fn composite_pair(&self, kid: &str) -> Option<CompositeKeyPair>
kid. Read moreSource§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,
Auto Trait Implementations§
impl Freeze for ClusterKeySource
impl !RefUnwindSafe for ClusterKeySource
impl Send for ClusterKeySource
impl Sync for ClusterKeySource
impl Unpin for ClusterKeySource
impl UnsafeUnpin for ClusterKeySource
impl !UnwindSafe for ClusterKeySource
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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>
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>
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