mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-05 23:02:10 +03:00
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.
26 lines
1012 B
TypeScript
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);
|
|
});
|
|
});
|