Verify authenticity of PDF result webhooks

3 November 2026

A hand holds a key with a small USB device attached.
Illustrative photograph. Cropped and resized. Photo by cottonbro studio on Pexels. · Pexels License

Verify the event’s authentication tag against the exact received bytes before applying a job update. Then check the timestamp, tenant, schema and event identity separately. In the local exercise a correctly authenticated completion was applied, a modified body with its old tag was rejected, and a differently signed body that reused an event ID was rejected for a different reason. None of those outcomes identifies a real vendor or qualifies its webhook endpoint. Signed event results · Event contract

Local fixture execution and verification evidence

Evaluating webhook signature behaviour begins in a controlled test environment using local synthetic records. In the primary contract test artefact signed-event-results.json, verification logic was executed under Python 3.12.14 with exactly zero network calls (network_calls: 0) and the HTTP webhook server marked as NOT_RUN. The local test used a synthetic clock set to 2026-10-31T12:00:00Z, a defined freshness window of 300 seconds, and a public test key explicitly marked as PUBLIC_TEST_VALUE_NOT_A_CREDENTIAL. Event contract · Signed event results

The local test suite compares two distinct event scenarios to establish verification baselines: Signed event results

  1. Authentic completion. The local verifier used event E02, job SYN-J01, revision 2, state SUCCEEDED and tenant SYN-T01. The fixture’s timestamp and exact body produced the expected HMAC; the observed result was APPLIED. An unchanged replay was recognised independently as DUPLICATE. No sandbox transmitted an HTTP request in this local run.
  2. Body altered, original tag retained. The altered bytes no longer match the HMAC generated for the original message. The local altered-body control recorded REJECTED_SIGNATURE. It is not sufficient to validate just the parsed JSON fields; verify the precise byte representation required by the actual supplier’s signing rules.
  3. Altered body, newly valid tag, reused ID. A different test body changed the reported state to FAILED and was signed with the public fixture key. The tag is valid for those bytes. The event ID E02 had already been associated with different bytes, so the observed result was REJECTED_EVENT_ID_CONFLICT. A signature match alone does not make the state transition acceptable.

Signed event results · Event contract

Across the synthetic fixture, all 9 test cases passed successfully, demonstrating how deterministic signature, timestamp, tenant, and schema checks process incoming webhook notifications. Signed event results

Local contract fixtures versus live vendor integrations

Engineers implementing webhook handlers must distinguish between local contract validation and live vendor operations. The test evidence explicitly records that no network endpoints, Transport Layer Security (TLS), durable messaging queues, provider redelivery policies, or source-of-truth API queries were exercised. The first-party record confirms that the test represents a bounded local fixture rather than hardened production validation or a security audit. Signed event results

Furthermore, matching a recorded signature or payload checksum establishes only that the message body arrived unaltered from a possessor of the signing key. It does not verify the business correctness of the processed PDF content, the identity of the intended document owner, or the current authorisation permissions of the receiving endpoint. A live production integration requires additional infrastructure layers, including secret key storage in managed vaults, TLS termination, ingress rate limiting, replay protection via timestamp freshness limits, and status polling reconciliation for unconfirmed jobs.

Design the receiver test

For the buying exercise, use an authorised sandbox and submit one correctly signed result plus a copy whose bytes have changed. Keep those actual observations separate from the previously measured local controls.

What to send through an authorised sandboxExpected decision to verifyEvidence to retain
A genuine, fresh completion for an expected tenant and schemaApply the allowed transition once.Event ID, job/revision, verification result and resulting state.
The same bytes and tag againRecognise a duplicate without a second downstream action.Original event link and second delivery disposition.
A changed body with the first tagReject the authentication check without updating the job.Rejection reason and unchanged state, without storing the secret.
A separately valid body reusing the same ID with changed contentHold or reject the identity conflict.Both body digests and the previous authoritative event.

Choose the supplier’s documented key, rotation method and freshness policy for a real test. The local public test key and 300-second window belong to this fixture. Do not log private signing keys or use a public fixture key on a real endpoint. Include a case with a valid signature for the wrong tenant and one with an unsupported schema. The local outcomes were REJECTED_SCOPE and HELD_SCHEMA; the record does not show a schema upgrade or resolution. Signed event results · Event contract

For each rejected event, inspect the receiving job and any downstream side effects before calling the integration ready. Preserve the redacted request metadata, expected disposition and actual observation. A passing local HMAC comparison is a reproducible control; it does not by itself establish network transport security, sender identity under production keys, durable deduplication or the processing result’s factual correctness. Event contract · Signed event results

Part of the Test duplicate and out-of-order PDF webhook events guide.

Published by Arke Technologies (Pty) Ltd, Johannesburg. Drafted with NotebookLM. Source checks and editing by Kairos (Codex).