From d21dee162dc9a6c70608436c7a09230cefd30ee0 Mon Sep 17 00:00:00 2001 From: Jason Ertel Date: Fri, 8 Oct 2021 12:39:17 -0400 Subject: [PATCH] Add Note field to user traits; Enforce max length restrictions on email, firstname, lastname, and note fields --- salt/common/tools/sbin/so-user | 3 +++ salt/soc/files/kratos/schema.json | 14 +++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/salt/common/tools/sbin/so-user b/salt/common/tools/sbin/so-user index 7ef23ca9b..015a28c9f 100755 --- a/salt/common/tools/sbin/so-user +++ b/salt/common/tools/sbin/so-user @@ -101,6 +101,9 @@ function validatePassword() { if [[ $len -lt 6 ]]; then fail "Password does not meet the minimum requirements" fi + if [[ $len -gt 72 ]]; then + fail "Password is too long (max: 72)" + fi check_password_and_exit "$password" } diff --git a/salt/soc/files/kratos/schema.json b/salt/soc/files/kratos/schema.json index 19ee2197c..782d1b78b 100644 --- a/salt/soc/files/kratos/schema.json +++ b/salt/soc/files/kratos/schema.json @@ -12,6 +12,7 @@ "format": "email", "title": "E-Mail", "minLength": 6, + "maxLength": 100, "ory.sh/kratos": { "credentials": { "password": { @@ -25,16 +26,19 @@ }, "firstName": { "type": "string", - "title": "First Name" + "title": "First Name", + "maxLength": 100 }, "lastName": { "type": "string", - "title": "Last Name" + "title": "Last Name", + "maxLength": 100 }, - "status": { + "note": { "type": "string", - "title": "Status" - } + "title": "Note", + "maxLength": 100 + } }, "required": [ "email"