apikey

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(name string, location string, paramName string, value string, logger contract.Logger) contract.Security

New creates a new API Key security scheme.

Types

type Cookie struct {
	Security
}

Cookie represents an API token security which expects a token as a header value.

func (Cookie) Enrich

func (sec Cookie) Enrich(req *http.Request, log contract.Logger)

Enrich adds an API key to the request's headers.

type Header struct {
	Security
}

Header represents an API token security which expects a token as a header value.

func (Header) Enrich

func (sec Header) Enrich(req *http.Request, log contract.Logger)

Enrich adds an API key to the request's headers.

type Query

type Query struct {
	Security
}

Query represents an API token security which expects a token as a query parameter.

func (Query) Enrich

func (sec Query) Enrich(req *http.Request, log contract.Logger)

Enrich adds an API key to the request's query.

type Security

type Security struct {
	Name      string
	ParamName string
	Value     string
	Log       contract.Logger
}

Security implements the security type that requires a unique API key to be present in each API request. The exact location of the key is implemented corresponding classes.

func (Security) GetName

func (sec Security) GetName() string

GetName returns name.

Jump to

Keyboard shortcuts

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