summaryrefslogtreecommitdiffstats
path: root/crates/auth/src/cnfg.rs
blob: c895d05a9110d9e9963992ced8b5a140f5e7e1fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use serde::Deserialize;

#[derive(Deserialize, Clone)]
#[serde(rename_all = "kebab-case")]
pub struct LocalConfig {
    pub oauth: OauthConfig,
}

#[derive(Deserialize, Clone)]
#[serde(rename_all = "kebab-case")]
pub struct OauthConfig {
    pub discord: OauthCredentials,
    pub session_lifespan: u64,
    pub jwt_encoding_key: String,
}

#[derive(Deserialize, Clone)]
#[serde(rename_all = "kebab-case")]
pub struct OauthCredentials {
    pub client_id: String,
    pub client_secret: String,
    pub redirect_url: String,
    pub auth_url: Option<String>,
    pub token_url: Option<String>,
}