auth

package
v1.7.7 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAuthFailed = fmt.Errorf("Authentcation failed!")

Functions

This section is empty.

Types

type Authenticator

type Authenticator interface {
	Authenticate(Username, Password) (*User, error)
}

type DebugAuth

type DebugAuth struct{}

func NewDebugAuth

func NewDebugAuth() *DebugAuth

func (DebugAuth) Authenticate

func (d DebugAuth) Authenticate(u Username, p Password) (*User, error)

type Password

type Password string

type User

type User struct {
	Username Username
	ID       UserId
	Role     string
}

type UserId

type UserId string

type Username

type Username string

type UsernamePassword

type UsernamePassword struct{}

func NewUsernamePasswordAuth

func NewUsernamePasswordAuth() *UsernamePassword

func (UsernamePassword) Authenticate

func (up UsernamePassword) Authenticate(username Username, password Password) (*User, error)

Jump to

Keyboard shortcuts

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