middleware

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package middleware provides a standard set of middleware for pomerium.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CorsBypass added in v0.4.0

func CorsBypass(target http.Handler) func(next http.Handler) http.Handler

CorsBypass is middleware that takes a target handler as a paramater, if the request is determined to be a CORS preflight request, that handler is called instead of the normal handler chain.

func Healthcheck added in v0.0.2

func Healthcheck(endpoint, msg string) func(http.Handler) http.Handler

Healthcheck endpoint middleware useful to setting up a path like `/ping` that load balancers or uptime testing external services can make a request before hitting any routes. It's also convenient to place this above ACL middlewares as well.

https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html

func SetHeaders

func SetHeaders(headers map[string]string) func(next http.Handler) http.Handler

SetHeaders sets a map of response headers.

func StripCookie added in v0.4.0

func StripCookie(cookieName string) func(next http.Handler) http.Handler

StripCookie strips the cookie from the downstram request.

func TimeoutHandlerFunc added in v0.4.0

func TimeoutHandlerFunc(timeout time.Duration, timeoutError string) func(next http.Handler) http.Handler

TimeoutHandlerFunc wraps http.TimeoutHandler

func ValidateRequestURL added in v0.5.1

func ValidateRequestURL(r *http.Request, key string) error

ValidateRequestURL validates the current absolute request URL was signed by a given shared key.

func ValidateSignature

func ValidateSignature(sharedSecret string) func(next http.Handler) http.Handler

ValidateSignature ensures the request is valid and has been signed with the correspdoning client secret key

Types

This section is empty.

Directories

Path Synopsis
Package responsewriter contains helper functions that useful for hooking into various parts of a response.
Package responsewriter contains helper functions that useful for hooking into various parts of a response.

Jump to

Keyboard shortcuts

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