pub struct AuditLogger { /* private fields */ }Expand description
Simple audit logger for use by authentication and rate limiting modules This provides a lightweight interface without requiring full database setup
Implementations§
Source§impl AuditLogger
impl AuditLogger
Sourcepub fn new(config: AuditConfig) -> Result<Self>
pub fn new(config: AuditConfig) -> Result<Self>
Create a new audit logger with file-based logging
Sourcepub fn with_manager(config: AuditConfig, manager: Arc<AuditManager>) -> Self
pub fn with_manager(config: AuditConfig, manager: Arc<AuditManager>) -> Self
Create audit logger with database manager
Sourcepub async fn log_auth_event(
&self,
client_id: &str,
user_id: &str,
method_name: &str,
success: bool,
error_message: Option<&str>,
)
pub async fn log_auth_event( &self, client_id: &str, user_id: &str, method_name: &str, success: bool, error_message: Option<&str>, )
Log authentication event
Sourcepub async fn log_rate_limit_violation(
&self,
client_id: &str,
tool_name: &str,
limit_type: &str,
)
pub async fn log_rate_limit_violation( &self, client_id: &str, tool_name: &str, limit_type: &str, )
Log rate limit violation
Sourcepub async fn log_security_event(
&self,
action: &str,
severity: AuditSeverity,
user_id: Option<&str>,
details: HashMap<String, Value>,
)
pub async fn log_security_event( &self, action: &str, severity: AuditSeverity, user_id: Option<&str>, details: HashMap<String, Value>, )
Log general security event
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 !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