mirror of
1
Fork 0

[chore] extending maximumPasswordLength to 256 (#1372)

* [chore] extending maximumPasswordLength to 256

Resolves: #1365

* Make long test longer
This commit is contained in:
즈눅 2023-01-23 07:25:11 +09:00 committed by GitHub
parent 0ceacd7b1d
commit 13ec15d2bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -32,7 +32,7 @@ import (
) )
const ( const (
maximumPasswordLength = 64 maximumPasswordLength = 256
minimumPasswordEntropy = 60 // dictates password strength. See https://github.com/wagslane/go-password-validator minimumPasswordEntropy = 60 // dictates password strength. See https://github.com/wagslane/go-password-validator
minimumReasonLength = 40 minimumReasonLength = 40
maximumReasonLength = 500 maximumReasonLength = 500

View File

@ -39,7 +39,7 @@ func (suite *ValidationTestSuite) TestCheckPasswordStrength() {
shortPassword := "Ok12" shortPassword := "Ok12"
specialPassword := "Ok12%" specialPassword := "Ok12%"
longPassword := "thisisafuckinglongpasswordbutnospecialchars" 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$@" strongPassword := "3dX5@Zc%mV*W2MBNEy$@"
var err error var err error
@ -75,7 +75,7 @@ func (suite *ValidationTestSuite) TestCheckPasswordStrength() {
err = validate.NewPassword(tooLong) err = validate.NewPassword(tooLong)
if assert.Error(suite.T(), err) { 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) err = validate.NewPassword(strongPassword)