mirror of
https://github.com/lennart-k/rustical.git
synced 2026-01-31 16:08:20 +00:00
Add initial OIDC support #33
This commit is contained in:
@@ -1,9 +1,20 @@
|
||||
use openidconnect::{ClientId, ClientSecret, IssuerUrl, Scope};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
fn default_enabled() -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Debug, Clone)]
|
||||
pub struct OidcConfig {
|
||||
pub name: String,
|
||||
pub issuer: IssuerUrl,
|
||||
pub client_id: ClientId,
|
||||
pub client_secret: Option<ClientSecret>,
|
||||
pub scopes: Vec<Scope>,
|
||||
pub allow_sign_up: bool,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Debug, Clone)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct FrontendConfig {
|
||||
@@ -12,4 +23,6 @@ pub struct FrontendConfig {
|
||||
pub secret_key: [u8; 64],
|
||||
#[serde(default = "default_enabled")]
|
||||
pub enabled: bool,
|
||||
#[serde(default)]
|
||||
pub oidc: Option<OidcConfig>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user