Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test fixes. #5

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions src/presentation_exchange.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ use serde::{Deserialize, Serialize};
use serde_json::{Map, Value};

// TODO does openidconnect have a Request type?
#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Serialize)]
pub struct ResponseRequest {
_id_token: serde_json::Value, // IdTokenSIOP, // CoreIdTokenClaims,
_vp_token: VpToken,
id_token: serde_json::Value, // IdTokenSIOP, // CoreIdTokenClaims,
vp_token: VpToken,
}

#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
Expand Down Expand Up @@ -129,18 +129,18 @@ pub struct DescriptorMap {
pub id: String,
pub format: String, // TODO should be enum of supported formats
pub path: String,
//pub path_nested: Option<Box<DescriptorMap>>,
pub path_nested: Option<Box<DescriptorMap>>,
}

#[derive(Deserialize)]
#[derive(Serialize, Deserialize)]
pub struct SubmissionRequirementBaseBase {
_name: Option<String>,
_purpose: Option<String>,
#[serde(flatten)]
_property_set: Option<Map<String, serde_json::Value>>,
}

#[derive(Deserialize)]
#[derive(Serialize, Deserialize)]
#[serde(untagged)]
pub enum SubmissionRequirementBase {
From {
Expand All @@ -155,14 +155,14 @@ pub enum SubmissionRequirementBase {
},
}

#[derive(Deserialize)]
#[derive(Serialize, Deserialize)]
#[serde(tag = "rule", rename_all = "snake_case")]
pub enum SubmissionRequirement {
All(SubmissionRequirementBase),
Pick(SubmissionRequirementPick),
}

#[derive(Deserialize)]
#[derive(Serialize, Deserialize)]
pub struct SubmissionRequirementPick {
#[serde(flatten)]
_submission_requirement: SubmissionRequirementBase,
Expand Down Expand Up @@ -224,9 +224,9 @@ pub(crate) mod tests {
// assert_eq!(serde_json::to_value(res).unwrap(), value);
}

#[derive(Deserialize)]
#[derive(Serialize, Deserialize)]
pub struct PresentationDefinitionTest {
_presentation_definition: PresentationDefinition,
presentation_definition: PresentationDefinition,
}

#[test]
Expand Down Expand Up @@ -254,9 +254,9 @@ pub(crate) mod tests {
}

// TODO use VP type?
#[derive(Deserialize)]
#[derive(Serialize, Deserialize)]
pub struct PresentationSubmissionTest {
_presentation_submission: PresentationSubmission,
presentation_submission: PresentationSubmission,
}

#[test]
Expand Down Expand Up @@ -286,9 +286,9 @@ pub(crate) mod tests {
}
}

#[derive(Deserialize)]
#[derive(Serialize, Deserialize)]
pub struct SubmissionRequirementsTest {
_submission_requirements: Vec<SubmissionRequirement>,
submission_requirements: Vec<SubmissionRequirement>,
}

#[test]
Expand Down
Loading