From 13ec15d2bb88c252f0d55619f1d18d008dad93d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A6=88=EB=88=85?= Date: Mon, 23 Jan 2023 07:25:11 +0900 Subject: [PATCH] [chore] extending maximumPasswordLength to 256 (#1372) * [chore] extending maximumPasswordLength to 256 Resolves: #1365 * Make long test longer --- internal/validate/formvalidation.go | 2 +- internal/validate/formvalidation_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/validate/formvalidation.go b/internal/validate/formvalidation.go index da81c4666..48e0b7015 100644 --- a/internal/validate/formvalidation.go +++ b/internal/validate/formvalidation.go @@ -32,7 +32,7 @@ ) const ( - maximumPasswordLength = 64 + maximumPasswordLength = 256 minimumPasswordEntropy = 60 // dictates password strength. See https://github.com/wagslane/go-password-validator minimumReasonLength = 40 maximumReasonLength = 500 diff --git a/internal/validate/formvalidation_test.go b/internal/validate/formvalidation_test.go index 531545098..61f505412 100644 --- a/internal/validate/formvalidation_test.go +++ b/internal/validate/formvalidation_test.go @@ -39,7 +39,7 @@ func (suite *ValidationTestSuite) TestCheckPasswordStrength() { shortPassword := "Ok12" specialPassword := "Ok12%" longPassword := "thisisafuckinglongpasswordbutnospecialchars" - tooLong := "Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Quisque a enim nibh. Vestibulum bibendum leo ac porttitor auctor." + tooLong := "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed euismod, ante id iaculis suscipit, nibh nibh varius enim, eget euismod augue augue eget mi. Praesent tincidunt, ex id finibus congue, enim nunc euismod nulla, id tincidunt ipsum neque at nunc. Sed id convallis libero. Sed euismod augue augue eget mi. Praesent tincidunt, ex id finibus congue, enim nunc euismod nulla, id tincidunt ipsum neque at nunc. Sed id convallis libero. Sed euismod augue augue eget mi. Praesent tincidunt, ex id finibus congue, enim nunc euismod nulla, id tincidunt ipsum neque at nunc." strongPassword := "3dX5@Zc%mV*W2MBNEy$@" var err error @@ -75,7 +75,7 @@ func (suite *ValidationTestSuite) TestCheckPasswordStrength() { err = validate.NewPassword(tooLong) if assert.Error(suite.T(), err) { - assert.Equal(suite.T(), errors.New("password should be no more than 64 chars"), err) + assert.Equal(suite.T(), errors.New("password should be no more than 256 chars"), err) } err = validate.NewPassword(strongPassword)