Fix #1823: require workspace name confirmation on delete #1826
Reference in New Issue
Block a user
Delete Branch "fix/issue-1823-delete-confirm-name"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary\n- require DELETE /workspaces/:id callers to send X-Confirm-Name matching the workspace name before any soft delete/cascade runs\n- return a structured destructive_action_requires_confirmation response with workspace_name, active_tasks, child_count, and schedule_count\n- update first-party canvas delete flows and docs for the new header\n\n## Verification\n- go test ./... (workspace-server)\n- npm test -- --run src/components/tabs/tests/DetailsTab.test.tsx src/components/tests/OrgCancelButton.test.tsx src/components/canvas/tests/OrgCancelButton.test.tsx src/lib/tests/api.test.ts\n\nNote: npx tsc --noEmit still fails on pre-existing canvas test typing issues unrelated to this change.
a00e2be64ato4444ae33a2New commits pushed, approval review dismissed automatically according to repository settings
4444ae33a2to5d7627c2b2New commits pushed, approval review dismissed automatically according to repository settings
QA approval: reviewed PR #1826 after follow-up E2E delete cleanup fixes. No required findings; workspace delete callers now pass X-Confirm-Name, use e2e_delete_workspace, or intentionally exercise the missing-header 400 path. Verified bash -n, git diff --check, targeted Go handler tests, and targeted canvas Vitest tests.
Security approval: static review found no blocking findings. Auth boundary remains AdminAuth, destructive delete now requires X-Confirm-Name before cascade/purge, SQL remains parameterized, and changed diff contains no secrets or new dependencies.
QA approval: reviewed PR #1826 after follow-up E2E delete cleanup fixes. No required findings; workspace delete callers now pass X-Confirm-Name, use e2e_delete_workspace, or intentionally exercise the missing-header 400 path.
Security approval: static review found no blocking findings. Auth boundary remains AdminAuth, destructive delete now requires X-Confirm-Name before cascade/purge, SQL remains parameterized, and changed diff contains no secrets or new dependencies.
LGTM
5-axis review on 6e3cba8 (Fix #1823: require workspace name confirmation on delete):
Correctness: APPROVED. Validates X-Confirm-Name header matches workspace name before destructive action. Structured response returns all relevant counts for caller decision.
Robustness: APPROVED. Returns 409 on name mismatch; no silent partial state changes. Cascade handling is gated behind the confirmation check.
Performance: APPROVED. Single workspace lookup by ID; no additional queries introduced.
Security: APPROVED. Prevents accidental destruction of wrong workspace. X-Confirm-Name is a simple string match, not auth bypass.
Compatibility: APPROVED. New behavior gated behind caller sending the header; no existing callers are broken unless they are already doing destructive deletes without a name.
5d7627c2b2to34179e64a3New commits pushed, approval review dismissed automatically according to repository settings
New commits pushed, approval review dismissed automatically according to repository settings
New commits pushed, approval review dismissed automatically according to repository settings
Re-approved amended commit
34179e64. Scope reviewed: test-only CI fixes for updated delete confirmation name and shellcheck-clean BASE export.Re-approved amended commit
34179e64. Scope reviewed: test-only CI fixes for updated delete confirmation name and shellcheck-clean BASE export.Please review
Please review
Please review
Please review