From cd0e0ebb0de372ff31c982ef023fe1979addb05a Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Sat, 19 Dec 2020 11:34:45 +0100 Subject: [PATCH] refactor: move password config to selfservice BREAKING CHANGE: The following configuration keys were updated: ```patch selfservice.methods.password.config.max_breaches ``` - `password.max_breaches` -> `selfservice.methods.password.config.max_breaches` - `password.ignore_network_errors` -> `selfservice.methods.password.config.ignore_network_errors` --- .schema/config.schema.json | 44 ++++++++++++++++----------------- driver/config/provider_viper.go | 4 +-- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.schema/config.schema.json b/.schema/config.schema.json index 02348cfb037c..7bc89cd9403a 100644 --- a/.schema/config.schema.json +++ b/.schema/config.schema.json @@ -643,6 +643,28 @@ "type": "boolean", "title": "Enables Username/Email and Password Method", "default": true + }, + "config": { + "type": "object", + "title": "Password Configuration", + "description": "Define how passwords are validated.", + "properties": { + "max_breaches": { + "title": "Allow Password Breaches", + "description": "Defines how often a password may have been breached before it is rejected.", + "type": "integer", + "minimum": 0, + "maximum": 100, + "default": 0 + }, + "ignore_network_errors": { + "title": "Ignore Lookup Network Errors", + "description": "If set to false the password validation fails when the network or the Have I Been Pwnd API is down.", + "type": "boolean", + "default": true + } + }, + "additionalProperties": false } } }, @@ -1020,28 +1042,6 @@ ], "additionalProperties": false }, - "password": { - "type": "object", - "title": "Password Configuration", - "description": "Define how passwords are validated.", - "properties": { - "max_breaches": { - "title": "Allow Password Breaches", - "description": "Defines how often a password may have been breached before it is rejected.", - "type": "integer", - "minimum": 0, - "maximum": 100, - "default": 0 - }, - "ignore_network_errors": { - "title": "Ignore Lookup Network Errors", - "description": "If set to false the password validation fails when the network or the Have I Been Pwnd API is down.", - "type": "boolean", - "default": true - } - }, - "additionalProperties": false - }, "secrets": { "type": "object", "properties": { diff --git a/driver/config/provider_viper.go b/driver/config/provider_viper.go index c121c7461e5e..36a1d89e5586 100644 --- a/driver/config/provider_viper.go +++ b/driver/config/provider_viper.go @@ -82,8 +82,8 @@ const ( ViperKeyHasherArgon2ConfigParallelism = "hashers.argon2.parallelism" ViperKeyHasherArgon2ConfigSaltLength = "hashers.argon2.salt_length" ViperKeyHasherArgon2ConfigKeyLength = "hashers.argon2.key_length" - ViperKeyPasswordMaxBreaches = "password.max_breaches" - ViperKeyIgnoreNetworkErrors = "password.ignore_network_errors" + ViperKeyPasswordMaxBreaches = "selfservice.methods.password.config.max_breaches" + ViperKeyIgnoreNetworkErrors = "selfservice.methods.password.config.ignore_network_errors" ViperKeyVersion = "version" Argon2DefaultMemory uint32 = 4 * 1024 * 1024 Argon2DefaultIterations uint32 = 4