turbo
c579fec8 - fix: Update Factory session network policy (#13814)

Commit
98 days ago
fix: Update Factory session network policy (#13814) ## Summary - keep named sandbox creation fail-closed with `networkPolicy: "deny-all"` - apply workspace credentials through the running session's network-policy endpoint - use the custom policy schema accepted by the live Sandbox REST API - retain method/path-scoped header injection for GitHub and workspace publishing ## Production and preview evidence Production failures after #13812 reached the named-sandbox update endpoint and rejected the SDK object's `allow` property. The first version of this PR moved the same SDK object to the documented session endpoint. Preview workspace `ws_a52900be7ac448a0ba227bc6b25d4c2d` proved that endpoint also rejects the SDK 2.5 object: ``` POST /v2/sandboxes/sessions/sbx_ZGVYSNrBKyLeI9qi4p4Gqy7bCD4B/network-policy Invalid request: should NOT have additional property `allow`. ``` Vercel's live REST reference lists the accepted custom schema as `mode`, `allowedDomains`, `deniedCIDRs`, and `injectionRules`. This revision isolates that documented API shape at the SDK boundary while preserving the existing L7 match restrictions. ## Verification - `node --experimental-strip-types --test tests/fx-workspace.test.mjs` (7 passed) - `pnpm exec tsc --noEmit` - pre-push hooks: `format`, `check:toml` - updated Vercel preview deployed successfully at commit `4e7f6a7f6c` ## Remaining preview check The updated preview is deployed, but the protected terminal POST was not authorized from automation. Reloading the existing workspace once will exercise the updated policy against its existing sandbox; deployment logs should then confirm whether the terminal proceeds past policy application.
Author
Parents
Loading