Conversation
There was a problem hiding this comment.
Pull request overview
Adds a dedicated VP Token validation path for OID4VP, shifting away from the generic “decode authorization response” flow and introducing shared primitives for signature verification and verification-material resolution.
Changes:
- Introduces
VpTokenValidatorto validateVpTokencontents (JWT VC JSON, dc+sd-jwt, vc+sd-jwt), including signature checks and DCQL evaluation. - Refactors VP token building/structural validation (
VpTokenBuilder+validate_presentation_submission) and replacesvalidator-based DCQL validation withthiserror-based error types. - Adds core verification utilities (
VerificationMaterialResolver,SignatureVerifier) and updates tests/usages accordingly.
Reviewed changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| siopv2/src/relying_party.rs | Deprecates validate_response to steer OID4VP users to VpTokenValidator. |
| oid4vp/src/token/vp_token_validator.rs | New VP token validator implementation + tests. |
| oid4vp/src/token/vp_token_builder.rs | Builder now uses Presentations and a custom error type; structural submission validation extracted. |
| oid4vp/src/token/vp_token.rs | Replaces PresentationFormat with Presentations(Vec<StringOrObject>). |
| oid4vp/src/token/verifiable_presentation_jwt*.rs | Makes VP JWT wrapper generic over credential type. |
| oid4vp/src/oid4vp.rs | Removes OID4VP decode_authorization_response implementation and old decoded VP token type. |
| oid4vp/src/dcql_evaluation.rs | Evaluates DCQL against DecodedVpToken instead of raw JSON map. |
| oid4vp/src/dcql/{dcql_query.rs,claims.rs,meta.rs} | Moves validation to explicit validate_all() with custom errors; adds vc+sd-jwt format. |
| oid4vc-core/src/{verifier.rs,verification_material_resolver.rs,types/string_or_object.rs} | Adds signature verifier, verification material resolver trait (+ test impl), and StringOrObject. |
| oid4vc-core/src/jwt.rs | Exposes base64_url_encode publicly. |
| oid4vc-manager/tests/* | Updates tests to use new validator and deprecated paths where needed. |
| Cargo.toml / crate Cargo.toml files | Adds identity-related deps and workspace patches; removes validator usage. |
Comments suppressed due to low confidence (1)
oid4vp/src/oid4vp.rs:49
OID4VPsetsResponseHandle::ResponseItem = DecodedVpToken, but thisExtensionimplementation no longer overridesdecode_authorization_response. Callers using the genericRelyingParty::validate_responsepath will now hit the default implementation and get a runtime "Not implemented" error. Consider reintroducingdecode_authorization_response(possibly delegating toVpTokenValidator), or changingResponseItem/ API so decoding is not expected via theExtensiontrait.
impl ResponseHandle for ResponseHandler {
type Input = VpToken;
type Parameters = AuthorizationResponseParameters;
type ResponseItem = DecodedVpToken;
}
/// This is the [`Extension`] implementation for the [`OID4VP`] extension.
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
pub struct OID4VP;
impl OpenID4VC for OID4VP {}
impl Extension for OID4VP {
type RequestHandle = RequestHandler;
type ResponseHandle = ResponseHandler;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 27 out of 27 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 27 out of 27 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
…ifier and verification material resolver
Description of change
This PR implementation introduces a comprehensive validation flow for OID4VP Verifiable Presentations using DCQL (Digital Credential Query Language), along with necessary infrastructure updates and dependency improvements.
VpTokenValidator: Ideally suited for OID4VP Authorization Responses, this new validator handles:vp_tokenagainst aDcqlQuery.jwt_vc_json,dc+sd-jwt, andvc+sd-jwtpresentation formats.RelyingParty::validate_responseas deprecated for OID4VP flows, steering users towards the newVpTokenValidator.validatorcrate was not functionally used, once it's Error types where utilized so I have replaced it with customthiserrortypes (DcqlQueryError,MetaError,VpTokenBuilderError,DcqlClaimsError) for more granular and idiomatic error reporting across DCQL and token parsing modules.VerificationMaterialResolvertrait for abstracting DID/Key resolution.SignatureVerifierimplementation usingidentity_verification.StringOrObjectutility andPresentationsnewtype for flexible JSON handling.Cargo.tomlto include necessaryidentity-*crates. (the patch changes can be seen here: https://github.com/iotaledger/identity/compare/v1.9.1-beta.1...impierce:identity.rs:fix/issues?expand=1)Breaking change
RelyingPartyManager::validate_responsefor OID4VP Authorization Responses has been deprecated. UseVpTokenValidatorinstead.fn evaluate_dcql_queryandfn evaluate_credential_queryarguments have been changed to use strong typing.Links to any relevant issues
n/a
How the change has been tested
VpTokenValidatorStringOrObjectDefinition of Done checklist
Add an
xto the boxes that are relevant to your changes.