Files
OmniRoute/tests/unit/gamification/federation-auth.test.ts
diegosouzapw b50dfb98bc fix: restore v3.8.0 state for regressive files — prevent auth/gamification/i18n/test regressions
Resets 68 files to release/v3.8.0 state to prevent:
- Auth: allExpired detection, apiKeyHealth sync, terminal connection handling
- Security: federation leaderboard auth, pbkdf2 hashing, antiCheat zScore
- Executor: fixToolPairs after fixToolAdjacency (Claude tool adjacency)
- Provider: apiKeyHealth cleanup on key rotation
- UI: NotificationToast onClick stopPropagation
- i18n: ~50 deleted keys in en.json + all 41 locales
- Tests: 500+ lines of deleted tests restored

New features (t3.chat, combo exhaustion, Kiro multi-account, Zed Docker,
context window filter, CLI rotate, E2E failover) remain intact.
2026-05-20 09:25:04 -03:00

26 lines
1012 B
TypeScript

import { describe, it } from "node:test";
import assert from "node:assert/strict";
describe("Federation Leaderboard Auth", () => {
it("rejects requests without Authorization header", async () => {
const { GET } = await import("../../../src/app/api/gamification/federation/leaderboard/route");
const { NextRequest } = await import("next/server");
const req = new NextRequest("http://localhost/api/gamification/federation/leaderboard");
const response = await GET(req);
assert.equal(response.status, 401);
});
it("rejects requests with invalid bearer token", async () => {
const { GET } = await import("../../../src/app/api/gamification/federation/leaderboard/route");
const { NextRequest } = await import("next/server");
const req = new NextRequest("http://localhost/api/gamification/federation/leaderboard", {
headers: { Authorization: "Bearer invalid-token-12345" },
});
const response = await GET(req);
assert.equal(response.status, 403);
});
});