Documentation ¶
Overview ¶
Package contexthandler contains the ContextHandler service.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyWithReqContext ¶
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.
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 ¶
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.