stack/packages/stack-cli
Devin AI dd0d7559b0 fix: address code review bot findings for browser-secret auth
Bug 1: Exhausted confirmation code lockout
- Add attempts < MAX_ATTEMPTS check to init guard so a fresh code is
  generated once the previous one is exhausted.

Bug 2: Heartbeat code delivery made idempotent
- Rename consumeRemoteDevelopmentEnvironmentBrowserSecretConfirmationCodeForCli
  to peekRemoteDevelopmentEnvironmentBrowserSecretConfirmationCodeForCli (non-
  destructive). Always return the code until it expires or is consumed by
  submit.
- CLI deduplicates locally so it only logs each code once.

Bug 3: Handle browser-secret redirects in config-update
- Catch RemoteDevelopmentEnvironmentBrowserSecretRedirectingError and return
  'redirecting' instead of throwing.

Bug 4: Guard malformed return_to URL
- Wrap new URL() in try-catch in sameOriginReturnTo; fail closed to '/'.

Bug 5: Localbound helper one-shot enforcement
- Close the helper server after successfully issuing a browser secret.

Bug 6: Auth gate before body parse in submit-confirmation-code
- Run assertRemoteDevelopmentEnvironmentBrowserSecretSetupRequest before
  reading/parsing the JSON body.

Bug 7: Guard response.json() in CLI heartbeat
- Wrap response.json() in try-catch to handle unparseable responses.

Also: reset process-global browser-secret state between tests and call
vi.resetModules() in afterEach.

Co-Authored-By: Konstantin Wohlwend <n2d4xc@gmail.com>
2026-06-03 18:00:49 +00:00
..
scripts feat(hexclave): PR 3 — native @hexclave/* source rename + delete dual-publish wiring (#1482) 2026-05-29 15:21:59 -07:00
src fix: address code review bot findings for browser-secret auth 2026-06-03 18:00:49 +00:00
.eslintrc.cjs Stack CLI (#1227) 2026-03-09 13:24:15 -07:00
package.json Upgrade pnpm to v11.5.0 2026-06-01 15:33:25 -07:00
tsconfig.json Stack CLI (#1227) 2026-03-09 13:24:15 -07:00
tsdown.config.ts stack-cli: cloud/local init flow, auto-create on empty projects, post-setup next-steps (#1383) 2026-05-08 10:47:49 -07:00
vitest.config.ts Fast-start local emulator via RAM snapshot + live secret rotation (#1340) 2026-04-20 14:24:49 -07:00