pub struct SecurityContext { /* private fields */ }Expand description
Production Security Context for comprehensive security management
Implementations§
Source§impl SecurityContext
 
impl SecurityContext
pub fn new(config: SecurityConfig) -> Self
Sourcepub async fn validate_request(
    &self,
    request: &mut Request,
) -> Result<SecurityValidationResult>
 
pub async fn validate_request( &self, request: &mut Request, ) -> Result<SecurityValidationResult>
Comprehensive request validation
Sourcepub async fn generate_csrf_token(&self, session_id: &str) -> String
 
pub async fn generate_csrf_token(&self, session_id: &str) -> String
Generate a CSRF token for a session
Sourcepub fn add_security_headers(&self, response: &mut Response)
 
pub fn add_security_headers(&self, response: &mut Response)
Add comprehensive security headers to response
Sourcepub fn get_security_stats(&self) -> SecurityStats
 
pub fn get_security_stats(&self) -> SecurityStats
Get security statistics
Sourcepub fn get_recent_events(&self, since: Instant) -> Vec<SecurityEvent>
 
pub fn get_recent_events(&self, since: Instant) -> Vec<SecurityEvent>
Get recent security events
Auto 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<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
    T: 'a,
 
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
    T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
    T: 'a,
 
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
    T: 'a,
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