pub struct CoreConfig {
pub app_name: String,
pub base_url: Url,
pub base_path: String,
pub trusted_origins: Vec<String>,
pub session: SessionConfig,
pub cookies: CookieConfig,
pub email_password: Option<EmailPassword>,
pub email_verification: EmailVerification,
pub rate_limit: RateLimit,
pub client_ip: ClientIp,
pub ids: IdStrategy,
/* private fields */
}Expand description
Everything the builder collected, frozen at .build().
Fields§
§app_name: String§base_url: Url§base_path: String§trusted_origins: Vec<String>§session: SessionConfig§email_password: Option<EmailPassword>§email_verification: EmailVerification§rate_limit: RateLimit§client_ip: ClientIp§ids: IdStrategyImplementations§
Source§impl CoreConfig
impl CoreConfig
pub fn is_trusted_origin(&self, origin: &str) -> bool
Sourcepub fn is_safe_redirect(&self, target: &str) -> bool
pub fn is_safe_redirect(&self, target: &str) -> bool
Accepts relative paths (/dashboard) and absolute URLs on a trusted origin. See
CoreConfig::resolve_redirect.
Sourcepub fn resolve_redirect(&self, target: &str) -> Option<Url>
pub fn resolve_redirect(&self, target: &str) -> Option<Url>
Where a browser lands when redirected to target, or None when that isn’t safe.
Control characters and backslashes are refused anywhere, because browsers drop or
reinterpret them (/\t/evil.example opens //evil.example). A relative target must
start with a single /, have no encoded / or \ (%2f, %5c) in its path, and
still be on base_url’s origin once resolved against it. An absolute target must be on
a trusted origin.
Sourcepub fn is_fresh(&self, session: &Session) -> bool
pub fn is_fresh(&self, session: &Session) -> bool
Whether session was created within fresh_age, the rule behind Fresh access.
A zero fresh_age makes every session fresh.
Sourcepub fn session_tokens(&self) -> SessionTokens
pub fn session_tokens(&self) -> SessionTokens
How session tokens are stored (SessionTokens).
Sourcepub fn oauth_tokens_in_plaintext(&self) -> bool
pub fn oauth_tokens_in_plaintext(&self) -> bool
Whether OAuth tokens are stored as plain text
(Builder::store_oauth_tokens_in_plaintext).
Sourcepub fn session_token_eq(&self, token: &str) -> Where<Session>
pub fn session_token_eq(&self, token: &str) -> Where<Session>
The filter that finds the session row of token, under the configured
SessionTokens: by its SHA-256, or by the token itself.
Sourcepub fn owns_account_provider(&self, provider_id: &str) -> bool
pub fn owns_account_provider(&self, provider_id: &str) -> bool
Whether fastauth reads, changes and deletes account rows of provider_id. Every
provider, unless Builder::only_owned_accounts
is on: then only credential and the providers plugins register (social sign-in),
and rows another app owns, such as its oidc accounts, are left alone.
Sourcepub fn owned_account_providers(&self) -> Option<&[String]>
pub fn owned_account_providers(&self) -> Option<&[String]>
The account providers fastauth owns, or None when it manages every row.