From 5bf307797bf4d4718c818aa216f505c8e2b519b0 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Fri, 7 Aug 2020 13:38:44 -0400 Subject: [PATCH] Fix typo and also set default min user name length to 3 because jeff, jim, todd, mike --- internal/auth/password/authmethod.go | 2 +- internal/auth/password/authmethod_test.go | 6 +++--- internal/auth/password/errors.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/auth/password/authmethod.go b/internal/auth/password/authmethod.go index 13a2819931..97aa00c089 100644 --- a/internal/auth/password/authmethod.go +++ b/internal/auth/password/authmethod.go @@ -37,7 +37,7 @@ func NewAuthMethod(scopeId string, opt ...Option) (*AuthMethod, error) { ScopeId: scopeId, Name: opts.withName, Description: opts.withDescription, - MinUserNameLength: 5, + MinUserNameLength: 3, MinPasswordLength: 8, }, } diff --git a/internal/auth/password/authmethod_test.go b/internal/auth/password/authmethod_test.go index 7612f0240f..863526e7ba 100644 --- a/internal/auth/password/authmethod_test.go +++ b/internal/auth/password/authmethod_test.go @@ -32,7 +32,7 @@ func TestAuthMethod_New(t *testing.T) { args: args{}, want: &AuthMethod{ AuthMethod: &store.AuthMethod{ - MinUserNameLength: 5, + MinUserNameLength: 3, MinPasswordLength: 8, }, }, @@ -47,7 +47,7 @@ func TestAuthMethod_New(t *testing.T) { want: &AuthMethod{ AuthMethod: &store.AuthMethod{ Name: "test-name", - MinUserNameLength: 5, + MinUserNameLength: 3, MinPasswordLength: 8, }, }, @@ -62,7 +62,7 @@ func TestAuthMethod_New(t *testing.T) { want: &AuthMethod{ AuthMethod: &store.AuthMethod{ Description: "test-description", - MinUserNameLength: 5, + MinUserNameLength: 3, MinPasswordLength: 8, }, }, diff --git a/internal/auth/password/errors.go b/internal/auth/password/errors.go index fae2738681..b98e8a4121 100644 --- a/internal/auth/password/errors.go +++ b/internal/auth/password/errors.go @@ -5,7 +5,7 @@ import "errors" var ( // ErrTooShort results from attempting to set a password which is to // short. - ErrTooShort = errors.New("password to short") + ErrTooShort = errors.New("too short") // ErrUnsupportedConfiguration results from attempting to perform an // operation that sets a password configuration to an unsupported type.