* 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
27 lines
731 B
Go
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)
|
|
}
|