apikey

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	KeySource      token.Source      `json:"keySource"`
	Keys           []Key             `json:"keys"`
	ForwardHeaders map[string]string `json:"forwardHeaders"`
}

Config configures an API key ACP handler.

type Handler

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

Handler is an API Key ACP Handler.

func NewHandler

func NewHandler(cfg *Config, name string) (*Handler, error)

NewHandler creates a new API key ACP Handler.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(rw http.ResponseWriter, req *http.Request)

type Key

type Key struct {
	ID       string            `json:"id"`
	Metadata map[string]string `json:"metadata"`
	Value    string            `json:"value"`
}

Key defines an API key.

Jump to

Keyboard shortcuts

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