Description
High-risk admin actions (status transitions, payouts holds, manual reversals) need a structured review queue requiring a second approver before execution, with full audit context attached.
Requirements and context
- Must be secure, tested, and documented
- Should be efficient and easy to review
- Relevant code:
src/routes/admin.ts, src/security/audit.ts
- Self-approval must be rejected by identity check
Suggested execution
- Fork the repo and create a branch
git checkout -b feat/dual-control-admin
- Implement changes
- Add
admin_pending_actions with payload and TTL
- Add approve/reject endpoints with role + identity guard
- Apply pending payload atomically on approval
- Validate security and correctness assumptions
Test and commit
- Run tests
- Cover edge cases
- Approver swap mid-flow, TTL expiry, replay of approval
- Include test output and notes
Example commit message
feat: dual-control review queue for high-risk admin ops
Guidelines
- Minimum 95 percent test coverage
- Clear documentation
- Timeframe: 96 hours
Description
High-risk admin actions (status transitions, payouts holds, manual reversals) need a structured review queue requiring a second approver before execution, with full audit context attached.
Requirements and context
src/routes/admin.ts,src/security/audit.tsSuggested execution
git checkout -b feat/dual-control-adminadmin_pending_actionswith payload and TTLTest and commit
npm testExample commit message
feat: dual-control review queue for high-risk admin opsGuidelines