You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: scripts/ralph/prd.json
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -464,8 +464,8 @@
464
464
"Typecheck passes"
465
465
],
466
466
"priority": 26,
467
-
"passes": false,
468
-
"notes": "Local uses POSTGRES_HOST_AUTH_METHOD: trust (password bypassed), CI defaults to scram-sha-256. This means the SCRAM crypto path is only tested in CI and never locally. If a developer breaks crypto support needed for SCRAM, they won't catch it locally."
467
+
"passes": true,
468
+
"notes": "Fixed: Removed POSTGRES_HOST_AUTH_METHOD: trust from local Docker setup. Implemented subtle.deriveBits (PBKDF2) in both guest-side SandboxSubtle and host-side bridge dispatcher. Local and CI now both use scram-sha-256 authentication. All pg fixtures pass with SCRAM auth."
- `createHostCommandExecutor()` wraps `node:child_process.spawn` as a `CommandExecutor` for sandbox bash tool tests
20
20
- TCP socket bridge: guest calls `_netSocketConnectRaw.applySync()` → host creates real `net.Socket` → events dispatched back via `_netSocketDispatch` applySync callback
21
21
- `wrapNetworkAdapter` in `permissions.ts` must forward ALL adapter methods — new methods added to NetworkAdapter interface need corresponding forwarding in the wrapper
22
-
- pg library uses Web Crypto `subtle.deriveBits` for SCRAM-SHA-256 auth — this is NOT implemented in sandbox; use `POSTGRES_HOST_AUTH_METHOD: "trust"` to bypass
22
+
- pg library uses Web Crypto `subtle.deriveBits` for SCRAM-SHA-256 auth — implemented in sandbox crypto.subtle bridge (guest: SandboxSubtle.deriveBits in require-setup.ts, host: deriveBits case in bridge-setup.ts using pbkdf2Sync)
- CRITICAL: `wrapNetworkAdapter` in `permissions.ts` must forward ALL new adapter methods — this was the root cause of a silent failure where the adapter's `netSocketConnect` was never called
61
61
- The net module was previously a "deferred core module" stub (Proxy that throws on any method call) — must remove from `_deferredCoreModules` set when implementing
62
62
- `loadPolyfillRef` in `bridge-setup.ts` must also return null for `net` to prevent node-stdlib-browser's stub from being loaded
63
-
- Postgres 16 defaults to SCRAM-SHA-256 auth which needs `subtle.deriveBits` — not available in sandbox yet; `trust` auth is the workaround
63
+
- Postgres 16 defaults to SCRAM-SHA-256 auth which needs `subtle.deriveBits` — now implemented in sandbox crypto.subtle bridge
64
64
- The adapter's socketId counter is reused from `nextUpgradeSocketId` — bridge-setup must use the adapter's returned socketId, not its own counter
65
65
---
66
66
67
+
## 2026-03-19T20:46 - US-026
68
+
- Implemented `subtle.deriveBits` in sandbox crypto bridge to support SCRAM-SHA-256 Postgres authentication
69
+
- Removed `POSTGRES_HOST_AUTH_METHOD: "trust"` from local Docker setup so local and CI both use scram-sha-256
70
+
- Files changed:
71
+
- `packages/secure-exec-node/src/bridge-setup.ts` — added `deriveBits` case to host-side crypto.subtle dispatcher (uses Node's `pbkdf2Sync`)
- `subtle.deriveBits` for PBKDF2 maps directly to Node's `pbkdf2Sync(password, salt, iterations, keylen, digest)` — the algorithm object carries salt/iterations/hash, the key carries the password in `_raw`
77
+
- Guest-side `SandboxSubtle` methods must serialize algorithm-specific fields (salt as base64, hash as normalized name) before crossing the bridge
78
+
- After adding a new subtle operation, the bridge/isolate-runtime must be rebuilt (`pnpm turbo build`) and fixture caches cleared to pick up the regenerated code
0 commit comments