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 {