auth

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnauthorized  = errors.New("unauthorized")
	ErrUnknownDomain = errors.New("unknown domain")
	ErrUnknownUser   = errors.New("unknown user")
)

Functions

This section is empty.

Types

type PermissionTable

type PermissionTable map[string]UserTable

type SimpleUserAuthenticator

type SimpleUserAuthenticator struct {
	Permissions PermissionTable
}

func (*SimpleUserAuthenticator) AddPermission

func (a *SimpleUserAuthenticator) AddPermission(user string, password string, domain string) (err error)

func (*SimpleUserAuthenticator) Load

func (a *SimpleUserAuthenticator) Load(f io.Reader) (err error)

func (*SimpleUserAuthenticator) RemovePermission

func (a *SimpleUserAuthenticator) RemovePermission(user string, domain string) (err error)

func (*SimpleUserAuthenticator) Save

func (a *SimpleUserAuthenticator) Save(w io.Writer) (err error)

func (*SimpleUserAuthenticator) VerifyPermissions

func (a *SimpleUserAuthenticator) VerifyPermissions(user string, password string, domain string) (err error)

type UserAuthenticator

type UserAuthenticator interface {
	VerifyPermissions(user string, password string, domain string) (err error)
}

type UserTable

type UserTable map[string][]byte

Jump to

Keyboard shortcuts

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