pub struct Builder<D, U, P, S, B> { /* private fields */ }Expand description
Collects configuration. .build() only exists once secret, base_url and database
are set: the last three type parameters track that.
Implementations§
Source§impl<D, U, P, S, B> Builder<D, U, P, S, B>
impl<D, U, P, S, B> Builder<D, U, P, S, B>
Sourcepub fn secret(self, secret: Secret) -> Builder<D, U, P, Present, B>
pub fn secret(self, secret: Secret) -> Builder<D, U, P, Present, B>
The master secret (at least 32 bytes). See Secret::from_env.
Sourcepub fn secrets(
self,
secrets: impl IntoIterator<Item = Secret>,
) -> Builder<D, U, P, Present, B>
pub fn secrets( self, secrets: impl IntoIterator<Item = Secret>, ) -> Builder<D, U, P, Present, B>
Several secrets for rotation: the first signs, all verify.
Sourcepub fn base_url(self, url: impl Into<String>) -> Builder<D, U, P, S, Present>
pub fn base_url(self, url: impl Into<String>) -> Builder<D, U, P, S, Present>
The public URL of the app, e.g. https://acme.dk.
pub fn app_name(self, name: impl Into<String>) -> Builder<D, U, P, S, B>
Sourcepub fn base_path(self, path: impl Into<String>) -> Builder<D, U, P, S, B>
pub fn base_path(self, path: impl Into<String>) -> Builder<D, U, P, S, B>
Where auth routes live (default /api/auth).
Sourcepub fn trusted_origins(
self,
origins: impl IntoIterator<Item = impl Into<String>>,
) -> Builder<D, U, P, S, B>
pub fn trusted_origins( self, origins: impl IntoIterator<Item = impl Into<String>>, ) -> Builder<D, U, P, S, B>
Origins allowed to make cookie-carrying requests and to be redirect targets.
pub fn email_password(self, config: EmailPassword) -> Builder<D, U, P, S, B>
pub fn email_verification( self, config: EmailVerification, ) -> Builder<D, U, P, S, B>
pub fn session(self, config: SessionConfig) -> Builder<D, U, P, S, B>
pub fn rate_limit(self, config: RateLimit) -> Builder<D, U, P, S, B>
pub fn client_ip(self, source: ClientIp) -> Builder<D, U, P, S, B>
Sourcepub fn ids(self, strategy: IdStrategy) -> Builder<D, U, P, S, B>
pub fn ids(self, strategy: IdStrategy) -> Builder<D, U, P, S, B>
How ids are generated and stored; IdStrategy::Ulid unless set.
Apps upgrading a Postgres database created by fastauth 0.1 (uuid id columns)
keep it working with .ids(IdStrategy::UuidV7).
pub fn mailer(self, mailer: impl Mailer) -> Builder<D, U, P, S, B>
Sourcepub fn user_fields<U2>(self) -> Builder<D, U2, P, S, B>where
U2: Fields,
pub fn user_fields<U2>(self) -> Builder<D, U2, P, S, B>where
U2: Fields,
The app’s own columns on user.
Source§impl<U, P, S, B> Builder<NoDatabase, U, P, S, B>
impl<U, P, S, B> Builder<NoDatabase, U, P, S, B>
Trait Implementations§
Auto Trait Implementations§
impl<D, U, P, S, B> !RefUnwindSafe for Builder<D, U, P, S, B>
impl<D, U, P, S, B> !Sync for Builder<D, U, P, S, B>
impl<D, U, P, S, B> !UnwindSafe for Builder<D, U, P, S, B>
impl<D, U, P, S, B> Forget for Builder<D, U, P, S, B>
impl<D, U, P, S, B> Freeze for Builder<D, U, P, S, B>
impl<D, U, P, S, B> Move for Builder<D, U, P, S, B>
impl<D, U, P, S, B> Send for Builder<D, U, P, S, B>
impl<D, U, P, S, B> Unpin for Builder<D, U, P, S, B>
impl<D, U, P, S, B> UnsafeUnpin for Builder<D, U, P, S, B>where
D: UnsafeUnpin,
P: UnsafeUnpin,
Vec<Box<dyn FnOnce(&mut PluginBuilder<'_, D>) + Send>>: UnsafeUnpin,
PhantomData<fn() -> (U, S, B)>: UnsafeUnpin,
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
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> ⓘ
Converts
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> ⓘ
Converts
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