pub struct Auth { /* private fields */ }Expand description
The panel’s authentication configuration (ADR-0013).
The default is Auth::password; Auth::custom installs an app-owned
Authenticator; Auth::disabled is the explicit fail-open opt-out.
Sign-in attempts are throttled per login by default; see Auth::throttle.
Auth::registration adds a sign-up page.
Implementations§
Source§impl Auth
impl Auth
Sourcepub fn custom(authenticator: impl Authenticator) -> Self
pub fn custom(authenticator: impl Authenticator) -> Self
An app-owned authenticator over its own user table.
Sourcepub fn disabled() -> Self
pub fn disabled() -> Self
Explicit fail-open opt-out for public demos (ADR-0013): no gate, no login routes, sessions unused.
Sourcepub fn throttle(self, throttle: LoginThrottle) -> Self
pub fn throttle(self, throttle: LoginThrottle) -> Self
How many sign-in attempts one login may make from one client address
in a window; defaults to five a minute. LoginThrottle::off counts nothing, for a proxy
that limits sign-ins itself.
Sourcepub fn registration(self, registrar: impl Registrar) -> Self
pub fn registration(self, registrar: impl Registrar) -> Self
Lets visitors create their own account at {prefix}/register, through registrar; the
login page links to it.
use tablo_core::{Auth, PasswordAuth};
let auth = Auth::password().registration(PasswordAuth);PasswordAuth registers an active AdminUser from a SignUp, who signs in to the
panel at once: only open it where any visitor may hold an account. A custom
Registrar decides what a new account may do. Mounting refuses a registrar whose
User is not the type the authenticator loads, and a registration
on Auth::disabled.
Sourcepub fn sign_up_throttle(self, throttle: LoginThrottle) -> Self
pub fn sign_up_throttle(self, throttle: LoginThrottle) -> Self
How many sign-ups one client address may submit in a window; defaults to five a minute. Every sign-up POST counts, whether or not it creates an account.
Sourcepub fn is_disabled(&self) -> bool
pub fn is_disabled(&self) -> bool
Whether the explicit opt-out is set.