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
Click to show internal directories.
Click to hide internal directories.