fix/sdjwt import over oid4vc#529
Conversation
maycon-mello
commented
May 15, 2026
- feat: support importing decoded SD-JWT VC payloads
- honor issuer-advertised format in OID4VCI credential acquisition
There was a problem hiding this comment.
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.
| []; | ||
|
|
||
| if (Array.isArray(supported)) { | ||
| return supported[0]; |
There was a problem hiding this comment.
how do we know the first entry in the array is the right one?
There was a problem hiding this comment.
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