auth

package
v1.18.2 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: BSD-3-Clause Imports: 17 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrExpiry = errors.New("expiry duration must be a positive number")
View Source
var ErrTokenExpired = errors.New("token expired")

Functions

func New

func New(encryptionKey, passwordHash string, logger log.Logger) (*authenticator, error)

func PermissionCheckHandler

func PermissionCheckHandler(auth auth) func(h http.Handler) http.Handler

Types

type Authenticator

type Authenticator interface {
	Authorize(string) bool
	GenerateKey(string, time.Duration) (string, error)
	RefreshKey(string, time.Duration) (string, error)
	Enforce(string, string, string) (bool, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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