pub enum AuthBackendKind {
File(FileBackendConfig),
Sql(SqlConfig),
Ldap(LdapConfig),
OAuth2(OAuth2Config),
}Expand description
Discriminated-union config type for all supported authentication backends.
Call AuthBackendKind::build to construct an Arc<dyn AuthBackend> from
whichever variant was selected in the server configuration.
Variants§
File(FileBackendConfig)
File-based backend (bcrypt htpasswd format with optional SCRAM extension).
Sql(SqlConfig)
SQL database backend (PostgreSQL / MySQL / SQLite via sqlx).
Ldap(LdapConfig)
LDAP / Active Directory backend.
OAuth2(OAuth2Config)
OAuth2 / OIDC backend (JWT introspection, XOAUTH2 SASL).
Implementations§
Source§impl AuthBackendKind
impl AuthBackendKind
Sourcepub async fn build(self) -> Result<Arc<dyn AuthBackend>>
pub async fn build(self) -> Result<Arc<dyn AuthBackend>>
Construct an Arc<dyn AuthBackend> from this configuration variant.
The returned backend is immediately ready for use; SQL backends have their connection pool opened, LDAP backends hold a lazily-allocated pool, and the file backend has already read its passwd file into memory.
Auto Trait Implementations§
impl Freeze for AuthBackendKind
impl RefUnwindSafe for AuthBackendKind
impl Send for AuthBackendKind
impl Sync for AuthBackendKind
impl Unpin for AuthBackendKind
impl UnsafeUnpin for AuthBackendKind
impl UnwindSafe for AuthBackendKind
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