Skip to content

Support OpenID4VP multi-signed request in Rust matcher - #45

Merged
netheril96 merged 2 commits into
mainfrom
multisigned-rust-matcher
Jul 24, 2026
Merged

Support OpenID4VP multi-signed request in Rust matcher#45
netheril96 merged 2 commits into
mainfrom
multisigned-rust-matcher

Conversation

@QZHelen

@QZHelen QZHelen commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@QZHelen
QZHelen requested a review from netheril96 July 7, 2026 03:54
pub dcql_query: Option<DcqlQuery>,
pub offer: Option<JsonValue>,
pub transaction_data: Vec<String>,
pub request: String,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to avoid using JsonValue as much as possible. It removes the clarity and guardrails provided by static typing.

We should make request an enum of either a string or a struct with the right fields, and implement a custom DeJson for it, just like how ProtocolRequestData is done.

In addition, the payload field seems to be a mistake. Judging from the test data, it is a subfield of request instead.

@QZHelen
QZHelen force-pushed the multisigned-rust-matcher branch from 10fefde to 090ffde Compare July 17, 2026 05:29
Comment thread matcher-rs/src/openid4vp_models.rs Outdated
}

#[derive(Debug, Clone)]
pub enum OpenId4VpRequestData {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This struct is only for signed requests, right? Let's add "signed" to the name so it is clear to readers that unsigned requests have no use for this struct.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was referring to it as a struct, but it is actually an enum. Sorry for the mistake. The naming comment still stands.

Comment thread matcher-rs/src/openid4vp_models.rs Outdated

#[derive(DeJson, Debug, Clone, Default)]
#[nserde(default)]
pub struct OpenId4VpRequestObject {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, if this is only valid in the context multisigned, we should add multisigned to its name. If this struct is valid for both single-signed and multi-signed cases, we should add signed to its name instead.

@QZHelen
QZHelen force-pushed the multisigned-rust-matcher branch from 090ffde to fe11207 Compare July 21, 2026 02:36
@QZHelen

QZHelen commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

@netheril96 please take a look at this update. I decided not to update any model structure and just parse the request directly into the existing structure, as there's no reason that we need to keep the original payload / signature for now.

Comment thread matcher-rs/src/openid4vp.rs Outdated
pr.request.as_str()
} else {
return Err("Missing multisigned request data".into());
};

@netheril96 netheril96 Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole blocks let json_str = ... looks a lot like the ones in the beginning of parse_protocol_request_data. Shall we extract them out into a function?

Comment thread matcher-rs/src/openid4vp.rs Outdated

let parsed: JsonValue = DeJson::deserialize_json(json_str)?;

let payload = match &parsed {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of match &parsed, write match parsed, then you don't need to clone the strings anymore.

Comment thread matcher-rs/src/openid4vp.rs
@QZHelen
QZHelen requested a review from netheril96 July 23, 2026 04:17
@netheril96
netheril96 merged commit 054646a into main Jul 24, 2026
1 check 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.

2 participants