test: pin custom-header coverage on every outbound API call - #424
Merged
Conversation
The header table exists to clear a merchant's firewall, so a call site that skips it is blocked by that same firewall. Pins the pre-auth API-key verification call, and fails the build if a new call site builds its own HTTP client instead of going through the adapter. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Test-only PR (no production code changes). Verified the new execute() call in AdapterTest matches the real method signature ($endpoint, $payload, $method, $storeId, $apiKeyOverride), and the new OutboundCallSiteCoverageTest file-sweep correctly reaches the module sources with a reasonable named-exception list for the signed-URL upload path. No critical issues found.
Ready for human approval ✅
Contributor
Author
|
Adversarial review: ran both test files against the real PR branch (phpunit 10.5.64, no vendor/ needed thanks to the bootstrap stubs).
Full suite: 27/27 passing, no vacuous assertions found. No changes needed. by Claude |
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.
Audit of every outbound call to the API for custom-header coverage, plus tests to keep it that way.
The header table exists so a merchant can clear their own firewall; a call
site that skips it is blocked by that same firewall on that one request.
Audit found no gap — every server-side call routes through
Service\Api\Adapter, which merges the configured rows unconditionally,including the pre-auth API-key verification call. Two tests close the
coverage hole rather than a behaviour one:
carry the configured headers, not just the right key
of going through the adapter
The one non-adapter client is the invoice PUT to a signed Cloud Storage URL,
whose headers are fixed by the signature; it is named as an exception.