pub struct SecurityAuditEvent {
pub event_id: String,
pub timestamp_ms: u64,
pub severity: AuditSeverity,
pub event: AuditEvent,
pub client_ip: Option<String>,
pub origin: Option<String>,
pub user_agent: Option<String>,
pub path: Option<String>,
pub deployment_id: Option<String>,
pub subject: Option<String>,
pub metering_key: Option<String>,
}Expand description
Security audit event
Fields§
§event_id: StringUnique event ID
timestamp_ms: u64Timestamp when event occurred
severity: AuditSeverityEvent severity
event: AuditEventEvent type with details
client_ip: Option<String>Client IP address
origin: Option<String>Client origin
user_agent: Option<String>User agent string
path: Option<String>Request path
deployment_id: Option<String>Deployment ID if applicable
subject: Option<String>Subject identifier if authenticated
metering_key: Option<String>Metering key if available
Implementations§
Source§impl SecurityAuditEvent
impl SecurityAuditEvent
Sourcepub fn new(severity: AuditSeverity, event: AuditEvent) -> Self
pub fn new(severity: AuditSeverity, event: AuditEvent) -> Self
Create a new security audit event
Sourcepub fn with_client_ip(self, ip: SocketAddr) -> Self
pub fn with_client_ip(self, ip: SocketAddr) -> Self
Add client IP address
Sourcepub fn with_origin(self, origin: impl Into<String>) -> Self
pub fn with_origin(self, origin: impl Into<String>) -> Self
Add origin
Sourcepub fn with_user_agent(self, user_agent: impl Into<String>) -> Self
pub fn with_user_agent(self, user_agent: impl Into<String>) -> Self
Add user agent
Sourcepub fn with_deployment_id(self, deployment_id: impl Into<String>) -> Self
pub fn with_deployment_id(self, deployment_id: impl Into<String>) -> Self
Add deployment ID
Sourcepub fn with_subject(self, subject: impl Into<String>) -> Self
pub fn with_subject(self, subject: impl Into<String>) -> Self
Add subject
Sourcepub fn with_metering_key(self, metering_key: impl Into<String>) -> Self
pub fn with_metering_key(self, metering_key: impl Into<String>) -> Self
Add metering key
Trait Implementations§
Source§impl Clone for SecurityAuditEvent
impl Clone for SecurityAuditEvent
Source§fn clone(&self) -> SecurityAuditEvent
fn clone(&self) -> SecurityAuditEvent
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 SecurityAuditEvent
impl Debug for SecurityAuditEvent
Source§impl<'de> Deserialize<'de> for SecurityAuditEvent
impl<'de> Deserialize<'de> for SecurityAuditEvent
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 SecurityAuditEvent
impl RefUnwindSafe for SecurityAuditEvent
impl Send for SecurityAuditEvent
impl Sync for SecurityAuditEvent
impl Unpin for SecurityAuditEvent
impl UnsafeUnpin for SecurityAuditEvent
impl UnwindSafe for SecurityAuditEvent
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