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>,
}Expand description
Structured audit record emitted once per gate consultation (ADR-033).
The JSON projection of this struct is the public contract — field names are stable. Adding fields is non-breaking; removing or renaming requires a new ADR.
In v0.2 events are emitted via tracing::info! as structured JSON. The
EventStore write path is deferred to v0.3 when the VerbRegistry gains
a runtime handle (see ADR-033 §“Implementation Status”).
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" or "deny".
deny_reason: Option<String>Deny reason, present only when decision == "deny".
obligations: Vec<Obligation>Obligations attached by the policy on Allow (empty array on Deny).
Always serialized — obligations: [] is the wire shape when there
are none, so non-Rust consumers do not need to special-case absence
vs. emptiness.
gate_impl: StringName of the gate implementation that produced this decision.
session_id: Option<String>Correlation token — GateContext::session_id when present, else None.
Implementations§
Source§impl AuditEvent
impl AuditEvent
Sourcepub fn from_check(
req: &GateRequest,
decision: &GateDecision,
gate_impl: &str,
) -> AuditEvent
pub fn from_check( req: &GateRequest, decision: &GateDecision, gate_impl: &str, ) -> AuditEvent
Build an AuditEvent from the gate inputs and output.
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 more