Skip to content

[Feature] Admin incident review and pause authorization UI - #265

Open
morelucks wants to merge 8 commits into
JointSave-org:mainfrom
morelucks:feature/incident-review-pause-auth-ui-261
Open

[Feature] Admin incident review and pause authorization UI#265
morelucks wants to merge 8 commits into
JointSave-org:mainfrom
morelucks:feature/incident-review-pause-auth-ui-261

Conversation

@morelucks

@morelucks morelucks commented Aug 30, 2026

Copy link
Copy Markdown

Summary

This PR implements the incident review and pause authorization UI for the security circuit breaker, completing issue #261.
closes #261
The backend APIs for incident management and pause authorizations were already complete. This PR adds the missing frontend layer to make them accessible to pool admins.

Changes

New Components

  • Incident Review Page (): Lists all security incidents for a pool with summary stats (total, open, executed, dry-run, awaiting on-chain)
  • IncidentReviewCard: Card component for reviewing incidents with actions to resolve, resume, or record on-chain transaction hash
  • PauseAuthorizationPanel: Panel for managing pause authorizations with create/revoke functionality and armed/disarmed status display
  • PausedPoolBanner: Banner shown to all pool members when a pool is paused, with deep-link for admins to the incident review screen

Integrations

  • Integrated PausedPoolBanner into GroupClient.tsx - shown when pool status is 'paused'
  • Added revokePauseAuthorizationMessage() function to wallet-proof.ts for signing revocation proofs
  • Deep-links from paused pool notifications to incident review screen

i18n

  • Added comprehensive EN + ES translations under admin.incidents.* and admin.pauseAuth.* namespaces
  • Added group.paused.* translations for the paused pool banner

Testing

  • Created component tests in incident-review.test.tsx covering:
    • Incident status mapping (executed/dry-run/skipped)
    • Authorization status rendering (active/used/expired/revoked)
    • Action dialogs and submission flows
    • Severity styling and display

Acceptance Criteria

✅ Admin can open, review, and act on incidents for pools they own (resolve/resume/record on-chain hash)
✅ Admin can pre-authorize, list, and revoke automatic on-chain pause from the UI
✅ Paused pool shows a banner with pause_reason, notifications link to review screen
✅ EN + ES translations present
✅ Component tests cover incident status mapping and authorization status rendering

Notes

  • The API routes already handle server-side auth (creator check) and rate limiting
  • The UI passes callerAddress and handles 403s gracefully
  • Entry XDR is never displayed (security best practice - it's a bearer credential)
  • Follows existing admin security page conventions for layout and accessibility
  • Uses SEP-53 wallet signature proof for all authorization actions

Related

Fixes #261

Part of the security circuit breaker initiative that started with PR #259 (automated incident response) and PR #264 (admin emergency controls).

Testing

Tested with:

  • Various incident statuses (open/resolved, executed/dry-run/skipped)
  • Authorization lifecycle (create → active → used/expired/revoked)
  • Pool pause → incident review → resume flow
  • Deep-link navigation from paused pool banner
  • i18n strings in both EN and ES locales

…ointSave-org#263)

Implements comprehensive admin self-service emergency controls for pool management:

Smart Contract Changes:
- Add pause(), unpause(), emergency_withdraw() functions to rotational pool
- Add Admin and Paused storage keys
- Add admin authorization checks
- Add is_paused() and admin() view functions
- Prevent deposits/payouts when paused

Frontend Features:
- SEP-53 wallet signature proof utilities (client + server)
- AdminEmergencyControls component with pause/resume/emergency_withdraw UI
- Confirmation dialogs with warnings for each action
- Real-time pool status alerts
- Integration with group detail page

API Layer:
- POST /api/pools/[id]/admin endpoint for admin actions
- Wallet proof verification using Stellar cryptography
- Rate limiting (5 actions per minute per pool)
- Eligibility checks and safeguards
- Activity logging with tx hash tracking

Database:
- Add pause_reason and paused_at columns to pools table
- Migration script provided
- Updated TypeScript types

Security:
- SEP-53 signature verification prevents address spoofing
- 5-minute timestamp expiration
- Ownership verification against pool creator
- Rate limiting prevents abuse
- Audit logging for all actions
- Multiple confirmations for irreversible actions

Internationalization:
- Full EN + ES translations for all UI strings
- i18n utility functions

Testing:
- Unit tests for wallet proof message generation
- Timestamp validation tests
- Signature verification tests
- Ownership check tests

Documentation:
- Comprehensive implementation guide
- Usage instructions for admins
- Security considerations
- Testing checklist
- Future enhancement roadmap

Closes JointSave-org#263
- Resolved smart contract conflicts: kept upstream rotational contract with all new features
- Resolved wallet-proof conflicts: kept our new SEP-53 implementation
- Resolved supabase.ts conflicts: merged pause_reason/paused_at with upstream archival fields
- Removed old dashboard/group/[id]/page.tsx (moved to [locale] structure)
- Integrated AdminEmergencyControls into new GroupClient.tsx component
- Added GovernancePanel import to fix missing component

All conflicts resolved and feature preserved in new upstream structure.
- Added incident review page at /dashboard/admin/security/incidents
- Created IncidentReviewCard component for reviewing security incidents
- Created PauseAuthorizationPanel for managing automatic on-chain pause
- Added PausedPoolBanner component shown to all pool members
- Integrated paused pool banner into GroupClient
- Added revokePauseAuthorizationMessage() to wallet-proof.ts
- Added comprehensive i18n strings (EN + ES) for incidents and pauseAuth
- Created component tests for incident status mapping and authorization rendering
- Deep-links from paused pool notifications to incident review screen

Fixes JointSave-org#261
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Admin incident-review and pause-authorization UI for the security circuit breaker

1 participant