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