pub struct SecureSessionConfig {
pub max_lifetime: Duration,
pub idle_timeout: Duration,
pub max_concurrent_sessions: u32,
pub rotation_interval: Duration,
pub require_secure_transport: bool,
pub enable_device_fingerprinting: bool,
pub max_risk_score: u8,
pub validate_ip_address: bool,
pub max_ip_changes: u32,
pub enable_geolocation: bool,
}Expand description
Secure session configuration
Fields§
§max_lifetime: DurationMaximum session lifetime
idle_timeout: DurationSession idle timeout
max_concurrent_sessions: u32Maximum concurrent sessions per user
rotation_interval: DurationForce session rotation interval
require_secure_transport: boolRequire secure transport (HTTPS)
enable_device_fingerprinting: boolEnable device fingerprinting
max_risk_score: u8Maximum allowed risk score
validate_ip_address: boolEnable IP address validation
max_ip_changes: u32Maximum IP address changes per session
enable_geolocation: boolEnable geolocation tracking
Implementations§
Source§impl SecureSessionConfig
impl SecureSessionConfig
Sourcepub fn for_high_security() -> Self
pub fn for_high_security() -> Self
Sourcepub fn for_mobile() -> Self
pub fn for_mobile() -> Self
Trait Implementations§
Source§impl Clone for SecureSessionConfig
impl Clone for SecureSessionConfig
Source§fn clone(&self) -> SecureSessionConfig
fn clone(&self) -> SecureSessionConfig
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 moreSource§impl Debug for SecureSessionConfig
impl Debug for SecureSessionConfig
Source§impl Default for SecureSessionConfig
impl Default for SecureSessionConfig
Source§fn default() -> Self
fn default() -> Self
Returns a balanced default suitable for most web applications.
| Field | Value | Rationale |
|---|---|---|
max_lifetime | 8 h | Covers a working day without forcing re-login |
idle_timeout | 30 min | OWASP recommendation for general web apps |
max_concurrent_sessions | 3 | Desktop + phone + tablet |
rotation_interval | 1 h | Limits window for session-fixation |
require_secure_transport | true | Always enforce HTTPS |
enable_device_fingerprinting | true | Detect session hijacking |
max_risk_score | 70 | Permit moderate anomalies |
validate_ip_address | true | Catch session theft across IPs |
max_ip_changes | 3 | Allow mobile network handoffs |
enable_geolocation | false | Requires external MaxMind DB |
Auto Trait Implementations§
impl Freeze for SecureSessionConfig
impl RefUnwindSafe for SecureSessionConfig
impl Send for SecureSessionConfig
impl Sync for SecureSessionConfig
impl Unpin for SecureSessionConfig
impl UnsafeUnpin for SecureSessionConfig
impl UnwindSafe for SecureSessionConfig
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> 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