Skip to content

Commit

Permalink
Merge branch 'main' into release/0.59.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrik-Stas authored Sep 28, 2023
2 parents 1dee351 + 636c295 commit 3f8a5c0
Show file tree
Hide file tree
Showing 167 changed files with 2,756 additions and 1,561 deletions.
2 changes: 1 addition & 1 deletion .github/actions/derive-cache-info/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ runs:
- id: main
shell: bash
run: |
source ./ci/util.sh
source ./.github/ci/util.sh
DOCKER_IMG=${{ inputs.docker-img }}
CACHE_KEY=`as_docker_cache_key $DOCKER_IMG`
CACHE_DIR="/tmp/cachedir-$CACHE_KEY"
Expand Down
30 changes: 0 additions & 30 deletions .github/actions/publish-android/action.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/actions/setup-codecov-rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ runs:
docker run --rm -d --name mysql --network host -e MYSQL_ROOT_PASSWORD=mysecretpassword mysql:5.7.35
docker run --rm -d --name indypool --network host ${{ env.DOCKER_IMAGE_POOL }}
sleep 5
docker-compose -f ./ci/agency/docker-compose.yml up -d
docker-compose -f ./.github/ci/agency/docker-compose.yml up -d
2 changes: 1 addition & 1 deletion .github/actions/setup-testing-nodejs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ runs:
docker run --rm -d --name mysql --network host -e MYSQL_ROOT_PASSWORD=mysecretpassword mysql:5.7.35
docker run --rm -d --name indypool --network host ${{ env.DOCKER_IMAGE_POOL }}
sleep 5
docker-compose -f ./ci/agency/docker-compose.yml up -d
docker-compose -f ./.github/ci/agency/docker-compose.yml up -d
- name: "Build binding module"
shell: bash
run: (cd wrappers/vcx-napi-rs && npm install && npm run build:napi:debug)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 3 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,15 @@ jobs:
run: |
set -x
HASH_DOCKERFILE_LIBVCX=${{ hashFiles('ci/libvcx.dockerfile') }}
HASH_DOCKERFILE_VDRPROXY=${{ hashFiles('ci/vdrproxy.dockerfile') }}
HASH_DOCKERFILE_LIBVCX=${{ hashFiles('.github/ci/libvcx.dockerfile') }}
HASH_DOCKERFILE_VDRPROXY=${{ hashFiles('.github/ci/vdrproxy.dockerfile') }}
HASH_SRC_LIBVDRTOOLS=${{ hashFiles('libvdrtools') }}
HASH_SRC_LIBVCX=${{ hashFiles('libvcx') }}
HASH_SRC_ARIESVCX=${{ hashFiles('aries_vcx') }}
HASH_SRC_ARIESVCX_CORE=${{ hashFiles('aries_vcx_core') }}
HASH_SRC_AGENCYCLIENT=${{ hashFiles('agency_client') }}
HASH_SRC_DIDDOC=${{ hashFiles('diddoc') }}
HASH_SRC_MESSAGES=${{ hashFiles('messages') }}
HASH_SRC_WRAPPER_JAVA=${{ hashFiles('wrappers/java') }}
SEED_HASH_ARIESVCX=${HASH_SRC_LIBVDRTOOLS:0:11}-${HASH_SRC_ARIESVCX_CORE:0:11}-${HASH_SRC_ARIESVCX:0:11}-${HASH_SRC_AGENCYCLIENT:0:11}-${HASH_SRC_DIDDOC:0:11}-${HASH_SRC_MESSAGES:0:11}}
HASH_ARIESVCX=$(echo -n "$SEED_HASH_ARIESVCX" | sha256sum | awk '{print $1}')
Expand Down Expand Up @@ -233,7 +232,7 @@ jobs:
uses: ./.github/actions/build-image
with:
docker-img: ${{ env.DOCKER_IMG_CACHED }}
dockerfile-path: "ci/vdrproxy.dockerfile"
dockerfile-path: ".github/ci/vdrproxy.dockerfile"
build-arg: "ALPINE_CORE_IMAGE=$DOCKER_IMG_CACHED_ALPINE_CORE"
branch-name: ${{ env.BRANCH_NAME }}
branch-main: ${{ env.MAIN_BRANCH }}
Expand Down
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
**/node_modules
**/*.node
**/dist
wrappers/ios/vcx/vcx.framework/**
wrappers/ios/vcx/vcx.framework.dSYM/**
wrappers/ios_legacy/vcx/vcx.framework/**
wrappers/ios_legacy/vcx/vcx.framework.dSYM/**
.vscode
*.code-workspace
**/tails.txt
Expand Down
3 changes: 1 addition & 2 deletions agents/rust/aries-vcx-agent/src/services/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ impl ServiceConnections {
request,
self.service_endpoint.clone(),
vec![],
&HttpClient,
)
.await?;

Expand All @@ -122,7 +121,7 @@ impl ServiceConnections {
pub async fn accept_response(&self, thread_id: &str, response: Response) -> AgentResult<()> {
let invitee: Connection<_, _> = self.connections.get(thread_id)?.try_into()?;
let invitee = invitee
.handle_response(&self.profile.inject_wallet(), response, &HttpClient)
.handle_response(&self.profile.inject_wallet(), response)
.await?;

self.connections.insert(thread_id, invitee.into())?;
Expand Down
12 changes: 6 additions & 6 deletions agents/rust/aries-vcx-agent/src/services/holder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ use aries_vcx::{
core::profile::profile::Profile,
handlers::issuance::holder::Holder,
messages::{
msg_fields::protocols::cred_issuance::{
issue_credential::IssueCredential, offer_credential::OfferCredential,
propose_credential::ProposeCredential,
msg_fields::protocols::cred_issuance::v1::{
issue_credential::IssueCredentialV1, offer_credential::OfferCredentialV1,
propose_credential::ProposeCredentialV1,
},
AriesMessage,
},
Expand Down Expand Up @@ -63,7 +63,7 @@ impl ServiceCredentialsHolder {
pub async fn send_credential_proposal(
&self,
connection_id: &str,
propose_credential: ProposeCredential,
propose_credential: ProposeCredentialV1,
) -> AgentResult<String> {
let connection = self.service_connections.get_by_id(connection_id)?;
let wallet = self.profile.inject_wallet();
Expand All @@ -83,7 +83,7 @@ impl ServiceCredentialsHolder {
pub fn create_from_offer(
&self,
connection_id: &str,
offer: OfferCredential,
offer: OfferCredentialV1,
) -> AgentResult<String> {
self.service_connections.get_by_id(connection_id)?;
let holder = Holder::create_from_offer("", offer)?;
Expand Down Expand Up @@ -128,7 +128,7 @@ impl ServiceCredentialsHolder {
pub async fn process_credential(
&self,
thread_id: &str,
msg_issue_credential: IssueCredential,
msg_issue_credential: IssueCredentialV1,
) -> AgentResult<String> {
let mut holder = self.get_holder(thread_id)?;
let connection_id = self.get_connection_id(thread_id)?;
Expand Down
14 changes: 7 additions & 7 deletions agents/rust/aries-vcx-agent/src/services/issuer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ use aries_vcx::{
core::profile::profile::Profile,
handlers::{issuance::issuer::Issuer, util::OfferInfo},
messages::{
msg_fields::protocols::cred_issuance::{
ack::AckCredential, propose_credential::ProposeCredential,
request_credential::RequestCredential,
msg_fields::protocols::cred_issuance::v1::{
ack::AckCredentialV1, propose_credential::ProposeCredentialV1,
request_credential::RequestCredentialV1,
},
AriesMessage,
},
Expand Down Expand Up @@ -63,7 +63,7 @@ impl ServiceCredentialsIssuer {
pub async fn accept_proposal(
&self,
connection_id: &str,
proposal: &ProposeCredential,
proposal: &ProposeCredentialV1,
) -> AgentResult<String> {
let issuer = Issuer::create_from_proposal("", proposal)?;
self.creds_issuer.insert(
Expand Down Expand Up @@ -106,7 +106,7 @@ impl ServiceCredentialsIssuer {
pub fn process_credential_request(
&self,
thread_id: &str,
request: RequestCredential,
request: RequestCredentialV1,
) -> AgentResult<()> {
let IssuerWrapper {
mut issuer,
Expand All @@ -120,7 +120,7 @@ impl ServiceCredentialsIssuer {
Ok(())
}

pub fn process_credential_ack(&self, thread_id: &str, ack: AckCredential) -> AgentResult<()> {
pub fn process_credential_ack(&self, thread_id: &str, ack: AckCredentialV1) -> AgentResult<()> {
let IssuerWrapper {
mut issuer,
connection_id,
Expand Down Expand Up @@ -180,7 +180,7 @@ impl ServiceCredentialsIssuer {
issuer.get_rev_id().map_err(|err| err.into())
}

pub fn get_proposal(&self, thread_id: &str) -> AgentResult<ProposeCredential> {
pub fn get_proposal(&self, thread_id: &str) -> AgentResult<ProposeCredentialV1> {
let issuer = self.get_issuer(thread_id)?;
issuer.get_proposal().map_err(|err| err.into())
}
Expand Down
2 changes: 1 addition & 1 deletion aries_vcx/src/common/credentials/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ mod integration_tests {

assert_eq!(prover_cred.schema_id, schema.schema_id);
assert_eq!(prover_cred.cred_def_id, cred_def.get_cred_def_id());
assert_eq!(prover_cred.cred_rev_id.unwrap().to_string(), cred_rev_id);
assert_eq!(prover_cred.cred_rev_id.unwrap(), cred_rev_id);
assert_eq!(prover_cred.rev_reg_id.unwrap(), rev_reg.rev_reg_id);
})
.await;
Expand Down
23 changes: 1 addition & 22 deletions aries_vcx/src/common/signing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use messages::msg_fields::protocols::connection::{
};
use time;

use crate::{errors::error::prelude::*, global::settings};
use crate::errors::error::prelude::*;

async fn get_signature_data(
wallet: &Arc<dyn BaseWallet>,
Expand Down Expand Up @@ -90,27 +90,6 @@ pub async fn decode_signed_connection_response(
Ok(connection)
}

pub async fn unpack_message_to_string(
wallet: &Arc<dyn BaseWallet>,
msg: &[u8],
) -> VcxResult<String> {
if settings::indy_mocks_enabled() {
return Ok(String::new());
}
let unpack_msg = wallet.unpack_message(msg).await.map_err(|_| {
AriesVcxError::from_msg(
AriesVcxErrorKind::InvalidMessagePack,
"Failed to unpack message",
)
})?;
serde_json::to_string(&unpack_msg).map_err(|_| {
AriesVcxError::from_msg(
AriesVcxErrorKind::InvalidMessageFormat,
"Failed to convert message to utf8 string",
)
})
}

// #[cfg(test)]
// pub mod unit_tests {
// use crate::common::test_utils::{create_trustee_key, indy_handles_to_profile};
Expand Down
2 changes: 1 addition & 1 deletion aries_vcx/src/core/profile/ledger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub fn indyvdr_build_ledger_read(
let response_cacher = Arc::new(InMemoryResponseCacher::new(cache_config));

let config_read = IndyVdrLedgerReadConfig {
request_submitter: request_submitter.clone(),
request_submitter,
response_parser,
response_cacher,
protocol_version: ProtocolVersion::node_1_4(),
Expand Down
43 changes: 24 additions & 19 deletions aries_vcx/src/handlers/issuance/holder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ use messages::{
decorators::{thread::Thread, timing::Timing},
msg_fields::protocols::{
cred_issuance::{
ack::{AckCredential, AckCredentialContent},
issue_credential::IssueCredential,
offer_credential::OfferCredential,
propose_credential::ProposeCredential,
request_credential::RequestCredential,
v1::{
ack::{AckCredentialV1, AckCredentialV1Content},
issue_credential::IssueCredentialV1,
offer_credential::OfferCredentialV1,
propose_credential::ProposeCredentialV1,
request_credential::RequestCredentialV1,
CredentialIssuanceV1,
},
CredentialIssuance,
},
notification::ack::{AckContent, AckDecorators, AckStatus},
Expand All @@ -34,16 +37,16 @@ use crate::{
protocols::issuance::holder::state_machine::{HolderFullState, HolderSM, HolderState},
};

fn build_credential_ack(thread_id: &str) -> AckCredential {
let content = AckCredentialContent::builder()
fn build_credential_ack(thread_id: &str) -> AckCredentialV1 {
let content = AckCredentialV1Content::builder()
.inner(AckContent::builder().status(AckStatus::Ok).build())
.build();
let decorators = AckDecorators::builder()
.thread(Thread::builder().thid(thread_id.to_owned()).build())
.timing(Timing::builder().out_time(Utc::now()).build())
.build();

AckCredential::builder()
AckCredentialV1::builder()
.id(Uuid::new_v4().to_string())
.content(content)
.decorators(decorators)
Expand All @@ -64,7 +67,7 @@ impl Holder {

pub fn create_with_proposal(
source_id: &str,
propose_credential: ProposeCredential,
propose_credential: ProposeCredentialV1,
) -> VcxResult<Holder> {
trace!(
"Holder::create_with_proposal >>> source_id: {:?}, propose_credential: {:?}",
Expand All @@ -77,7 +80,7 @@ impl Holder {

pub fn create_from_offer(
source_id: &str,
credential_offer: OfferCredential,
credential_offer: OfferCredentialV1,
) -> VcxResult<Holder> {
trace!(
"Holder::create_from_offer >>> source_id: {:?}, credential_offer: {:?}",
Expand All @@ -88,7 +91,7 @@ impl Holder {
Ok(Holder { holder_sm })
}

pub fn set_proposal(&mut self, credential_proposal: ProposeCredential) -> VcxResult<()> {
pub fn set_proposal(&mut self, credential_proposal: ProposeCredentialV1) -> VcxResult<()> {
self.holder_sm = self.holder_sm.clone().set_proposal(credential_proposal)?;
Ok(())
}
Expand All @@ -115,10 +118,10 @@ impl Holder {
}
}

pub fn get_msg_credential_request(&self) -> VcxResult<RequestCredential> {
pub fn get_msg_credential_request(&self) -> VcxResult<RequestCredentialV1> {
match self.holder_sm.state {
HolderFullState::RequestSet(ref state) => {
let mut msg: RequestCredential = state.msg_credential_request.clone();
let mut msg: RequestCredentialV1 = state.msg_credential_request.clone();
let timing = Timing::builder().out_time(Utc::now()).build();
msg.decorators.timing = Some(timing);
Ok(msg)
Expand All @@ -142,7 +145,7 @@ impl Holder {
&mut self,
ledger: &Arc<dyn AnoncredsLedgerRead>,
anoncreds: &Arc<dyn BaseAnonCreds>,
credential: IssueCredential,
credential: IssueCredentialV1,
) -> VcxResult<()> {
self.holder_sm = self
.holder_sm
Expand Down Expand Up @@ -176,7 +179,7 @@ impl Holder {
self.holder_sm.get_attachment()
}

pub fn get_offer(&self) -> VcxResult<OfferCredential> {
pub fn get_offer(&self) -> VcxResult<OfferCredentialV1> {
self.holder_sm.get_offer()
}

Expand Down Expand Up @@ -261,10 +264,12 @@ impl Holder {
message: AriesMessage,
) -> VcxResult<()> {
let holder_sm = match message {
AriesMessage::CredentialIssuance(CredentialIssuance::OfferCredential(offer)) => {
self.holder_sm.clone().receive_offer(offer)?
}
AriesMessage::CredentialIssuance(CredentialIssuance::IssueCredential(credential)) => {
AriesMessage::CredentialIssuance(CredentialIssuance::V1(
CredentialIssuanceV1::OfferCredential(offer),
)) => self.holder_sm.clone().receive_offer(offer)?,
AriesMessage::CredentialIssuance(CredentialIssuance::V1(
CredentialIssuanceV1::IssueCredential(credential),
)) => {
self.holder_sm
.clone()
.receive_credential(ledger, anoncreds, credential)
Expand Down
Loading

0 comments on commit 3f8a5c0

Please sign in to comment.