P0 fixes: - ModelError.Is(): use exact matching instead of substring contains() - shouldClearStickySession: add context param for cancellation/tracing P1 fixes: - TODO stubs: return 501 Not Implemented errors - validateInstanceSignature: deduplicate to shared validateCodeSignature() - Error messages: standardize to English only - http.go: remove pseudo if-else with duplicate branches
23 lines
516 B
Go
23 lines
516 B
Go
package middleware
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/google/wire"
|
|
)
|
|
|
|
// JWTAuthMiddleware JWT 认证中间件类型
|
|
type JWTAuthMiddleware gin.HandlerFunc
|
|
|
|
// AdminAuthMiddleware 管理员认证中间件类型
|
|
type AdminAuthMiddleware gin.HandlerFunc
|
|
|
|
// APIKeyAuthMiddleware API Key 认证中间件类型
|
|
type APIKeyAuthMiddleware gin.HandlerFunc
|
|
|
|
// ProviderSet 中间件层的依赖注入
|
|
var ProviderSet = wire.NewSet(
|
|
NewJWTAuthMiddleware,
|
|
NewAdminAuthMiddleware,
|
|
NewAPIKeyAuthMiddleware,
|
|
)
|