pub struct LocalAuthConfig {
pub password: bool,
pub otp: bool,
pub mfa: bool,
pub anonymous: bool,
pub email_verification: bool,
pub mfa_issuer: Option<String>,
pub email_from: Option<String>,
pub reset_url_template: Option<String>,
pub magic_link_template: Option<String>,
pub verification_url_template: Option<String>,
}Expand description
[auth.local] — the auth methods FraiseQL operates itself, rather than
delegating to an IdP (#367).
Every enabled method mounts real HTTP routes and requires a database pool:
credentials, MFA enrollments, OTP budgets and sessions are all durable
state. A method enabled without what it needs refuses to boot rather than
mounting a flow that cannot complete.
Fields§
§password: boolEmail + password sign-in: mounts /auth/v1/password/{signup,login} and
the reset pair. Reset-link delivery additionally requires
email_from.
otp: boolEmail OTP / magic-link sign-in: mounts /auth/v1/otp and
/auth/v1/verify. Requires email_from — a code
nobody receives is not a login method.
mfa: boolTOTP MFA: mounts /auth/v1/mfa/{enroll,challenge,verify,unenroll},
backed by the Postgres enrollment store (enrollments must survive a
restart, or a deploy locks every user out of their own account).
anonymous: boolAnonymous guest sessions: mounts POST /auth/v1/signup, which issues a
session to any caller with no credentials at all. Off by default — this
is a deliberate “anyone may hold a session” posture, not a convenience.
email_verification: boolEmail verification for local-password accounts (#945): mounts
POST /auth/v1/email/verify/{start,confirm}, both of which require an
authenticated caller and act only on that caller’s own account.
Requires password — verification proves the address a
local identity claims, and an account without one has nothing to verify
— plus email_from and
verification_url_template.
Confirming promotes the account’s own core.tb_user.email, which is what
lets a later trusted social sign-in for the same address link into it. It
never merges two accounts: an address already verified elsewhere is
refused.
mfa_issuer: Option<String>Service name shown in authenticator apps for MFA enrollment
(otpauth://…?issuer=). Defaults to "FraiseQL".
email_from: Option<String>The [mailbox.<name>] account whose SMTP half delivers OTP codes and
password-reset links. Required whenever otp or password is enabled;
naming a mailbox with no [mailbox.<name>.smtp] section refuses to boot.
reset_url_template: Option<String>Template for the password-reset link, with {token} substituted for the
opaque reset token — e.g. https://app.example.com/reset?token={token}.
Required when password is enabled: the link points at the operator’s
front end, which FraiseQL cannot guess.
magic_link_template: Option<String>Template for the OTP magic link, with {code} substituted. Optional:
when absent the email carries the bare six-digit code.
verification_url_template: Option<String>Template for the email-verification link, with {token} substituted for
the opaque verification token — e.g.
https://app.example.com/verify-email?token={token}. Required when
email_verification is enabled: the link
points at the operator’s front end, which FraiseQL cannot guess.
Trait Implementations§
Source§impl Clone for LocalAuthConfig
impl Clone for LocalAuthConfig
Source§impl Debug for LocalAuthConfig
impl Debug for LocalAuthConfig
Source§impl Default for LocalAuthConfig
impl Default for LocalAuthConfig
Source§impl<'de> Deserialize<'de> for LocalAuthConfig
impl<'de> Deserialize<'de> for LocalAuthConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for LocalAuthConfig
Source§impl PartialEq for LocalAuthConfig
impl PartialEq for LocalAuthConfig
Source§impl Serialize for LocalAuthConfig
impl Serialize for LocalAuthConfig
impl StructuralPartialEq for LocalAuthConfig
Auto Trait Implementations§
impl Freeze for LocalAuthConfig
impl RefUnwindSafe for LocalAuthConfig
impl Send for LocalAuthConfig
impl Sync for LocalAuthConfig
impl Unpin for LocalAuthConfig
impl UnsafeUnpin for LocalAuthConfig
impl UnwindSafe for LocalAuthConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.