common

package
v11.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// XForwardedSSL is a non-standard X-Forwarded-* header that is set to "on" or "off" depending on
	// whether SSL is enabled.
	XForwardedSSL = "X-Forwarded-Ssl"
)

Variables

ReservedHeaders is a list of headers injected by Teleport.

Functions

func IsReservedHeader

func IsReservedHeader(header string) bool

IsReservedHeader returns true if the provided header is one of headers injected by Teleport.

func WithSessionContext

func WithSessionContext(r *http.Request, sessionCtx *SessionContext) *http.Request

WithSessionContext adds session context to provided request.

Types

type HeaderRewriter

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

HeaderRewriter delegates to oxy's rewriter and then appends its own headers.

func NewHeaderRewriter

func NewHeaderRewriter(delegates ...forward.ReqRewriter) *HeaderRewriter

NewHeaderRewriter will create a new header rewriter with a number of delegates. The delegates will be executed in the order supplied

func (*HeaderRewriter) Rewrite

func (hr *HeaderRewriter) Rewrite(req *http.Request)

Rewrite will delegate to the supplied delegates' rewrite functions and then inject its own headers.

type SessionContext

type SessionContext struct {
	// Identity is the requested identity.
	Identity *tlsca.Identity
	// App is the requested identity.
	App types.Application
	// Emitter is the audit log emitter.
	Emitter events.Emitter
}

SessionContext contains common context parameters for an App session.

func GetSessionContext

func GetSessionContext(r *http.Request) (*SessionContext, error)

GetSessionContext retrieves the session context from a request.

Jump to

Keyboard shortcuts

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