Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

test(forge): pass the DNS-resolving SSRF check through for offline BYOK fixtures

nirholas6bd6b4ef51e2
diff --git a/tests/api/forge-byok-providers.test.js b/tests/api/forge-byok-providers.test.js
index 7229a3e6e..02704011b 100644
--- a/tests/api/forge-byok-providers.test.js
+++ b/tests/api/forge-byok-providers.test.js
@@ -15,6 +15,14 @@ afterEach(() => {
vi.restoreAllMocks();
});
+// The reference-image fetch is SSRF-checked (DNS-resolved) before it goes out;
+// these fixtures use offline `.test` hosts, so the check is passed through here
+// and covered on its own in tests/ssrf-hardening-guards.test.js.
+vi.mock('../../api/_lib/ssrf-guard.js', async (importOriginal) => ({
+ ...(await importOriginal()),
+ assertSafePublicUrl: async (u) => new URL(u),
+}));
+
// R2 is mocked once for the whole file — only the Stability adapter reaches it.
vi.mock('../../api/_lib/r2.js', () => ({
putObject: vi.fn(async () => ({})),