Repository navigation
fix(vc): make validation futures Send - #130
Conversation
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
|
Warning Review limit reachedYou'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. View limit details
No actionable comments were generated in the recent review.
|
| 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:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related PRs
- impierce/identity-kit#94: Adds JWT
statusclaim entries to validation; this change collects those entries withcredentialStatusentries 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: 
5
-
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] requiresvalidateandvalidate_v2futures for the three named validators to be usable inSendcontexts. The PR collects status entries intoVec<CredentialStatus<'_>>before each awaited status check insrc/vc/validation/credential.rs,src/vc/validation/presentation.rs, andsrc/sd_jwt_vc/validation.rs. The sharedcheck_statusesAPI now accepts the vector.tests/validation_send.rstype-checks all six required methods inside aSendfuture. 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-timeSendcoverage for validation futures. The additionalJwtValidator::validateassertion 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.
Comment @coderabbitai help to get the list of available commands.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V5qDJyFr6fJGpmmhjBcfhe
|
@coderabbitai review Generated by Claude Code |
|
|
@coderabbitai review Generated by Claude Code |
✅ Action performed
|
…utures # Conflicts: # src/sd_jwt_vc/validation.rs # src/vc/validation/presentation.rs
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
Fixes #129.
JwtCredentialValidator,JwtPresentationValidatorandSdJwtCredentialValidatorpassed an iterator overCredentialStatus::Vcdm/CredentialStatus::SdJwttocheck_statuses, which kept it across.await. rustc can't prove such a futureSend(rust-lang/rust#110338), so the futures ofvalidateandvalidate_v2couldn't be awaited in a spawned task, anaxumhandler or another future that must beSend. openid4vc'sVpTokenValidator::validate_vp_tokeninherits this, which blocks UniCore from upgrading to openid4vc 0.2.The status entries are now collected into a
Vecbefore the checks are awaited. Only crate-private signatures change.Tests
tests/validation_send.rsawaits all six methods inside anasyncblock that must beSend. 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 docwith-D warningsandcargo build --no-default-features --features did-key,software --lockedpass.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