pub struct NodeIdentityProvider { /* private fields */ }Expand description
Native identity provider backed by a root Ed25519 key.
Derives purpose-keyed identities via HKDF. Maps every recognized pubkey to a
specific authorization Subject (#328): the node’s own root/derived keys
map to "system" (genuine in-process authority), while enrolled mesh-peer
keys map to their per-host subject (service:inference:host-<label>). An
unrecognized pubkey resolves to Subject::anonymous — deny-by-default,
never the "system" god principal.
Implementations§
Source§impl NodeIdentityProvider
impl NodeIdentityProvider
Sourcepub fn new(root_key: &SigningKey) -> Self
pub fn new(root_key: &SigningKey) -> Self
Create from a root signing key.
Sourcepub fn register_purpose(&self, purpose: &str) -> Result<[u8; 32]>
pub fn register_purpose(&self, purpose: &str) -> Result<[u8; 32]>
Pre-register a purpose so its derived pubkey is recognized by resolve().
The derived key belongs to THIS node, so it maps to the in-process
"system" authority. Called automatically by identity_open(), but can
also be called at startup to register purposes used internally.
Sourcepub fn register_peer(&self, pubkey: [u8; 32], subject: Subject)
pub fn register_peer(&self, pubkey: [u8; 32], subject: Subject)
Enroll a networked mesh peer’s Ed25519 signer key → per-host subject (#328).
The peer authenticates as its OWN granular principal
(service:inference:host-<label>), NEVER as "system". The roster is
populated from the operator-configured mesh_peers enrollment record
(see hyprstream::auth::mesh_trust), so a peer whose key is not enrolled
resolves to Subject::anonymous (fail-closed, deny-by-default).
A peer key MUST NOT shadow the node’s own "system" keys: if the pubkey
is already registered (e.g. the node’s root/derived key), the existing
binding is kept and the peer entry is rejected to prevent a misconfigured
roster from downgrading in-process authority.
Trait Implementations§
Source§impl Drop for NodeIdentityProvider
impl Drop for NodeIdentityProvider
Source§impl IdentityProvider for NodeIdentityProvider
impl IdentityProvider for NodeIdentityProvider
Auto Trait Implementations§
impl !Freeze for NodeIdentityProvider
impl !RefUnwindSafe for NodeIdentityProvider
impl Send for NodeIdentityProvider
impl Sync for NodeIdentityProvider
impl Unpin for NodeIdentityProvider
impl UnsafeUnpin for NodeIdentityProvider
impl UnwindSafe for NodeIdentityProvider
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
§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