Files
new-api/router/retired_frontend_routes_test.go
Calcium-Ion 31d70fca39 refactor(auth): replace dashboard sessions with stateless tokens and session control (#6329)
* refactor(auth): replace dashboard sessions with stateless tokens

* feat(auth): harden session issuance and distributed enforcement

* fix(proxy): preserve trusted proxy compatibility defaults

* refactor: address dashboard auth review feedback

* refactor: remove classic frontend and flatten web app
2026-07-20 16:48:43 +08:00

27 lines
731 B
Go

package router
import (
"net/http"
"testing"
"github.com/gin-gonic/gin"
"github.com/stretchr/testify/assert"
)
func TestRetiredFrontendAPIRoutes(t *testing.T) {
gin.SetMode(gin.TestMode)
engine := gin.New()
SetApiRouter(engine)
routes := make(map[string]struct{}, len(engine.Routes()))
for _, route := range engine.Routes() {
routes[route.Method+" "+route.Path] = struct{}{}
}
_, hasAsyncCleanup := routes[http.MethodPost+" /api/system-task/log-cleanup"]
_, hasDirectDelete := routes[http.MethodDelete+" /api/log/"]
_, hasConsoleMigration := routes[http.MethodPost+" /api/option/migrate_console_setting"]
assert.True(t, hasAsyncCleanup)
assert.False(t, hasDirectDelete)
assert.False(t, hasConsoleMigration)
}