authbp

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidatePassword

func ValidatePassword(password string) error

ValidatePassword checks the strength of a password by ensuring it meets certain criteria:

  • password is not empty;

  • password is at least 8 characters long;

  • password contains at least one uppercase letter;

  • password contains at least one lowercase letter;

  • password contains at least one digit;

  • password contains at least one special character (punctuation or symbol).

Types

type AccessTokenProvider

type AccessTokenProvider interface {
	Create(claims map[string]interface{}) (string, error)
	Verify(token []byte) (jwt.Token, error)
}

func NewJWTTokenProvider

func NewJWTTokenProvider(privateKey, issuer string) AccessTokenProvider

type PasswordProvider

type PasswordProvider interface {
	Generate(password string) (string, error)
	Compare(password, encodedHash string) (bool, error)
}

func NewArgonPasswordProvider

func NewArgonPasswordProvider(
	memory uint32, iterations uint32, parallelism uint8, saltLength uint32, keyLength uint32,
) PasswordProvider

func NewBcryptPasswordProvider

func NewBcryptPasswordProvider(cost int) PasswordProvider

type RefreshTokenProvider

type RefreshTokenProvider interface {
	Create() (string, error)
}

func NewCryptoRefreshTokenProvider

func NewCryptoRefreshTokenProvider() RefreshTokenProvider

Jump to

Keyboard shortcuts

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