From 20fa1d516eb906cfd73c48ab550794e575c686d0 Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Wed, 22 Nov 2023 13:50:12 +0100 Subject: [PATCH] Make the claims_imports optional in the config --- crates/config/src/sections/upstream_oauth2.rs | 1 + docs/config.schema.json | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/crates/config/src/sections/upstream_oauth2.rs b/crates/config/src/sections/upstream_oauth2.rs index 94ae31fe..913c3f2c 100644 --- a/crates/config/src/sections/upstream_oauth2.rs +++ b/crates/config/src/sections/upstream_oauth2.rs @@ -300,6 +300,7 @@ pub struct Provider { /// How claims should be imported from the `id_token` provided by the /// provider + #[serde(default)] pub claims_imports: ClaimsImports, } diff --git a/docs/config.schema.json b/docs/config.schema.json index 2846e228..1beae6e6 100644 --- a/docs/config.schema.json +++ b/docs/config.schema.json @@ -1751,7 +1751,6 @@ } ], "required": [ - "claims_imports", "client_id", "id", "issuer", @@ -1769,6 +1768,24 @@ }, "claims_imports": { "description": "How claims should be imported from the `id_token` provided by the provider", + "default": { + "displayname": { + "action": "ignore", + "template": null + }, + "email": { + "action": "ignore", + "set_email_verification": "import", + "template": null + }, + "localpart": { + "action": "ignore", + "template": null + }, + "subject": { + "template": null + } + }, "allOf": [ { "$ref": "#/definitions/ClaimsImports"