engine/security/actor.rs
1//! Principals and actors.
2//!
3//! An actor is whoever performs an Engine operation. The Engine only knows
4//! actor *references*; the OS owns the actual user/group database, credentials,
5//! and authentication.
6
7use crate::core::object_id::Id;
8
9/// Marker type distinguishing [`ActorId`] from
10/// other [`Id`] types.
11#[derive(Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Debug)]
12pub struct ActorIdMarker;
13
14/// The identity of an actor (a principal) that performs Engine operations.
15///
16/// The Engine treats actor IDs as opaque references. The OS decides what an
17/// actor is (a user, a group, a service) and maps them onto its own model.
18///
19/// The OS layers have a load-bearing convention on top: on Unix the actor
20/// id *is* the effective user id (`uid == actor id`, so ownership resolves
21/// without a database lookup), and on Windows it is the account's RID. The
22/// convention lives in the OS layer; the Engine itself never assumes it.
23pub type ActorId = Id<ActorIdMarker>;