auth

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package auth_middleware provides HTTP middleware for JWT authentication verification. It validates GitlabZoektAPIRequestHeader containing Bearer tokens and logs warnings when tokens are missing or invalid.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Auth          *authentication.Auth
	Logger        *slog.Logger
	ExcludedPaths []string // Paths that don't require authentication (e.g., /health, /metrics)
	Enabled       bool     // Whether JWT verification is enabled
}

Config holds the configuration for the JWT authentication middleware

func (*Config) Middleware

func (c *Config) Middleware() func(next http.Handler) http.Handler

Middleware returns an HTTP middleware that verifies JWT tokens in GitlabZoektAPIRequestHeader

Jump to

Keyboard shortcuts

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