apikeys

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAuth

func CheckAuth(authKeys []string, key string) (result bool, err error)

func NewApiKeysMiddleware

func NewApiKeysMiddleware(o AuthOptions) func(*web.C, http.Handler) http.Handler

func ReadAuthKeys

func ReadAuthKeys(authFile string) []string

Types

type ApiKeysMiddleware

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

func (ApiKeysMiddleware) ServeHTTP

func (a ApiKeysMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request)

type AuthOptions

type AuthOptions struct {
	AuthFile      string
	UnauthMethods []string
	BasicAuth     bool
	SiteName      string
	SitePath      string
}

Jump to

Keyboard shortcuts

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