commit 13ec15d2bb88c252f0d55619f1d18d008dad93d8
parent 0ceacd7b1d0b03e3da1d552aa0bbbe7037e57e90
Author: 즈눅 <xnuk@users.noreply.github.com>
Date: Mon, 23 Jan 2023 07:25:11 +0900
[chore] extending maximumPasswordLength to 256 (#1372)
* [chore] extending maximumPasswordLength to 256
Resolves: #1365
* Make long test longer
Diffstat:
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/internal/validate/formvalidation.go b/internal/validate/formvalidation.go
@@ -32,7 +32,7 @@ import (
)
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
@@ -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)