Repository navigation
Conversation
Every request carried a non-standard `request-signature: test` header that was removed from the spec (ucp#636), and the suite never sent the Content-Digest the signatures spec requires. Remove the header from the default headers and install an httpx request hook on the shared client that adds an RFC 9530 `sha-256` Content-Digest over the raw body bytes of every request that has a body. Fixes Universal-Commerce-Protocol#129
|
@ynachiket thanks for picking up #129. I opened #132 for the same fix without noticing this one, so I'm closing mine in favor of yours, which also has the unit tests and the RFC 9530 vector. Since this PR notes that the server-backed suites weren't run, here's what I saw against a real server. I ran the full suite against Mercado Pago's business implementation (2026-08-25, REST binding), which rejects requests that have a body and no
52 of the 55 failures on |
|
Thanks @williammacarini, and for closing #132 in favor of this one. Your run against Mercado Pago covers the gap the description notes, that the server-backed suites weren't run here. If you're happy with it, I'll add a one-line summary to the PR description: @gswetha, when you have a moment, could you review this? All checks pass and there are no merge conflicts. The one red item is the |
Description
Fixes #129.
Every request from the suite carried a non-standard
request-signature: testheader, which was removed from the spec (ucp#636). The suite also never sentContent-Digest, whichsignatures.mdrequires (RFC 9530,sha-256=:<base64>:over the raw body bytes) on any request that has a body.request-signaturefrom the default headers inframework/base_test.pyandintegration_test_utils.py.framework/content_digest.py:compute_content_digest()and an httpx request event hook,add_content_digest, that setsContent-Digestwhenever the request has a body (bodiless requests are untouched).BaseIntegrationTest.setUp, so every module gets it without per-test changes.framework/content_digest_test.py: unit tests that need no server, including the RFC 9530 sha-256 example vector and a client-level check that the header is sent.Type of change
Checklist
Note:
ruff check,ruff format --check, codespell and the new unit tests pass locally; all 87 existing tests still collect. The server-backed suites were not run locally (no merchant server available).