feat(sandbox): export VERIFY_TOKEN from sandbox env (AIT-179) - #22
Conversation
`sandbox env` now writes VERIFY_TOKEN (the GET-handshake echo value, distinct from WEBHOOK_HMAC_SECRET) for WhatsApp and Instagram sessions, so `sandbox webhook set` verifies against a starter-kit server configured via `sandbox env --write .env`. The session parser requires verifyToken on the wire; sessions from older backends surface MALFORMED_SANDBOX_SESSION (backend deploys before this release).
📝 WalkthroughWalkthroughSandbox sessions now require ChangesSandbox verification token
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/api/__tests__/sandbox-session.test.ts (1)
16-16: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAdd a regression test for missing
verifyToken.The fixture update covers only valid payloads. Add a case such as
{ ...validWa, verifyToken: '' }and assert the parser throwsMALFORMED_SANDBOX_SESSION; this protects the new boundary contract from being accidentally relaxed.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/api/__tests__/sandbox-session.test.ts` at line 16, Add a regression case in the sandbox session parser tests using the valid payload with an empty verifyToken, and assert that parsing throws MALFORMED_SANDBOX_SESSION. Keep the existing valid fixture tests unchanged and target the parser behavior exercised by the surrounding sandbox-session tests.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/api/__tests__/sandbox-session.test.ts`:
- Line 16: Add a regression case in the sandbox session parser tests using the
valid payload with an empty verifyToken, and assert that parsing throws
MALFORMED_SANDBOX_SESSION. Keep the existing valid fixture tests unchanged and
target the parser behavior exercised by the surrounding sandbox-session tests.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: bd2c857b-0b5c-44b7-a746-ecf722c3022b
📒 Files selected for processing (20)
CHANGELOG.mdREADME.mdsrc/__tests__/sandbox-listen/picker.test.tssrc/api/__tests__/sandbox-session.test.tssrc/api/sandbox-session.tssrc/auth/__tests__/login.test.tssrc/commands/__tests__/sandbox-listen-banner.test.tssrc/commands/__tests__/wizard.test.tssrc/commands/sandbox-listen/__tests__/listen-positional.test.tssrc/commands/sandbox/__tests__/env.test.tssrc/commands/sandbox/__tests__/helpers.test.tssrc/commands/sandbox/__tests__/logs-default-format.test.tssrc/commands/sandbox/__tests__/logs.test.tssrc/commands/sandbox/__tests__/picker.test.tssrc/commands/sandbox/__tests__/send-positional.test.tssrc/commands/sandbox/__tests__/send.test.tssrc/commands/sandbox/__tests__/status.test.tssrc/commands/sandbox/__tests__/stop.test.tssrc/commands/sandbox/__tests__/webhook.test.tssrc/commands/sandbox/env.ts
`sandbox env` now writes VERIFY_TOKEN (the GET-handshake echo value, distinct from WEBHOOK_HMAC_SECRET) for WhatsApp and Instagram sessions, so `sandbox webhook set` verifies against a starter-kit server configured via `sandbox env --write .env`. The session parser requires verifyToken on the wire; sessions from older backends surface MALFORMED_SANDBOX_SESSION (backend deploys before this release).
Summary
sandbox envnow writesVERIFY_TOKEN(GET-handshake echo value, distinct fromWEBHOOK_HMAC_SECRET) for WhatsApp and Instagram sessions —sandbox webhook setnow verifies against a starter-kit server configured viasandbox env --write .env.verifyTokenon the wire; older backends surfaceMALFORMED_SANDBOX_SESSION.Rollout
Release AFTER hookmyapp/hookmyapp#97 is deployed (backend must emit
verifyTokenfirst).Test plan
sandbox env --write .env+ starter-kit v3 +sandbox webhook setend to end on stagingSummary by CodeRabbit
New Features
sandbox envnow includesVERIFY_TOKENfor WhatsApp and Instagram sessions in dotenv and JSON output.sandbox webhook setnow verifies the configured webhook URL using the session’s verification token.Bug Fixes
Documentation