fix: passthrough the minimum password length (#5236)

This commit is contained in:
Henrique Dias
2025-06-29 11:28:32 +02:00
committed by GitHub
parent 7354eb6cf9
commit bf37f88c32
11 changed files with 100065 additions and 30 deletions

View File

@@ -1,13 +1,16 @@
package errors
import "errors"
import (
"errors"
"fmt"
)
var (
ErrEmptyKey = errors.New("empty key")
ErrExist = errors.New("the resource already exists")
ErrNotExist = errors.New("the resource does not exist")
ErrEmptyPassword = errors.New("password is empty")
ErrShortPassword = errors.New("password is too short")
ErrEasyPassword = errors.New("password is too easy")
ErrEmptyUsername = errors.New("username is empty")
ErrEmptyRequest = errors.New("empty request")
ErrScopeIsRelative = errors.New("scope is a relative path")
@@ -20,3 +23,11 @@ var (
ErrSourceIsParent = errors.New("source is parent")
ErrRootUserDeletion = errors.New("user with id 1 can't be deleted")
)
type ErrShortPassword struct {
MinimumLength uint
}
func (e ErrShortPassword) Error() string {
return fmt.Sprintf("password is too short, minimum length is %d", e.MinimumLength)
}