Documentation
¶
Index ¶
- func APIKeyAuthMiddleware(cfg *config.Configuration, secretService service.SecretService, ...) gin.HandlerFunc
- func AuthenticateMiddleware(cfg *config.Configuration, secretService service.SecretService, ...) gin.HandlerFunc
- func CORSMiddleware(c *gin.Context)
- func ErrorHandler() gin.HandlerFunc
- func GuestAuthenticateMiddleware(c *gin.Context)
- func RequestIDMiddleware(c *gin.Context)
- func SentryMiddleware(cfg *config.Configuration) gin.HandlerFunc
- type ErrorDetail
- type ErrorResponse
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 ErrorHandler ¶
func ErrorHandler() gin.HandlerFunc
ErrorHandler middleware handles error responses
func GuestAuthenticateMiddleware ¶
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 SentryMiddleware ¶
func SentryMiddleware(cfg *config.Configuration) gin.HandlerFunc
SentryMiddleware returns a middleware that captures errors and performance data
Types ¶
type ErrorDetail ¶
type ErrorDetail struct {
Display string `json:"message"`
Details map[string]any `json:"details,omitempty"`
}
ErrorDetail contains error information
type ErrorResponse ¶
type ErrorResponse struct {
Success bool `json:"success"`
Error ErrorDetail `json:"error"`
}
ErrorResponse represents the standard error response structure