mhttp

package
v0.0.0-...-2a6dfc0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAuthHandler

func NewAuthHandler(mesh *meshauth.Mesh, mux *http.ServeMux) http.Handler

Types

type AuthHandlerWrapper

type AuthHandlerWrapper struct {
	// Original handler
	Handler http.Handler

	// Authn function
	Auth *oidc.Authn

	// The wrapper will use this to log events and errors.
	Logger *slog.Logger
}

Handler wraps another handler with authn and authz functions.

With otel, this is already wrapped in a telemetry wrapper, ctx can be used for tracing. The otel http instrumentation currently doesn't allow other interactions.

func (*AuthHandlerWrapper) ServeHTTP

func (h *AuthHandlerWrapper) ServeHTTP(writer http.ResponseWriter, request *http.Request)

Entry point for H1, H2 - will delegate to the real handler after authenticating. Also keeps track of the request time and logs the request.

Jump to

Keyboard shortcuts

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