Repository navigation
fix(framework): send Content-Digest and drop the removed request-signature header - #132
Closed
williammacarini wants to merge 1 commit into
Closed
williammacarini wants to merge 1 commit into
williammacarini wants to merge 1 commit into
Conversation
…ature header Every request carried `request-signature: test`, a non-standard header removed from the spec after 2026-01-23 (ucp#636), and no request carried `Content-Digest`. signatures.md requires the digest whenever a request has a body, so a business that enforces it rejected every mutating request and most modules never got past setup. Register an httpx request event hook on the shared client that sets `Content-Digest: sha-256=:<base64>:` over the raw body bytes, and drop `request-signature` from both header helpers. The digest is harmless for businesses that ignore it. Fixes Universal-Commerce-Protocol#129
7 of 12 tasks
Author
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.
Description
Fixes #129.
Every request the suite sent carried
request-signature: test, a non-standard header removed from the spec after 2026-01-23 (Universal-Commerce-Protocol/ucp#636), and no request carriedContent-Digest. signatures.md binds a request body to its signature with RFC 9530Content-Digest, and the header is required whenever a request has a body. A business that enforces the digest therefore rejected every mutating request, and most modules never got past setup.This PR:
add_content_digest, an httpx request event hook registered on the sharedself.client. It setsContent-Digest: sha-256=:<base64>:over the raw body bytes on every request that has a body. Because it is a hook on the client, it also covers bodies the tests build by hand.request-signaturefromBaseIntegrationTest.get_headersand from theintegration_test_utils.get_headersfacade.The digest is harmless for businesses that ignore it. Once #105 adds a signing-key slot, the same hook is where
Signature-InputandSignaturewould go.Evidence. Run against Mercado Pago's business implementation (2026-08-25), which enforces the digest on every request with a body:
main(0642adf)On
main, 52 of the 55 failures areContent-Digest header is missing or invalidduring setup. The 13 left on this branch are gaps on the business side (order webhooks, the simulation and adjustment endpoints, the payment-decline status code) plus #126.Type of change
Checklist
ruff formatandruff checkpass)The pre-commit hooks could not run locally (corporate network blocks the node download for prettier), so CI is the first run of the full hook set.
🤖 Generated with Claude Code