pub enum Principal {
User(VerifiedUser),
Service(ServiceIdentity),
Anonymous,
}Expand description
An authenticated actor: a user, a service, or anonymous.
Every cross-boundary invocation carries exactly one immediate-caller
Principal. The framework stamps it; activations read it; nobody outside
plexus-auth-core can construct one.
§Sealing
The discriminants below carry sealed payloads (VerifiedUser,
ServiceIdentity), and the Anonymous variant is constructable only via
the pub(crate) anonymous_sealed constructor. This means external
crates cannot match-then-rebuild a Principal::Anonymous and pass it
off as authentic; the only way to obtain any Principal is through the
framework’s mint paths inside this crate.
tests/compile_fail/seal_principal_construct.rs asserts external
construction is rejected.
Variants§
User(VerifiedUser)
An end-user principal, carrying the verified token claims.
Service(ServiceIdentity)
A non-user authenticated principal (e.g., another Plexus service).
Anonymous
An unauthenticated caller. Methods marked #[plexus::method(public)]
see this; everything else is denied at the perimeter.