auth

package
v0.7.6 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ApiKeyHeader = "X-Api-Key"
View Source
const MessageUnauthorized = `{"message": "request unauthorized"}`

Variables

This section is empty.

Functions

func MAuth

func MAuth(m Manager, logger log.Logger) *middleware.NamedMiddleware

Types

type Key

type Key string

type KeyManager

type KeyManager struct {
	// contains filtered or unexported fields
}

func NewKeyManager

func NewKeyManager(r io.Reader, healthcheckKey string) (*KeyManager, error)

func (*KeyManager) IsAllowed

func (k *KeyManager) IsAllowed(t *token) bool

type Manager

type Manager interface {
	IsAllowed(*token) bool
}

type User

type User struct{}

Jump to

Keyboard shortcuts

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