extract JsonWebKey from @transmute/json-web-signature - #617
Open
maycon-mello wants to merge 6 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes the direct dependency on @transmute/json-web-signature by introducing a local JsonWebKey implementation and updating internal imports to reference it, while also adjusting package dependencies accordingly.
Changes:
- Replaced
@transmute/json-web-signatureimports with a locally maintainedJsonWebKeyimplementation. - Added
packages/credential-sdk/src/vc/crypto/JsonWebKey.jsto provide JWA-aware signer/verifier wiring for JWK-based suites. - Updated
packages/credential-sdkdependencies (split transmute packages, removedresolutions, and bumpedjsonld-signaturesto^10.0.0).
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/credential-sdk/src/vc/helpers.js | Updates JsonWebKey import to the new local implementation. |
| packages/credential-sdk/src/vc/crypto/JsonWebSignature2020.js | Updates JsonWebKey import path to the new local implementation. |
| packages/credential-sdk/src/vc/crypto/JsonWebKey.js | Introduces local JsonWebKey implementation and JWA signer/verifier setup. |
| packages/credential-sdk/package.json | Removes @transmute/json-web-signature, adds transmute key/jose dependencies, and bumps jsonld-signatures. |
Suppressed comments (1)
packages/credential-sdk/src/vc/crypto/JsonWebKey.js:114
- Typo in error message: "suppport" should be "support" to keep thrown errors clear and searchable.
`getSigner does not suppport ${JSON.stringify(publicKeyJwk, null, 2)}`,
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
|
|
||
| throw new Error( | ||
| `getVerifier does not suppport ${JSON.stringify(publicKeyJwk, null, 2)}`, |
Comment on lines
+88
to
+90
| const { publicKeyJwk } = await k.export({ type: 'JsonWebKey2020' }); | ||
| const { kty, crv } = publicKeyJwk; | ||
| const { alg } = k; |
Comment on lines
+118
to
+128
| const applyJwa = async (k, options) => { | ||
| const verifier = await getVerifier(k, options); | ||
| // eslint-disable-next-line no-param-reassign | ||
| k.verifier = () => verifier; | ||
| if (k.privateKey) { | ||
| const signer = await getSigner(k, options); | ||
| // eslint-disable-next-line no-param-reassign | ||
| k.signer = () => signer; | ||
| } | ||
| return k; | ||
| }; |
mike-parkhill
requested changes
Aug 6, 2026
mike-parkhill
left a comment
Contributor
There was a problem hiding this comment.
Some linting errors and I think there's still a Copilot comment that's unresolved
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.
New file src/vc/crypto/JsonWebKey.js — extracted JsonWebKey from @transmute/json-web-signature (you only ever imported JsonWebKey, which never touches jsonld/http-client). Repointed the 2 imports in JsonWebSignature2020.js and vc/helpers.js.
package.json: removed @transmute/json-web-signature; added its 4 clean sub-deps (ed25519-key-pair, secp256k1-key-pair, jose-ld, web-crypto-key-pair) as direct deps; bumped jsonld-signatures ^9.3.1 → ^10.0.0 (uses jsonld@6, same major you already run);