diff --git a/src/image-generation/live-test-helpers.test.ts b/src/image-generation/live-test-helpers.test.ts index 9924a8cc0660..54c77369f661 100644 --- a/src/image-generation/live-test-helpers.test.ts +++ b/src/image-generation/live-test-helpers.test.ts @@ -87,7 +87,8 @@ describe("image-generation live-test helpers", () => { it("redacts live API keys for diagnostics", () => { expect(redactLiveApiKey(undefined)).toBe("none"); - expect(redactLiveApiKey("short-key")).toBe("short-key"); - expect(redactLiveApiKey("sk-proj-1234567890")).toBe("sk-proj-...7890"); + expect(redactLiveApiKey(" ")).toBe("none"); + expect(redactLiveApiKey("synthetic-12")).toBe(""); + expect(redactLiveApiKey("synthetic-credential-value")).toBe(""); }); }); diff --git a/src/media-generation/live-test-helpers.ts b/src/media-generation/live-test-helpers.ts index b7c62a2dd496..6b5211360c7d 100644 --- a/src/media-generation/live-test-helpers.ts +++ b/src/media-generation/live-test-helpers.ts @@ -12,16 +12,13 @@ type LiveProviderModelConfig = } | undefined; -/** Redacts live API keys while preserving enough shape for diagnostics. */ +/** Redacts live API keys without retaining credential-derived text in test output. */ export function redactLiveApiKey(value: string | undefined): string { const trimmed = value?.trim(); if (!trimmed) { return "none"; } - if (trimmed.length <= 12) { - return trimmed; - } - return `${trimmed.slice(0, 8)}...${trimmed.slice(-4)}`; + return ""; } /** Parses comma-separated live-test filters; null means "all". */ diff --git a/src/video-generation/live-test-helpers.test.ts b/src/video-generation/live-test-helpers.test.ts index 1c9400abd4d1..96b68aeddea5 100644 --- a/src/video-generation/live-test-helpers.test.ts +++ b/src/video-generation/live-test-helpers.test.ts @@ -80,8 +80,9 @@ describe("video-generation live-test helpers", () => { it("redacts live API keys for diagnostics", () => { expect(redactLiveApiKey(undefined)).toBe("none"); - expect(redactLiveApiKey("short-key")).toBe("short-key"); - expect(redactLiveApiKey("sk-proj-1234567890")).toBe("sk-proj-...7890"); + expect(redactLiveApiKey(" ")).toBe("none"); + expect(redactLiveApiKey("synthetic-12")).toBe(""); + expect(redactLiveApiKey("synthetic-credential-value")).toBe(""); }); it("runs buffer-backed video-to-video only for supported providers/models", () => {