pub struct Subject {
pub subject_id: Uuid,
pub subject_type: Option<GtsTypeId>,
}Expand description
The party behind a write, in the platform’s own vocabulary rather than in
a vocabulary of this gear’s own: SecurityContext’s subject_id and
optional subject_type.
A subject and not a user because most writes into this gear arrive from an
automation or a service integration, so a user_id member would be empty
on the majority of rows and would need a second member beside it for the
rest (DESIGN § API element envelope).
Fields§
§subject_id: Uuid§subject_type: Option<GtsTypeId>GTS type of the acting subject, e.g.
gts.cf.core.security.subject_user.v1~. Optional, matching
SecurityContext, which does not always carry one.
Implementations§
Source§impl Subject
impl Subject
Sourcepub fn principal(&self) -> String
pub fn principal(&self) -> String
The producer principal this subject writes as.
One string, derived from the subject id rather than invented beside it, so “who wrote this row” (the audit envelope) and “who owns this namespace” (the ownership boundary) cannot disagree. The subject type is deliberately not part of it: the id is already unique, and folding the type in would make one principal look like two the day a producer is re-typed.
Sourcepub fn from_security_context(ctx: &SecurityContext) -> Self
pub fn from_security_context(ctx: &SecurityContext) -> Self
The subject a SecurityContext names.
Trait Implementations§
impl Eq for Subject
impl StructuralPartialEq for Subject
Auto Trait Implementations§
impl Freeze for Subject
impl RefUnwindSafe for Subject
impl Send for Subject
impl Sync for Subject
impl Unpin for Subject
impl UnsafeUnpin for Subject
impl UnwindSafe for Subject
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.