Repository navigation
Commit d053e5f
fix(platform): accept sandbox controllers without echoed binding props (#349)
Fixes #344
## Problem
Every managed Sandbox deploy failed at `worker_upload` with:
```
Sandbox controller authority binding differs from this deployment.
```
`provisionSandboxController` uploads the `void-sb-*` controller with a
`service` binding that carries `props`, then reads `/settings` back and
required the same `props`. Cloudflare applies `props` at runtime but
never returns them:
```
PUT script, service binding + props → 200, target entrypoint sees ctx.props ✓
GET /settings → { entrypoint, environment, name, service, type } (no props)
GET /bindings, /versions/{id} → same, no props
```
(Checked against the live Cloudflare API with throwaway scripts.) So the
check rejected even a freshly created controller. The integration mock
echoed uploaded bindings verbatim, which hid this.
## Fix
- Drop the `props` comparison in `assertConfiguration`. Keep the
`service` and `entrypoint` checks. The plain-text identity bindings
(`__VOID_SANDBOX_OWNER`, `__VOID_USER_ID`, `__PROJECT_ID`,
`__VOID_PROJECT_SLUG`, `__VOID_DEPLOYMENT_ID`) come from the same upload
and are still checked; `SandboxControl` still verifies each admission
against the database.
- The Cloudflare mock now returns the real `/settings` shape (no
`props`, adds `environment`). With the old assertion, the sandbox
integration suite fails with the production error.
Also confirmed live: `/settings` returns `namespace_id` for the
controller's Durable Object binding, including with `containers`, so the
next check in this path holds.
## Verification
- `vp test run --project platform-api-integration
platform/packages/api/test/integration/api-sandbox.test.ts`: 15/15
- `vp test run --project "platform-*"`: all pass
- `@voidcloud/api` typecheck: pass
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>1 parent dac5dc3 commit d053e5f
2 files changed
Lines changed: 14 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
| |||
134 | 133 | | |
135 | 134 | | |
136 | 135 | | |
| 136 | + | |
| 137 | + | |
137 | 138 | | |
138 | 139 | | |
139 | 140 | | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
| 141 | + | |
149 | 142 | | |
150 | 143 | | |
151 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1620 | 1620 | | |
1621 | 1621 | | |
1622 | 1622 | | |
| 1623 | + | |
| 1624 | + | |
1623 | 1625 | | |
1624 | | - | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
1625 | 1635 | | |
1626 | 1636 | | |
1627 | 1637 | | |
| |||
0 commit comments