Repository navigation
Release 3.1.2: keep the signing key out of the malformed-JWK error - #157
Merged
Merged
Conversation
loadUCPSigningKeyFromEnv echoed JSON.parse's message when the private JWK env var was not valid JSON, and V8's message quotes an excerpt of its input, so a malformed key put key characters into the thrown error and from there into logs. The error now names the variable only, and a test asserts no part of the value reaches it. Sweep: eslint 10 with eslint-plugin-import-x, tsup 9 (the esbuild override is retired), the coupled set to mppx 0.13.5 and viem 2.57.7, @solana/kit 8.5, fastify 5.12.7, and publishing on Node 26. The jose load failure now carries its cause; the key-material rethrow withholds it on purpose.
import-x classifies @agent-score/commerce as internal when it resolves to a built dist/ and as external when it does not, so local lint and CI lint (which runs before the build) demanded opposite orders. A pathGroup pins it to external, the old plugin's classification, and the examples keep their original order.
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.
Summary
Maintenance sweep for node-commerce, released as 3.1.2 because it carries one fix to shipped code.
Fix: the signing key no longer leaks into the malformed-JWK error.
loadUCPSigningKeyFromEnvbuilt its "is not valid JSON" error fromJSON.parse's own message. V8 quotes an excerpt of the input in that message (Unexpected token 'S', ...""OKP","d":SECRETBYTE"... is not valid JSON), and the input here is the private JWK, so a malformed key put key characters into the thrown error and from there into whatever logs it. The error now names the variable only, and carries no cause. The other key-material rethrow already withheld its details; it keeps doing so, with a comment on why it has no cause.Sweep:
dist/and as external when it does not, so local lint and CI lint (which runs before the build) demanded opposite orders; apathGroupsentry pins@agent-score/**to external, the old plugin's classification, and lint passes both with and withoutdist/. The examples keep their order. The jose load failure now carries itscause. The dependabot eslint major ignore is removed, and CLAUDE.md and the hook comment no longer say eslint is held.--provenanceand--access.Worked with Varun, as part of a three-session maintenance sweep.
Not done, on purpose: TypeScript stays on 6, since typescript-eslint 8.71.2 still peers typescript <6.1.0. The peer ranges are unchanged; they already admit the new versions. The live all-rails settle that the coupled set owes runs once the FullEnrich store is on the new pins; the result is recorded on the pay release PR.
Type of change
Public API
The malformed-JWK error's message is now
UCP_SIGNING_KEY_JWK_PRIVATE is not valid JSON.(or the configured variable name) without the parser's detail. The type and the variable name in the message are unchanged. No other change to exported types, signatures or wire formats.Test plan
A new test feeds a malformed value and asserts the message carries no part of it and the error carries no cause. It fails against the previous
ucp-jwks.ts(the message matched the value) and passes with the fix. Run locally under Node 24: lint, typecheck, knip, test (1637 passed, 4 skipped) and build, each exit 0. osv-scanner 2.7.0 over bun.lock reports no issues across 842 packages.Checklist