Skip to content

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

Description

@Sendi0011

Summary

The automated incident-response circuit breaker (merged in PR #259) is fully wired server-side but invisible in the UI. An admin monitoring a pool can see security alerts on the admin security page, but there is no screen to review an incident, act on it (resolve / resume / record the on-chain hash), or pre-authorise / revoke the automatic on-chain pause.

The backend already exists and is complete:

  • GET /api/admin/incidents?poolId=&callerAddress= — review queue
  • POST /api/admin/incidents/[id]resolve, resume, record_onchain
  • GET/POST /api/admin/pause-authorizations — register, list, revoke (armed status)

There is no frontend for any of it. When the breaker auto-pauses a pool the admin receives a notification, but has nowhere to open it from.

Requirements

  1. Incident review screen under the existing /dashboard/admin/security area: list incidents for a pool, showing severity, alert count, trigger rules, the decision reason, executed/dry-run state, onchain_status, cooldown/skip_reason, and timestamps — surfaced from GET /api/admin/incidents.
  2. Act on an incident: resolve (required note), resume (platform → active, flagging when onchainUnpauseRequired so the admin knows the contract stays paused), and record the tx hash of the on-chain pause/unpause they signed. Wire to POST /api/admin/incidents/[id], using the existing signMessage proof helper where the endpoint expects a wallet action.
  3. Pause-authorization panel: show armed state per pool, list each authorization with its status (active/used/expired/revoked) and ledger expiry, sign a new one in-browser via signPauseAuthorization (reuse frontend/lib/pause-authorization.ts and @/components/web3-provider's kit), and revoke with the SEP-53 message proof (signRevokeProof).
  4. Primary CTA: make the pool-paused notification/deep-link land on this review screen, and show a banner (mirroring archived-pool-banner.tsx) when a pool is in paused status with a pause_reason, telling members what happened.
  5. i18n: add EN + ES strings under the existing admin namespace (frontend/messages/en.json, es.json).

Notes / context

  • Follow the existing admin/security/page.tsx and security-alert-card.tsx conventions (data fetching, layout, accessibility).
  • The API routes already do server-side auth (creator check) and rate limiting — the UI should pass callerAddress and handle 403s gracefully.
  • The entry XDR is never returned by GET; the UI must not try to display it.
  • Component tests would be valuable here (the codebase uses Vitest + RTL, e.g. frontend/__tests__/deposit-calendar.test.tsx), covering the incident status mapping and the authorization armed/status rendering.

Acceptance criteria

  • Admin can open, review, and act on incidents for a pool they own (resolve / resume / record on-chain hash)
  • Admin can pre-authorise, list, and revoke the automatic on-chain pause from the UI
  • A paused pool shows a banner with its pause_reason, and notifications link to the review screen
  • EN + ES translations present
  • Component tests cover incident status mapping and authorization status rendering
  • Lint, format, and all CI checks pass

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third CampaignfeatureNew functionality to addfrontendhigh-complexityLarge scope, multiple systems/files. Needs planningpriority: highMajor impact, breaks key feature. fix next after P0

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions