Repository navigation
fix(client): security hardening - #489
Conversation
🟡 Risk Classification: MINORApproval route: AI Review + Human Approval Classification reasons
Operational gates
Files analysed: 8 wall-e 2026.06.19-02 · policy |
🔬 Debug — why this classification?Each reason code emitted by the classifier, its source clause in the AI in SDLC Control Framework, and what it means.
Kinds:
See issue #3 for the proposal to formalise this map as Appendix A of the standards doc. wall-e 2026.06.19-02 · debug |
🟠 Advisory review: Concerns worth a lookThis PR needs a human approval. Before you give it, these are the things I'd want resolved. This PR hardens request header handling and adds an explicit Concerns
This is not an approval. wall-e cannot auto-approve this PR — it is an opinion to help whoever does. Advisory review · us.anthropic.claude-sonnet-4-6 · wall-e 2026.06.19-02 |
🟡 Risk Classification: MINORApproval route: AI Review + Human Approval Classification reasons
Operational gates
Files analysed: 8 wall-e 2026.06.19-02 · policy |
🔬 Debug — why this classification?Each reason code emitted by the classifier, its source clause in the AI in SDLC Control Framework, and what it means.
Kinds:
See issue #3 for the proposal to formalise this map as Appendix A of the standards doc. wall-e 2026.06.19-02 · debug |
Security hardening of the request headers, on fetch and on axios. updatePaymentInstrumentDetails takes the ETag as an explicit ifMatch parameter, sent as the If-Match header and not sent when undefined or null.
updatePaymentInstrumentDetails emits a runtime warning when ifMatch is not given and body.headers holds an if-match key, the form earlier versions read the ETag from. The key is still sent only inside the body. The types and the method docs describe label, default and ifMatch as in the API reference, and the header group list is exported for its test.
1e5cf4e to
c32b968
Compare
🟡 Risk Classification: MINORApproval route: AI Review + Human Approval Classification reasons
Operational gates
Files analysed: 8 wall-e 2026.06.19-02 · policy |
🔬 Debug — why this classification?Each reason code emitted by the classifier, its source clause in the AI in SDLC Control Framework, and what it means.
Kinds:
See issue #3 for the proposal to formalise this map as Appendix A of the standards doc. wall-e 2026.06.19-02 · debug |
|



Summary
Security hardening of the request headers, and an explicit
ifMatchparameter for the payment instrument update.Changes
src/services/http.js: security hardening of the request headers, on both HTTP clients.src/services/utils.js:setHeader, which sets a header as the only one of its name.src/api/platforms/payment-instruments.js,src/api/platforms/platforms.js:updatePaymentInstrumentDetails(entityId, id, body, ifMatch)sendsifMatchas the onlyIf-Matchheader, replacing a configured one; it is not sent whenundefinedornull, and then a runtime warning is emitted ifbody.headersstill holds anif-matchkey.types/dist/api/platforms/payment-instruments.d.ts,types/dist/api/platforms/platforms.d.ts: theifMatchparameter, thelabelanddefaultdocs from the API reference, andheadersremoved fromUpdatePaymentInstrumentRequest.test/http/requestHeaders.js: request headers on both HTTP clients (fetch and axios), and the payment instrument update withifMatch, OAuth included.test/platforms/payment-instruments/payment-instruments-unit.js: the update passes the ETag inifMatch.Design notes:
setHeaderis used only for the headers the SDK sets (Authorization,Content-Type,Cko-Idempotency-Key, andIf-MatchfromifMatch), so a configured header of the same name is replaced instead of sent next to the SDK value; names are compared as the HTTP clients compare them. The configured header objects are copied for each request, so the merchant's configuration object is not changed. A configuredCko-Idempotency-Keyis still sent when no idempotency key is passed.ifMatchfollowsupdateReserveRule(same parameter position, sent through the configuration headers). The warning usesprocess.emitWarning, so JavaScript callers of the earlier form learn about the change at runtime instead of only through the 428; the key is only detected, never sent as a header. No new validation or error type: a value the HTTP client cannot send is handled by the client as before (fetch rejects it with the SDK'sApiError).API Reference
Breaking changes
Released as a minor version (security hardening).
headersfield in a request body is no longer sent as HTTP headers; it is sent only inside the body. Migration: use the method parameter where there is one, otherwiseoptions.headers.updatePaymentInstrumentDetails: the ETag is no longer read frombody.headers['if-match'], and in TypeScriptifMatchis a required parameter. The API reads the ETag only from theIf-Matchheader and answers 428 without it. Migration:updatePaymentInstrumentDetails(entityId, id, body, ifMatch); a call that still passes the ETag inbody.headersemits a runtime warning.Authorization,Content-TypeorCko-Idempotency-Keyno longer replaces or is sent next to the SDK value, on fetch and on axios. Migration: none needed; pass the idempotency key as the method parameter.Tests
Unit and integration suites green. The integration test
test/http/httpClient-it.js(axios timeout) is intermittent on master too: it can stop the run with an uncaught connection error, and under act the build workflow passed or stopped there depending on the run. It is unrelated to this change.Related
None.