fix(approvals): narrow gate scope to token-mint + secret-write only (#2579 follow-up) #2592
Reference in New Issue
Block a user
Delete Branch "fix-2579-e2e"
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?
Follow-up to #2574 / #2579.
The merged Phase-4 approval gate included
ActionDeleteWorkspaceandActionDeprovisionin the gated set. This causes the E2E API Smoke test to fail because the smoke harness uses admin-token for workspace CRUD cleanup — the DELETE returns 202 (pending_approval) instead of actually deleting, so count-based assertions cascade-fail.This change narrows the gate to the two actions that were the actual security target:
ActionSecretWrite— workspace/global secret writesActionOrgTokenMint— org token mintingWorkspace delete/deprovision are removed from the gated map while preserving all other gate infrastructure.
SOP checklist
Comprehensive testing performed
workspace-server/internal/approvals/policy.gogated-action map.Local-postgres E2E run
Staging-smoke verified or pending
Root-cause not symptom
Five-Axis review walked
No backwards-compat shim / dead code added
Memory consulted
Refs #2579
7606947559toef5676a7b9ef5676a7b9toce0f951785/sop-ack comprehensive-testing
/sop-ack local-postgres-e2e
/sop-ack staging-smoke
/sop-ack five-axis-review
/sop-ack memory-consulted
/sop-ack root-cause
/sop-ack no-backwards-compat
Approved from code review.
Correctness: The policy map now gates only
ActionSecretWriteandActionOrgTokenMint, matching the requested #2579 follow-up.ActionDeleteWorkspaceandActionDeprovisionremain defined and call sites can still pass throughgateDestructive, butIsGatedshort-circuits them as intended.Robustness: The change is centralized in the approvals policy map, so there is no partial handler-specific divergence. Updated tests keep the gate-cycle coverage on a still-gated action and preserve short-circuit coverage for non-gated actions.
Security: This deliberately narrows the approval boundary per the stated CTO/product decision. The two retained high-risk credential surfaces, secret writes and org-token minting, remain gated; no new auth path or input trust is introduced.
Performance: No material runtime cost change; this is a constant-size map lookup.
Readability: The diff is small and the action boundary remains auditable in one file. SOP checklist is fully acked, and the relevant CI/Platform Go plus E2E API Smoke Test checks are green.
Caveat: I did not run local Go tests because this runtime lacks the
gobinary. Some review/gate status checks are still failing pending approvals, but I found no code-review blocker.