Skip to content

Commit

Permalink
[STORY-648] feat: raise DB user passwords minimum length to 24
Browse files Browse the repository at this point in the history
  • Loading branch information
sc-david-voisin committed Sep 16, 2024
1 parent ddc1542 commit b5375cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion db/users/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func CreateUser(ctx context.Context, app, addonUUID, username string, readonly b
isPasswordGenerated := false
if password == "" {
isPasswordGenerated = true
password = gopassword.Generate(64)
password = gopassword.Generate()
confirmedPassword = password
}

Expand Down
4 changes: 2 additions & 2 deletions db/users/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ func isPasswordValid(password, confirmedPassword string) (string, bool) {
if password != confirmedPassword {
return "Password confirmation doesn't match", false
}
if len(password) < 8 || len(password) > 64 {
return "Password must contain between 8 and 64 characters", false
if len(password) < 24 || len(password) > 64 {
return "Password must contain between 24 and 64 characters", false
}
return "", true
}
Expand Down

0 comments on commit b5375cd

Please sign in to comment.