mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-09-30 22:26:38 +08:00
88360350a0
Delete the old monolithic openflare-server implementation and rename Wavelet/ to openflare-server/ to complete the migration consolidation. Update CI workflows, agent Dockerfiles, and deployment docs for the new layout (frontend/, docker/Dockerfile).
17 lines
612 B
Go
17 lines
612 B
Go
// Copyright 2026 Arctel.net
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package apiutil
|
|
|
|
import (
|
|
"github.com/Rain-kl/Wavelet/internal/apps/admin"
|
|
"github.com/Rain-kl/Wavelet/internal/apps/oauth"
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
// AdminMiddlewares returns Wavelet-standard middlewares for OpenFlare console routes.
|
|
// OpenFlare no longer distinguishes Admin vs Root tiers; all management endpoints share
|
|
// the same gate: user.IsAdmin for session users, token_admin for Access Token callers.
|
|
func AdminMiddlewares() []gin.HandlerFunc {
|
|
return []gin.HandlerFunc{oauth.LoginRequired(), admin.LoginAdminRequired()}
|
|
} |