handlers

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BearerTokenExtractor = &jwtrequest.PostExtractionFilter{
	Extractor: jwtrequest.MultiExtractor{
		jwtrequest.HeaderExtractor{"Authorization"},
		jwtrequest.ArgumentExtractor{"access_token"},
	},
	Filter: stripPrefixFromTokenString("bearer"),
}

BearerTokenExtractor extracts a bearer token in format "bearer THETOKEN" from Authorization header Uses PostExtractionFilter to strip "Bearer " prefix from header

View Source
var TokenExtractor = &jwtrequest.PostExtractionFilter{
	Extractor: jwtrequest.MultiExtractor{
		jwtrequest.HeaderExtractor{"Authorization"},
		jwtrequest.ArgumentExtractor{"access_token"},
	},
	Filter: stripPrefixFromTokenString("token"),
}

TokenExtractor extracts a token in format "token THETOKEN" from Authorization header Uses PostExtractionFilter to strip "token " prefix from header

Functions

func NewAuthHandler

func NewAuthHandler(logger *zap.Logger, configstoreClient *csapi.Client, adminToken string, sd *common.TokenSigningData, required bool) func(http.Handler) http.Handler

func NewMaxBytesHandler

func NewMaxBytesHandler(h http.Handler, n int64) *maxBytesHandler

func NewWebBundleHandlerFunc

func NewWebBundleHandlerFunc(gatewayURL string) func(w http.ResponseWriter, r *http.Request)

Types

type AuthHandler

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

func (*AuthHandler) ServeHTTP

func (h *AuthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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