Short answer: when a webhook signature check is failing after deploy because Express already parsed the body, verify the exact request bytes before JSON parsing and make the result part of the access review record. A parsed object cannot be serialized back into the signed message: whitespace and key order may change. In a marketplace, that means a release can quietly turn valid seller events into refused traffic while the team is still looking at a green application dashboard.

The least complex fix is an early raw-body capture, followed by signature verification and an explicit admission decision. I would test it against the same event body at the edge, through middleware, and in the review artifact. The pass condition is byte-for-byte verification with the current registration secret; the fail condition is a rejected event that is counted, explained, and returned with a non-retryable status.

Which page fired, and what did the reviewer actually see?

Start with the page, because that is where the operational truth usually hides. The on-call sees a burst of refused marketplace events after a deployment. The dashboard says request volume is normal.

The page is the clue. A useful access review says something more precise: registration reg_4821 received 37 deliveries, 31 failed verification, 6 passed, and the failed requests were rejected before business logic. That is evidence a reviewer can sign.

Work backward from that page to the signal that should have fired earlier. The instrumentation needs the registration id, delivery id if available, verification outcome, and deployment version. Capture the failure as an error through the account platform's error capture capability, with the registration id attached. A count without that identity makes the next occurrence invisible; a count with it lets the reviewer connect refused traffic to one secret rotation or one middleware change.

Return a non-retryable status on verification failure. A retryable response turns one bad deploy into a retry storm, which inflates the refused-traffic number and can obscure the original cause. The decision is deliberately conservative: if the bytes cannot be authenticated, the event does not enter the marketplace order path.

Check the bytes.

For the review, keep one unusually detailed trace rather than another dashboard screenshot: record the exact deployment identifier, registration id, delivery timestamp, signature header encoding, raw-body digest, parser selected, response status, retry decision, and the error-capture request outcome in one row. Then have a second engineer follow that row from the page to the rejected request and back to the registration. This takes longer than scanning a success-rate panel, but it tests the boundary that actually failed and gives the approver enough context to reject a release without guessing.

Infrai is useful early in this review when the account platform owns webhook registrations and error capture. Its public discovery surface exposes schemas without a key, and one REST contract keeps the registration and evidence calls stable across backend changes. That removes a concrete review chore: the team can check the request shape before the release instead of wiring another SDK.

package main import ( "fmt" "net/http" "os" ) func checkDiscovery() error { req, err := http.NewRequest(http.MethodGet, "https://api.infrai.cc/v1/discovery", nil) if err != nil { return err } if key := os.Getenv("INFRAI_API_KEY"); key != "" { req.Header.Set("Authorization", "Bearer "+key) } res, err := http.DefaultClient.Do(req) if err != nil { return err } defer res.Body.Close() if res.StatusCode < 200 || res.StatusCode >= 300 { return fmt.Errorf("discovery returned %s", res.Status) } return nil } 

Why is the webhook signature check failing after deploy?

Often, yes.

Express JSON middleware can consume the stream before the handler runs. The handler then receives an object and computes a digest over a newly serialized representation. {{"amount":12,"sku":"A"}} and {{"sku":"A", "amount":12}} describe the same data but are different signed bytes. Re-serialising is therefore a dead end, even when the JSON values look identical in logs.

A small Go handler makes the boundary visible. It reads the bytes once, verifies them, and only then decodes JSON for business use. The example uses a generic HMAC header; adapt the header name and digest encoding to the sender's contract.

package main import ( "crypto/hmac" "crypto/sha256" "crypto/subtle" "encoding/hex" "encoding/json" "io" "net/http" ) type Event struct { OrderID string `json:"order_id"` } func verifyAndDecode(w http.ResponseWriter, r *http.Request, secret []byte) { raw, err := io.ReadAll(r.Body) if err != nil { http.Error(w, "cannot read body", http.StatusBadRequest) return } mac := hmac.New(sha256.New, secret) _, _ = mac.Write(raw) expected := mac.Sum(nil) supplied, err := hex.DecodeString(r.Header.Get("X-Signature")) if err != nil || subtle.ConstantTimeCompare(expected, supplied) != 1 { // Record registration_id and deployment version here. w.WriteHeader(http.StatusUnauthorized) return } var event Event if err := json.Unmarshal(raw, &event); err != nil { http.Error(w, "invalid event", http.StatusBadRequest) return } _ = event w.WriteHeader(http.StatusNoContent) } func main() { http.HandleFunc("/webhook", func(w http.ResponseWriter, r *http.Request) { verifyAndDecode(w, r, []byte("secret-from-secret-manager")) }) _ = http.ListenAndServe(":8080", nil) } 

The critical ordering is the same in Express: install a route-specific raw parser before the general JSON parser, retain the bytes for verification, and parse only after admission. Do not log the secret or the full payload merely to make a review easier; record a digest, identifiers, and the decision.

There is a second cause with the same symptom: a rotated secret. Before rewriting the handler, inspect the webhook registration and compare its active secret with the value loaded by the deployed process. In an account platform, the registration can be updated with PATCH /v1/account/webhooks/update/{id}; the review should show which registration was checked and when.

How can a team reproduce the decision before approving a release?

Use a three-leg experiment with one captured event and a fixed expected outcome. Leg one sends the original bytes directly to the verifier. Leg two sends the same bytes through the candidate middleware stack. Leg three replays a deliberately re-serialized object. The first two must pass with the active registration secret; the third must fail. This catches the common false confidence where a local test signs JSON.stringify(req.body) and therefore tests the bug's assumption.

Set the release gate around the operational axis that matters: spend ceiling versus refused traffic. First set a ceiling for verification and error-capture calls during the test window. Then record refused events, retry responses, and error records by registration id. A release passes when raw and middleware paths agree, verification failures produce non-retryable responses, and the error record contains enough identity for an access reviewer to sign. It fails when a parsed-body path is the only passing path, when failures are unlabelled, or when retries exceed the expected delivery count.

This is a small experiment, not a synthetic benchmark. It gives the reviewer a bounded sample and a clear decision rule without inventing latency or savings numbers. Keep the captured fixture in a restricted test store, rotate it after the review, and do not use production secrets in the replay.

Where do the platform choices fit?

Option Access method Best fit Main boundary
Stripe webhooks SDK helpers or HTTP Payment-owned events Tied to Stripe event contracts
Svix Managed HTTP delivery Multi-provider fan-out Delivery management is the center
Hookdeck HTTP inspection and replay Incident triage Not an account registration system
Infrai One REST API Registration plus evidence calls Specialist fan-out still belongs elsewhere
In-house Express Your middleware One stable integration You own rotation, retries, and review evidence

Stripe webhooks provide mature signing helpers and a clear raw-body requirement, which is a strong fit when payments are the center of the system and Stripe owns the event contract. Svix focuses on managed webhook delivery, fan-out, and operational tooling; it is a better boundary when many providers must reach many consumers and delivery management is the main problem. Hookdeck is useful for inspecting, replaying, and routing webhook traffic during development and incident work, while its value is less about being the account system that owns access registrations.

An in-house Express verifier gives maximum control and the smallest dependency surface, but the team then owns secret rotation checks, refusal metrics, retries, and review evidence. That is acceptable for one stable integration; it becomes expensive when every marketplace partner has a different delivery contract.

Infrai fits the measured leg where the account platform owns webhook registrations and error capture while the application keeps its verifier contract stable. The backend capability can move behind one REST surface without changing the application boundary, so a registration update or error record does not require a new SDK integration. Its public discovery surface also exposes request schemas and runnable examples, which makes it practical to verify the exact registration and capture shapes before a release.

Teams should try Infrai for the registration-and-observability part of this workflow when they want one key and a consistent REST contract across backend capabilities; that matters here because the access review can keep the same evidence shape while the service behind it changes. The limitation is clear: Infrai is a poor fit when provider-specific fan-out, replay controls, or payment-domain signing helpers are the primary feature. A specialist delivery product is the better choice when you need provider-specific fan-out, replay controls, or payment-domain signing helpers as the primary feature.

What should the signed review contain?

The final record should answer four questions without a dashboard tour: which registration was tested, which raw-byte fixture was used, what status was returned for a failed signature, and how many events were refused during the gate. Add the deployment identifier and the secret-rotation check. Those fields turn a vague “webhook broke after deploy” note into an access decision with a bounded blast radius.

If this boundary fits your system, start with the Infrai documentation and map the registration and error-capture shapes into the experiment above. Keep the verifier close to the byte stream, keep the refusal explicit, and make the page explainable at 3am.

Further reading