pub struct AuditEvent {
pub timestamp: DateTime<Utc>,
pub actor: ActorRef,
pub namespace: String,
pub verb: String,
pub decision: AuditDecision,
pub deny_reason: Option<String>,
pub obligations: Vec<Obligation>,
pub gate_impl: String,
pub session_id: Option<String>,
pub op_index: Option<u32>,
pub ref_resolution: Option<RefResolution>,
}Expand description
Structured audit record emitted once per gate consultation.
JSON field names are stable; events reach tracing and the configured event store. See
crates/khive-gate/docs/api/audit-events.md.
Fields§
§timestamp: DateTime<Utc>Wall-clock timestamp of the gate check (UTC, RFC3339 in JSON).
actor: ActorRefCaller identity as given to the gate.
namespace: StringNamespace in which the verb was invoked.
verb: StringVerb being dispatched.
decision: AuditDecisionGate outcome — "allow", "deny", or "gate_unavailable".
deny_reason: Option<String>Deny reason, present only when decision == "deny".
obligations: Vec<Obligation>Obligations on allow; always serialized and empty on deny or outage.
gate_impl: StringName of the gate implementation that produced this decision.
session_id: Option<String>Correlation token — GateContext::session_id when present, else None.
op_index: Option<u32>Original request parser position, not completion order. Unknown outside a composed-request scope and in historical envelopes.
ref_resolution: Option<RefResolution>Reference provenance; absent together with op_index when unknown.
Implementations§
Source§impl AuditEvent
impl AuditEvent
Sourcepub fn with_operation_attribution(
self,
operation: Option<OperationAttribution>,
) -> AuditEvent
pub fn with_operation_attribution( self, operation: Option<OperationAttribution>, ) -> AuditEvent
Attach provenance established by a request runner. A direct gate consultation without that scope explicitly remains unattributed.
Sourcepub fn from_check(
req: &GateRequest,
decision: &GateDecision,
gate_impl: &str,
) -> AuditEvent
pub fn from_check( req: &GateRequest, decision: &GateDecision, gate_impl: &str, ) -> AuditEvent
Project one request/decision pair into a timestamped stable audit envelope.
See crates/khive-gate/docs/api/audit-events.md.
Project a gate infrastructure failure into the stable audit envelope.
Trait Implementations§
Source§impl Clone for AuditEvent
impl Clone for AuditEvent
Source§fn clone(&self) -> AuditEvent
fn clone(&self) -> AuditEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AuditEvent
impl Debug for AuditEvent
Source§impl<'de> Deserialize<'de> for AuditEvent
impl<'de> Deserialize<'de> for AuditEvent
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<AuditEvent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AuditEvent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for AuditEvent
impl Serialize for AuditEvent
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for AuditEvent
impl RefUnwindSafe for AuditEvent
impl Send for AuditEvent
impl Sync for AuditEvent
impl Unpin for AuditEvent
impl UnsafeUnpin for AuditEvent
impl UnwindSafe for AuditEvent
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<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