Paradaux
IssuesPAR-160Done
0

Admin webhooks page: list/search/filter all webhooks + create a webhook for an arbitrary account

Goal

An admin-only page at /admin/webhooks to oversee the whole transaction-feed webhook fleet (PAR-151/153), beyond a player's own /me/webhooks:

  1. List every webhook_subscription (all owners/accounts/firms), newest first, paginated.
  2. Search + filter — by target URL / owner name / account or firm name / id; by scope (account vs firm), status (active / paused / auto-disabled), and source (explorer-managed vs in-game API key).
  3. Create an arbitrary webhook for a given account — admin supplies an account id + URL; the subscription is created scoped to that account (account_id set, firm_id null), key_type mapped from the account type, owner_uuid resolved from the account's owner (so it's a legitimate, model-consistent webhook visible to both the owner and admins). SSRF-validated; secret shown once.
  4. Per-row admin actions: pause/enable, delete (not owner-scoped — admin power).

Implementation (economy-explorer)

  • lib/sql/webhook.ts: listAllWebhooks(filters) + countAllWebhooks (LEFT JOIN accounts/firm/firm_players for display names), adminCreateForAccount(...), adminSetActive(id, active), adminDelete(id) — non-owner-scoped.
  • lib/actions/webhooks.ts (or admin-webhooks.ts): adminCreateWebhookAction({accountId,url}) (admin-gated, resolves the account via findAccount, maps key_type, owner = account owner, SSRF), adminSetWebhookActiveAction, adminDeleteWebhookAction.
  • app/admin/webhooks/page.tsx (admin gate + audit, Toolbar search/filters + table + Pagination, create form), create-admin-webhook-form.tsx, admin-webhook-row-actions.tsx.
  • Add Webhooks to the admin nav (HeaderNav).

Notes

  • key_type is enum('PERSONAL','BUSINESS','GOVERNMENT') — map account type; SYSTEM accounts fall back to a valid enum value (the dispatcher matches by account_id, not key_type).
  • Owner-attribution means the account owner can also see/manage it via /me/webhooks — documented; a covert admin-only oversight webhook would be a separate option if wanted.

Follow-up to PAR-153.

Comments

No comments yet.

Activity

  • ParadauxIO linked a commit — Commit 5350153 — Consolidate admin tools into an Admin section with its own sub-navbar (PAR-161)Jun 14, 2026, 4:39 PM
  • ParadauxIO linked a pull request — PR #18 merged — Release: consolidate admin tools into an Admin section + sub-navbar (PAR-161)Jun 14, 2026, 4:39 PM
  • ParadauxIO linked a pull request — PR #18 open — Release: consolidate admin tools into an Admin section + sub-navbar (PAR-161)Jun 14, 2026, 4:38 PM
  • ParadauxIO linked a pull request — PR #17 open — Release: admin webhooks page + consolidated Admin section/sub-navbar (PAR-160, PAR-161)Jun 14, 2026, 4:37 PM
  • ParadauxIO linked a commit — Commit 5350153 — Consolidate admin tools into an Admin section with its own sub-navbar (PAR-161)Jun 14, 2026, 4:37 PM
  • ParadauxIO linked a commit — Commit 3673b37 — Merge pull request #17 from MCCitiesNetwork/developJun 14, 2026, 4:31 PM
  • ParadauxIO linked a commit — Commit 5636252 — Admin webhooks page: fleet-wide list/search/filter + create for any account (PAR-160)Jun 14, 2026, 4:31 PM
  • ParadauxIO changed status to Status → DoneJun 14, 2026, 4:31 PM
  • ParadauxIO linked a pull request — PR #17 merged — Release: admin webhooks page — fleet-wide list/search/filter + create for any account (PAR-160)Jun 14, 2026, 4:31 PM
  • tesks changed status to Status → Pending ReleaseJun 14, 2026, 4:28 PM
  • ParadauxIO linked a pull request — PR #17 open — Release: admin webhooks page — fleet-wide list/search/filter + create for any account (PAR-160)Jun 14, 2026, 4:28 PM
  • ParadauxIO linked a commit — Commit 5636252 — Admin webhooks page: fleet-wide list/search/filter + create for any account (PAR-160)Jun 14, 2026, 4:28 PM
  • tesks created the issueJun 14, 2026, 4:23 PM