diff --git a/internal/db/migrations/postgres.gen.go b/internal/db/migrations/postgres.gen.go index 2471f25260..dadc4e0e3e 100644 --- a/internal/db/migrations/postgres.gen.go +++ b/internal/db/migrations/postgres.gen.go @@ -1705,7 +1705,7 @@ begin; description text, create_time wt_timestamp, update_time wt_timestamp, - min_user_name_length int not null default 5, + min_user_name_length int not null default 3, min_password_length int not null default 8, foreign key (scope_id, public_id) references auth_method (scope_id, public_id) diff --git a/internal/db/migrations/postgres/12_auth_password.up.sql b/internal/db/migrations/postgres/12_auth_password.up.sql index 858c77bf14..44df77d708 100644 --- a/internal/db/migrations/postgres/12_auth_password.up.sql +++ b/internal/db/migrations/postgres/12_auth_password.up.sql @@ -64,7 +64,7 @@ begin; description text, create_time wt_timestamp, update_time wt_timestamp, - min_user_name_length int not null default 5, + min_user_name_length int not null default 3, min_password_length int not null default 8, foreign key (scope_id, public_id) references auth_method (scope_id, public_id) diff --git a/internal/servers/controller/handlers/authmethods/authmethod_service_test.go b/internal/servers/controller/handlers/authmethods/authmethod_service_test.go index 6d2ca67e96..16cc92ddc6 100644 --- a/internal/servers/controller/handlers/authmethods/authmethod_service_test.go +++ b/internal/servers/controller/handlers/authmethods/authmethod_service_test.go @@ -45,7 +45,7 @@ func TestGet(t *testing.T) { Type: "password", Attributes: &structpb.Struct{Fields: map[string]*structpb.Value{ "min_password_length": structpb.NewNumberValue(8), - "min_user_name_length": structpb.NewNumberValue(5), + "min_user_name_length": structpb.NewNumberValue(3), }}, Scope: &scopes.ScopeInfo{ Id: o.GetPublicId(), @@ -125,7 +125,7 @@ func TestList(t *testing.T) { Type: "password", Attributes: &structpb.Struct{Fields: map[string]*structpb.Value{ "min_password_length": structpb.NewNumberValue(8), - "min_user_name_length": structpb.NewNumberValue(5), + "min_user_name_length": structpb.NewNumberValue(3), }}, }) } @@ -140,7 +140,7 @@ func TestList(t *testing.T) { Type: "password", Attributes: &structpb.Struct{Fields: map[string]*structpb.Value{ "min_password_length": structpb.NewNumberValue(8), - "min_user_name_length": structpb.NewNumberValue(5), + "min_user_name_length": structpb.NewNumberValue(3), }}, }) } @@ -313,7 +313,7 @@ func TestCreate(t *testing.T) { Type: "password", Attributes: &structpb.Struct{Fields: map[string]*structpb.Value{ "min_password_length": structpb.NewNumberValue(8), - "min_user_name_length": structpb.NewNumberValue(5), + "min_user_name_length": structpb.NewNumberValue(3), }}, }, }, @@ -371,7 +371,7 @@ func TestCreate(t *testing.T) { Type: "password", Attributes: &structpb.Struct{Fields: map[string]*structpb.Value{ "invalid_field": structpb.NewStringValue("invalid_value"), - "min_user_name_length": structpb.NewNumberValue(5), + "min_user_name_length": structpb.NewNumberValue(3), }}, }}, res: nil, @@ -465,7 +465,7 @@ func TestUpdate(t *testing.T) { Type: "password", Attributes: &structpb.Struct{Fields: map[string]*structpb.Value{ "min_password_length": structpb.NewNumberValue(8), - "min_user_name_length": structpb.NewNumberValue(5), + "min_user_name_length": structpb.NewNumberValue(3), }}, }, }, @@ -489,7 +489,7 @@ func TestUpdate(t *testing.T) { Type: "password", Attributes: &structpb.Struct{Fields: map[string]*structpb.Value{ "min_password_length": structpb.NewNumberValue(8), - "min_user_name_length": structpb.NewNumberValue(5), + "min_user_name_length": structpb.NewNumberValue(3), }}, }, }, @@ -543,7 +543,7 @@ func TestUpdate(t *testing.T) { Type: "password", Attributes: &structpb.Struct{Fields: map[string]*structpb.Value{ "min_password_length": structpb.NewNumberValue(8), - "min_user_name_length": structpb.NewNumberValue(5), + "min_user_name_length": structpb.NewNumberValue(3), }}, }, }, @@ -567,7 +567,7 @@ func TestUpdate(t *testing.T) { Type: "password", Attributes: &structpb.Struct{Fields: map[string]*structpb.Value{ "min_password_length": structpb.NewNumberValue(8), - "min_user_name_length": structpb.NewNumberValue(5), + "min_user_name_length": structpb.NewNumberValue(3), }}, }, }, @@ -591,7 +591,7 @@ func TestUpdate(t *testing.T) { Type: "password", Attributes: &structpb.Struct{Fields: map[string]*structpb.Value{ "min_password_length": structpb.NewNumberValue(8), - "min_user_name_length": structpb.NewNumberValue(5), + "min_user_name_length": structpb.NewNumberValue(3), }}, }, },