pub enum SecurityPreset {
Development,
Balanced,
HighSecurity,
Paranoid,
}
Expand description
Security presets for common configurations
Variants§
Development
Development-friendly settings (lower security, more convenient)
USE ONLY FOR DEVELOPMENT - NOT PRODUCTION SAFE
- Shorter passwords allowed (6+ chars)
- Weaker password requirements
- Less strict cookie settings
- Disabled CSRF protection for easier testing
- Longer session timeouts for convenience
Balanced
Balanced settings for most applications
Good balance of security and usability suitable for most production applications that don’t handle highly sensitive data.
- Standard password requirements (8+ chars)
- Secure cookies and CSRF protection
- Reasonable rate limiting
- Basic audit logging
HighSecurity
High security settings for sensitive applications
Strong security settings suitable for applications handling sensitive data like financial information, healthcare records, or personal data subject to compliance requirements.
- Strict password requirements (12+ chars, complexity)
- Strong JWT algorithms (RSA-256)
- Aggressive rate limiting
- Comprehensive audit logging
- Short session timeouts
Paranoid
Maximum security (paranoid mode)
Extremely strict security settings for high-risk environments where security is paramount over convenience.
- Very strict password requirements (16+ chars)
- Strongest cryptographic algorithms
- Very aggressive rate limiting
- Extensive audit logging and monitoring
- Very short session timeouts
- Constant-time operations
Implementations§
Source§impl SecurityPreset
impl SecurityPreset
Sourcepub fn to_config(&self) -> SecurityConfig
pub fn to_config(&self) -> SecurityConfig
Convert the security preset to a SecurityConfig
Sourcepub fn to_rate_limit_config(&self) -> RateLimitConfig
pub fn to_rate_limit_config(&self) -> RateLimitConfig
Get rate limiting configuration for this security preset
Sourcepub fn to_audit_config(&self) -> AuditConfig
pub fn to_audit_config(&self) -> AuditConfig
Get audit configuration for this security preset
Sourcepub async fn validate_environment(
&self,
) -> AuthFrameworkResult<Vec<SecurityIssue>>
pub async fn validate_environment( &self, ) -> AuthFrameworkResult<Vec<SecurityIssue>>
Validate the current environment against this security preset
Sourcepub async fn security_audit(&self) -> AuthFrameworkResult<SecurityAuditReport>
pub async fn security_audit(&self) -> AuthFrameworkResult<SecurityAuditReport>
Perform a security audit of the current configuration
Sourcepub fn get_security_recommendations(&self) -> Vec<String>
pub fn get_security_recommendations(&self) -> Vec<String>
Get security recommendations for this preset
Trait Implementations§
Source§impl Clone for SecurityPreset
impl Clone for SecurityPreset
Source§fn clone(&self) -> SecurityPreset
fn clone(&self) -> SecurityPreset
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for SecurityPreset
impl Debug for SecurityPreset
Source§impl PartialEq for SecurityPreset
impl PartialEq for SecurityPreset
impl StructuralPartialEq for SecurityPreset
Auto Trait Implementations§
impl Freeze for SecurityPreset
impl RefUnwindSafe for SecurityPreset
impl Send for SecurityPreset
impl Sync for SecurityPreset
impl Unpin for SecurityPreset
impl UnwindSafe for SecurityPreset
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
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>
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>
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