passwordhelpers

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ValidatePasswordCriteriaValid                  = iota
	ValidatePasswordCriteriaTooShort               = iota
	ValidatePasswordCriteriaMissingLowerCaseLetter = iota
	ValidatePasswordCriteriaMissingUpperCaseLetter = iota
	ValidatePasswordCriteriaMissingDigit           = iota
	ValidatePasswordCriteriaMissingSymbol          = iota
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BCryptPasswordHasher

type BCryptPasswordHasher struct{}

func (BCryptPasswordHasher) ComparePasswords

func (BCryptPasswordHasher) ComparePasswords(hash []byte, password string) error

func (BCryptPasswordHasher) HashPassword

func (BCryptPasswordHasher) HashPassword(password string) ([]byte, error)

type ConfigPasswordCriteriaValidator

type ConfigPasswordCriteriaValidator struct{}

func (ConfigPasswordCriteriaValidator) ValidatePasswordCriteria

func (ConfigPasswordCriteriaValidator) ValidatePasswordCriteria(password string) ValidatePasswordCriteriaError

type PasswordCriteriaValidator

type PasswordCriteriaValidator interface {
	// ValidatePasswordCriteria validates the password meets the minimum complexity criteria.
	ValidatePasswordCriteria(password string) ValidatePasswordCriteriaError
}

type PasswordHasher

type PasswordHasher interface {
	// HashPassword hashes the passwords and returns the hash and any errors.
	HashPassword(password string) ([]byte, error)

	// ComparePasswords compares a password hash and a plain text password.
	// Returns nil if equal and any other errors.
	ComparePasswords(hash []byte, password string) error
}

type ValidatePasswordCriteriaError

type ValidatePasswordCriteriaError struct {

	// Status is an int that describes the type of error.
	Status int
	// contains filtered or unexported fields
}

func CreateValidatePasswordCriteriaError

func CreateValidatePasswordCriteriaError(status int, message string) ValidatePasswordCriteriaError

CreateValidatePasswordCriteriaError creates a ValidatePasswordCriteriaError with the provided status and error message.

func CreateValidatePasswordCriteriaValid

func CreateValidatePasswordCriteriaValid() ValidatePasswordCriteriaError

CreateValidatePasswordCriteriaValid creates a ValidatePasswordCriteriaError with a ValidatePasswordCriteriaValid status and nil err.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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