fix(webhooks): send signed payload in GET deliveries - #3368
Open
Sanderhoff-alt wants to merge 1 commit into
Open
fix(webhooks): send signed payload in GET deliveries#3368Sanderhoff-alt wants to merge 1 commit into
Sanderhoff-alt wants to merge 1 commit into
Conversation
GET webhook deliveries signed the serialized event payload but sent no request body. Receivers therefore saw an empty body that could neither be parsed nor verified against X-Hindsight-Signature. Send the exact signed bytes as the GET body and disable caching so a cached response cannot suppress later events sent to the same URL. Keep configured query parameters unchanged. Cover the final httpx transport request, signature verification, query parameters, cache headers, and GET retry behavior. Document the raw-body signature contract and the interoperability limits of GET request bodies.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
GET webhook deliveries serialized an event and computed
X-Hindsight-Signatureover those bytes, but dispatched the request without a body. Receivers therefore observed an empty body, could not parse the event, and could not reproduce the signature from the bytes they received.Design
AsyncClient.requestwithcontent=payload_bytes, since the conveniencegetAPI does not accept request content.Cache-Control: no-cache, no-storefor GET deliveries because HTTP caches generally do not include request content in their cache key and could otherwise suppress later events sent to the same URL.GuardedAsyncTransport, preserving the existing SSRF validation and IP pinning behavior.Contract and compatibility
The signature remains
sha256=HMAC-SHA256(secret, raw_request_body). Receivers must verify the exact body bytes before parsing JSON; reserialization is not equivalent. POST remains the default and recommended method because GET request bodies are not handled consistently by every server, proxy, or framework. The webhook documentation now makes this limitation explicit.Verification
httpx.MockTransportto inspect the final GET method, URL, query parameters, raw body, signature, and cache directive.git diff --check.Scope
This change intentionally does not alter POST delivery semantics, webhook persistence, retry timing, signature format, or URL security policy.