reproxy

package
v0.21.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package reproxy contains a handler for re-proxying traffic through the http controlplane.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

The Handler looks for an X-Pomerium-Reproxy-Policy header and if found re-proxies the request upstream to the destination.

This is used to forward requests to Kubernetes with headers split to multiple values instead of coalesced via a comma. (https://github.com/kubernetes/kubernetes/issues/94683) If the upstream issue is fixed we will remove this.

func New

func New() *Handler

New creates a new Handler.

func (*Handler) GetPolicyIDFromHeaders

func (h *Handler) GetPolicyIDFromHeaders(headers http.Header) (uint64, bool)

GetPolicyIDFromHeaders gets a policy id from http headers. If no policy id is found or the HMAC isn't valid, false will be returned.

func (*Handler) GetPolicyIDHeaders

func (h *Handler) GetPolicyIDHeaders(policyID uint64) [][2]string

GetPolicyIDHeaders returns http headers for the given policy id.

func (*Handler) Middleware

func (h *Handler) Middleware(next http.Handler) http.Handler

Middleware returns an HTTP middleware for handling reproxying.

func (*Handler) Update

func (h *Handler) Update(ctx context.Context, cfg *config.Config)

Update updates the handler with new configuration.

Jump to

Keyboard shortcuts

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