Support OpenID4VP multi-signed request in Rust matcher#45
Conversation
| pub dcql_query: Option<DcqlQuery>, | ||
| pub offer: Option<JsonValue>, | ||
| pub transaction_data: Vec<String>, | ||
| pub request: String, |
There was a problem hiding this comment.
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.
10fefde to
090ffde
Compare
| } | ||
|
|
||
| #[derive(Debug, Clone)] | ||
| pub enum OpenId4VpRequestData { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
I was referring to it as a struct, but it is actually an enum. Sorry for the mistake. The naming comment still stands.
|
|
||
| #[derive(DeJson, Debug, Clone, Default)] | ||
| #[nserde(default)] | ||
| pub struct OpenId4VpRequestObject { |
There was a problem hiding this comment.
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.
No description provided.