security

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package securityprovider contains some default securityprovider implementations, which can be used as a RequestEditorFn of a client.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAPIKeyInvalidIn indicates a usage of an invalid In.
	// Should be cookie, header or query.
	ErrAPIKeyInvalidIn = errors.New("invalid 'in' specified for apiKey")
)

Functions

func APIKey

func APIKey(in, name, apiKey string) (func(ctx context.Context, req *http.Request) error, error)

ApiKey will attach a generic apiKey for a given name either to a cookie, header or as a query parameter.

func BasicAuth

func BasicAuth(username, password string) func(ctx context.Context, req *http.Request) error

BasicAuth provides a SecurityProvider, which can solve the BasicAuth challenge for api-calls.

func BearerToken

func BearerToken(token string) func(ctx context.Context, req *http.Request) error

BearerToken provides a SecurityProvider, which can solve the Bearer Auth challende for api-calls.

Types

This section is empty.

Jump to

Keyboard shortcuts

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