contexthandler

package
v0.0.0-...-fb7f86c Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package contexthandler contains the ContextHandler service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyWithReqContext

func CopyWithReqContext(ctx context.Context) context.Context

CopyWithReqContext returns a copy of the parent context with a semi-shallow copy of the ReqContext as a value. The ReqContexts's *web.Context is deep copied so that headers are thread-safe; additional properties are shallow copied and should be treated as read-only.

func FromContext

func FromContext(c context.Context) *contextmodel.ReqContext

FromContext returns the ReqContext value stored in a context.Context, if any.

func WithAuthHTTPHeaders

func WithAuthHTTPHeaders(ctx context.Context, cfg *setting.Cfg) context.Context

WithAuthHTTPHeaders returns a new context in which all possible configured auth header will be included and later retrievable by AuthHTTPHeaderListFromContext.

Types

type AuthHTTPHeaderList

type AuthHTTPHeaderList struct {
	Items []string
}

AuthHTTPHeaderList used to record HTTP headers that being when verifying authentication of an incoming HTTP request.

func AuthHTTPHeaderListFromContext

func AuthHTTPHeaderListFromContext(c context.Context) *AuthHTTPHeaderList

AuthHTTPHeaderListFromContext returns the AuthHTTPHeaderList in a context.Context, if any, and will include any HTTP headers used when verifying authentication of an incoming HTTP request.

type ContextHandler

type ContextHandler struct {
	Cfg *setting.Cfg
	// contains filtered or unexported fields
}

ContextHandler is a middleware.

func ProvideService

func ProvideService(cfg *setting.Cfg, tracer tracing.Tracer, features *featuremgmt.FeatureManager, authnService authn.Service,
) *ContextHandler

func (*ContextHandler) Middleware

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

Middleware provides a middleware to initialize the request context.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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