pub struct BrowserTokenConfig {
pub secret: Vec<u8>,
pub issuer: String,
pub audience: String,
pub access_ttl_secs: i64,
pub refresh_ttl_secs: i64,
pub cookie_secure: bool,
pub same_site: SameSite,
pub cookie_name: String,
pub cookie_path: String,
}Expand description
Configuration for the hybrid-token authority. Secure by default:
Secure cookies, SameSite=Strict, a short access TTL, and an
HttpOnly refresh cookie.
Fields§
§secret: Vec<u8>HS256 signing/verification secret. Must be ≥ MIN_SECRET_BYTES.
issuer: Stringiss claim stamped on every token and required on verify.
audience: Stringaud claim stamped on every token and required on verify.
access_ttl_secs: i64Access-JWT lifetime, seconds. Short by design (default 15 min): the blast radius of a leaked in-memory access token is one TTL.
refresh_ttl_secs: i64Refresh-cookie lifetime, seconds (default 30 days). Bounds how
long a stolen refresh cookie is useful and sets the cookie’s
Max-Age.
Secure attribute on the refresh cookie. Default true — the
cookie must only ride HTTPS. Tests on a clear-text loopback set
this false explicitly.
same_site: SameSiteSameSite attribute on the refresh cookie.
Cookie name. Default reddb_refresh.
Cookie Path — scopes which requests carry the refresh cookie.
Default /auth/browser, so it reaches refresh/logout but no
other endpoint ever sees it.
Implementations§
Trait Implementations§
Source§impl Clone for BrowserTokenConfig
impl Clone for BrowserTokenConfig
Source§fn clone(&self) -> BrowserTokenConfig
fn clone(&self) -> BrowserTokenConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for BrowserTokenConfig
impl RefUnwindSafe for BrowserTokenConfig
impl Send for BrowserTokenConfig
impl Sync for BrowserTokenConfig
impl Unpin for BrowserTokenConfig
impl UnsafeUnpin for BrowserTokenConfig
impl UnwindSafe for BrowserTokenConfig
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request