pub struct PlatformPrincipal {
pub id: PrincipalId,
pub kind: PrincipalKindTag,
pub effective_permissions: PermissionSet,
pub credential_id: Option<Uuid>,
}Expand description
Platform-scope authenticated identity.
Deliberately carries no tenant. A platform principal operates the tenant directory — creating, inspecting, suspending, and recovering administration for tenants — and is never implicitly authorized over the resources inside one. Because the type has no tenant to offer, a handler holding one cannot open a tenant-scoped connection at all; the control-plane boundary is enforced by what is representable rather than by a check a caller could forget.
Fields§
§id: PrincipalIdStable principal id.
kind: PrincipalKindTagThe kind the platform directory stores for this principal.
GlobalAdmin for a machine root, User for a human registered for
federated sign-in. Audit reads it, so a human’s decision is never
recorded as a machine’s. It is read from the store at session
verification, never inferred from what the principal may do.
effective_permissions: PermissionSetPermissions resolved from the principal’s platform grant.
Absence of a grant is denial: a platform principal with an empty set authenticates but authorizes nothing.
credential_id: Option<Uuid>Non-secret id of the credential the session was minted from, when one
was presented. None for a federated login.
Implementations§
Source§impl PlatformPrincipal
impl PlatformPrincipal
Sourcepub const fn new(
id: PrincipalId,
kind: PrincipalKindTag,
effective_permissions: PermissionSet,
) -> Self
pub const fn new( id: PrincipalId, kind: PrincipalKindTag, effective_permissions: PermissionSet, ) -> Self
Construct a platform-scope principal.
Sourcepub const fn with_credential_id(self, credential_id: Option<Uuid>) -> Self
pub const fn with_credential_id(self, credential_id: Option<Uuid>) -> Self
Name the credential this session was minted from.
Trait Implementations§
Source§impl Clone for PlatformPrincipal
impl Clone for PlatformPrincipal
Source§impl Debug for PlatformPrincipal
impl Debug for PlatformPrincipal
Source§impl<'de> Deserialize<'de> for PlatformPrincipal
impl<'de> Deserialize<'de> for PlatformPrincipal
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for PlatformPrincipal
Source§impl From<PlatformPrincipal> for AuthContext
impl From<PlatformPrincipal> for AuthContext
Source§fn from(principal: PlatformPrincipal) -> Self
fn from(principal: PlatformPrincipal) -> Self
Lift a verified platform principal into the shared context.
The platform arm is the one that carries no tenant, which is what downstream tenancy checks read the context for.
Source§impl PartialEq for PlatformPrincipal
impl PartialEq for PlatformPrincipal
Source§impl Serialize for PlatformPrincipal
impl Serialize for PlatformPrincipal
impl StructuralPartialEq for PlatformPrincipal
Auto Trait Implementations§
impl Freeze for PlatformPrincipal
impl RefUnwindSafe for PlatformPrincipal
impl Send for PlatformPrincipal
impl Sync for PlatformPrincipal
impl Unpin for PlatformPrincipal
impl UnsafeUnpin for PlatformPrincipal
impl UnwindSafe for PlatformPrincipal
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.