middlewares

package
v1.24.2 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceTokenHeader = "gitlab-iam-auth-token"

ServiceTokenHeader is the metadata key (gRPC) / HTTP header name that service-to-service callers of the auth service present their token under.

Variables

This section is empty.

Functions

func CorsHandler

func CorsHandler(next http.Handler, cfg config.CORSConfig) http.Handler

func ServiceTokenAuth

func ServiceTokenAuth(next http.Handler, tokens ...string) http.Handler

ServiceTokenAuth returns middleware that validates the service token header. It wraps a handler and rejects requests where the header value does not match any of the expected tokens using constant-time comparison. Empty token values are ignored, allowing optional tokens (e.g. next_service_token) to be unset.

Types

This section is empty.

Jump to

Keyboard shortcuts

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