scufflecloud_core_traits/
config.rs1use std::borrow::Cow;
2
3pub trait ConfigInterface: Send + Sync {
4 fn service_bind(&self) -> std::net::SocketAddr;
5 fn swagger_ui_enabled(&self) -> bool;
6 fn turnstile_secret_key(&self) -> &str;
7 fn email_from_address(&self) -> &str;
8 fn dashboard_origin(&self) -> &url::Url;
9 fn timeout_config(&self) -> TimeoutConfig;
10 fn google_oauth2_config(&self) -> GoogleOAuth2Config<'_>;
11}
12
13pub struct TimeoutConfig {
14 pub max_request: std::time::Duration,
15 pub user_session: std::time::Duration,
16 pub user_session_token: std::time::Duration,
17 pub mfa: std::time::Duration,
18 pub new_user_email_request: std::time::Duration,
19 pub user_session_request: std::time::Duration,
20 pub magic_link_request: std::time::Duration,
21}
22
23pub struct GoogleOAuth2Config<'a> {
24 pub client_id: Cow<'a, str>,
25 pub client_secret: Cow<'a, str>,
26}