Token Vault
Webhook Integration

Debug & Testing Tools

Interactive tools for testing webhook endpoints, verifying security, and diagnosing latency.

Token Vault includes built-in debug tools for webhook mode users. Access them from the Debug hub in the navigation bar, or go directly to /debug in the dashboard.

Webhook Endpoint Tester

The endpoint tester at /debug/webhook lets you test each webhook endpoint individually or run a full automated workflow.

Loading diagram...

Available Endpoint Tests

TestEndpointWhat It Verifies
Health CheckGET/POST /v1/healthWebhook is reachable and reports healthy status
Storage ListPOST /v1/storage (list)Can list tokens, audit events, proxy configs, vault config
Storage GetPOST /v1/storage (get)Can retrieve a single item from a collection
Storage BatchPOST /v1/storage (list_batch)Can fetch multiple collections in one call
Storage SetPOST /v1/storage (set)Can write test data to a collection
Storage DeletePOST /v1/storage (delete)Can remove items (requires confirmation)
Refresh GetPOST /v1/refresh (get)TV-mediated refresh Phase 1 works (requires tv-refresh capability)
Forged Credential TicketGET /v1/credentialWebhook rejects tickets signed with wrong HMAC key
Real Ticket from TV IPGET /v1/credentialWebhook rejects requests from Token Vault's IP
Forged Store TicketPOST /v1/storeWebhook rejects store tickets with wrong HMAC key

Each test shows the full HTTP request and response, with secrets masked. Schema validation checks that responses match the expected format. Per-call latency is measured and colour-coded: green (< 200ms), yellow (< 500ms), red (> 500ms).

Full Workflow Test

The "Test All" button runs an automated sequence that exercises the entire webhook protocol:

Loading diagram...
  1. Health check -verify the webhook is reachable.
  2. List tokens -fetch current token metadata.
  3. Write test data -create a test entry in the tokens collection.
  4. Read back -retrieve the test entry and validate the response schema.
  5. Batch list -fetch tokens and audit collections in one call.
  6. Security tests -run forged ticket and IP filtering tests.
  7. Delete test data -clean up the test entry.
  8. Verify cleanup -confirm the test entry no longer appears in listings.

Safe to run

The Full Workflow Test creates and cleans up its own test data (prefixed with __tv_test_). It does not modify your real tokens or credentials.

Results are saved and displayed on the vault settings page via the Webhook Test Results card, showing pass/fail/warning status for each step with the total latency.

Security Tests

Three security tests verify your webhook correctly rejects unauthorized requests. See the Security page for detailed explanations of each test and why they matter.

TestExpected ResultIf It Fails
Forged Credential Ticket401 RejectedAny attacker could bypass Token Vault and steal credentials
Real Ticket from TV IPRejected (warning if accepted)No network-level zero-knowledge isolation
Forged Store Ticket401 RejectedAttackers could overwrite stored credentials

Latency Diagnostics

The latency diagnostics page at /debug/latency simulates a full dashboard load and shows where time is spent.

Waterfall View

Every API call the dashboard makes is timed and displayed as a horizontal bar:

  • Green (< 200ms) -fast, no action needed
  • Yellow (< 500ms) -acceptable, but could be optimised
  • Red (> 500ms) -slow, investigate your webhook or network

Phase Breakdown

Calls are grouped into phases:

  1. Server reads -agent, policy, grant, and user document lookups (parallelised)
  2. Webhook calls -individual /v1/storage calls for tokens, audit, vault config
  3. Batch calls -single /v1/storage list_batch call (if supported)

The summary shows total backend time, browser round-trip, and a verdict identifying whether server or webhook latency is the bottleneck.

System Overview

The diagnostics page also displays:

  • Current vault configuration and webhook status
  • Webhook capabilities (including tv-refresh)
  • Last 5 audit events with timestamps

Backend API Reference

These endpoints power the debug tools and can be called directly for automation:

EndpointMethodDescription
/api/vault/webhook/test-endpointPOSTTest a single webhook endpoint
/api/vault/webhook/test-allPOSTRun the full workflow test
/api/webhook/test-resultsGETRetrieve the last saved test-all results

On this page