From 29626ebb063cec7b1052d8c9fb29e5b3895462e7 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sun, 28 Apr 2024 15:05:01 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=83=20Updates=20schema=20to=20allow=20?= =?UTF-8?q?for=20env=20vars=20on=20user=20passwords?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/ConfigSchema.json | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/utils/ConfigSchema.json b/src/utils/ConfigSchema.json index a80bc043..c344261e 100644 --- a/src/utils/ConfigSchema.json +++ b/src/utils/ConfigSchema.json @@ -500,14 +500,9 @@ "users": { "title": "Users", "type": "array", - "description": "Usernames and hashed credentials for frontend authentication", + "description": "Usernames and hashed credentials for frontend authentication. Needs to be set at build-time.", "items": { "type": "object", - "additionalProperties": false, - "required": [ - "user", - "hash" - ], "properties": { "user": { "title": "Username", @@ -521,6 +516,12 @@ "minLength": 64, "maxLength": 64 }, + "password": { + "title": "Password", + "type": "string", + "description": "The environmental variable pointing to a plaintext password for that user. Must start with VUE_APP_", + "pattern": "^VUE_APP_.*" + }, "type": { "title": "Privileges", "type": "string", @@ -531,9 +532,15 @@ "description": "User type, denoting privilege level, either admin or normal", "default": "normal" } - } + }, + "additionalProperties": false, + "required": ["user"], + "oneOf": [ + { "required": ["hash"] }, + { "required": ["password"] } + ] } - }, + }, "enableHeaderAuth": { "title": "Enable HeaderAuth?", "type": "boolean",