auth

package
v0.0.0-...-d498c5e Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotOpen         = errors.New("AuthModule not ready")
	ErrNotFound        = errors.New("user id not found")
	ErrEmptyLine       = errors.New("Empty password line")
	ErrInvalidHashCost = errors.New("password line has an invalid hash cost")
	ErrCorruptLine     = errors.New("passwd line is corrupt")
	ErrInvalidUser     = errors.New("Invalid user")
	ErrCustnumExists   = errors.New("userid already exists")
)

Functions

This section is empty.

Types

type Auth

type Auth struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewAuthModule

func NewAuthModule(fpath string) (*Auth, error)

func (*Auth) AddUser

func (a *Auth) AddUser(custnum uint64, passwd string, cost int) (err error)

func (*Auth) Authenticate

func (a *Auth) Authenticate(custnum, passwd string) (cid uint64, err error)

func (*Auth) ChangePassword

func (a *Auth) ChangePassword(custnum uint64, passwd string) (err error)

func (*Auth) DeleteUser

func (a *Auth) DeleteUser(custnum uint64) (err error)

func (*Auth) List

func (a *Auth) List() (uhs []userHash, err error)

List returns a list of current users

Jump to

Keyboard shortcuts

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