pub struct AuditLogger { /* private fields */ }Expand description
Audit logger for compliance and security tracking.
Implementations§
Source§impl AuditLogger
impl AuditLogger
Sourcepub fn log(
&self,
event_type: AuditEventType,
user_id: Option<&str>,
username: Option<&str>,
ip_address: Option<&str>,
resource: Option<&str>,
action: &str,
result: AuditResult,
details: HashMap<String, String>,
)
pub fn log( &self, event_type: AuditEventType, user_id: Option<&str>, username: Option<&str>, ip_address: Option<&str>, resource: Option<&str>, action: &str, result: AuditResult, details: HashMap<String, String>, )
Log an audit event.
Sourcepub fn log_login_success(&self, user_id: &str, username: &str, ip: Option<&str>)
pub fn log_login_success(&self, user_id: &str, username: &str, ip: Option<&str>)
Log a login success.
Sourcepub fn log_login_failure(&self, username: &str, ip: Option<&str>, reason: &str)
pub fn log_login_failure(&self, username: &str, ip: Option<&str>, reason: &str)
Log a login failure.
Sourcepub fn log_permission_denied(
&self,
user_id: &str,
username: &str,
resource: &str,
permission: &str,
)
pub fn log_permission_denied( &self, user_id: &str, username: &str, resource: &str, permission: &str, )
Log a permission denial.
Sourcepub fn log_data_access(
&self,
user_id: &str,
username: &str,
table: &str,
operation: &str,
rows_affected: u64,
)
pub fn log_data_access( &self, user_id: &str, username: &str, table: &str, operation: &str, rows_affected: u64, )
Log a data access.
Sourcepub fn log_schema_change(
&self,
user_id: &str,
username: &str,
object: &str,
action: &str,
)
pub fn log_schema_change( &self, user_id: &str, username: &str, object: &str, action: &str, )
Log a schema change.
Sourcepub fn get_entries(&self, limit: usize, offset: usize) -> Vec<AuditEntry>
pub fn get_entries(&self, limit: usize, offset: usize) -> Vec<AuditEntry>
Get recent audit entries.
Sourcepub fn get_entries_by_type(
&self,
event_type: AuditEventType,
limit: usize,
) -> Vec<AuditEntry>
pub fn get_entries_by_type( &self, event_type: AuditEventType, limit: usize, ) -> Vec<AuditEntry>
Get entries by event type.
Sourcepub fn get_entries_for_user(
&self,
user_id: &str,
limit: usize,
) -> Vec<AuditEntry>
pub fn get_entries_for_user( &self, user_id: &str, limit: usize, ) -> Vec<AuditEntry>
Get entries for a specific user.
Sourcepub fn get_failed_logins(&self, since: u64) -> Vec<AuditEntry>
pub fn get_failed_logins(&self, since: u64) -> Vec<AuditEntry>
Get failed login attempts.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AuditLogger
impl !RefUnwindSafe for AuditLogger
impl Send for AuditLogger
impl Sync for AuditLogger
impl Unpin for AuditLogger
impl UnsafeUnpin for AuditLogger
impl UnwindSafe for AuditLogger
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more