Skip to content

extract JsonWebKey from @transmute/json-web-signature - #617

Open
maycon-mello wants to merge 6 commits into
masterfrom
dcka-5553-fixing-esm-issues
Open

extract JsonWebKey from @transmute/json-web-signature#617
maycon-mello wants to merge 6 commits into
masterfrom
dcka-5553-fixing-esm-issues

Conversation

@maycon-mello

@maycon-mello maycon-mello commented Aug 5, 2026

Copy link
Copy Markdown
Contributor
  • 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);

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-signature imports with a locally maintained JsonWebKey implementation.
  • Added packages/credential-sdk/src/vc/crypto/JsonWebKey.js to provide JWA-aware signer/verifier wiring for JWK-based suites.
  • Updated packages/credential-sdk dependencies (split transmute packages, removed resolutions, and bumped jsonld-signatures to ^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 mike-parkhill left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some linting errors and I think there's still a Copilot comment that's unresolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants