password

package
v0.30.93 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidCredentialsOption = errors.New("invalid credentials option")
	ErrInvalidUsername          = errors.New("invalid username option")
	ErrInvalidPassword          = errors.New("invalid password option")
	ErrMissingUsername          = errors.New("missing username")
	ErrMissingPassword          = errors.New("missing password")
)

Functions

func Feature added in v0.30.36

func Feature(config ...func(*Installer)) setup.Feature

Types

type Installer added in v0.30.36

type Installer struct{}

Installer enables user/password authentication.

func (*Installer) Install added in v0.30.36

func (i *Installer) Install(b *setup.Builder) error

type LoginModule

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

LoginModule authenticates a subject with username and password.

func (*LoginModule) Constructor added in v0.30.36

func (l *LoginModule) Constructor(
	_ *struct {
		creates.It `key:"login.pwd"`
	},
	verifiers []Verifier,
)

func (*LoginModule) Init added in v0.30.36

func (l *LoginModule) Init(opts map[string]any) error

func (*LoginModule) Login added in v0.30.36

func (l *LoginModule) Login(
	subject security.Subject,
	handler miruken.Handler,
) error

func (*LoginModule) Logout added in v0.30.36

func (l *LoginModule) Logout(
	subject security.Subject,
	handler miruken.Handler,
) error

type Map added in v0.30.36

type Map map[string][]byte

Map is a Verifier backed by a map of username and passwords.

func (Map) VerifyPassword added in v0.30.36

func (m Map) VerifyPassword(username string, password []byte) bool

type Verifier added in v0.30.36

type Verifier interface {
	VerifyPassword(username string, password []byte) bool
}

Verifier checks the password for a username.

Jump to

Keyboard shortcuts

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