middleware

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthMiddleware

func AuthMiddleware(deps *app.RuntimeDeps) gin.HandlerFunc

AuthMiddleware validates JWT tokens and sets user identity context. Assumes ContextMiddleware has already set requestID, traceID, and tenantID.

func PermissionMiddleware

func PermissionMiddleware(requiredPermission string) gin.HandlerFunc

PermissionMiddleware checks if the user has the required permission.

func RateLimitMiddleware

func RateLimitMiddleware(r rate.Limit, b int) gin.HandlerFunc

RateLimitMiddleware returns a gin.HandlerFunc that limits the request rate.

func RoleMiddleware

func RoleMiddleware(requiredRoles ...string) gin.HandlerFunc

RoleMiddleware checks if the user has one of the required roles.

func SecureHeadersMiddleware

func SecureHeadersMiddleware() gin.HandlerFunc

SecureHeadersMiddleware adds security headers to HTTP responses.

func TenantMiddleware

func TenantMiddleware(ts *tenants.TenantService) gin.HandlerFunc

TenantMiddleware resolves tenant from JWT or X-Tenant-ID header.

Types

This section is empty.

Jump to

Keyboard shortcuts

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