mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-19 00:18:27 +00:00
fix(aws-lambda): Lambda renders reach only public addresses unless the function opts out (#7780)
* fix(aws-lambda): Lambda renders reach only public addresses unless the function opts out * chore(aws-lambda): drop a comment the function name already says
This commit is contained in:
@@ -47,6 +47,7 @@ import {
|
||||
useBundledBinaries,
|
||||
} from "./handler.js";
|
||||
import { S3PlanV2ArtifactPublisher } from "./s3PlanV2Publisher.js";
|
||||
import { resolveRestrictPageNetwork } from "../../engine/src/config.js";
|
||||
|
||||
interface FakeS3Op {
|
||||
kind: "download" | "upload" | "copy";
|
||||
@@ -263,6 +264,25 @@ describe("unwrapEvent", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("render page address rules", () => {
|
||||
it("are on for every invocation unless the function turns them off", async () => {
|
||||
const before = process.env.PRODUCER_RESTRICT_PAGE_NETWORK;
|
||||
try {
|
||||
delete process.env.PRODUCER_RESTRICT_PAGE_NETWORK;
|
||||
await handleEvent({ Action: "warm" } as never, { skipChromeResolution: true });
|
||||
expect(process.env.PRODUCER_RESTRICT_PAGE_NETWORK).toBe("true");
|
||||
expect(resolveRestrictPageNetwork()).toBe(true);
|
||||
|
||||
process.env.PRODUCER_RESTRICT_PAGE_NETWORK = "false";
|
||||
await handleEvent({ Action: "warm" } as never, { skipChromeResolution: true });
|
||||
expect(resolveRestrictPageNetwork()).toBe(false);
|
||||
} finally {
|
||||
if (before === undefined) delete process.env.PRODUCER_RESTRICT_PAGE_NETWORK;
|
||||
else process.env.PRODUCER_RESTRICT_PAGE_NETWORK = before;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe("useBundledBinaries", () => {
|
||||
function taskRoot(...binaries: string[]): string {
|
||||
const root = mkdtempSync(join(tmpdir(), "hf-lambda-task-"));
|
||||
|
||||
Reference in New Issue
Block a user