pub struct AuditEvent {Show 13 fields
pub event_id: String,
pub event_type: String,
pub subject_id: Option<String>,
pub secondary_id: Option<String>,
pub actor_id: String,
pub actor_kind: String,
pub timestamp: DateTime<Utc>,
pub outcome: String,
pub matched_policy: Option<String>,
pub reason: Option<String>,
pub payload: Value,
pub prev_event_hash: Option<String>,
pub event_hash: String,
}Expand description
One audit entry. Flat, JSON-serializable. Shared data format —
event_hash / prev_event_hash are empty strings / None when the
OSS binary emits (via NullSink) and filled in by the Pro sink.
Fields§
§event_id: Stringevt_<uuid-simple> — stable id for dedup / ordering.
event_type: StringOne of event_types, or a custom extension string.
subject_id: Option<String>§secondary_id: Option<String>§actor_id: String§actor_kind: String§timestamp: DateTime<Utc>§outcome: String§matched_policy: Option<String>§reason: Option<String>§payload: Value§prev_event_hash: Option<String>Hash of the previous chained event, or None for chain start.
Pro writers populate this; OSS writers leave it None.
event_hash: StringHash of THIS event’s canonical bytes. Empty string means the event is unsigned — Pro writers fill it in, OSS writers don’t.
Implementations§
Source§impl AuditEvent
impl AuditEvent
pub fn new( event_type: impl Into<String>, actor_id: impl Into<String>, actor_kind: impl Into<String>, outcome: impl Into<String>, ) -> Self
Sourcepub fn is_signed(&self) -> bool
pub fn is_signed(&self) -> bool
True iff the event carries a chain hash. OSS readers can use this to distinguish signed (Pro-written) events from unsigned ones, even though OSS can’t verify the chain.
pub fn with_subject(self, subject_id: impl Into<String>) -> Self
pub fn with_secondary(self, secondary_id: impl Into<String>) -> Self
pub fn with_matched_policy(self, matched_policy: Option<String>) -> Self
pub fn with_reason(self, reason: impl Into<String>) -> Self
pub fn with_payload(self, payload: Value) -> Self
Trait Implementations§
Source§impl Clone for AuditEvent
impl Clone for AuditEvent
Source§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<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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
Mutably borrows from an owned value. Read more