fix: close workflow console review remediation

This commit is contained in:
lda
2026-08-12 14:51:02 +07:00 Verified
parent e0e1b718b8
commit a9bb2ab837
22 changed files with 359 additions and 178 deletions
@@ -0,0 +1,17 @@
import { describe, expect, it } from "vitest";
import { parseTrustedOrigins } from "./trusted-origins.js";
describe("parseTrustedOrigins", () => {
it("parses and deduplicates exact origins", () => {
expect([
...parseTrustedOrigins("https://console.example/, http://localhost:8787,https://console.example"),
]).toEqual(["https://console.example", "http://localhost:8787"]);
});
it.each(["https://console.example/path", "https://console.example?mode=1", "not a URL"])(
"rejects a value that is not an exact origin: %s",
(value) => {
expect(() => parseTrustedOrigins(value)).toThrow("Invalid trusted origin");
},
);
});