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.
Trait Implementations§
Source§impl Clone for CoreConfig
impl Clone for CoreConfig
Auto Trait Implementations§
impl !RefUnwindSafe for CoreConfig
impl !UnwindSafe for CoreConfig
impl Forget for CoreConfig
impl Freeze for CoreConfig
impl Move for CoreConfig
impl Send for CoreConfig
impl Sync for CoreConfig
impl Unpin for CoreConfig
impl UnsafeUnpin for CoreConfig
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