pub struct AllowThemBuilder { /* private fields */ }Expand description
Builder for constructing a configured AllowThem handle.
Implementations§
Source§impl AllowThemBuilder
impl AllowThemBuilder
Sourcepub fn new(url: impl Into<String>) -> Self
pub fn new(url: impl Into<String>) -> Self
Start building from a database URL.
At build time, calls Db::connect(url) which creates the pool,
sets pragmas (foreign_keys, WAL, busy_timeout), and runs migrations.
Sourcepub fn with_pool(pool: SqlitePool) -> Self
pub fn with_pool(pool: SqlitePool) -> Self
Start building from an existing pool.
At build time, calls Db::new(pool) which runs migrations.
The caller is responsible for pragma configuration on their pool.
Sourcepub fn session_ttl(self, ttl: Duration) -> Self
pub fn session_ttl(self, ttl: Duration) -> Self
Override session TTL. Default: 24 hours.
Override session cookie name. Default: "allowthem_session".
Set the Secure attribute on session cookies.
Default: true. Set to false for local development over HTTP.
Set the Domain attribute on session cookies.
Default: empty (omitted). When set, the cookie is sent to the domain and all its subdomains.
Sourcepub fn mfa_key(self, key: [u8; 32]) -> Self
pub fn mfa_key(self, key: [u8; 32]) -> Self
Set the AES-256-GCM encryption key for MFA secrets.
When not set, all MFA operations return AuthError::MfaNotConfigured.
This keeps MFA opt-in for embedded integrators who don’t need it.
Sourcepub fn signing_key(self, key: [u8; 32]) -> Self
pub fn signing_key(self, key: [u8; 32]) -> Self
Set the AES-256-GCM encryption key for RS256 signing key storage.
Required for OIDC/standalone mode. When not set, all signing key
operations return AuthError::SigningKeyNotConfigured.
Sourcepub fn base_url(self, url: impl Into<String>) -> Self
pub fn base_url(self, url: impl Into<String>) -> Self
Set the base URL (issuer) for the OIDC provider.
Required for standalone mode. Used as the iss claim in tokens
and for issuer validation on incoming access tokens.
When not set, OIDC operations return AuthError::BaseUrlNotConfigured.
Auto Trait Implementations§
impl Freeze for AllowThemBuilder
impl !RefUnwindSafe for AllowThemBuilder
impl Send for AllowThemBuilder
impl Sync for AllowThemBuilder
impl Unpin for AllowThemBuilder
impl UnsafeUnpin for AllowThemBuilder
impl !UnwindSafe for AllowThemBuilder
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
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