From dd0f56bb0ca0d2ff9d566485ed511d07babe02b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20Diot?= Date: Wed, 25 Jan 2023 11:30:39 +0100 Subject: [PATCH] Add password type for settings --- src/common/core/antibot/plugin.json | 6 +++--- src/common/core/authbasic/plugin.json | 2 +- src/common/db/model.py | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/common/core/antibot/plugin.json b/src/common/core/antibot/plugin.json index 9b0d90efd..823042c12 100644 --- a/src/common/core/antibot/plugin.json +++ b/src/common/core/antibot/plugin.json @@ -38,7 +38,7 @@ "id": "antibot-session-secret", "label": "Antibot Session secret", "regex": "^(random|\\w+)$", - "type": "text" + "type": "password" }, "ANTIBOT_SESSION_NAME": { "context": "global", @@ -74,7 +74,7 @@ "id": "antibot-recaptcha-secret", "label": "reCAPTCHA secret", "regex": "^[\\w-]*$", - "type": "text" + "type": "password" }, "ANTIBOT_HCAPTCHA_SITEKEY": { "context": "multisite", @@ -92,7 +92,7 @@ "id": "antibot-hcaptcha-secret", "label": "hCaptcha secret", "regex": "^(0x[a-zA-Z0-9]+)?$", - "type": "text" + "type": "password" } } } diff --git a/src/common/core/authbasic/plugin.json b/src/common/core/authbasic/plugin.json index 0df3ec25f..3b1d1955b 100644 --- a/src/common/core/authbasic/plugin.json +++ b/src/common/core/authbasic/plugin.json @@ -39,7 +39,7 @@ "id": "auth-basic-password", "label": "Password", "regex": "^.+", - "type": "text" + "type": "password" }, "AUTH_BASIC_TEXT": { "context": "multisite", diff --git a/src/common/db/model.py b/src/common/db/model.py index 83ba6ab05..89d3572b8 100644 --- a/src/common/db/model.py +++ b/src/common/db/model.py @@ -15,7 +15,9 @@ from sqlalchemy.orm import declarative_base, relationship from sqlalchemy.schema import UniqueConstraint CONTEXTS_ENUM = Enum("global", "multisite", name="contexts_enum") -SETTINGS_TYPES_ENUM = Enum("text", "check", "select", name="settings_types_enum") +SETTINGS_TYPES_ENUM = Enum( + "password", "text", "check", "select", name="settings_types_enum" +) METHODS_ENUM = Enum("ui", "scheduler", "autoconf", "manual", name="methods_enum") SCHEDULES_ENUM = Enum("once", "minute", "hour", "day", "week", name="schedules_enum") CUSTOM_CONFIGS_TYPES_ENUM = Enum(