mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-18 21:22:28 +03:00
Validated in local merge-train-equivalent focused gate on release/v3.8.50 tip 9081b57146: catalog fingerprint regression + existing catalog-cache callers, 8 tests passed.
16 lines
645 B
TypeScript
16 lines
645 B
TypeScript
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(""), "");
|
|
});
|