localuser

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPassword

func CheckPassword(username, password string) (err error)

HTTPMiddleware

func Patch added in v2.2.0

func Patch(newConfig ConfigStruct)

func Set added in v2.2.0

func Set(newConfig ConfigStruct)

Types

type ConfigStruct

type ConfigStruct struct {
	Cost  int64             `yaml:"cost" json:"cost,omitempty"` // bcrypt-cost
	Users map[string]string `yaml:"users" json:"users,omitempty"`
}

func (*ConfigStruct) MarshalZerologObject added in v2.2.0

func (c *ConfigStruct) MarshalZerologObject(e *zerolog.Event)

type Middleware

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

func (*Middleware) CheckPassword

func (mdw *Middleware) CheckPassword(username, password string) (err error)

return error of user not exist or password is wrong

to avoid spoofing, we not differe between not existing user and a wrong password

func (*Middleware) Init

func (mdw *Middleware) Init()

func (*Middleware) Patch added in v2.2.0

func (mdw *Middleware) Patch(newConfig ConfigStruct)

func (*Middleware) Set added in v2.2.0

func (mdw *Middleware) Set(newConfig ConfigStruct)

Jump to

Keyboard shortcuts

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