Skip to content

Confirm-before-revoke for API keys and webhooks using the shared dialog #10

@mikewheeleer

Description

@mikewheeleer

Add a confirmation step before deleting API keys and webhooks

Description

src/app/api-keys/page.tsx revokes a key the instant "Revoke" is clicked, and src/app/webhooks/page.tsx deletes a webhook on the first click of "Remove" — both destructive and irreversible, with no confirmation. The repo already ships ConfirmDialog (currently unused). This issue gates both deletions behind it.

Requirements and context

  • Repository scope: Agentpay-Org/Agentpay-frontend only.
  • Wire ConfirmDialog into both pages: clicking Revoke/Remove opens the dialog naming the target; only Confirm performs the apiDelete.
  • Show a success toast and refresh the list on success; surface failures via the existing role="alert".
  • Keep the dialog dismissible via Cancel and ensure the originating button regains focus when it closes (coordinate with the dialog-a11y issue if landed).

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b feature/api-keys-11-confirm-before-revoke
  • Implement changes
    • Write code in: src/app/api-keys/page.tsx and src/app/webhooks/page.tsx.
    • Write comprehensive tests in: create src/app/api-keys/page.test.tsx and src/app/webhooks/page.test.tsx — assert Cancel makes no call, Confirm deletes and refreshes, and error path alerts.
    • Add documentation: note the confirm step in README.md.
    • Validate role="dialog" / aria-modal semantics are reached.
  • Test and commit

Test and commit

  • Run npm run lint, npm run typecheck, npm test, and npm run build.
  • Cover edge cases: delete failure, double-confirm prevention, and empty list after deletion.
  • Include the npm test output.

Example commit message

feat(api-keys): gate key/webhook deletion behind ConfirmDialog with tests

Guidelines

  • Minimum 95 percent test coverage for the changed pages.
  • Clear, reviewer-focused documentation.
  • Timeframe: 96 hours.

Community & contribution rewards

  • 💬 Join the AgentPay community on Discord for questions, reviews, and faster merges: https://discord.gg/eXvRKkgcv
  • ⭐ This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project — if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward.

Metadata

Metadata

Assignees

No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions