auth

package
v0.0.0-...-d3bc976 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: GPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithUser

func ContextWithUser[T any](ctx context.Context, user T) context.Context

func UserFromContext

func UserFromContext[T any](ctx context.Context) (T, bool)

Types

type Authenticator

type Authenticator interface {
	Verify(user string, pass string) bool
	Users() []string
}

func NewAuthenticator

func NewAuthenticator(users []User) Authenticator

type User

type User struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

Jump to

Keyboard shortcuts

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