Skip to content

Commit

Permalink
use ssi 0.10 as a single dependency
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Tate <ryan.tate@spruceid.com>
  • Loading branch information
Ryanmtate committed Nov 11, 2024
1 parent d95fe3a commit 2851218
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 26 deletions.
17 changes: 10 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ reqwest = ["oauth2/reqwest"]
[dependencies]
# TODO feature-gate
isomdl = { git = "https://github.com/spruceid/isomdl", rev = "90ce218" }

ssi-claims = "0.1.1"
ssi-dids-core = "0.1.1"
ssi-jwk = "0.3.0"
ssi = { version = "0.10", features = ["secp256r1"] }
# ssi-claims = "0.1.1"
# ssi-dids-core = "0.1.1"
# ssi-jwk = "0.3.1"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_with = "3.3.0"
Expand All @@ -39,8 +39,11 @@ percent-encoding = "2.3.1"

[dev-dependencies]
assert-json-diff = "2.0.2"
did-jwk = "0.2.1"
did-method-key = "0.3.1"
ssi-verification-methods = "0.1.2"
# did-jwk = "0.2.1"
# did-method-key = "0.3.1"
# ssi-verification-methods = "0.1.2"
tokio = { version = "1.25.0", features = ["macros"] }
oid4vci = { path = ".", features = ["reqwest"] }

[patch."crates-io"]
ssi = { path = "../ssi" }
4 changes: 2 additions & 2 deletions src/core/profiles/jwt_vc_json/credential_configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use super::{CredentialSubjectClaims, Format};
pub struct CredentialConfiguration {
format: Format,
#[serde(default, skip_serializing_if = "Vec::is_empty")]
credential_signing_alg_values_supported: Vec<ssi_jwk::Algorithm>,
credential_signing_alg_values_supported: Vec<ssi::jwk::Algorithm>,
credential_definition: CredentialDefinition,
#[serde(default, skip_serializing_if = "Vec::is_empty")]
order: Vec<String>,
Expand All @@ -21,7 +21,7 @@ pub struct CredentialConfiguration {
impl CredentialConfiguration {
field_getters_setters![
pub self [self] ["JWT VC metadata value"] {
set_credential_signing_alg_values_supported -> credential_signing_alg_values_supported[Vec<ssi_jwk::Algorithm>],
set_credential_signing_alg_values_supported -> credential_signing_alg_values_supported[Vec<ssi::jwk::Algorithm>],
set_credential_definition -> credential_definition[CredentialDefinition],
set_order -> order[Vec<String>],
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/profiles/jwt_vc_json/credential_response.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use serde::{Deserialize, Serialize};
use ssi_claims::JwsBuf;
use ssi::claims::JwsBuf;

use crate::profiles::CredentialResponseProfile;

Expand Down
2 changes: 1 addition & 1 deletion src/credential_response_encryption.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use serde::{Deserialize, Serialize};
use ssi_jwk::JWK;
use ssi::jwk::JWK;

pub use crate::types::{BatchCredentialUrl, CredentialUrl, DeferredCredentialUrl, ParUrl};

Expand Down
29 changes: 14 additions & 15 deletions src/proof_of_possession.rs
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
use serde::{Deserialize, Serialize};
use serde_json::Value;
use ssi_claims::{
use ssi::claims::{
jws::{self, Header},
jwt,
};
use ssi_dids_core::DIDURLBuf;
use ssi_jwk::{Algorithm, JWKResolver, JWK};
use ssi::dids::DIDURLBuf;
use ssi::jwk::{Algorithm, JWKResolver, JWK};
use time::{Duration, OffsetDateTime};
use url::Url;

use crate::types::Nonce;

const JWS_TYPE: &str = "openid4vci-proof+jwt";

pub type ProofSigningAlgValuesSupported = Vec<ssi_jwk::Algorithm>;
pub type ProofSigningAlgValuesSupported = Vec<ssi::jwk::Algorithm>;

#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
pub struct KeyProofTypesSupported {
#[serde(rename = "$key$")]
key: KeyProofType,
proof_signing_alg_values_supported: Vec<ssi_jwk::Algorithm>,
proof_signing_alg_values_supported: Vec<ssi::jwk::Algorithm>,
}

#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
Expand Down Expand Up @@ -121,15 +121,15 @@ pub enum ConversionError {
#[error(transparent)]
SerializationError(#[from] serde_json::Error),
#[error(transparent)]
SigningError(#[from] ssi_claims::jws::Error),
SigningError(#[from] ssi::claims::jws::Error),
#[error("Unable to select JWT algorithm, please specify in JWK")]
MissingJWKAlg,
}

#[derive(thiserror::Error, Debug)]
pub enum ParsingError {
#[error(transparent)]
InvalidJWS(#[from] ssi_claims::jws::Error),
InvalidJWS(#[from] ssi::claims::jws::Error),
#[error("JWS type header is invalid, expected `{expected}`, found `{actual}`")]
InvalidJWSType { actual: String, expected: String },
#[error("JWS does not specify an algorithm")]
Expand All @@ -141,11 +141,11 @@ pub enum ParsingError {
#[error("Could not retrieve JWK from KID: {0}")]
KIDDereferenceError(String),
#[error(transparent)]
DIDDereferenceError(#[from] ssi_dids_core::resolution::Error),
DIDDereferenceError(#[from] ssi::dids::resolution::Error),
#[error(transparent)]
InvalidDIDURL(#[from] ssi_dids_core::InvalidDIDURL<String>),
InvalidDIDURL(#[from] ssi::dids::InvalidDIDURL<String>),
#[error(transparent)]
ProofValidationError(#[from] ssi_claims::ProofValidationError),
ProofValidationError(#[from] ssi::claims::ProofValidationError),
}

impl ProofOfPossession {
Expand Down Expand Up @@ -309,12 +309,11 @@ impl ProofOfPossession {

#[cfg(test)]
mod test {
use did_jwk::DIDJWK;
use did_method_key::DIDKey;
use serde_json::json;
use ssi_dids_core::{DIDResolver, VerificationMethodDIDResolver};
use ssi_jwk::JWK;
use ssi_verification_methods::AnyMethod;
use ssi::dids::jwk::DIDJWK;
use ssi::dids::{DIDKey, DIDResolver, VerificationMethodDIDResolver};
use ssi::jwk::JWK;
use ssi::prelude::AnyMethod;

use super::*;

Expand Down

0 comments on commit 2851218

Please sign in to comment.