Skip to content

P4.2 PR2: Traffic Hooks admin panel, versions/rollback and dry-run UI - #435

Merged
BaaRai merged 1 commit into
mainfrom
feat/tamper-hooks-ui
Nov 21, 2026
Merged

BaaRai merged 1 commit into
mainfrom
feat/tamper-hooks-ui

Conversation

@BaaRai

@BaaRai BaaRai commented Nov 21, 2026

Copy link
Copy Markdown
Owner

P4.2 PR2: operator UI for the tampering hooks, built on the API merged in #434. No backend change, no new endpoint.

The feature stays off unless ARTEX_TAMPER_HOOKS_ENABLED=1, and the tab is operator-only, like the rest of the traffic tooling.

  • Traffic > Hooks tab: list hooks with phase, priority, enabled state and matchers; create, edit, delete, toggle; version history with rollback. A new hook is always created disabled, the API client forces enabled:false and the toggle is a separate deliberate action.
  • Dry-run: pick a captured exchange from the Traffic list or send a synthetic input (method, URL, headers, body, status). The result shows the mutated request/response, which fields the hook changed, and the per-line trace. Fields a sensitive rule masked are displayed as their keyed HMAC, never in clear.
  • Safety in the UI: binary and compressed bodies are flagged and skipped, bodies over 1 MiB are flagged, and hook source and exchange content are rendered as text only (no dangerouslySetInnerHTML, no eval).
  • i18n: 86 keys added to tr.json and zh-CN.json, English fallback for the rest.

Tests: web/scripts/tamper-hooks.test.mjs covers response parsing, dry-run input derivation from a captured exchange, matcher line parsing, request-phase matcher filtering, and trace decoding with masked-field detection; test:i18n checks key parity; tsc --noEmit is clean.

@BaaRai
BaaRai merged commit 5876d51 into main Nov 21, 2026
6 checks 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.

1 participant