Skip to content

Commit

Permalink
rename domains to domain for proof options (#633)
Browse files Browse the repository at this point in the history
* use array as preferred for credential types

Signed-off-by: Ryan Tate <ryan.tate@spruceid.com>
Co-Authored-By: Joey Silberman <joey.silberman@spruceid.com>
Signed-off-by: Ryan Tate <ryan.tate@spruceid.com>

* Update crates/claims/crates/vc/Cargo.toml

* add conversion for json ld types to vec string

Signed-off-by: Ryan Tate <ryan.tate@spruceid.com>

* Update crates/json-ld/Cargo.toml

* use array as preferred for credential types

Signed-off-by: Ryan Tate <ryan.tate@spruceid.com>
Co-Authored-By: Joey Silberman <joey.silberman@spruceid.com>
Signed-off-by: Ryan Tate <ryan.tate@spruceid.com>

* add conversion for json ld types to vec string

Signed-off-by: Ryan Tate <ryan.tate@spruceid.com>

* rename domains to domain for proof options

Co-Authored-By: Timothée Haudebourg <timothee.haudebourg@spruceid.com>
Signed-off-by: Ryan Tate <ryan.tate@spruceid.com>

* remove version bump

Signed-off-by: Ryan Tate <ryan.tate@spruceid.com>

---------

Signed-off-by: Ryan Tate <ryan.tate@spruceid.com>
Co-authored-by: Joey Silberman <joey.silberman@spruceid.com>
Co-authored-by: Timothée Haudebourg <timothee.haudebourg@spruceid.com>
  • Loading branch information
3 people authored Dec 11, 2024
1 parent 3b57c43 commit 5211199
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion crates/claims/crates/data-integrity/core/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub struct ProofOptions<M, T> {
/// Example domain values include: `domain.example`` (DNS domain),
/// `https://domain.example:8443` (Web origin), `mycorp-intranet` (bespoke
/// text string), and `b31d37d4-dd59-47d3-9dd8-c973da43b63a` (UUID).
#[serde(default, skip_serializing_if = "Vec::is_empty")]
#[serde(default, skip_serializing_if = "Vec::is_empty", rename = "domain")]
pub domains: Vec<String>,

/// Used to mitigate replay attacks.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub struct ProofConfiguration<S: CryptographicSuite> {
/// Example domain values include: `domain.example`` (DNS domain),
/// `https://domain.example:8443` (Web origin), `mycorp-intranet` (bespoke
/// text string), and `b31d37d4-dd59-47d3-9dd8-c973da43b63a` (UUID).
#[serde(skip_serializing_if = "Vec::is_empty")]
#[serde(skip_serializing_if = "Vec::is_empty", rename = "domain")]
pub domains: Vec<String>,

/// Used to mitigate replay attacks.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ impl<'de> serde::de::Visitor<'de> for FieldVisitor {
"verificationMethod" => Ok(Field::VerificationMethod),
"proofPurpose" => Ok(Field::ProofPurpose),
"expires" => Ok(Field::Expires),
"domains" => Ok(Field::Domains),
"domain" => Ok(Field::Domains),
"challenge" => Ok(Field::Challenge),
"nonce" => Ok(Field::Nonce),
_ => {
Expand All @@ -316,7 +316,7 @@ impl<'de> serde::de::Visitor<'de> for FieldVisitor {
b"verificationMethod" => Ok(Field::VerificationMethod),
b"proofPurpose" => Ok(Field::ProofPurpose),
b"expires" => Ok(Field::Expires),
b"domains" => Ok(Field::Domains),
b"domain" => Ok(Field::Domains),
b"challenge" => Ok(Field::Challenge),
b"nonce" => Ok(Field::Nonce),
_ => {
Expand All @@ -338,7 +338,7 @@ impl<'de> serde::de::Visitor<'de> for FieldVisitor {
"verificationMethod" => Ok(Field::VerificationMethod),
"proofPurpose" => Ok(Field::ProofPurpose),
"expires" => Ok(Field::Expires),
"domains" => Ok(Field::Domains),
"domain" => Ok(Field::Domains),
"challenge" => Ok(Field::Challenge),
"nonce" => Ok(Field::Nonce),
_ => {
Expand All @@ -360,7 +360,7 @@ impl<'de> serde::de::Visitor<'de> for FieldVisitor {
b"verificationMethod" => Ok(Field::VerificationMethod),
b"proofPurpose" => Ok(Field::ProofPurpose),
b"expires" => Ok(Field::Expires),
b"domains" => Ok(Field::Domains),
b"domain" => Ok(Field::Domains),
b"challenge" => Ok(Field::Challenge),
b"nonce" => Ok(Field::Nonce),
_ => {
Expand Down
2 changes: 1 addition & 1 deletion crates/claims/crates/data-integrity/core/src/proof/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ pub struct Proof<S: CryptographicSuite> {
/// Example domain values include: `domain.example`` (DNS domain),
/// `https://domain.example:8443` (Web origin), `mycorp-intranet` (bespoke
/// text string), and `b31d37d4-dd59-47d3-9dd8-c973da43b63a` (UUID).
#[serde(skip_serializing_if = "Vec::is_empty")]
#[serde(skip_serializing_if = "Vec::is_empty", rename = "domain")]
pub domains: Vec<String>,

/// Used to mitigate replay attacks.
Expand Down

0 comments on commit 5211199

Please sign in to comment.