pub struct AuthConfig {
pub jwt_secret: String,
pub token_ttl_secs: i64,
pub admin_table: String,
pub secure_cookie: bool,
}Fields§
§jwt_secret: StringHS256 signing key. Rotating this instantly invalidates every existing session — the only built-in “log everyone out” / revoke-all mechanism, since sessions are stateless (no server-side store to clear).
token_ttl_secs: i64Cookie/JWT lifetime in seconds. This is also the maximum window a leaked
or stolen token stays valid, because tokens are self-contained and not
individually revocable — shorter is safer (e.g. 3_600 for 1h), longer is
more convenient. 86_400 (24h) is a reasonable default.
admin_table: StringTable/collection holding admin users.
Set the Secure flag on the auth cookie (disable only for local HTTP).
Trait Implementations§
Source§impl Clone for AuthConfig
impl Clone for AuthConfig
Source§fn clone(&self) -> AuthConfig
fn clone(&self) -> AuthConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 AuthConfig
impl Debug for AuthConfig
Auto Trait Implementations§
impl Freeze for AuthConfig
impl RefUnwindSafe for AuthConfig
impl Send for AuthConfig
impl Sync for AuthConfig
impl Unpin for AuthConfig
impl UnsafeUnpin for AuthConfig
impl UnwindSafe for AuthConfig
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