middleware

package
v0.26.2 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2026 License: MIT Imports: 11 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() func(http.Handler) http.Handler

AuthMiddleware 登录校验 - Gin到Chi迁移

func EnsureSelectedClusterMiddleware

func EnsureSelectedClusterMiddleware() func(http.Handler) http.Handler

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

func PlatformAuthMiddleware added in v0.0.75

func PlatformAuthMiddleware() func(http.Handler) http.Handler

PlatformAuthMiddleware 平台管理员角色校验 - Gin到Chi迁移

Types

This section is empty.

Jump to

Keyboard shortcuts

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