middleware

package
v0.0.113 Latest Latest
Warning

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

Go to latest
Published: May 17, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthMiddleware added in v0.0.27

func AuthMiddleware() gin.HandlerFunc

AuthMiddleware 登录校验

func CustomRecovery added in v0.0.20

func CustomRecovery() gin.HandlerFunc

CustomRecovery 是自定义的 Recovery 中间件

func EnsureSelectedClusterMiddleware

func EnsureSelectedClusterMiddleware() gin.HandlerFunc

EnsureSelectedClusterMiddleware 返回一个 Gin 中间件,用于强制校验请求是否已选择并有权限访问指定集群。 对于静态文件和部分白名单路径会直接跳过校验。其余请求将: 1. 校验 URL 中的集群参数是否存在且有效; 2. 校验用户 JWT 是否有效,并判断用户是否有访问该集群的权限(非平台管理员需在授权集群列表中); 3. 校验目标集群是否已连接。 校验不通过时将中止请求并返回相应的错误信息。

func PlatformAuthMiddleware added in v0.0.75

func PlatformAuthMiddleware() gin.HandlerFunc

PlatformAuthMiddleware 平台管理员角色校验

func RolePlatformOnly added in v0.0.70

func RolePlatformOnly(handler interface{}) gin.HandlerFunc

func SetCacheHeaders added in v0.0.57

func SetCacheHeaders() gin.HandlerFunc

Types

This section is empty.

Jump to

Keyboard shortcuts

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