Skip to content

Commit 3de11c2

Browse files
committed
test(producer): use vendor-neutral media hosts
1 parent 8bb7d81 commit 3de11c2

3 files changed

Lines changed: 12 additions & 9 deletions

File tree

‎packages/engine/src/services/videoFrameExtractor.errorClassification.test.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ describe("classifyVideoExtractionError download integrity", () => {
6060

6161
describe("extractAllVideoFrames download failure metadata", () => {
6262
it("threads a query-free fingerprint, allowlisted host, and zero used retries", async () => {
63-
const source = "https://media.heygen.ai/private/clip.mp4?X-Amz-Signature=super-secret#fragment";
63+
const source =
64+
"https://media.customer-cdn.example/private/clip.mp4?X-Amz-Signature=super-secret#fragment";
6465
vi.stubGlobal(
6566
"fetch",
6667
vi.fn().mockResolvedValue(new Response("<!doctype html><html><body>denied</body></html>")),
@@ -86,7 +87,7 @@ describe("extractAllVideoFrames download failure metadata", () => {
8687
expect(result.errors).toHaveLength(1);
8788
expect(result.errors[0]?.group).toEqual({
8889
sourceFingerprint: `sha256:${safeDownloadUrlIdentity(source).urlFingerprint}`,
89-
host: "media.heygen.ai",
90+
host: "media.customer-cdn.example",
9091
statusClass: "other",
9192
retry: { phase: "download", used: 0, budget: 1 },
9293
});

‎packages/producer/src/services/render/stages/extractVideosStage.test.ts‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,14 +251,15 @@ describe("resolveVideoExtractionPolicy", () => {
251251
});
252252

253253
describe("safeVideoExtractionSourceLogMetadata", () => {
254-
it("logs only a query-free fingerprint and allowlisted host for a signed remote source", () => {
255-
const source = "https://MEDIA.HEYGEN.AI/private/clip.mp4?X-Amz-Signature=super-secret#fragment";
254+
it("logs only a query-free fingerprint and normalized host for a signed remote source", () => {
255+
const source =
256+
"https://MEDIA.CUSTOMER-CDN.EXAMPLE/private/clip.mp4?X-Amz-Signature=super-secret#fragment";
256257
const metadata = safeVideoExtractionSourceLogMetadata(source);
257258

258259
expect(metadata).toMatchObject({
259260
sourceType: "remote",
260261
sourceFingerprint: expect.stringMatching(/^sha256:[0-9a-f]{64}$/),
261-
host: "media.heygen.ai",
262+
host: "media.customer-cdn.example",
262263
});
263264
expect(JSON.stringify(metadata)).not.toContain("super-secret");
264265
expect(JSON.stringify(metadata)).not.toContain("/private/clip.mp4");
@@ -348,11 +349,11 @@ describe("assertVideoExtractionSucceeded", () => {
348349
retryable: true,
349350
group: {
350351
sourceFingerprint: `sha256:${index.toString(16).padStart(64, "0")}`,
351-
host: index % 2 === 0 ? "media.heygen.ai" : "other",
352+
host: index % 2 === 0 ? "media.customer-cdn.example" : "other",
352353
statusClass: "http_5xx",
353354
retry: { phase: "download", used: 1, budget: 1 },
354355
},
355-
error: `https://media.heygen.ai/private/${index}.mp4?signature=secret`,
356+
error: `https://media.customer-cdn.example/private/${index}.mp4?signature=secret`,
356357
}));
357358
errors.push(
358359
{

‎packages/producer/src/services/render/stages/extractVideosStage.timelineBound.test.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ describe.each([
132132

133133
describe("video extraction source logging", () => {
134134
it("keeps the actual logger message source-free and emits only safe remote metadata", async () => {
135-
const source = "https://media.heygen.ai/private/clip.mp4?X-Amz-Signature=must-not-log#fragment";
135+
const source =
136+
"https://media.customer-cdn.example/private/clip.mp4?X-Amz-Signature=must-not-log#fragment";
136137
const log = {
137138
error: vi.fn(),
138139
warn: vi.fn(),
@@ -150,7 +151,7 @@ describe("video extraction source logging", () => {
150151
{
151152
sourceType: "remote",
152153
sourceFingerprint: `sha256:${safeDownloadUrlIdentity(source).urlFingerprint}`,
153-
host: "media.heygen.ai",
154+
host: "media.customer-cdn.example",
154155
},
155156
]);
156157
const serializedCall = JSON.stringify(extractionCall);

0 commit comments

Comments
 (0)