From 5a63a134312c4b767d81f967b84a95f12e55213e Mon Sep 17 00:00:00 2001 From: Miroslav Kovar Date: Thu, 24 Aug 2023 17:05:22 +0200 Subject: [PATCH] Send no attachment in requests Signed-off-by: Miroslav Kovar --- .../state_machine/requester/request_sent/helpers.rs | 9 ++------- .../state_machine/requester/request_sent/mod.rs | 9 +++------ 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/aries_vcx/src/protocols/did_exchange/state_machine/requester/request_sent/helpers.rs b/aries_vcx/src/protocols/did_exchange/state_machine/requester/request_sent/helpers.rs index 64dae55300..cc8529cdeb 100644 --- a/aries_vcx/src/protocols/did_exchange/state_machine/requester/request_sent/helpers.rs +++ b/aries_vcx/src/protocols/did_exchange/state_machine/requester/request_sent/helpers.rs @@ -58,7 +58,6 @@ pub async fn did_doc_from_did( let service = resolve_service(ledger, &OobService::Did(did.id().to_string())).await?; let did_url: DidUrl = format!("{}#vm-0", did.to_string()).try_into()?; let vm = VerificationMethod::builder(did_url, did.clone(), VerificationMethodType::Ed25519VerificationKey2020) - // TODO: Make it easier to get the first key in base58 (regardless of initial kind) from ServiceSov .add_public_key_base58( service .recipient_keys @@ -82,11 +81,7 @@ pub async fn did_doc_from_did( } // TODO: Replace by a builder -pub fn construct_request( - invitation_id: String, - our_did: String, - attachment: Option, -) -> Result { +pub fn construct_request(invitation_id: String, our_did: String) -> Result { let request_id = Uuid::new_v4().to_string(); let thread = { let mut thread = Thread::new(request_id.clone()); @@ -107,7 +102,7 @@ pub fn construct_request( goal_code: Some(MaybeKnown::Known(ThreadGoalCode::AriesRelBuild)), // Interop note: Should not have to send both DID and DDO if did resolvable did: our_did, - did_doc: attachment, + did_doc: None, }; Ok(Request::with_decorators(request_id.clone(), content, decorators)) } diff --git a/aries_vcx/src/protocols/did_exchange/state_machine/requester/request_sent/mod.rs b/aries_vcx/src/protocols/did_exchange/state_machine/requester/request_sent/mod.rs index 92f530335d..c1c6de7744 100644 --- a/aries_vcx/src/protocols/did_exchange/state_machine/requester/request_sent/mod.rs +++ b/aries_vcx/src/protocols/did_exchange/state_machine/requester/request_sent/mod.rs @@ -44,11 +44,7 @@ impl DidExchangeRequester { &wallet, ) .await?; - let request = construct_request( - invitation.id.clone(), - our_did_document.id().to_string(), - Some(signed_attach), - )?; + let request = construct_request(invitation.id.clone(), our_did_document.id().to_string())?; Ok(TransitionResult { state: DidExchangeRequester::from_parts( @@ -84,7 +80,7 @@ impl DidExchangeRequester { ))? .public_key()?; let signed_attach = jws_sign_attach(ddo_sov_to_attach(our_did_document.clone())?, key, &wallet).await?; - let request = construct_request(invitation_id.clone(), our_did.to_string(), Some(signed_attach))?; + let request = construct_request(invitation_id.clone(), our_did.to_string())?; Ok(TransitionResult { state: DidExchangeRequester::from_parts( @@ -156,6 +152,7 @@ impl DidExchangeRequester { invitation_id: self.state.invitation_id, request_id: self.state.request_id, }, + // TODO: Make sure to make the DDO identifier did:peer:3 for both did_document, self.our_did_document, ),