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) -> SecurityAuditEvent
pub fn new(severity: AuditSeverity, event: AuditEvent) -> SecurityAuditEvent
Create a new security audit event
Sourcepub fn with_client_ip(self, ip: SocketAddr) -> SecurityAuditEvent
pub fn with_client_ip(self, ip: SocketAddr) -> SecurityAuditEvent
Add client IP address
Sourcepub fn with_origin(self, origin: impl Into<String>) -> SecurityAuditEvent
pub fn with_origin(self, origin: impl Into<String>) -> SecurityAuditEvent
Add origin
Sourcepub fn with_user_agent(
self,
user_agent: impl Into<String>,
) -> SecurityAuditEvent
pub fn with_user_agent( self, user_agent: impl Into<String>, ) -> SecurityAuditEvent
Add user agent
Sourcepub fn with_path(self, path: impl Into<String>) -> SecurityAuditEvent
pub fn with_path(self, path: impl Into<String>) -> SecurityAuditEvent
Add request path
Sourcepub fn with_deployment_id(
self,
deployment_id: impl Into<String>,
) -> SecurityAuditEvent
pub fn with_deployment_id( self, deployment_id: impl Into<String>, ) -> SecurityAuditEvent
Add deployment ID
Sourcepub fn with_subject(self, subject: impl Into<String>) -> SecurityAuditEvent
pub fn with_subject(self, subject: impl Into<String>) -> SecurityAuditEvent
Add subject
Sourcepub fn with_metering_key(
self,
metering_key: impl Into<String>,
) -> SecurityAuditEvent
pub fn with_metering_key( self, metering_key: impl Into<String>, ) -> SecurityAuditEvent
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<SecurityAuditEvent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SecurityAuditEvent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for SecurityAuditEvent
impl Serialize for SecurityAuditEvent
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,
Serialize this value into the given Serde serializer. 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