mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-12-22 10:12:11 +00:00
[chore] extending maximumPasswordLength to 256 (#1372)
* [chore] extending maximumPasswordLength to 256 Resolves: #1365 * Make long test longer
This commit is contained in:
parent
0ceacd7b1d
commit
13ec15d2bb
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue