Skip to content

fix: allow vc+sd-jwt issuance by routing SdJwtVc to sd-jwt signing path - #454

Merged
ankita-p17 merged 1 commit into
mainfrom
fix/oid4vc-vc-sd-jwt-issuance
Oct 20, 2026
Merged

ankita-p17 merged 1 commit into
mainfrom
fix/oid4vc-vc-sd-jwt-issuance

Conversation

@ajile-in

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

Copy link
Copy Markdown
Member

Problem

Credential configurations using the vc+sd-jwt format fail issuance with:

Invalid request format vc+sd-jwt

getMixedCredentialRequestToCredentialMapper in src/utils/oid4vc-agent.ts only dispatched SdJwtDc (dc+sd-jwt) to handleSdJwtDcFormat, so anything configured as vc+sd-jwt fell through to the catch-all throw.

Change

  • Route SdJwtVc (vc+sd-jwt) through the same sd-jwt signing path as SdJwtDc (dc+sd-jwt). Credo's OpenId4VcIssuerService accepts ClaimFormat.SdJwtDc sign options for either configuration format and passes the format through as the credential typ header.
  • Capture the original format in a requestedFormat local and use it in the thrown error, so the residual error path does not narrow to never.

Scope

Single file, src/utils/oid4vc-agent.ts — 9 insertions, 2 deletions. Follow-up to #451; supersedes the closed #452.

Verification

  • npx tsc --noEmit -p tsconfig.build.json passes.
  • Local OID4VC e2e issuance for dc+sd-jwt, vc+sd-jwt and mso_mdoc all pass.

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of SD-JWT credential configurations, including clearer errors when a credential format is invalid.

- 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.

Signed-off-by: Ajay Jadhav <ajay@ayanworks.com>
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3a4f7c40-2017-4701-b1de-c1ea59f856ce
📥 Commits

Reviewing files that changed from the base of the PR and between 6b19172 and e2ea740.

📒 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 mapper now routes both SdJwtDc and SdJwtVc configurations through the SD-JWT handler. Invalid-format errors use the captured requested format.

Changes: SD-JWT credential mapping

Layer / File(s) Summary
SD-JWT dispatch and format errors
src/utils/oid4vc-agent.ts
The mapper routes both SD-JWT formats through the SD-JWT handler. It captures the requested format and uses it in invalid-format errors.

Priority: ➖ Normal

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

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: sagarkhole4

Merge Risk: ⚪ Minimal · up to e2ea7

The mapper supports both SD-JWT profiles while preserving the requested credential type. No actionable merge-blocking risk remains in the reviewed change.

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 and concisely describes the main change: routing SdJwtVc issuance through the SD-JWT signing path.
Linked Issues check Passed Linked issue #452 is closed. It provides historical context only. The PR objectives state that no active directly linked issue targets remain. No linked-issue coding requirements apply.
Out of Scope Changes check Passed The reported change is limited to src/utils/oid4vc-agent.ts. It routes SdJwtVc through the existing SD-JWT handler and preserves the requested format for the error path. These changes match the PR int…
Full details: Out of Scope Changes check

Explanation

The reported change is limited to src/utils/oid4vc-agent.ts. It routes SdJwtVc through the existing SD-JWT handler and preserves the requested format for the error path. These changes match the PR intent and do not show unrelated scope.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 2
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • 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.

@ankita-p17
ankita-p17 merged commit e0ccb09 into main Oct 20, 2026
3 of 4 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.

3 participants