middleware

package
v1.0.30 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2025 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIKeyAuthMiddleware

func APIKeyAuthMiddleware(cfg *config.Configuration, secretService service.SecretService, logger *logger.Logger) gin.HandlerFunc

APIKeyAuthMiddleware is a middleware that only allows requests with valid API keys

func AuthenticateMiddleware

func AuthenticateMiddleware(cfg *config.Configuration, secretService service.SecretService, logger *logger.Logger) gin.HandlerFunc

AuthenticateMiddleware is a middleware that authenticates requests based on either: 1. JWT token in the Authorization header as a Bearer token 2. API key in the x-api-key header (or configured header name)

func CORSMiddleware

func CORSMiddleware(c *gin.Context)

CORSMiddleware handles CORS headers

func EnvAccessMiddleware added in v1.0.18

func EnvAccessMiddleware(envAccessService service.EnvAccessService, logger *logger.Logger) gin.HandlerFunc

EnvAccessMiddleware checks if the user has access to the requested environment

func ErrorHandler

func ErrorHandler() gin.HandlerFunc

ErrorHandler middleware handles error responses

func GuestAuthenticateMiddleware

func GuestAuthenticateMiddleware(c *gin.Context)

GuestAuthenticateMiddleware is a middleware that allows requests without authentication For now it sets a default tenant ID and user ID in the request context

func PyroscopeMiddleware added in v1.0.21

func PyroscopeMiddleware(cfg *config.Configuration) gin.HandlerFunc

PyroscopeMiddleware returns a middleware that adds profiling labels to HTTP requests

func RequestIDMiddleware

func RequestIDMiddleware(c *gin.Context)

func SentryMiddleware

func SentryMiddleware(cfg *config.Configuration) gin.HandlerFunc

SentryMiddleware returns a middleware that captures errors and performance data

Types

This section is empty.

Jump to

Keyboard shortcuts

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