middlewares

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const KeySubdomainRequest = "subdomainRequest"

KeySubdomainRequest indicates if this is a subdomain request

Variables

This section is empty.

Functions

func CORS

func CORS() gin.HandlerFunc

func GZIP

func GZIP() gin.HandlerFunc

func HSTS

func HSTS() gin.HandlerFunc

func IsSubdomainRequest added in v0.6.1

func IsSubdomainRequest(c *gin.Context) bool

func JWTAuth

func JWTAuth(authService *auth.AuthService, allowGuest bool) gin.HandlerFunc

JWTAuth creates a Gin middleware function that validates access tokens. It requires the AuthService to access token validation logic and configuration.

func Logger

func Logger() gin.HandlerFunc

func RateLimiter

func RateLimiter(formattedRate string) gin.HandlerFunc

func SubdomainRewrite added in v0.6.1

func SubdomainRewrite(e *gin.Engine, config *SubdomainRewriteConfig) gin.HandlerFunc

func SubdomainSecurityHeaders added in v0.8.4

func SubdomainSecurityHeaders() gin.HandlerFunc

SubdomainSecurityHeaders adds security headers specifically for subdomain requests

Types

type SubdomainRewriteConfig added in v0.6.1

type SubdomainRewriteConfig struct {
	Domain  string // base domain
	Mapping *datasite.SubdomainMapping
}

Jump to

Keyboard shortcuts

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