Struct PrincipalId
pub struct PrincipalId(pub String);Expand description
Canonical, globally-unambiguous principal identifier. The durable ownership key for sessions, private memory, approvals, and audit attribution.
Composition is injective per identity class (see the constructors): an OIDC
identity is keyed by validated issuer AND subject — never by subject alone
and never by a config alias, so renaming an [oidc.<alias>] entry cannot
re-key principals, and two issuers cannot collide on a shared sub.
String equality across classes never links accounts.
Tuple Fields§
§0: StringImplementations§
Source§impl PrincipalId
impl PrincipalId
Sourcepub const SHARED_OPERATOR: &'static str = "shared-operator"
pub const SHARED_OPERATOR: &'static str = "shared-operator"
Sentinel id for the single-operator / trusted-local path (no distinct
identity source). Lets callers treat “trusted, but anonymous operator”
as a real Principal instead of branching on Option.
Sourcepub fn for_oidc(issuer: &str, subject: &str) -> Self
pub fn for_oidc(issuer: &str, subject: &str) -> Self
Canonical id for an OIDC human identity: validated issuer + sub.
Sourcepub fn for_service(issuer: &str, client_id: &str) -> Self
pub fn for_service(issuer: &str, client_id: &str) -> Self
Canonical id for an OIDC service principal: validated issuer + the
stable verified client identity (introspected client_id or an
equivalent provider-defined client subject). Never a human-subject
mapping.
Sourcepub fn for_roster(roster_principal_id: &str) -> Self
pub fn for_roster(roster_principal_id: &str) -> Self
Canonical id for a local roster identity: the durable
[users.<name>] principal id (NOT the display name — renaming a
roster entry must preserve this id or migrate ownership atomically).
pub fn as_str(&self) -> &str
Trait Implementations§
Source§impl Clone for PrincipalId
impl Clone for PrincipalId
Source§fn clone(&self) -> PrincipalId
fn clone(&self) -> PrincipalId
1.0.0 (const: unstable) · §fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more