PAR-160
0
Admin webhooks page: list/search/filter all webhooks + create a webhook for an arbitrary account
DoneNormalUnassignedEconomy Explorer
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:
- List every
webhook_subscription(all owners/accounts/firms), newest first, paginated. - 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).
- 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_typemapped from the account type,owner_uuidresolved 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. - 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(oradmin-webhooks.ts):adminCreateWebhookAction({accountId,url})(admin-gated, resolves the account viafindAccount, 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_typeisenum('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.
Resources
- commit5350153 Consolidate admin tools into an Admin section with its own sub-navbar (PAR-161)MCCitiesNetwork/economy-explorer
- PR · merged#18 Release: consolidate admin tools into an Admin section + sub-navbar (PAR-161)MCCitiesNetwork/economy-explorer
- PR#17 Release: admin webhooks page + consolidated Admin section/sub-navbar (PAR-160, PAR-161)MCCitiesNetwork/economy-explorer
- commit3673b37 Merge pull request #17 from MCCitiesNetwork/developMCCitiesNetwork/economy-explorer
- commit5636252 Admin webhooks page: fleet-wide list/search/filter + create for any account (PAR-160)MCCitiesNetwork/economy-explorer
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)
- ParadauxIO linked a pull request — PR #18 merged — Release: consolidate admin tools into an Admin section + sub-navbar (PAR-161)
- ParadauxIO linked a pull request — PR #18 open — Release: consolidate admin tools into an Admin section + sub-navbar (PAR-161)
- ParadauxIO linked a pull request — PR #17 open — Release: admin webhooks page + consolidated Admin section/sub-navbar (PAR-160, PAR-161)
- ParadauxIO linked a commit — Commit 5350153 — Consolidate admin tools into an Admin section with its own sub-navbar (PAR-161)
- ParadauxIO linked a commit — Commit 3673b37 — Merge pull request #17 from MCCitiesNetwork/develop
- ParadauxIO linked a commit — Commit 5636252 — Admin webhooks page: fleet-wide list/search/filter + create for any account (PAR-160)
- ParadauxIO changed status to Status → Done
- ParadauxIO linked a pull request — PR #17 merged — Release: admin webhooks page — fleet-wide list/search/filter + create for any account (PAR-160)
- tesks changed status to Status → Pending Release
- ParadauxIO linked a pull request — PR #17 open — Release: admin webhooks page — fleet-wide list/search/filter + create for any account (PAR-160)
- ParadauxIO linked a commit — Commit 5636252 — Admin webhooks page: fleet-wide list/search/filter + create for any account (PAR-160)
- tesks created the issue