middlewares

package
v0.0.0-...-629ae5f Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package middlewares contains HTTP middlewares used across the gateway.

Package middlewares contains HTTP middlewares used across the gateway.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Auth

func Auth(
	logger *slog.Logger,
	jwtSecret string,
) func(http.Handler) http.Handler

Auth parses the session cookie and injects user claims.

func BasicAuth

func BasicAuth(
	logger *slog.Logger,
	creds config.SecurityConfig,
	userService *user.Service,
) func(http.Handler) http.Handler

BasicAuth inspects the Authorization header for Basic scheme and, if present, validates against the configured username/password.

func Recover

func Recover(logger *slog.Logger) func(http.Handler) http.Handler

Recover wraps a handler with panic recovery and logs the panic using slog.

func Tag

func Tag() func(http.Handler) http.Handler

Tag injects parameters in context for tracing.

Types

This section is empty.

Jump to

Keyboard shortcuts

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