scufflecloud_core_traits/
config.rs

1use 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_name(&self) -> &str;
8    fn email_from_address(&self) -> &str;
9    fn dashboard_origin(&self) -> &url::Url;
10    fn timeout_config(&self) -> TimeoutConfig;
11    fn google_oauth2_config(&self) -> GoogleOAuth2Config<'_>;
12}
13
14pub struct TimeoutConfig {
15    pub max_request: std::time::Duration,
16    pub user_session: std::time::Duration,
17    pub user_session_token: std::time::Duration,
18    pub mfa: std::time::Duration,
19    pub new_user_email_request: std::time::Duration,
20    pub user_session_request: std::time::Duration,
21    pub magic_link_request: std::time::Duration,
22}
23
24pub struct GoogleOAuth2Config<'a> {
25    pub client_id: Cow<'a, str>,
26    pub client_secret: Cow<'a, str>,
27}