Skip to content

refactor: remove JWT VC (jwt_vc_json) credential format support#2508

Merged
swatigoel merged 1 commit into
inji:developfrom
tw-mosip:chore/remove-jwt-vc-json
Jun 26, 2026
Merged

refactor: remove JWT VC (jwt_vc_json) credential format support#2508
swatigoel merged 1 commit into
inji:developfrom
tw-mosip:chore/remove-jwt-vc-json

Conversation

@abhip2565

@abhip2565 abhip2565 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Removes support for the jwt_vc_json W3C VC credential format from Inji Wallet.

Summary by CodeRabbit

  • Bug Fixes

    • Updated credential display and verification logic for supported formats, including clearer handling of field names, labels, and face attributes.
    • Adjusted verification behavior on iOS so only supported formats use the fast-path verification result.
    • Improved fallback behavior when issuer metadata or display labels are unavailable.
  • Documentation

    • Removed outdated documentation for an unsupported credential format.

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>
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

This PR removes jwt_vc_json from the supported VC format set and updates rendering, metadata, OpenID4VCI, and iOS verification flows accordingly. Related tests were updated or removed, and the documentation page was removed.

Changes

Remove jwt_vc_json support

Layer / File(s) Summary
Format contract and consumer updates
shared/VCFormat.ts, shared/VCFormat.test.ts, shared/VCMetadata.test.ts, machines/VerifiableCredential/VCItemMachine/VCItemServices.test.ts
VCFormat drops jwt_vc_json; format tests and metadata coverage are trimmed, and the VC item service test now uses ldp_vc.
Rendering processor and field helpers
components/VC/common/VCProcessor.ts, components/VC/common/VCProcessor.test.ts, components/VC/common/VCUtils.tsx, components/VC/common/VCUtils.test.tsx, components/VC/Views/VCDetailView.tsx
processForRendering no longer special-cases jwt_vc_json; field value, field name, face attribute, and HR-line logic now follow the remaining VC formats, and the related tests remove jwt_vc_json cases.
OpenID4VCI metadata and claim paths
shared/openId4VCI/Utils.ts, shared/openId4VCI/Utils.test.ts
updateCredentialInformation, issuer well-known field extraction, and claim-path serialization stop handling jwt_vc_json; the tests drop that coverage and switch the affected mocked formats to ldp_vc.
iOS verification bypass
shared/vcjs/verifyCredential.ts
The iOS verification fast-path now returns success only for dc_sd_jwt.

Sequence Diagram(s)

Skipped.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested reviewers

  • swatigoel

Poem

🐇 Hop, hop—jwt_vc_json is out of sight,
The remaining formats now dance just right.
Claims and fields with a tidy thrum,
Flutter through paths both old and glum.
I twitched my nose: the code feels light.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is too brief and misses the required Description, issue ticket, and Screenshots sections. Add the template sections, include the issue ticket number/link, and provide screenshots or state that none are applicable.
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main change: removing jwt_vc_json credential format support.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

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 win

Validate the format before the generic claims path.

Right now any unsupported format with a Final 1.0 claims array is field-resolved at Lines 158-164 and never reaches the unsupported-format branch at Lines 201-204. A jwt_vc_json configuration with claims would 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 of

Also 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

📥 Commits

Reviewing files that changed from the base of the PR and between 8654f18 and 92cd501.

📒 Files selected for processing (13)
  • components/VC/Views/VCDetailView.tsx
  • components/VC/common/VCProcessor.test.ts
  • components/VC/common/VCProcessor.ts
  • components/VC/common/VCUtils.test.tsx
  • components/VC/common/VCUtils.tsx
  • docs/jwt-vc-json-support.md
  • machines/VerifiableCredential/VCItemMachine/VCItemServices.test.ts
  • shared/VCFormat.test.ts
  • shared/VCFormat.ts
  • shared/VCMetadata.test.ts
  • shared/openId4VCI/Utils.test.ts
  • shared/openId4VCI/Utils.ts
  • shared/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

@swatigoel swatigoel merged commit e4e5e2a into inji:develop Jun 26, 2026
10 checks passed
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.

2 participants