Skip to content

fix(vc): make validation futures Send - #130

Merged
daniel-mader merged 4 commits into
mainfrom
fix/send-validation-futures
Oct 26, 2026
Merged

daniel-mader merged 4 commits into
mainfrom
fix/send-validation-futures

Conversation

@daniel-mader

@daniel-mader daniel-mader commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #129.

JwtCredentialValidator, JwtPresentationValidator and SdJwtCredentialValidator passed an iterator over CredentialStatus::Vcdm / CredentialStatus::SdJwt to check_statuses, which kept it across .await. rustc can't prove such a future Send (rust-lang/rust#110338), so the futures of validate and validate_v2 couldn't be awaited in a spawned task, an axum handler or another future that must be Send. openid4vc's VpTokenValidator::validate_vp_token inherits this, which blocks UniCore from upgrading to openid4vc 0.2.

The status entries are now collected into a Vec before the checks are awaited. Only crate-private signatures change.

Tests

tests/validation_send.rs awaits all six methods inside an async block that must be Send. Without the fix it doesn't compile (implementation of FnOnce is not general enough).

On Rust 1.95.0: cargo fmt --all --check, cargo clippy --all-targets --all-features --locked -- -D warnings, cargo test --all-features --locked, cargo doc with -D warnings and cargo build --no-default-features --features did-key,software --locked pass.

The same change applies cleanly to v0.2.2. With it, UniCore builds against openid4vc 0.2.0, which requires identity-kit 0.2.x.


Generated by Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Status validation now checks credential status entries consistently across credential formats.
    • SD-JWT credential validation now includes both VCDM credential status entries and the SD-JWT status claim in its status check, helping ensure all provided status information is considered.

The validators passed an iterator over `CredentialStatus::Vcdm` and
`CredentialStatus::SdJwt` to `check_statuses`, which kept it across
`.await`. rustc can't prove such a future `Send` (rust-lang/rust#110338),
so the futures couldn't be awaited in a spawned task or a request handler.
The status entries are now collected before the checks are awaited.

Fixes #129

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V5qDJyFr6fJGpmmhjBcfhe
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 39 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between e7d7790 and f0ea55a.

Files selected for processing: 5
  • src/sd_jwt_vc/validation.rs
  • src/vc/validation/credential.rs
  • src/vc/validation/mod.rs
  • src/vc/validation/presentation.rs
  • tests/validation_send.rs

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between cf3d2c1 and e7d7790.

Files selected for processing: 5
  • src/sd_jwt_vc/validation.rs
  • src/vc/validation/credential.rs
  • src/vc/validation/mod.rs
  • src/vc/validation/presentation.rs
  • tests/validation_send.rs

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

Validation paths now collect credential status entries into vectors before status checks. A feature-gated compile-time test checks that the listed validation futures implement Send.

Changes: Send-Compatible Validation

Layer / File(s) Summary
Collect statuses before checking
src/vc/validation/*, src/sd_jwt_vc/validation.rs, tests/validation_send.rs
Credential, presentation, and SD-JWT validation paths collect status entries before checking them. The status-check functions accept vectors. A feature-gated test checks that validation futures implement Send without polling them.

Priority: Normal

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

Change: Bug fix

Possibly related PRs

  • impierce/identity-kit#94: Adds JWT status claim entries to validation; this change collects those entries with credentialStatus entries before status checking.
  • impierce/identity-kit#100: Combines VCDM 2.0 and SD-JWT status checks in presentation validation; this change collects the combined entries before status checking.
Merge Risk: Minimal · previous review e7d77

No actionable merge-blocking risk was identified; this change is mergeable after normal checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "fix(vc): make validation futures Send" matches the main change. The PR collects credential-status entries into a Vec before awaiting status checks, which makes the validation futures Send…
Linked Issues check Passed Issue [#129] requires validate and validate_v2 futures for the three named validators to be usable in Send contexts. The PR collects status entries into Vec<CredentialStatus<'_>> before each a…
Out of Scope Changes check Passed The changes remain focused on issue [#129]. They modify only status-entry collection, the crate-private status-check signatures, and compile-time Send coverage for validation futures. The additional…
Docstring Coverage Passed Docstring coverage is 90.91% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 5 files.
Full details: Title check

Explanation

The title "fix(vc): make validation futures Send" matches the main change. The PR collects credential-status entries into a Vec before awaiting status checks, which makes the validation futures Send. The change touches the validation flow in the SD-JWT and VC modules, and adds a compile-time test (tests/validation_send.rs) that checks the six validation methods are Send. The title is concise, uses a conventional commit prefix, and names the specific outcome. It is not vague or misleading.

Full details: Linked Issues check

Explanation

Issue [#129] requires validate and validate_v2 futures for the three named validators to be usable in Send contexts. The PR collects status entries into Vec&lt;CredentialStatus&lt;'_&gt;&gt; before each awaited status check in src/vc/validation/credential.rs, src/vc/validation/presentation.rs, and src/sd_jwt_vc/validation.rs. The shared check_statuses API now accepts the vector. tests/validation_send.rs type-checks all six required methods inside a Send future. The diff shows no public API changes.

Full details: Out of Scope Changes check

Explanation

The changes remain focused on issue [#129]. They modify only status-entry collection, the crate-private status-check signatures, and compile-time Send coverage for validation futures. The additional JwtValidator::validate assertion is part of the same validation-future type-check and does not add unrelated runtime behavior or public API changes.

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.

@codecov

codecov Bot commented Oct 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review


Generated by Claude Code

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review


Generated by Claude Code

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

…utures

# Conflicts:
#	src/sd_jwt_vc/validation.rs
#	src/vc/validation/presentation.rs
@daniel-mader
daniel-mader merged commit bef0de5 into main Oct 26, 2026
32 checks passed
@daniel-mader
daniel-mader deleted the fix/send-validation-futures branch October 26, 2026 22:51
This was referenced Oct 26, 2026
daniel-mader pushed a commit to impierce/ssi-agent that referenced this pull request Oct 26, 2026
IdentityKit's main branch now has the `Send` fix (impierce/identity-kit#130),
so the patch for openid4vc points at the same revision as the workspace
instead of the v0.2.2 backport.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V5qDJyFr6fJGpmmhjBcfhe
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.

vc, sd_jwt_vc: validation futures can't be awaited where Send is required

2 participants