fix(cap): keep only /api/v1/cap routes

Drop the unversioned /api/cap aliases so Challenge and Redeem exist only under /api/v1/cap.
This commit is contained in:
ryan
2026-08-30 16:39:40 +08:00
parent 56c650c5b5
commit 12b4c3e54c
3 changed files with 9 additions and 9 deletions
@@ -34,15 +34,18 @@ func TestApplyRegistersUnversionedCapRoutes(t *testing.T) {
t.Fatal(err)
}
want := map[string]bool{
"GET /api/v1/cap/challenge": false,
"POST /api/v1/cap/challenge": false,
"POST /api/cap/challenge": false,
"POST /api/cap/redeem": false,
"POST /api/v1/cap/redeem": false,
}
for _, rd := range ctx.Router().Routes() {
key := rd.Method + " " + rd.Path
if _, ok := want[key]; ok {
want[key] = true
}
if key == "POST /api/cap/challenge" || key == "POST /api/cap/redeem" {
t.Errorf("legacy route must not exist: %s", key)
}
}
for key, ok := range want {
if !ok {