middleware

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2025 License: Apache-2.0 Imports: 14 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 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 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