auth

package
v0.0.0-...-dee3174 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIKeyMiddleware

type APIKeyMiddleware struct {
	Path string
	// contains filtered or unexported fields
}

APIKeyMiddleware is a simplified shared secret authentication for api requests

func (*APIKeyMiddleware) InitializeKey

func (akm *APIKeyMiddleware) InitializeKey(key string)

InitializeKey will load a hash that could be safely persisted instead of the actual key

func (*APIKeyMiddleware) KeyIsValid

func (akm *APIKeyMiddleware) KeyIsValid(userAPIKey string) bool

KeyIsValid checks that userAPIKey matches userAPIKey hash

func (*APIKeyMiddleware) Middleware

func (akm *APIKeyMiddleware) Middleware(next http.Handler) http.Handler

Middleware function, which will be called for each api request

Jump to

Keyboard shortcuts

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