Skip to content

fix/sdjwt import over oid4vc#529

Open
maycon-mello wants to merge 4 commits into
masterfrom
feat/import-decoded-sd-jwt-payload
Open

fix/sdjwt import over oid4vc#529
maycon-mello wants to merge 4 commits into
masterfrom
feat/import-decoded-sd-jwt-payload

Conversation

@maycon-mello
Copy link
Copy Markdown
Collaborator

  • feat: support importing decoded SD-JWT VC payloads
  • honor issuer-advertised format in OID4VCI credential acquisition

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 extends the wallet SDK’s credential import/acquisition flows to (1) accept decoded SD-JWT VC payload objects (not only compact SD-JWT strings) and (2) better respect issuer-advertised credential format/type during OID4VCI issuance.

Changes:

  • Add support for recognizing/transforming decoded SD-JWT VC payload objects into W3C VC shape during import.
  • Introduce OID4VCI helpers to pick the offered credential configuration and derive (format, credentialTypes) from it.
  • Add unit/integration tests covering the new OID4VCI resolution logic and decoded SD-JWT payload import.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/wasm/src/services/credential/service.ts Uses new OID4VCI helper functions to determine format and credentialTypes during acquisition.
packages/wasm/src/services/credential/sd-jwt.ts Adds decoded-payload detection + conversion path; extends SD-JWT identification to accept decoded payload objects.
packages/wasm/src/services/credential/oid4vci.js New helper utilities for selecting offered config and resolving format/type.
packages/wasm/src/services/credential/oid4vci.test.js Unit tests for offered-config resolution and format/type derivation.
packages/core/src/credential-provider.ts Expands SD-JWT detection/conversion to allow object inputs (decoded payloads).
integration-tests/sd-jwt.test.ts Integration test validating import of decoded SD-JWT payload object.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/wasm/src/services/credential/oid4vci.js
Comment thread packages/wasm/src/services/credential/sd-jwt.ts Outdated
Comment thread packages/core/src/credential-provider.ts Outdated
[];

if (Array.isArray(supported)) {
return supported[0];
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.

how do we know the first entry in the array is the right one?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

good point, right now our API can only issue one format and this array is only used in the legacy flow. The latest OpenID specification will auto-select the proper option. But it's worth adding a filter here just to be safe

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