http

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTokenFilter

func NewTokenFilter(config TokenFilterConfig) libHTTP.Filter

NewTokenFilter returns a component that implements the http.Filter interface and can conditionally allow or disallow a request on the basis of a recognized token having been provided.

func ValidateEventSource

func ValidateEventSource(w http.ResponseWriter, r *http.Request)

ValidateEventSource responds to HTTP OPTIONS requests sent by a CloudEvents 1.0 source as part of the spec's abuse protection scheme.

Types

type TokenFilterConfig

type TokenFilterConfig interface {
	// AddToken adds a token to the TokenFilterConfig implementation's instance's
	// internal list of tokens. Implementations MUST hash the provided token
	// before addition to the list so that plain text tokens do not float around
	// in memory long-term.
	AddToken(string)
	// contains filtered or unexported methods
}

TokenFilterConfig is the interface for a component that encapsulates token filter configuration.

func NewTokenFilterConfig

func NewTokenFilterConfig() TokenFilterConfig

NewTokenFilterConfig returns an initialized implementation of the TokenFilterConfig interface.

Jump to

Keyboard shortcuts

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