pub struct GatePrincipal {
pub agent_id: String,
pub user_id: Option<String>,
pub parent_agent_id: Option<String>,
pub conv_id: Option<String>,
/* private fields */
}Expand description
Attributed principal for a governance / gate evaluation (WEFT-636).
Control already holds via agent_id; this type makes who authorized
the action and which child is acting first-class so chain records
and multi-tenant spawn paths carry attribution, not just a bare agent id.
Fields§
§agent_id: StringActing agent id (child or concierge). Always the evaluation principal
key when non-empty (see GovernanceEngine::eval_principal_key).
user_id: Option<String>Human / user authority under which the agent acts (spawn-at-user-level).
parent_agent_id: Option<String>Parent agent when this evaluation is for a spawned child.
conv_id: Option<String>Conversation scope for attribution (parent or child conv id).
Implementations§
Source§impl GatePrincipal
impl GatePrincipal
Sourcepub fn agent(agent_id: impl Into<String>) -> Self
pub fn agent(agent_id: impl Into<String>) -> Self
Build a principal for a bare agent (no user / parent attribution).
Sourcepub fn with_project(self, project: &ProjectAttestation) -> Self
pub fn with_project(self, project: &ProjectAttestation) -> Self
Attribute the action to a verified project (ADR-103 A6).
Sourcepub fn project_id(&self) -> Option<&str>
pub fn project_id(&self) -> Option<&str>
The attributed project, if one was verified.
Sourcepub fn instance_id(&self) -> Option<&str>
pub fn instance_id(&self) -> Option<&str>
The evaluating kernel’s node id, if recorded.
Sourcepub fn with_instance(self, instance_id: impl Into<String>) -> Self
pub fn with_instance(self, instance_id: impl Into<String>) -> Self
Record the evaluating kernel’s node id.
Sourcepub fn with_user(self, user_id: impl Into<String>) -> Self
pub fn with_user(self, user_id: impl Into<String>) -> Self
Attach a user authority (WEFT-635 / WEFT-636).
Sourcepub fn with_parent(self, parent_agent_id: impl Into<String>) -> Self
pub fn with_parent(self, parent_agent_id: impl Into<String>) -> Self
Attach parent agent attribution for a child spawn.
Trait Implementations§
Source§impl Clone for GatePrincipal
impl Clone for GatePrincipal
Source§impl Debug for GatePrincipal
impl Debug for GatePrincipal
Source§impl Default for GatePrincipal
impl Default for GatePrincipal
Source§impl<'de> Deserialize<'de> for GatePrincipal
impl<'de> Deserialize<'de> for GatePrincipal
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 GatePrincipal
Source§impl PartialEq for GatePrincipal
impl PartialEq for GatePrincipal
Source§impl Serialize for GatePrincipal
impl Serialize for GatePrincipal
impl StructuralPartialEq for GatePrincipal
Auto Trait Implementations§
impl Freeze for GatePrincipal
impl RefUnwindSafe for GatePrincipal
impl Send for GatePrincipal
impl Sync for GatePrincipal
impl Unpin for GatePrincipal
impl UnsafeUnpin for GatePrincipal
impl UnwindSafe for GatePrincipal
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,
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§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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more