From 39f97396a761bb09e26e7aa507ce7f17a6788db1 Mon Sep 17 00:00:00 2001 From: Alex Babel <13570439+AlexanderBabel@users.noreply.github.com> Date: Mon, 18 Mar 2024 11:58:21 +0100 Subject: [PATCH] Increase allowed username length to 64 in the default policy (#2471) --- policies/register.rego | 2 +- policies/register_test.rego | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/policies/register.rego b/policies/register.rego index 34ada0216..612308822 100644 --- a/policies/register.rego +++ b/policies/register.rego @@ -19,7 +19,7 @@ violation[{"field": "username", "msg": "username too short"}] { } violation[{"field": "username", "msg": "username too long"}] { - count(input.username) >= 15 + count(input.username) > 64 } violation[{"field": "username", "msg": "username contains invalid characters"}] { diff --git a/policies/register_test.rego b/policies/register_test.rego index 7e4ca3a01..6d1293fdf 100644 --- a/policies/register_test.rego +++ b/policies/register_test.rego @@ -45,7 +45,7 @@ test_short_username { } test_long_username { - not allow with input as {"username": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "registration_method": "upstream-oauth2"} + not allow with input as {"username": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "registration_method": "upstream-oauth2"} } test_invalid_username {