Skip to content

fix: allow vc+sd-jwt issuance (route SdJwtVc through sd-jwt signing path) - #452

Closed
ajile-in wants to merge 1 commit into
fix/data-type-issuesfrom
fix/oid4vc-vc-sd-jwt-format
Closed

ajile-in wants to merge 1 commit into
fix/data-type-issuesfrom
fix/oid4vc-vc-sd-jwt-format

Conversation

@ajile-in

@ajile-in ajile-in commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Broaden the OID4VC credential mapper to route vc+sd-jwt (SdJwtVc) to the existing sd-jwt signing path (currently only dc+sd-jwt is routed).
  • Credo's OpenId4VcIssuerService already accepts either format in that path and passes the credential configuration format through as the SD-JWT typ header, so the signing code remains format-agnostic.
  • Preserve the original requested format in the thrown error to avoid a TypeScript narrowing-to-never regression introduced by fully covering both formats.

Root cause

getMixedCredentialRequestToCredentialMapper() only dispatched mso_mdoc, dc+sd-jwt, and W3C formats; vc+sd-jwt fell through and threw Invalid request format vc+sd-jwt, even though it is advertised in the swagger enum and examples.

Test coverage

  • e2e: issuance flow parameterized over dc+sd-jwt and vc+sd-jwt (14/14 passing). The stored credential's JWT header typ is asserted against the requested format, confirming the issued token's type matches the configuration.
  • Decoded header example: {"typ":"vc+sd-jwt","alg":"EdDSA",...}

Verification

  • yarn build passes.
  • OID4VC issuance e2e (both formats) passes locally.
  • No changes to routes/swagger/examples beyond the mapper; existing dc+sd-jwt behaviour unchanged.

Notes

  • The askar patch and e2e suite are not included here (kept local) per user choice to keep this PR minimal and focused on the vc+sd-jwt gap.
  • This PR is based on origin/main (clean), so it does not pull in PR Fix type issues #451's local uncommitted changes or the DidController debug leftovers.

Summary by CodeRabbit

  • Bug Fixes
    • Credential requests using SD-JWT VC or SD-JWT DC formats are now handled correctly, and unsupported-format errors identify the requested format.
    • Verification results for mobile document presentations now include document details and the encoded presentation.
    • Credential issuance now uses the issuer’s first certificate when processing mobile document credentials.

@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 05b96acf-1109-41bf-be4e-aea7667d86ee
📥 Commits

Reviewing files that changed from the base of the PR and between 9fdda39 and be361db.

⛔ Files ignored due to path filters: 1
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing: 18
  • Dockerfile
  • package.json
  • patches/@ayanworks+credo-polygon-w3c-module+2.1.0.patch
  • patches/@credo-ts+core+0.6.2+001-fix-change-version-string-type-import-esm-export-interface.patch
  • patches/@credo-ts+core+0.7.0.patch
  • patches/@credo-ts+didcomm+0.7.0.patch
  • patches/@credo-ts+openid4vc+0.7.0.patch
  • src/authentication.ts
  • src/cliAgent.ts
  • src/controllers/did/DidController.ts
  • src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts
  • src/controllers/x509/x509.service.ts
  • src/routes/routes.ts
  • src/routes/swagger.json
  • src/utils/agent.ts
  • src/utils/helpers.ts
  • src/utils/logger.ts
  • src/utils/oid4vc-agent.ts
+------------------------+
| I am the one who bugs. |
+------------------------+
  \
   \     /)/)
        ( '')
        /  |
      o(___)

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4049f2b8-e415-4ed8-98a3-652ef8dbc01a
📥 Commits

Reviewing files that changed from the base of the PR and between 1f8f443 and 9fdda39.

📒 Files selected for processing: 1
  • src/utils/oid4vc-agent.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The credential request mapper now routes both SdJwtDc and SdJwtVc formats to handleSdJwtDcFormat. Invalid-format errors use the saved requested format.

Changes: SD-JWT dispatch

Layer / File(s) Summary
Format dispatch and error reporting
src/utils/oid4vc-agent.ts
The mapper saves the requested format, routes both SD-JWT formats to handleSdJwtDcFormat, and uses the saved format in invalid-format errors.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Suggested reviewers: sagarkhole4

Merge Risk: ⚪ Minimal · up to 9fdda

vc+sd-jwt requests retain their requested format through issuance; no actionable merge risk remains.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies the main change: routing SdJwtVc through the SD-JWT signing path to enable vc+sd-jwt issuance.
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

- Broaden SdJwt dispatch to also handle vc+sd-jwt (cred +sd-jwt accepts
  either format; credo passes the format through as typ header).
- Preserve original format in thrown error to avoid narrowing to never.
@ajile-in
ajile-in force-pushed the fix/oid4vc-vc-sd-jwt-format branch from 9fdda39 to be361db Compare October 19, 2026 11:44
@ajile-in
ajile-in changed the base branch from main to fix/data-type-issues October 19, 2026 11:44
@sonarqubecloud

Copy link
Copy Markdown

@ajile-in

Copy link
Copy Markdown
Member Author

Duplicate of the fix already included in #451 . Closing.

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.

1 participant