fix: reject project list/use for CI-scoped keys with clear errors#308
fix: reject project list/use for CI-scoped keys with clear errors#308leggetter wants to merge 4 commits into
Conversation
Validate credentials before cross-project commands, omit X-Team-ID on ListProjects, improve login and MCP flows for single-project CI keys, and strip legacy workspace/team keys on profile save. Co-Authored-By: Claude <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
ReviewSolid change, well-tested (unit + MCP + acceptance), and the fix lands at a reasonable depth — client-side 1.
|
Only show CI-scoped login prefix when validate confirms no user_id; validate --type before the credentials check so invalid flags fail offline (fixes CI). Co-Authored-By: Claude <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Rebalance CI matrix runtimes (~5.3 min slice 0 vs ~3 min slice 2). Move ConnectionListResponse to helpers so gateway tests compile without connection_list in the same build. Co-Authored-By: Claude <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Rename ErrProjectScopedCredentials (ErrCIScopedCredentials alias), update messages for single-project scope, and match CLI_PROJECT_SCOPED from API. Co-Authored-By: Claude <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
project list/project useand fail fast withErrCIScopedCredentialswhen the stored key has nouser_id(e.g. afterhookdeck ci)ListProjectswithoutX-Team-IDso staleproject_id/ legacy workspace fields do not scope the teams requesthookdeck login: CI keys no longer short-circuit validate — TTY opens browser sign-in; non-TTY fails immediately (no poll)hookdeck_logintreats CI-scoped keys as needing browser auth;hookdeck_projectssurfaces reauth hints for local and API errorsSaveProfilestrips deprecatedworkspace_*andteam_*keys from config on writeContext
hookdeck project listrequires a user-associated CLI key. Keys created byhookdeck ciare scoped to one project and previously caused an opaque API 500 onGET /teams. This PR adds client-side guards with actionable messages and aligns login/MCP behavior so users can upgrade to a full session.Pairs with the companion API PR in
hookdeck/core(CLI_USER_REQUIREDonGET /teams).Test plan
go test ./...go test -tags=project_use ./test/acceptance/... -run TestProjectListFailsWithCIKeyhookdeck cithenproject list→ clear error, notFatal Error/ 500hookdeck loginwith CI key in TTY → browser sign-in; headless → immediate errorhookdeck_loginreturns browser URL (not "Already authenticated")Made with Cursor