pub struct SecurityContext {
pub user_id: Option<String>,
pub source: CommandSource,
pub timestamp: DateTime<Utc>,
pub request_id: String,
pub neutralization: NeutralizationContext,
}Expand description
Security context for command execution
Fields§
§user_id: Option<String>User identifier (for future authentication)
source: CommandSourceSource of command (cli, api, etc)
timestamp: DateTime<Utc>Timestamp
request_id: StringRequest ID for correlation
neutralization: NeutralizationContextNeutralization tracking
Implementations§
Source§impl SecurityContext
impl SecurityContext
Sourcepub fn new(source: CommandSource) -> SecurityContext
pub fn new(source: CommandSource) -> SecurityContext
Create a new security context
Sourcepub fn with_user(self, user_id: String) -> SecurityContext
pub fn with_user(self, user_id: String) -> SecurityContext
Create with user ID
Sourcepub const fn with_neutralization_mode(
self,
mode: NeutralizationMode,
) -> SecurityContext
pub const fn with_neutralization_mode( self, mode: NeutralizationMode, ) -> SecurityContext
Set neutralization mode
Sourcepub const fn with_enhanced_mode(self, enhanced: bool) -> SecurityContext
pub const fn with_enhanced_mode(self, enhanced: bool) -> SecurityContext
Enable enhanced mode
Sourcepub fn record_neutralization(&mut self, success: bool)
pub fn record_neutralization(&mut self, success: bool)
Record neutralization result
Sourcepub const fn should_neutralize(&self) -> bool
pub const fn should_neutralize(&self) -> bool
Check if neutralization should be attempted based on context
Trait Implementations§
Source§impl Clone for SecurityContext
impl Clone for SecurityContext
Source§fn clone(&self) -> SecurityContext
fn clone(&self) -> SecurityContext
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 moreAuto Trait Implementations§
impl Freeze for SecurityContext
impl RefUnwindSafe for SecurityContext
impl Send for SecurityContext
impl Sync for SecurityContext
impl Unpin for SecurityContext
impl UnwindSafe for SecurityContext
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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