middleware

package
v0.0.0-...-ba6faa5 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KubeClientCtxKey    = "kubeClient"
	DynamicClientCtxKey = "dynClient"
	TokenCtxKey         = "token"
)
View Source
const (
	LoggerCtxKey = "logger"
)
View Source
const (
	WebsocketTokenHeader = "Sec-Websocket-Protocol"
)

Variables

This section is empty.

Functions

func LoggerMiddleware

func LoggerMiddleware(baseLogger *zap.Logger) gin.HandlerFunc

LoggerMiddleware is a middleware that initializes a logger and sets it in the request context. The logger is initialized with a default "unknown" user. This middleware should be applied globally to ensure the logger is available in the context for all requests.

func TokenAuthMiddleware

func TokenAuthMiddleware(tokenProvider auth.TokenProvider, scheme *runtime.Scheme) gin.HandlerFunc

TokenAuthMiddleware validates the Authorization header and sets up Kubernetes client.

Types

This section is empty.

Jump to

Keyboard shortcuts

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