diff --git a/Cargo.lock b/Cargo.lock index c323c5074f..c0e1e57ce9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -811,7 +811,7 @@ dependencies = [ [[package]] name = "libvcx" -version = "0.20.0" +version = "0.20.1" dependencies = [ "android_logger", "aries-vcx", diff --git a/agents/node/vcxagent-core/package.json b/agents/node/vcxagent-core/package.json index cf937ca387..0f379ad0af 100644 --- a/agents/node/vcxagent-core/package.json +++ b/agents/node/vcxagent-core/package.json @@ -67,6 +67,6 @@ "winston": "^3.3.3" }, "peerDependencies": { - "@hyperledger/node-vcx-wrapper": "^0.20.0" + "@hyperledger/node-vcx-wrapper": "^0.20.1" } } diff --git a/agents/node/vcxagent-core/test/feature-discovery.spec.js b/agents/node/vcxagent-core/test/feature-discovery.spec.js index e44c04c233..b2b0c4a7dd 100644 --- a/agents/node/vcxagent-core/test/feature-discovery.spec.js +++ b/agents/node/vcxagent-core/test/feature-discovery.spec.js @@ -26,13 +26,13 @@ describe('send ping, get ping', () => { expect(aliceMessages1.length).toBe(1) expect(JSON.parse(aliceMessages1[0].decryptedMsg)["@type"].match(/discover-features\/1.0\/disclose/)) const disclosedProtocols = JSON.parse(aliceMessages1[0].decryptedMsg)["protocols"].map(r => r.pid) - expect(disclosedProtocols).toContain("did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/connections/1.0") - expect(disclosedProtocols).toContain("did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/issue-credential/1.0") - expect(disclosedProtocols).toContain("did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/report-problem/1.0") - expect(disclosedProtocols).toContain("did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/present-proof/1.0") - expect(disclosedProtocols).toContain("did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/trust_ping/1.0") - expect(disclosedProtocols).toContain("did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/discover-features/1.0") - expect(disclosedProtocols).toContain( "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/basicmessage/1.0") + expect(disclosedProtocols).toContain("https://didcomm.org/connections/1.0") + expect(disclosedProtocols).toContain("https://didcomm.org/issue-credential/1.0") + expect(disclosedProtocols).toContain("https://didcomm.org/report-problem/1.0") + expect(disclosedProtocols).toContain("https://didcomm.org/present-proof/1.0") + expect(disclosedProtocols).toContain("https://didcomm.org/trust_ping/1.0") + expect(disclosedProtocols).toContain("https://didcomm.org/discover-features/1.0") + expect(disclosedProtocols).toContain( "https://didcomm.org/basicmessage/1.0") await alice.updateConnection(4) const aliceMessages2 = await alice.downloadReceivedMessagesV2() diff --git a/aries_vcx/src/messages/a2a/message_family.rs b/aries_vcx/src/messages/a2a/message_family.rs index 45b8724cdb..0743089d8a 100644 --- a/aries_vcx/src/messages/a2a/message_family.rs +++ b/aries_vcx/src/messages/a2a/message_family.rs @@ -16,7 +16,8 @@ pub enum MessageFamilies { } impl MessageFamilies { - pub const DID: &'static str = "did:sov:BzCbsNYhMrjHiqZDTUASHg"; + pub const ARIES_CORE_PREFIX: &'static str = "https://didcomm.org"; + pub const DID_PREFIX: &'static str = "did:sov:BzCbsNYhMrjHiqZDTUASHg"; pub fn version(&self) -> &'static str { match self { @@ -35,7 +36,7 @@ impl MessageFamilies { } pub fn id(&self) -> String { - format!("{};spec/{}/{}", Self::DID, self.to_string(), self.version().to_string()) + format!("{}/{}/{}", Self::ARIES_CORE_PREFIX, self.to_string(), self.version().to_string()) } pub fn actors(&self) -> Option<(Actors, Actors)> { diff --git a/aries_vcx/src/messages/a2a/message_type.rs b/aries_vcx/src/messages/a2a/message_type.rs index 33cb4d04a2..aaaae9f5f9 100644 --- a/aries_vcx/src/messages/a2a/message_type.rs +++ b/aries_vcx/src/messages/a2a/message_type.rs @@ -1,42 +1,42 @@ +use regex::{Match, Regex}; use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; use serde_json::Value; -use agency_client::message_type::parse_message_type; +use crate::error::{VcxError, VcxErrorKind, VcxResult}; use crate::messages::a2a::message_family::MessageFamilies; #[derive(Debug, Clone, PartialEq, Default)] pub struct MessageType { - pub did: String, + pub prefix: String, pub family: MessageFamilies, pub version: String, - pub type_: String, + pub msg_type: String, } impl MessageType { pub fn build(family: MessageFamilies, name: &str) -> MessageType { MessageType { - did: MessageFamilies::DID.to_string(), + prefix: MessageFamilies::ARIES_CORE_PREFIX.to_string(), version: family.version().to_string(), family, - type_: name.to_string(), + msg_type: name.to_string(), } } } - impl<'de> Deserialize<'de> for MessageType { fn deserialize(deserializer: D) -> Result where D: Deserializer<'de> { let value = Value::deserialize(deserializer).map_err(de::Error::custom)?; match value.as_str() { Some(type_) => { - let (did, family, version, type_) = parse_message_type(type_).map_err(de::Error::custom)?; - Ok(MessageType { - did, - family: MessageFamilies::from(family), - version, - type_, - }) + if let Some(msg_type) = parse_message_type_legacy(type_) { + Ok(msg_type) + } else if let Some(msg_type) = parse_message_type(type_) { + Ok(msg_type) + } else { + Err(de::Error::custom("Unexpected @type field structure.")) + } } _ => Err(de::Error::custom("Unexpected @type field structure.")) } @@ -52,6 +52,77 @@ impl Serialize for MessageType { impl std::string::ToString for MessageType { fn to_string(&self) -> String { - format!("{};spec/{}/{}/{}", self.did, self.family.to_string(), self.version, self.type_) + if self.family == MessageFamilies::Routing { // vcxagency-node only supports legacy format right now + format!("{};spec/{}/{}/{}", MessageFamilies::DID_PREFIX.to_string(), self.family.to_string(), self.version, self.msg_type) + } else { + format!("{}/{}/{}/{}", self.prefix, self.family.to_string(), self.version, self.msg_type) + } + } +} + + +pub fn parse_message_type_legacy(message_type: &str) -> Option { + lazy_static! { + static ref RE: Regex = Regex::new(r"(?x) + (?P[\d\w:]*); + (?P.*)/ + (?P.*)/ + (?P.*)/ + (?P.*)").unwrap(); } + + RE.captures(message_type) + .and_then(|cap| { + let did = cap.name("did").as_ref().map(Match::as_str); + let family = cap.name("family").as_ref().map(Match::as_str); + let version = cap.name("version").as_ref().map(Match::as_str); + let msg_type = cap.name("type").as_ref().map(Match::as_str); + + match (did, family, version, msg_type) { + (Some(did), Some(family), Some(version), Some(msg_type)) => { + Some(MessageType { + prefix: did.to_string(), + family: MessageFamilies::from(family.to_string()), + version: version.to_string(), + msg_type: msg_type.to_string(), + }) + } + _ => { + panic!("Message type regex captures, but failed to map it onto MessageType structure.") + } + } + }) +} + +pub fn parse_message_type(message_type: &str) -> Option { + lazy_static! { + static ref RE: Regex = Regex::new(r"(?x) + (?P.+)/ # https://didcomm.org/ + (?P.+)/ # connections/ + (?P.+)/ # 1.0/ + (?P.+) # request + ").unwrap(); + } + + RE.captures(message_type) + .and_then(|cap| { + let prefix = cap.name("prefix").as_ref().map(Match::as_str); + let family = cap.name("family").as_ref().map(Match::as_str); + let version = cap.name("version").as_ref().map(Match::as_str); + let msg_type = cap.name("type").as_ref().map(Match::as_str); + + match (prefix, family, version, msg_type) { + (Some(prefix), Some(family), Some(version), Some(msg_type)) => { + Some(MessageType { + prefix: prefix.to_string(), + family: MessageFamilies::from(family.to_string()), + version: version.to_string(), + msg_type: msg_type.to_string(), + }) + } + _ => { + panic!("Message type regex captures, but failed to map it onto MessageType structure.") + } + } + }) } diff --git a/aries_vcx/src/messages/a2a/mod.rs b/aries_vcx/src/messages/a2a/mod.rs index 1787693b36..3b6ae97861 100644 --- a/aries_vcx/src/messages/a2a/mod.rs +++ b/aries_vcx/src/messages/a2a/mod.rs @@ -1,37 +1,34 @@ -pub mod message_family; -pub mod message_type; -pub mod protocol_registry; - -use log; -use self::message_type::MessageType; -use self::message_family::MessageFamilies; - use serde::{de, Deserialize, Deserializer, ser, Serialize, Serializer}; use serde_json::Value; +use log; + +use crate::messages::ack::Ack; +use crate::messages::basic_message::message::BasicMessage; use crate::messages::connection::invite::Invitation; +use crate::messages::connection::problem_report::ProblemReport as ConnectionProblemReport; use crate::messages::connection::request::Request; use crate::messages::connection::response::SignedResponse; -use crate::messages::connection::problem_report::ProblemReport as ConnectionProblemReport; -use crate::messages::trust_ping::ping::Ping; -use crate::messages::trust_ping::ping_response::PingResponse; -use crate::messages::forward::Forward; +use crate::messages::discovery::disclose::Disclose; +use crate::messages::discovery::query::Query; use crate::messages::error::ProblemReport as CommonProblemReport; -use crate::messages::issuance::credential_proposal::CredentialProposal; -use crate::messages::ack::Ack; - +use crate::messages::forward::Forward; +use crate::messages::issuance::credential::Credential; use crate::messages::issuance::credential_offer::CredentialOffer; +use crate::messages::issuance::credential_proposal::CredentialProposal; use crate::messages::issuance::credential_request::CredentialRequest; -use crate::messages::issuance::credential::Credential; - +use crate::messages::proof_presentation::presentation::Presentation; use crate::messages::proof_presentation::presentation_proposal::PresentationProposal; use crate::messages::proof_presentation::presentation_request::PresentationRequest; -use crate::messages::proof_presentation::presentation::Presentation; +use crate::messages::trust_ping::ping::Ping; +use crate::messages::trust_ping::ping_response::PingResponse; -use crate::messages::discovery::query::Query; -use crate::messages::discovery::disclose::Disclose; +use self::message_family::MessageFamilies; +use self::message_type::MessageType; -use crate::messages::basic_message::message::BasicMessage; +pub mod message_family; +pub mod message_type; +pub mod protocol_registry; #[derive(Debug, PartialEq, Clone)] pub enum A2AMessage { @@ -93,7 +90,7 @@ impl<'de> Deserialize<'de> for A2AMessage { Err(_) => return Ok(A2AMessage::Generic(value)) }; - match (message_type.family, message_type.type_.as_str()) { + match (message_type.family, message_type.msg_type.as_str()) { (MessageFamilies::Routing, A2AMessage::FORWARD) => { Forward::deserialize(value) .map(|msg| A2AMessage::Forward(msg)) @@ -294,6 +291,144 @@ impl A2AMessage { const BASIC_MESSAGE: &'static str = "message"; } +#[cfg(test)] +pub mod test_a2a_serialization { + use serde_json::Value; + + use crate::messages::a2a::{A2AMessage, MessageId}; + use crate::messages::ack::{Ack, AckStatus}; + use crate::messages::connection::request::Request; + use crate::utils::devsetup::SetupDefaults; + use crate::messages::forward::Forward; + + #[test] + #[cfg(feature = "general_test")] + fn test_serialization_deserialization_connection_request() { + let _setup = SetupDefaults::init(); + let a2a_msg = A2AMessage::ConnectionRequest(Request { + id: Default::default(), + label: "foobar".to_string(), + connection: Default::default(), + }); + let serialized = serde_json::to_string(&a2a_msg).unwrap(); + + // serialization + let val: Value = serde_json::from_str(&serialized).unwrap(); + assert_eq!(val["@id"], Value::String("testid".into())); + assert_eq!(val["@type"], Value::String("https://didcomm.org/connections/1.0/request".into())); + assert_eq!(val["label"], Value::String("foobar".into())); + assert_eq!(val["connection"]["DID"], Value::String("".into())); + assert!(val["connection"]["DIDDoc"].is_object()); + + // deserialization back + let a2a_msg: A2AMessage = serde_json::from_str(&serialized).unwrap(); + if let A2AMessage::ConnectionRequest(request) = &a2a_msg { + assert_eq!(request.id, MessageId("testid".into())); + assert_eq!(request.label, "foobar"); + } else { + panic!("The message was expected to be deserialized as ConnectionRequest, but was not. Deserialized: {:?} ", a2a_msg) + } + } + + #[test] + #[cfg(feature = "general_test")] + fn test_serialize_deserialize_connection_ack() { + let _setup = SetupDefaults::init(); + let a2a_msg = A2AMessage::Ack(Ack::create().set_status(AckStatus::Ok)); + let serialized = serde_json::to_string(&a2a_msg).unwrap(); + + // serialization + let val: Value = serde_json::from_str(&serialized).unwrap(); + assert_eq!(val["@id"], Value::String("testid".into())); + assert_eq!(val["@type"], Value::String("https://didcomm.org/notification/1.0/ack".into())); + assert_eq!(val["status"], Value::String("OK".into())); + assert!(val["~thread"].is_object()); + + // deserialization back + let a2a_msg: A2AMessage = serde_json::from_str(&serialized).unwrap(); + if let A2AMessage::Ack(ack) = &a2a_msg { + assert_eq!(ack.id, MessageId("testid".into())); + assert_eq!(ack.thread.sender_order, 0); + } else { + panic!("The message was expected to be deserialized as ConnectionRequest, but was not. Deserialized: {:?} ", a2a_msg) + } + } + + #[test] + #[cfg(feature = "general_test")] + // todo: Add support for aries @type-ed messages on vcxagency-node, then we can stop giving fwd messages special treatment, delete this test + fn test_serialize_forward_message_to_legacy_format() { + let _setup = SetupDefaults::init(); + let a2a_msg = A2AMessage::Forward(Forward::new("BzCbsNYhMrjHiqZDTUASHg".into(), "{}".as_bytes().to_vec()).unwrap()); + let serialized = serde_json::to_string(&a2a_msg).unwrap(); + + // serialization + let val: Value = serde_json::from_str(&serialized).unwrap(); + assert_eq!(val["@type"], Value::String("did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/routing/1.0/forward".into())); + } + + #[test] + #[cfg(feature = "general_test")] + fn test_deserialize_connection_ack_legacy() { + let _setup = SetupDefaults::init(); + let msg = + r#"{ + "@id": "testid", + "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/notification/1.0/ack", + "status": "OK", + "~thread": { + "received_orders": {}, + "sender_order": 0 + } + }"#; + let a2a_msg: A2AMessage = serde_json::from_str(msg).unwrap(); + if let A2AMessage::Ack(ack) = &a2a_msg { + assert_eq!(ack.id, MessageId("testid".into())); + assert_eq!(ack.thread.sender_order, 0); + } else { + panic!("The message was expected to be deserialized as Ack, but was not.") + } + } + + #[test] + #[cfg(feature = "general_test")] + fn test_deserialization_connection_request_legacy() { + let _setup = SetupDefaults::init(); + let msg = + r#"{ + "@id": "testid", + "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/connections/1.0/request", + "connection": { + "DID": "", + "DIDDoc": { + "@context": "https://w3id.org/did/v1", + "authentication": [], + "id": "", + "publicKey": [], + "service": [ + { + "id": "did:example:123456789abcdefghi;indy", + "priority": 0, + "recipientKeys": [], + "routingKeys": [], + "serviceEndpoint": "", + "type": "IndyAgent" + } + ] + } + }, + "label": "foofoo" + }"#; + let a2a_msg: A2AMessage = serde_json::from_str(msg).unwrap(); + if let A2AMessage::ConnectionRequest(request) = &a2a_msg { + assert_eq!(request.id, MessageId("testid".into())); + assert_eq!(request.label, "foofoo"); + } else { + panic!("The message was expected to be deserialized as Connection Request, but was not.") + } + } +} + #[macro_export] macro_rules! a2a_message { ($type:ident) => ( diff --git a/aries_vcx/src/messages/a2a/protocol_registry.rs b/aries_vcx/src/messages/a2a/protocol_registry.rs index a0af689ad2..21dbf34f9c 100644 --- a/aries_vcx/src/messages/a2a/protocol_registry.rs +++ b/aries_vcx/src/messages/a2a/protocol_registry.rs @@ -3,11 +3,11 @@ use strum::IntoEnumIterator; use crate::messages::a2a::message_family::MessageFamilies; use crate::messages::discovery::disclose::ProtocolDescriptor; -use crate::settings::Actors; use crate::settings; +use crate::settings::Actors; pub struct ProtocolRegistry { - protocols: Vec + protocols: Vec, } impl ProtocolRegistry { @@ -176,13 +176,13 @@ pub mod tests { let protocols = registry.get_protocols_for_query(None); assert!(!protocols.is_empty()); - let protocols = registry.get_protocols_for_query(Some("did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/connections")); + let protocols = registry.get_protocols_for_query(Some("https://didcomm.org/connections")); let expected_protocols = vec![ ProtocolDescriptor { pid: MessageFamilies::Connections.id(), roles: None }, ]; assert_eq!(expected_protocols, protocols); - let protocols = registry.get_protocols_for_query(Some("did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/connections/1.0")); + let protocols = registry.get_protocols_for_query(Some("https://didcomm.org/connections/1.0")); let expected_protocols = vec![ ProtocolDescriptor { pid: MessageFamilies::Connections.id(), roles: None }, ]; @@ -198,7 +198,7 @@ pub mod tests { let registry: ProtocolRegistry = ProtocolRegistry::init(); - let protocols = registry.get_protocols_for_query(Some("did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/connections/1.0")); + let protocols = registry.get_protocols_for_query(Some("https://didcomm.org/connections/1.0")); let expected_protocols = vec![ ProtocolDescriptor { pid: MessageFamilies::Connections.id(), roles: Some(vec![Actors::Invitee]) }, diff --git a/aries_vcx/src/messages/discovery/disclose.rs b/aries_vcx/src/messages/discovery/disclose.rs index 0037e33d87..bad773c175 100644 --- a/aries_vcx/src/messages/discovery/disclose.rs +++ b/aries_vcx/src/messages/discovery/disclose.rs @@ -48,7 +48,7 @@ pub mod tests { use crate::messages::connection::response::tests::*; fn _protocol_descriptor() -> ProtocolDescriptor { - ProtocolDescriptor { pid: String::from("did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/"), roles: None } + ProtocolDescriptor { pid: String::from("https://didcomm.org/"), roles: None } } pub fn _disclose() -> Disclose { diff --git a/aries_vcx/src/messages/discovery/query.rs b/aries_vcx/src/messages/discovery/query.rs index 0595de3758..fdb7c06420 100644 --- a/aries_vcx/src/messages/discovery/query.rs +++ b/aries_vcx/src/messages/discovery/query.rs @@ -35,7 +35,7 @@ pub mod tests { use super::*; fn _query_string() -> String { - String::from("did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/") + String::from("https://didcomm.org/") } diff --git a/aries_vcx/src/utils/constants.rs b/aries_vcx/src/utils/constants.rs index 365d84a3fb..8d1cc96dd4 100644 --- a/aries_vcx/src/utils/constants.rs +++ b/aries_vcx/src/utils/constants.rs @@ -28,7 +28,7 @@ pub static PROOF_RESPONSE_STR: &str = r#"{"version":null,"to_did":null,"from_did pub static ARIES_PROVER_CREDENTIALS: &str = r#"{"attrs":{"attribute_0":{"credential":{"cred_info":{"attrs":{"age":"25","date":"05-2018","degree":"maths","last_name":"clark","name":"alice","sex":"female"},"cred_def_id":"V4SGRU86Z58d6TV7PBUe6f:3:CL:39:tag1","cred_rev_id":"1","referent":"d1b0d013-d658-4514-b7d4-dede4e41f24b","rev_reg_id":"V4SGRU86Z58d6TV7PBUe6f:4:V4SGRU86Z58d6TV7PBUe6f:3:CL:39:tag1:CL_ACCUM:tag1","schema_id":"V4 SGRU86Z58d6TV7PBUe6f:2:FaberVcx:55.94.78"},"interval":{"from":null,"to":1600425779536}},"tails_file":"/tmp/tails"},"attribute_1":{"credential":{"cred_info":{"attrs":{"age":"25","date":"05-2018","degree":"maths","last_name":"clark","name":"alice","sex":"female"},"cred_def_id":"V4SGRU86Z58d6TV7PBUe6f:3:CL:39:tag1","cred_rev_id":"1","referent":"d1b0d013-d658-4514-b7d4-dede4e41f24b","rev_reg_id":"V4SGRU86Z58d6TV7PBUe6f:4:V4SGRU86Z58d6TV7PBUe6f:3:CL:39:tag1:CL_ACCUM:tag1","schema_id":"V4SGRU86Z58d6TV7PBUe6f:2:FaberVcx:55.94.78"},"interval":{"from ":null,"to":1600425779536}},"tails_file":"/tmp/tails"},"attribute_2":{"credential":{"cred_info":{"attrs":{"age":"25","date":"05-2018","degree":"maths","last_name":"clark","name":"alice","sex":"female"},"cred_def_id":"V4SGRU86Z58d6TV7PBUe6f:3:CL:39:tag1","cred_rev_id":"1","referent":"d1b0d013-d658-4514-b7d4-dede4e41f24b","rev_reg_id":"V4SGRU86Z58d6TV7PBUe6f:4:V4SGRU86Z58d6TV7PBUe6f:3:CL:39:tag1:CL_ACCUM:tag1","schema_id":"V4SGRU86Z58d6TV7PBUe6f:2:FaberVcx:55.94.78"},"interval":{"from":null,"to":1600425779536}},"tails_file":"/tmp/tails"},"predicate_0":{"credential":{"cred_info":{"attrs":{"age":"25","date":"05-2018","degree":"maths","last_name":"clark","name":"alice","sex":"female"},"cred_def_id":"V4SGRU86Z58d6TV7PBUe6f:3:CL:39:tag1","cred_rev_id":"1","referent":"d1b0d013-d658-4514-b7d4-dede4e41f24b","rev_reg_id":"V4SGRU86Z58d6TV7PBUe6f:4:V4SGRU86Z58d6TV7PBUe6f:3:CL:39:tag1:CL_ACCUM:tag1","schema_id":"V4SGRU86Z58d6TV7PBUe6f:2:FaberVcx:55.94.78"},"interval":{"from":null,"to":1600425779536}},"tails_file":"/tmp/tails"}}}"#; pub static ARIES_PROVER_SELF_ATTESTED_ATTRS: &str = r#"{"attribute_3":"Smith"}"#; pub static PROOF_REJECT_RESPONSE_STR: &str = r#"{"version":null,"to_did":null,"from_did":"2hoqvcwupRTUNkXn6ArYzs","proof_request_id":null,"libindy_proof":"","state":9}"#; -pub static PROOF_REJECT_RESPONSE_STR_V2: &str = r#"{"@id":"6ccc927b-84a4-4766-8145-d40d112999df","@type":"did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/report-problem/1.0/problem-report","comment":"Presentation Request was rejected","~thread":{"received_orders":{},"sender_order":0,"thid":"94028fc2-be95-4c35-9a66-6810b0e3d6da"}}"#; +pub static PROOF_REJECT_RESPONSE_STR_V2: &str = r#"{"@id":"6ccc927b-84a4-4766-8145-d40d112999df","@type":"https://didcomm.org/report-problem/1.0/problem-report","comment":"Presentation Request was rejected","~thread":{"received_orders":{},"sender_order":0,"thid":"94028fc2-be95-4c35-9a66-6810b0e3d6da"}}"#; pub const REGISTER_RESPONSE: &'static [u8; 51] = &[129, 167, 98, 117, 110, 100, 108, 101, 100, 145, 220, 0, 31, 208, 129, 208, 165, 64, 116, 121, 112, 101, 208, 130, 208, 164, 110, 97, 109, 101, 208, 169, 83, 73, 71, 78, 69, 68, 95, 85, 80, 208, 163, 118, 101, 114, 208, 163, 49, 46, 48]; pub const UPDATE_COM_METHOD_RESPONSE_DECRYPTED: &str = r#"{"@type":"did:sov:123456789abcdefghi1234;spec/configs/1.0/COM_METHOD_UPDATED","id":"12345"}"#; pub const CONNECTED_RESPONSE: &'static [u8; 162] = &[129, 167, 98, 117, 110, 100, 108, 101, 100, 145, 220, 0, 138, 204, 131, 204, 165, 64, 116, 121, 112, 101, 204, 130, 204, 164, 110, 97, 109, 101, 204, 169, 67, 79, 78, 78, 69, 67, 84, 69, 68, 204, 163, 118, 101, 114, 204, 163, 49, 46, 48, 204, 175, 119, 105, 116, 104, 80, 97, 105, 114, 119, 105, 115, 101, 68, 73, 68, 204, 182, 65, 52, 97, 54, 57, 113, 97, 102, 113, 90, 72, 80, 76, 80, 80, 117, 53, 74, 70, 81, 114, 99, 204, 181, 119, 105, 116, 104, 80, 97, 105, 114, 119, 105, 115, 101, 68, 73, 68, 86, 101, 114, 75, 101, 121, 204, 217, 44, 53, 119, 84, 75, 88, 114, 100, 102, 85, 105, 84, 81, 55, 102, 51, 115, 90, 74, 122, 118, 72, 112, 99, 83, 55, 88, 72, 72, 120, 105, 66, 107, 70, 116, 80, 67, 115, 121, 110, 90, 116, 118, 52, 107]; diff --git a/aries_vcx/src/utils/mockdata/mockdata_connection.rs b/aries_vcx/src/utils/mockdata/mockdata_connection.rs index 18440c0b84..2910e9b774 100644 --- a/aries_vcx/src/utils/mockdata/mockdata_connection.rs +++ b/aries_vcx/src/utils/mockdata/mockdata_connection.rs @@ -2,7 +2,7 @@ pub const ARIES_CONNECTION_INVITATION: &str = r#" { "@id": "28b39b79-f5db-4478-879a-15bb12632d00", - "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/connections/1.0/invitation", + "@type": "https://didcomm.org/connections/1.0/invitation", "label": "alice-e9b498a1-7d86-4389-a9de-3823dbb2f27e", "recipientKeys": [ "DEKbrMDX9LBGhCk4LBhH6t5B6Kh5iE7GvfepAJYXp7GX" @@ -50,7 +50,7 @@ pub const CONNECTION_SM_INVITEE_INVITED: &str = r#" pub const ARIES_CONNECTION_REQUEST: &str = r#" { "@id": "b5517062-303f-4267-9a29-09bc89497c06", - "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/connections/1.0/request", + "@type": "https://didcomm.org/connections/1.0/request", "connection": { "DID": "2RjtVytftf9Psbh3E8jqyq", "DIDDoc": { @@ -186,9 +186,9 @@ pub const CONNECTION_SM_INVITEE_REQUESTED: &str = r#" pub const ARIES_CONNECTION_RESPONSE: &str = r#" { "@id": "586c54a1-8fcf-4539-aebe-19bf02567653", - "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/connections/1.0/response", + "@type": "https://didcomm.org/connections/1.0/response", "connection~sig": { - "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/signature/1.0/ed25519Sha512_single", + "@type": "https://didcomm.org/signature/1.0/ed25519Sha512_single", "sig_data": "AAAAAF9aIsl7IkRJRCI6IjNZcThnclM2eWNUemFDallBZjRQSkQiLCJESUREb2MiOnsiQGNvbnRleHQiOiJodHRwczovL3czaWQub3JnL2RpZC92MSIsImF1dGhlbnRpY2F0aW9uIjpbeyJwdWJsaWNLZXkiOiIzWXE4Z3JTNnljVHphQ2pZQWY0UEpEIzEiLCJ0eXBlIjoiRWQyNTUxOVNpZ25hdHVyZUF1dGhlbnRpY2F0aW9uMjAxOCJ9XSwiaWQiOiIzWXE4Z3JTNnljVHphQ2pZQWY0UEpEIiwicHVibGljS2V5IjpbeyJjb250cm9sbGVyIjoiM1lxOGdyUzZ5Y1R6YUNqWUFmNFBKRCIsImlkIjoiMSIsInB1YmxpY0tleUJhc2U1OCI6IjJQYUNFVW9vUXFlUXpxOGtFZmk4QjhmejNvRkNzbXRDcHl5SDQyTWJLVTlYIiwidHlwZSI6IkVkMjU1MTlWZXJpZmljYXRpb25LZXkyMDE4In1dLCJzZXJ2aWNlIjpbeyJpZCI6ImRpZDpleGFtcGxlOjEyMzQ1Njc4OWFiY2RlZmdoaTtpbmR5IiwicHJpb3JpdHkiOjAsInJlY2lwaWVudEtleXMiOlsiM1lxOGdyUzZ5Y1R6YUNqWUFmNFBKRCMxIl0sInJvdXRpbmdLZXlzIjpbIjNCQWlaenRyRVRmenJWa3hZVTR3S2pUNVZ2WTVWbVVickxBY3lwNmZySjhZIiwiSGV6Y2UyVVdNWjN3VWhWa2gyTGZLU3M4bkR6V3d6czJXaW43RXpOTjNZYVIiXSwic2VydmljZUVuZHBvaW50IjoiaHR0cDovL2xvY2FsaG9zdDo4MDgwL2FnZW5jeS9tc2ciLCJ0eXBlIjoiSW5keUFnZW50In1dfX0=", "signature": "W4h3HFIkOu3XHE_QHNfCZZL5t_4ah7zx7UegwyN13P3ugmJVY6UUwYOXrCb0tJL7wEpGKIxguQp21W-e7QQhCg==", "signer": "DEKbrMDX9LBGhCk4LBhH6t5B6Kh5iE7GvfepAJYXp7GX" @@ -258,7 +258,7 @@ pub const CONNECTION_SM_INVITEE_COMPLETED: &str = r#" pub const ARIES_CONNECTION_ACK: &str = r#" { "@id": "680e90b0-4a01-4dc7-8a1d-e54b43ebcc28", - "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/notification/1.0/ack", + "@type": "https://didcomm.org/notification/1.0/ack", "status": "OK", "~thread": { "received_orders": {}, diff --git a/aries_vcx/src/utils/mockdata/mockdata_credex.rs b/aries_vcx/src/utils/mockdata/mockdata_credex.rs index 0aa9ad229e..9fd3f63bae 100644 --- a/aries_vcx/src/utils/mockdata/mockdata_credex.rs +++ b/aries_vcx/src/utils/mockdata/mockdata_credex.rs @@ -20,9 +20,9 @@ pub const CREDENTIAL_ISSUER_SM_INITIAL: &str = r#" // Faber send Cred offer to Alice pub const ARIES_CREDENTIAL_OFFER: &str = r#"{ "@id": "57b3f85d-7673-4e6f-bb09-cc27cf2653c0", - "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/issue-credential/1.0/offer-credential", + "@type": "https://didcomm.org/issue-credential/1.0/offer-credential", "credential_preview": { - "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/issue-credential/1.0/credential-preview", + "@type": "https://didcomm.org/issue-credential/1.0/credential-preview", "attributes": [ { "name": "age", @@ -63,9 +63,9 @@ pub const ARIES_CREDENTIAL_OFFER: &str = r#"{ pub const ARIES_CREDENTIAL_OFFER_JSON_FORMAT: &str = r#"{ "@id": "57b3f85d-7673-4e6f-bb09-cc27cf2653c0", - "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/issue-credential/1.0/offer-credential", + "@type": "https://didcomm.org/issue-credential/1.0/offer-credential", "credential_preview": { - "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/issue-credential/1.0/credential-preview", + "@type": "https://didcomm.org/issue-credential/1.0/credential-preview", "attributes": [ { "name": "age", @@ -153,7 +153,7 @@ pub const CREDENTIAL_SM_OFFER_RECEIVED: &str = r#" "offer": { "@id": "0a794e24-c6b4-46bc-93b6-642b6dc98c98", "credential_preview": { - "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/issue-credential/1.0/credential-preview", + "@type": "https://didcomm.org/issue-credential/1.0/credential-preview", "attributes": [ { "name": "age", @@ -229,7 +229,7 @@ pub const SERIALIZED_CREDENTIAL_V2_OFFER_RECEIVED: &str = r#"{ "offer": { "@id": "e314d535-6996-4c97-baab-d778d498f349", "credential_preview": { - "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/issue-credential/1.0/credential-preview", + "@type": "https://didcomm.org/issue-credential/1.0/credential-preview", "attributes": [ { "name": "age", @@ -279,7 +279,7 @@ pub const SERIALIZED_CREDENTIAL_V2_OFFER_RECEIVED: &str = r#"{ pub const ARIES_CREDENTIAL_REQUEST: &str = r#" { "@id": "fbd9e14b-4370-4086-8271-3808203e9ef9", - "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/issue-credential/1.0/request-credential", + "@type": "https://didcomm.org/issue-credential/1.0/request-credential", "requests~attach": [ { "@id": "libindy-cred-request-0", @@ -338,7 +338,7 @@ pub const CREDENTIAL_ISSUER_SM_REQUEST_RECEIVED: &str = r#" // Faber sends credential pub const ARIES_CREDENTIAL_RESPONSE: &str = r#"{ "@id": "e5b39a25-36fe-49df-9534-3e486bfb6fb8", - "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/issue-credential/1.0/issue-credential", + "@type": "https://didcomm.org/issue-credential/1.0/issue-credential", "credentials~attach": [ { "@id": "libindy-cred-0", diff --git a/aries_vcx/src/utils/mockdata/mockdata_proof.rs b/aries_vcx/src/utils/mockdata/mockdata_proof.rs index 3dd8e32d55..90dc8ef02a 100644 --- a/aries_vcx/src/utils/mockdata/mockdata_proof.rs +++ b/aries_vcx/src/utils/mockdata/mockdata_proof.rs @@ -2,7 +2,7 @@ pub const ARIES_PROOF_REQUEST_PRESENTATION: &str = r#" { "@id": "4e62363d-6348-4b59-9d98-a86497f9301b", - "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/present-proof/1.0/request-presentation", + "@type": "https://didcomm.org/present-proof/1.0/request-presentation", "comment": "alice-131bc1e2-fa29-404c-a87c-69983e02084d wants you to share proofForAlice", "request_presentations~attach": [ { @@ -19,7 +19,7 @@ pub const ARIES_PROOF_REQUEST_PRESENTATION: &str = r#" pub const ARIES_PROOF_PRESENTATION: &str = r#" { "@id": "6ab775f7-a712-41a3-9248-36dff8955525", - "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/present-proof/1.0/presentation", + "@type": "https://didcomm.org/present-proof/1.0/presentation", "presentations~attach": [ { "@id": "libindy-presentation-0", @@ -41,7 +41,7 @@ pub const ARIES_PROOF_PRESENTATION: &str = r#" pub static ARIES_PRESENTATION_REQUEST: &str = r#" { "@id": "c0431961-f755-4c3e-9bf6-0216019e560c", - "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/present-proof/1.0/request-presentation", + "@type": "https://didcomm.org/present-proof/1.0/request-presentation", "comment": "faber-2110edd8-98f3-4164-9aa8-9f6e7a1a0658 wants you to share proofForAlice", "request_presentations~attach": [ { @@ -58,7 +58,7 @@ pub static ARIES_PRESENTATION_REQUEST: &str = r#" pub static ARIES_PROOF_PRESENTATION_ACK: &str = r#" { "@id": "c4c2685d-e0b4-49f4-8a3e-7fe4bb3c0c8f", - "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/present-proof/1.0/ack", + "@type": "https://didcomm.org/present-proof/1.0/ack", "status": "OK", "~thread": { "received_orders": {}, @@ -241,7 +241,7 @@ pub static PRESENTATION_REQUEST_MESSAGE_ARRAY: &str = r#" [ { "@id": "testid", - "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/present-proof/1.0/request-presentation", + "@type": "https://didcomm.org/present-proof/1.0/request-presentation", "comment": "institution wants you to share request1", "request_presentations~attach": [ { @@ -255,7 +255,7 @@ pub static PRESENTATION_REQUEST_MESSAGE_ARRAY: &str = r#" }, { "@id": "testid", - "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/present-proof/1.0/request-presentation", + "@type": "https://didcomm.org/present-proof/1.0/request-presentation", "comment": "institution wants you to share request2", "request_presentations~attach": [ { @@ -273,7 +273,7 @@ pub static PRESENTATION_REQUEST_MESSAGE_ARRAY: &str = r#" pub static PRESENTATION_REQUEST_MESSAGE_1: &str = r#" { "@id": "testid", - "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/present-proof/1.0/request-presentation", + "@type": "https://didcomm.org/present-proof/1.0/request-presentation", "comment": "institution wants you to share request1", "request_presentations~attach": [ { @@ -290,7 +290,7 @@ pub static PRESENTATION_REQUEST_MESSAGE_1: &str = r#" pub static PRESENTATION_REQUEST_MESSAGE_2: &str = r#" { "@id": "testid", - "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/present-proof/1.0/request-presentation", + "@type": "https://didcomm.org/present-proof/1.0/request-presentation", "comment": "institution wants you to share request2", "request_presentations~attach": [ { @@ -308,7 +308,7 @@ pub static PRESENTATION_REQUEST_MESSAGE_ARRAY_EMPTY_ATTACH: &str = r#" [ { "@id": "testid", - "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/present-proof/1.0/request-presentation", + "@type": "https://didcomm.org/present-proof/1.0/request-presentation", "comment": "institution wants you to share request1", "request_presentations~attach": [ { @@ -322,7 +322,7 @@ pub static PRESENTATION_REQUEST_MESSAGE_ARRAY_EMPTY_ATTACH: &str = r#" }, { "@id": "testid", - "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/present-proof/1.0/request-presentation", + "@type": "https://didcomm.org/present-proof/1.0/request-presentation", "comment": "institution wants you to share request2", "request_presentations~attach": [ { diff --git a/libvcx/Cargo.toml b/libvcx/Cargo.toml index ec2371eb0e..44a46f4a1c 100644 --- a/libvcx/Cargo.toml +++ b/libvcx/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libvcx" -version = "0.20.0" +version = "0.20.1" authors = ["Absa Group Limited", "Hyperledger Indy Contributors "] publish = false description = "Absa's fork of HL LibVCX" diff --git a/wrappers/node/package.json b/wrappers/node/package.json index cb1fea67f7..b9664d062c 100644 --- a/wrappers/node/package.json +++ b/wrappers/node/package.json @@ -3,7 +3,7 @@ "name": "@hyperledger/node-vcx-wrapper", "description": "NodeJS wrapper Aries Framework", "license": "Apache-2.0", - "version": "0.20.0", + "version": "0.20.1", "directories": { "test": "test", "build": "dist", diff --git a/wrappers/node/test/suite1/ariesvcx-connection.test.ts b/wrappers/node/test/suite1/ariesvcx-connection.test.ts index 6bcd312977..9dd391a00a 100644 --- a/wrappers/node/test/suite1/ariesvcx-connection.test.ts +++ b/wrappers/node/test/suite1/ariesvcx-connection.test.ts @@ -203,7 +203,7 @@ describe('Connection:', () => { assert.isString(parsedInvitation['@id']); assert.equal( parsedInvitation['@type'], - 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/connections/1.0/invitation', + 'https://didcomm.org/connections/1.0/invitation', ); assert.isString(parsedInvitation.label); assert.isArray(parsedInvitation.recipientKeys);