pub struct AuthConfig {Show 28 fields
pub mode: AuthMode,
pub public_url: Option<Url>,
pub sqlite_path: PathBuf,
pub key_path: PathBuf,
pub bootstrap_secret: Option<String>,
pub allowed_client_redirect_uris: Vec<String>,
pub admin_email: String,
pub google: GoogleConfig,
pub authelia: AutheliaConfig,
pub github: GitHubConfig,
pub default_provider: String,
pub access_token_ttl: Duration,
pub refresh_token_ttl: Duration,
pub auth_code_ttl: Duration,
pub register_requests_per_minute: u32,
pub authorize_requests_per_minute: u32,
pub max_pending_oauth_states: usize,
pub env_prefix: String,
pub default_data_dir: PathBuf,
pub session_cookie_name: String,
pub scopes_supported: Vec<String>,
pub resource_path: String,
pub default_scope: String,
pub static_token_scopes: Vec<String>,
pub login_path: String,
pub enable_dynamic_registration: bool,
pub disable_static_token_with_oauth: bool,
pub token_encryption_key: Option<TokenEncryptionKey>,
}Fields§
§mode: AuthMode§public_url: Option<Url>§sqlite_path: PathBuf§key_path: PathBuf§bootstrap_secret: Option<String>§allowed_client_redirect_uris: Vec<String>§admin_email: StringSingle bootstrap admin email permitted to log in through any configured
OAuth/OIDC provider.
Required when mode == AuthMode::OAuth. Additional users are granted
through the SQLite-backed allowlist managed via the web UI.
google: GoogleConfig§authelia: AutheliaConfig§github: GitHubConfig§default_provider: StringWhich configured provider /authorize and /auth/login use when the
request omits ?provider=. Must name a provider that is actually
configured (validated in AuthConfig::validate). Resolved
automatically when unset: google > authelia > github, in that
priority order, picking the first one that has credentials — this is
what makes every existing single-provider (Google-only) deployment
keep working with zero config changes after upgrading.
access_token_ttl: Duration§refresh_token_ttl: Duration§auth_code_ttl: Duration§register_requests_per_minute: u32§max_pending_oauth_states: usize§env_prefix: StringEnv var prefix used for diagnostics (e.g. "LAB", "SYSLOG_MCP").
Set via AuthConfigBuilder::env_prefix BEFORE any env reads.
default_data_dir: PathBufDefault base directory for auth.db and auth-jwt.pem when the
corresponding env vars are unset.
Browser session cookie name. Lab consumer leaves this at the default
("lab_session"); other consumers override with their own brand.
scopes_supported: Vec<String>Scopes advertised on /.well-known/oauth-authorization-server and
/.well-known/oauth-protected-resource.
resource_path: StringPath appended to public_url to form the canonical resource URL
returned in the protected-resource metadata document.
default_scope: StringDefault scope applied when /authorize requests omit one and the
only scope accepted by the legacy single-scope validator.
static_token_scopes: Vec<String>Scopes minted into the static-bearer-derived AuthContext so legacy
admin tools keep functioning when the dual-mode middleware (L2) is
deployed. Lab keeps the legacy ["lab:read","lab:admin"] defaults;
cortex will override with ["syslog:read","syslog:admin"].
login_path: StringPath of the browser login route (typically /auth/login).
enable_dynamic_registration: boolWhether POST /register (RFC 7591 dynamic client registration) is
mounted. Defaults to false (closed) — opt-in per consumer.
disable_static_token_with_oauth: boolWhen true, dual-mode middleware MUST reject the static bearer
token whenever OAuth is active. Defaults to false (lab keeps the
historical break-glass behavior); cortex overrides to true.
token_encryption_key: Option<TokenEncryptionKey>Optional at-rest encryption key for upstream provider refresh tokens.
When present, provider refresh tokens are encrypted with
ChaCha20-Poly1305 before being written to SQLite. Set via
{PREFIX}_TOKEN_ENCRYPTION_KEY (64 hex digits or 43 base64url chars).
When absent, tokens are stored as plaintext (backward-compatible).
Implementations§
Source§impl AuthConfig
impl AuthConfig
Sourcepub fn from_sources(
vars: impl IntoIterator<Item = (String, String)>,
) -> Result<Self, AuthError>
pub fn from_sources( vars: impl IntoIterator<Item = (String, String)>, ) -> Result<Self, AuthError>
Backward-compatible convenience: read env vars using the default
LAB prefix. Equivalent to AuthConfigBuilder::new().build_from_sources(vars).
Trait Implementations§
Source§impl Clone for AuthConfig
impl Clone for AuthConfig
Source§fn clone(&self) -> AuthConfig
fn clone(&self) -> AuthConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AuthConfig
impl Debug for AuthConfig
Source§impl Default for AuthConfig
impl Default for AuthConfig
Source§impl PartialEq for AuthConfig
impl PartialEq for AuthConfig
Source§fn eq(&self, other: &AuthConfig) -> bool
fn eq(&self, other: &AuthConfig) -> bool
self and other values to be equal, and is used by ==.impl Eq for AuthConfig
impl StructuralPartialEq for AuthConfig
Auto Trait Implementations§
impl Freeze for AuthConfig
impl RefUnwindSafe for AuthConfig
impl Send for AuthConfig
impl Sync for AuthConfig
impl Unpin for AuthConfig
impl UnsafeUnpin for AuthConfig
impl UnwindSafe for AuthConfig
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.