pub struct AuditEvent {
pub timestamp: DateTime<Utc>,
pub user: String,
pub session_id: Option<String>,
pub event_type: AuditEventType,
pub resource: String,
pub outcome: AuditOutcome,
pub metadata: Option<Value>,
}Expand description
An audit event.
Fields§
§timestamp: DateTime<Utc>Timestamp of the event.
user: StringUser ID.
session_id: Option<String>Session ID (if available).
event_type: AuditEventTypeType of event.
resource: StringResource being accessed (tool name, agent name).
outcome: AuditOutcomeOutcome of the access attempt.
metadata: Option<Value>Additional metadata.
Implementations§
Source§impl AuditEvent
impl AuditEvent
Sourcepub fn tool_access(user: &str, tool_name: &str, outcome: AuditOutcome) -> Self
pub fn tool_access(user: &str, tool_name: &str, outcome: AuditOutcome) -> Self
Create a new tool access event.
Sourcepub fn agent_access(user: &str, agent_name: &str, outcome: AuditOutcome) -> Self
pub fn agent_access(user: &str, agent_name: &str, outcome: AuditOutcome) -> Self
Create a new agent access event.
Sourcepub fn with_session(self, session_id: impl Into<String>) -> Self
pub fn with_session(self, session_id: impl Into<String>) -> Self
Set the session ID.
Sourcepub fn with_metadata(self, metadata: Value) -> Self
pub fn with_metadata(self, metadata: Value) -> Self
Set metadata.
Trait Implementations§
Source§impl Clone for AuditEvent
impl Clone for AuditEvent
Source§fn clone(&self) -> AuditEvent
fn clone(&self) -> AuditEvent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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<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 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