mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-02 06:56:36 +08:00
refactor(backend): rename OpenFlare directory to lowercase openflare
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
// Copyright 2026 Arctel.net
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package apiutil
|
||||
|
||||
import "Wavelet/core/contracts"
|
||||
|
||||
// AdminMiddlewares returns Wavelet-standard middlewares for OpenFlare console routes.
|
||||
// OpenFlare no longer distinguishes Admin vs Root tiers; all management endpoints share
|
||||
// the same gate: RequireAuth + RequireAdmin from the platform AuthService.
|
||||
//
|
||||
// 返回 []any 而非 []gin.HandlerFunc:内核 RouterExtension.Use 收 ...any,
|
||||
// 而 Go 不允许把 []T 直接展开成 ...any。
|
||||
func AdminMiddlewares(auth contracts.AuthService) []any {
|
||||
return []any{auth.RequireAuthMiddleware(), auth.RequireAdminMiddleware()}
|
||||
}
|
||||
Reference in New Issue
Block a user