manager

package
v0.0.0-...-32bdac0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NoPasswordErr       = errors.New("Invalid password key. The password doesn't exist")
	PasswordConflictErr = errors.New("Invalid password key. The password already exists")
)
View Source
var (
	UserAlreadyExistsErr = errors.New("user with the same username already exits.")
	UserInvalidErr       = errors.New("Invalid credentials for user authentification.")
)

Functions

func CreateUser

func CreateUser(username string, password string) error

func UserAddPassword

func UserAddPassword(username string, opts PasswordOptions) error

func UserGetPassword

func UserGetPassword(username string, key string) (string, error)

func UserRemovePassword

func UserRemovePassword(username string, key string) error

func UserRenamePassword

func UserRenamePassword(username string, oldKey string, newKey string) error

func ValidateUserCreds

func ValidateUserCreds(username string, password string) error

Types

type PasswordOptions

type PasswordOptions struct {
	Key string `json:"key"`
	generator.Options
}

type UserData

type UserData struct {
	Username  string            `bson:"username"`
	Password  string            `bson:"password"`
	Passwords map[string][]byte `bson:"passwords,omitempty"`
}

Jump to

Keyboard shortcuts

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