pub struct AuditState {
pub halted: AtomicBool,
pub violation_count: AtomicU32,
}Expand description
Shared audit state (overflow flag, alarm counter).
Lives in AppState and survives the lifetime of the server process.
Callers pass the database pool explicitly so the same state can be
used from any async context.
Fields§
§halted: AtomicBoolWhen true, EST operations MUST be rejected (FAU_STG.4 halt).
violation_count: AtomicU32Rolling count of consecutive security violations. Reset to 0 after a successful authentication.
Implementations§
Source§impl AuditState
impl AuditState
Sourcepub fn is_halted(&self) -> bool
pub fn is_halted(&self) -> bool
Check whether EST operations should be rejected due to audit storage exhaustion (FAU_STG.4).
Sourcepub fn set_halted(&self, halted: bool)
pub fn set_halted(&self, halted: bool)
Set the halted flag (called when audit storage is full and
overflow policy is halt).
Sourcepub fn record_violation(&self) -> u32
pub fn record_violation(&self) -> u32
Increment the security violation counter and return the new count.
Sourcepub fn reset_violations(&self)
pub fn reset_violations(&self)
Reset the violation counter (called after successful authentication).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AuditState
impl RefUnwindSafe for AuditState
impl Send for AuditState
impl Sync for AuditState
impl Unpin for AuditState
impl UnsafeUnpin for AuditState
impl UnwindSafe for AuditState
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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