Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

645 B
Raw Blame
import assert from "node:assert/strict";
import { test } from "node:test";

import { fingerprintCatalogAuthKey } from "../../src/app/api/v1/models/catalogCache.ts";

test("fingerprintCatalogAuthKey never returns the raw API key", () => {
  const raw = "sk-test-super-secret-catalog-key";
  const finger = fingerprintCatalogAuthKey(raw);
  assert.equal(finger.length, 16);
  assert.equal(finger.includes(raw), false);
  assert.equal(finger.includes("sk-test"), false);
  assert.equal(fingerprintCatalogAuthKey(raw), finger);
  assert.notEqual(fingerprintCatalogAuthKey("sk-other"), finger);
  assert.equal(fingerprintCatalogAuthKey(""), "");
});