Skip to content

feat: confirm-before-revoke for API keys and webhooks (#10)#32

Merged
mikewheeleer merged 1 commit into
Agentpay-Org:mainfrom
ZuLu0890:feat/confirm-before-revoke
Jun 19, 2026
Merged

feat: confirm-before-revoke for API keys and webhooks (#10)#32
mikewheeleer merged 1 commit into
Agentpay-Org:mainfrom
ZuLu0890:feat/confirm-before-revoke

Conversation

@ZuLu0890

Copy link
Copy Markdown
Contributor

Summary

Closes #10.

Adds a confirmation step before any destructive action on the API Keys and Webhooks pages, using the existing shared ConfirmDialog component — no new dependencies.

Changes

File What changed
src/app/api-keys/page.tsx Added pendingRevoke state. Revoke button now opens ConfirmDialog; confirmed fires onDelete, cancelled is a no-op.
src/app/webhooks/page.tsx Added pendingRemove state + onDelete helper. Remove button opens ConfirmDialog; confirmed fires onDelete, cancelled is a no-op.
src/app/api-keys/page.test.tsx 4 new tests: dialog opens on Revoke, cancel does not call DELETE, confirm calls DELETE with correct path, dialog closes after action.
src/app/webhooks/page.test.tsx 4 new tests: same coverage for webhooks Remove flow.

Testing

  • npm run build — ✅ clean (Turbopack, TypeScript)
  • npm test — ✅ 28 tests, 11 suites, 0 failures

Accessibility

ConfirmDialog already carries role="dialog", aria-modal="true", and aria-labelledby. Both trigger buttons are type="button" with visible, descriptive labels.

Wire the shared ConfirmDialog into both the API keys and webhooks pages
so destructive actions require an explicit confirmation step before the
DELETE request is fired.

Changes:
- api-keys/page.tsx: add pendingRevoke state; Revoke button opens dialog,
  onConfirm calls onDelete, onCancel dismisses without side-effects
- webhooks/page.tsx: add pendingRemove state; Remove button opens dialog,
  onConfirm calls onDelete, onCancel dismisses without side-effects
- api-keys/page.test.tsx: 4 tests covering dialog open, cancel, confirm
- webhooks/page.test.tsx: 4 tests covering dialog open, cancel, confirm

All 28 tests pass, build clean.
@mikewheeleer

Copy link
Copy Markdown
Contributor

oh nice, a confirm step before revoking keys and webhooks is a great safety net against fat-finger mistakes. lgtm 👍

@mikewheeleer mikewheeleer merged commit dad1b0f into Agentpay-Org:main Jun 19, 2026
1 check passed
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.

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

2 participants