auth

package
v0.0.0-...-4ecb97e Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OptAllowAll option = iota
	OptAuthenticatedUser
	OptOnlyAdmin
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth interface {
	Middleware() func(http.Handler) http.Handler
	GenerateToken(userID string) (string, error)
	UserFromContext(ctx context.Context, authOpt option) (db.User, error)
}

func NewAuth

func NewAuth(dbal db.Dbal, log logger.Logger, signKey string, tokenDuration int) (Auth, error)

Jump to

Keyboard shortcuts

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