password

package
v1.22.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2024 License: MIT Imports: 12 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrComplexity = errors.New("password not complex enough")
	ErrMinLength  = errors.New("password not long enough")
)
View Source
var ErrIsPwned = errors.New("password has been pwned")

Functions

func BuildComplexityError

func BuildComplexityError(locale translation.Locale) template.HTML

BuildComplexityError builds the error message when password complexity checks fail

func Generate

func Generate(n int) (string, error)

Generate a random password

func IsComplexEnough

func IsComplexEnough(pwd string) bool

IsComplexEnough return True if password meets complexity settings

func IsErrIsPwnedRequest added in v1.22.0

func IsErrIsPwnedRequest(err error) bool

func IsPwned

func IsPwned(ctx context.Context, password string) error

IsPwned checks whether a password has been pwned If a password has not been pwned, no error is returned.

func NewComplexity

func NewComplexity()

NewComplexity for preparation

Types

type ErrIsPwnedRequest added in v1.22.0

type ErrIsPwnedRequest struct {
	// contains filtered or unexported fields
}

func (ErrIsPwnedRequest) Error added in v1.22.0

func (err ErrIsPwnedRequest) Error() string

func (ErrIsPwnedRequest) Unwrap added in v1.22.0

func (err ErrIsPwnedRequest) Unwrap() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL