refactor: remove JWT VC (jwt_vc_json) credential format support#2508
Conversation
Drops the jwt_vc_json W3C VC format from the wallet: - remove jwt_vc_json from the VCFormat enum - remove its branches from VCProcessor, VCUtils, VCDetailView, verifyCredential and the openId4VCI download/field-resolution Utils - delete docs/jwt-vc-json-support.md - update/remove the affected unit tests and fixtures ldp_vc, mso_mdoc and the SD-JWT formats are unaffected. tsc passes and the affected jest suites are green (278 tests). BREAKING CHANGE: jwt_vc_json credentials are no longer downloaded, processed, rendered or verified by the wallet. Signed-off-by: abhip2565 <paul.apaul.abhishek.ap@gmail.com>
WalkthroughThis PR removes ChangesRemove jwt_vc_json support
Sequence Diagram(s)Skipped. Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
shared/openId4VCI/Utils.ts (1)
157-164: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winValidate the format before the generic
claimspath.Right now any unsupported format with a Final 1.0
claimsarray is field-resolved at Lines 158-164 and never reaches the unsupported-format branch at Lines 201-204. Ajwt_vc_jsonconfiguration withclaimswould still produce fields despite the removal contract.Suggested guard
matchingWellknownDetails = getMatchingCredentialIssuerMetadata( wellknownResponse, credentialConfigurationId, ); + const supportedFormats = [ + VCFormat.mso_mdoc, + VCFormat.ldp_vc, + VCFormat.vc_sd_jwt, + VCFormat.dc_sd_jwt, + ]; + if (!supportedFormats.includes(format as VCFormat)) { + console.error(`Unsupported credential format - ${format} found`); + throw new UnsupportedVcFormat(format); + } // OpenID4VCI Final 1.0: credential_metadata.claims is a flat array ofAlso applies to: 201-204
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@shared/openId4VCI/Utils.ts` around lines 157 - 164, The generic Final 1.0 claims-array resolution in Utils.ts is happening before the format support check, so unsupported formats like jwt_vc_json can still populate fields. Update the logic around the matchingWellknownDetails.claims handling to validate the format first, then only run the claims extraction for supported formats; ensure the unsupported-format branch in the same utility still wins when format is not allowed, even if claims is present.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@shared/openId4VCI/Utils.ts`:
- Around line 157-164: The generic Final 1.0 claims-array resolution in Utils.ts
is happening before the format support check, so unsupported formats like
jwt_vc_json can still populate fields. Update the logic around the
matchingWellknownDetails.claims handling to validate the format first, then only
run the claims extraction for supported formats; ensure the unsupported-format
branch in the same utility still wins when format is not allowed, even if claims
is present.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b8cf45ed-97a5-48a5-903b-b84168e25ce6
📒 Files selected for processing (13)
components/VC/Views/VCDetailView.tsxcomponents/VC/common/VCProcessor.test.tscomponents/VC/common/VCProcessor.tscomponents/VC/common/VCUtils.test.tsxcomponents/VC/common/VCUtils.tsxdocs/jwt-vc-json-support.mdmachines/VerifiableCredential/VCItemMachine/VCItemServices.test.tsshared/VCFormat.test.tsshared/VCFormat.tsshared/VCMetadata.test.tsshared/openId4VCI/Utils.test.tsshared/openId4VCI/Utils.tsshared/vcjs/verifyCredential.ts
💤 Files with no reviewable changes (8)
- docs/jwt-vc-json-support.md
- shared/VCFormat.ts
- components/VC/common/VCUtils.test.tsx
- components/VC/common/VCProcessor.ts
- components/VC/common/VCProcessor.test.ts
- shared/VCMetadata.test.ts
- components/VC/Views/VCDetailView.tsx
- components/VC/common/VCUtils.tsx
Removes support for the
jwt_vc_jsonW3C VC credential format from Inji Wallet.Summary by CodeRabbit
Bug Fixes
Documentation