Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Purge vdrtools #1013

Merged
merged 22 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 5 additions & 29 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
backend: ["vdrtools", "modular_libs", "vdr_proxy_ledger"]
backend: ["credx,vdrtools_wallet", "vdr_proxy_ledger"]
steps:
- name: "Git checkout"
uses: actions/checkout@v3
Expand All @@ -133,15 +133,15 @@ jobs:
sudo apt-get install -y libsodium-dev libssl-dev libzmq3-dev
- name: "Verify clippy across the entire workspace with default features"
run: |
cargo clippy -p aries-vcx --features legacy_proof,migration --features ${{ matrix.backend }} --no-default-features
cargo clippy -p aries-vcx --features legacy_proof --features ${{ matrix.backend }} --no-default-features
env:
RUSTFLAGS: -D warnings

aries_vcx_core_clippy:
runs-on: ubuntu-20.04
strategy:
matrix:
backend: ["vdrtools_anoncreds", "modular_libs", "vdr_proxy_ledger"]
backend: ["credx,vdrtools_wallet", "vdr_proxy_ledger"]
steps:
- name: "Git checkout"
uses: actions/checkout@v3
Expand Down Expand Up @@ -237,7 +237,7 @@ jobs:
run: |
RUSTFLAGS='-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' \
RUSTDOCFLAGS='-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' \
RUST_TEST_THREADS=1 CARGO_INCREMENTAL=0 TEST_POOL_IP=127.0.0.1 cargo test --package aries-vcx -F 'modular_libs' -- --ignored;
RUST_TEST_THREADS=1 CARGO_INCREMENTAL=0 TEST_POOL_IP=127.0.0.1 cargo test --package aries-vcx -- --ignored;

mkdir -p /tmp/artifacts/coverage
grcov ./target/debug/ -s . -t lcov --llvm --branch --ignore-not-existing -o /tmp/artifacts/coverage/coverage.lcov
Expand Down Expand Up @@ -274,12 +274,6 @@ jobs:
test-integration-aries-vcx:
needs: workflow-setup
runs-on: ubuntu-20.04
strategy:
matrix:
features: [
"vdrtools",
"modular_libs"
]
steps:
- name: "Git checkout"
uses: actions/checkout@v3
Expand All @@ -288,7 +282,7 @@ jobs:
with:
rust-toolchain-version: ${{ env.RUST_TOOLCHAIN_VERSON }}
- name: "Run aries-vcx integration tests"
run: RUST_TEST_THREADS=1 cargo test --manifest-path="aries_vcx/Cargo.toml" --features ${{ matrix.features }} -- --ignored;
run: RUST_TEST_THREADS=1 cargo test --manifest-path="aries_vcx/Cargo.toml" -- --ignored;

test-integration-aries-vcx-mysql:
needs: workflow-setup
Expand Down Expand Up @@ -332,24 +326,6 @@ jobs:
with:
name: "docker-services-${{ github.job }}"

test-integration-aries-vcx-migration:
needs: workflow-setup
runs-on: ubuntu-20.04
steps:
- name: "Git checkout"
uses: actions/checkout@v3
- name: "Setup rust testing environment"
uses: ./.github/actions/setup-testing-rust
with:
rust-toolchain-version: ${{ env.RUST_TOOLCHAIN_VERSON }}
- name: "Run aries-vcx tests: pool_tests agency_pool_tests"
run: |
cargo test --manifest-path="wallet_migrator/Cargo.toml";
RUST_TEST_THREADS=1 CARGO_INCREMENTAL=0 TEST_POOL_IP=127.0.0.1 cargo test --manifest-path="aries_vcx/Cargo.toml" -F migration --test test_credential_issuance -- --include-ignored;
RUST_TEST_THREADS=1 CARGO_INCREMENTAL=0 TEST_POOL_IP=127.0.0.1 cargo test --manifest-path="aries_vcx/Cargo.toml" -F migration --test test_credential_retrieval -- --include-ignored;
RUST_TEST_THREADS=1 CARGO_INCREMENTAL=0 TEST_POOL_IP=127.0.0.1 cargo test --manifest-path="aries_vcx/Cargo.toml" -F migration --test test_proof_presentation -- --include-ignored;
RUST_TEST_THREADS=1 CARGO_INCREMENTAL=0 TEST_POOL_IP=127.0.0.1 cargo test --manifest-path="aries_vcx/Cargo.toml" -F migration --test test_revocations -- --include-ignored;

test-integration-libvcx:
needs: workflow-setup
if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }}
Expand Down
2 changes: 1 addition & 1 deletion agents/rust/aries-vcx-agent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ edition.workspace = true
[dependencies]
serde = "1.0.145"
aries-vcx = { path = "../../../aries_vcx" }
aries_vcx_core = { path = "../../../aries_vcx_core" }
aries_vcx_core = { path = "../../../aries_vcx_core", features = ["credx", "vdrtools_wallet"] }
async-trait = "0.1.64"
derive_builder = "0.11.2"
serde_json = "1.0.85"
Expand Down
6 changes: 3 additions & 3 deletions agents/rust/aries-vcx-agent/src/agent/agent_struct.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::sync::Arc;

use aries_vcx::core::profile::vdrtools_profile::VdrtoolsProfile;
use aries_vcx::core::profile::modular_libs_profile::ModularLibsProfile;

use crate::{
agent::agent_config::AgentConfig,
Expand All @@ -14,7 +14,7 @@ use crate::{

#[derive(Clone)]
pub struct Agent {
pub(super) profile: Arc<VdrtoolsProfile>,
pub(super) profile: Arc<ModularLibsProfile>,
pub(super) config: AgentConfig,
pub(super) connections: Arc<ServiceConnections>,
pub(super) schemas: Arc<ServiceSchemas>,
Expand All @@ -27,7 +27,7 @@ pub struct Agent {
}

impl Agent {
pub fn profile(&self) -> &VdrtoolsProfile {
pub fn profile(&self) -> &ModularLibsProfile {
&self.profile
}

Expand Down
4 changes: 2 additions & 2 deletions agents/rust/aries-vcx-agent/src/agent/init.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::sync::Arc;

use aries_vcx::{
core::profile::{ledger::VcxPoolConfig, vdrtools_profile::VdrtoolsProfile, Profile},
core::profile::{ledger::VcxPoolConfig, modular_libs_profile::ModularLibsProfile, Profile},
global::settings::DEFAULT_LINK_SECRET_ALIAS,
};
use aries_vcx_core::{
Expand Down Expand Up @@ -72,7 +72,7 @@ impl Agent {
response_cache_config: None,
};

let indy_profile = VdrtoolsProfile::init(wallet, pool_config).unwrap();
let indy_profile = ModularLibsProfile::init(wallet, pool_config).unwrap();
let profile = Arc::new(indy_profile);
let anoncreds = profile.anoncreds();
anoncreds
Expand Down
6 changes: 3 additions & 3 deletions agents/rust/aries-vcx-agent/src/services/connection.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::sync::{Arc, Mutex};

use aries_vcx::{
core::profile::{vdrtools_profile::VdrtoolsProfile, Profile},
core::profile::{modular_libs_profile::ModularLibsProfile, Profile},
handlers::util::AnyInvitation,
messages::msg_fields::protocols::{
connection::{request::Request, response::Response},
Expand All @@ -22,13 +22,13 @@ use crate::{
pub type ServiceEndpoint = Url;

pub struct ServiceConnections {
profile: Arc<VdrtoolsProfile>,
profile: Arc<ModularLibsProfile>,
service_endpoint: ServiceEndpoint,
connections: Arc<ObjectCache<GenericConnection>>,
}

impl ServiceConnections {
pub fn new(profile: Arc<VdrtoolsProfile>, service_endpoint: ServiceEndpoint) -> Self {
pub fn new(profile: Arc<ModularLibsProfile>, service_endpoint: ServiceEndpoint) -> Self {
Self {
profile,
service_endpoint,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::sync::{Arc, Mutex};

use aries_vcx::{
common::primitives::credential_definition::{CredentialDef, CredentialDefConfig},
core::profile::{vdrtools_profile::VdrtoolsProfile, Profile},
core::profile::{modular_libs_profile::ModularLibsProfile, Profile},
};

use crate::{
Expand All @@ -11,12 +11,12 @@ use crate::{
};

pub struct ServiceCredentialDefinitions {
profile: Arc<VdrtoolsProfile>,
profile: Arc<ModularLibsProfile>,
cred_defs: ObjectCache<CredentialDef>,
}

impl ServiceCredentialDefinitions {
pub fn new(profile: Arc<VdrtoolsProfile>) -> Self {
pub fn new(profile: Arc<ModularLibsProfile>) -> Self {
Self {
profile,
cred_defs: ObjectCache::new("cred-defs"),
Expand Down
6 changes: 3 additions & 3 deletions agents/rust/aries-vcx-agent/src/services/holder.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::sync::Arc;

use aries_vcx::{
core::profile::{vdrtools_profile::VdrtoolsProfile, Profile},
core::profile::{modular_libs_profile::ModularLibsProfile, Profile},
handlers::issuance::holder::Holder,
messages::{
msg_fields::protocols::cred_issuance::v1::{
Expand Down Expand Up @@ -36,14 +36,14 @@ impl HolderWrapper {
}

pub struct ServiceCredentialsHolder {
profile: Arc<VdrtoolsProfile>,
profile: Arc<ModularLibsProfile>,
creds_holder: ObjectCache<HolderWrapper>,
service_connections: Arc<ServiceConnections>,
}

impl ServiceCredentialsHolder {
pub fn new(
profile: Arc<VdrtoolsProfile>,
profile: Arc<ModularLibsProfile>,
service_connections: Arc<ServiceConnections>,
) -> Self {
Self {
Expand Down
6 changes: 3 additions & 3 deletions agents/rust/aries-vcx-agent/src/services/issuer.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::sync::Arc;

use aries_vcx::{
core::profile::{vdrtools_profile::VdrtoolsProfile, Profile},
core::profile::{modular_libs_profile::ModularLibsProfile, Profile},
handlers::{issuance::issuer::Issuer, util::OfferInfo},
messages::{
msg_fields::protocols::cred_issuance::v1::{
Expand Down Expand Up @@ -36,14 +36,14 @@ impl IssuerWrapper {
}

pub struct ServiceCredentialsIssuer {
profile: Arc<VdrtoolsProfile>,
profile: Arc<ModularLibsProfile>,
creds_issuer: ObjectCache<IssuerWrapper>,
service_connections: Arc<ServiceConnections>,
}

impl ServiceCredentialsIssuer {
pub fn new(
profile: Arc<VdrtoolsProfile>,
profile: Arc<ModularLibsProfile>,
service_connections: Arc<ServiceConnections>,
) -> Self {
Self {
Expand Down
6 changes: 3 additions & 3 deletions agents/rust/aries-vcx-agent/src/services/prover.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::{collections::HashMap, sync::Arc};

use aries_vcx::{
core::profile::{vdrtools_profile::VdrtoolsProfile, Profile},
core::profile::{modular_libs_profile::ModularLibsProfile, Profile},
handlers::{
proof_presentation::{prover::Prover, types::SelectedCredentials},
util::PresentationProposalData,
Expand Down Expand Up @@ -39,14 +39,14 @@ impl ProverWrapper {
}

pub struct ServiceProver {
profile: Arc<VdrtoolsProfile>,
profile: Arc<ModularLibsProfile>,
provers: ObjectCache<ProverWrapper>,
service_connections: Arc<ServiceConnections>,
}

impl ServiceProver {
pub fn new(
profile: Arc<VdrtoolsProfile>,
profile: Arc<ModularLibsProfile>,
service_connections: Arc<ServiceConnections>,
) -> Self {
Self {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::{

use aries_vcx::{
common::primitives::revocation_registry::RevocationRegistry,
core::profile::{vdrtools_profile::VdrtoolsProfile, Profile},
core::profile::{modular_libs_profile::ModularLibsProfile, Profile},
};

use crate::{
Expand All @@ -14,13 +14,13 @@ use crate::{
};

pub struct ServiceRevocationRegistries {
profile: Arc<VdrtoolsProfile>,
profile: Arc<ModularLibsProfile>,
issuer_did: String,
rev_regs: ObjectCache<RevocationRegistry>,
}

impl ServiceRevocationRegistries {
pub fn new(profile: Arc<VdrtoolsProfile>, issuer_did: String) -> Self {
pub fn new(profile: Arc<ModularLibsProfile>, issuer_did: String) -> Self {
Self {
profile,
issuer_did,
Expand Down
6 changes: 3 additions & 3 deletions agents/rust/aries-vcx-agent/src/services/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::sync::{Arc, Mutex};

use aries_vcx::{
common::primitives::credential_schema::Schema,
core::profile::{vdrtools_profile::VdrtoolsProfile, Profile},
core::profile::{modular_libs_profile::ModularLibsProfile, Profile},
};
use aries_vcx_core::ledger::base_ledger::AnoncredsLedgerRead;

Expand All @@ -12,13 +12,13 @@ use crate::{
};

pub struct ServiceSchemas {
profile: Arc<VdrtoolsProfile>,
profile: Arc<ModularLibsProfile>,
issuer_did: String,
schemas: ObjectCache<Schema>,
}

impl ServiceSchemas {
pub fn new(profile: Arc<VdrtoolsProfile>, issuer_did: String) -> Self {
pub fn new(profile: Arc<ModularLibsProfile>, issuer_did: String) -> Self {
Self {
profile,
issuer_did,
Expand Down
6 changes: 3 additions & 3 deletions agents/rust/aries-vcx-agent/src/services/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::sync::Arc;

use aries_vcx::{
common::proofs::proof_request::PresentationRequestData,
core::profile::{vdrtools_profile::VdrtoolsProfile, Profile},
core::profile::{modular_libs_profile::ModularLibsProfile, Profile},
handlers::proof_presentation::verifier::Verifier,
messages::{
msg_fields::protocols::present_proof::{
Expand Down Expand Up @@ -41,14 +41,14 @@ impl VerifierWrapper {
}

pub struct ServiceVerifier {
profile: Arc<VdrtoolsProfile>,
profile: Arc<ModularLibsProfile>,
verifiers: ObjectCache<VerifierWrapper>,
service_connections: Arc<ServiceConnections>,
}

impl ServiceVerifier {
pub fn new(
profile: Arc<VdrtoolsProfile>,
profile: Arc<ModularLibsProfile>,
service_connections: Arc<ServiceConnections>,
) -> Self {
Self {
Expand Down
13 changes: 4 additions & 9 deletions aries_vcx/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,15 @@ path = "src/lib.rs"
doctest = false

[features]
default = ["vdrtools"]
vdrtools = ["aries_vcx_core/vdrtools_anoncreds", "aries_vcx_core/vdrtools_wallet"]
default = ["credx", "vdrtools_wallet"]
# Feature flag to include the 'modular library' dependencies (vdrtools alternatives; indy-vdr, indy-credx)
modular_libs = ["aries_vcx_core/modular_libs"]
# TODO: Remove using "vdrtools" feature flag for vdr_proxy_ledger once IndyCredxAnonCreds
# is fully implemented
vdr_proxy_ledger = ["aries_vcx_core/vdr_proxy_ledger", "vdrtools"]
credx = ["aries_vcx_core/credx"]
vdr_proxy_ledger = ["aries_vcx_core/vdr_proxy_ledger", "aries_vcx_core/vdrtools_wallet"]
vdrtools_wallet = ["aries_vcx_core/vdrtools_wallet"]

# Feature for allowing legacy proof verification
legacy_proof = ["aries_vcx_core/legacy_proof"]

# Used for testing the migrator
migration = ["vdrtools", "modular_libs", "legacy_proof"]

[dependencies]
agency_client = { path = "../agency_client" }
messages = { path = "../messages" }
Expand Down
1 change: 0 additions & 1 deletion aries_vcx/src/common/anoncreds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ pub mod integration_tests {
.await;
}

// #[cfg(feature = "modular_libs")]
#[tokio::test]
#[ignore]
async fn test_pool_proof_req_attribute_names() {
Expand Down
2 changes: 1 addition & 1 deletion aries_vcx/src/common/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ pub async fn get_verkey_from_ledger(
//
// #[tokio::test]
// #[ignore]
// #[cfg(all(not(feature = "vdr_proxy_ledger"), not(feature = "modular_libs"),))]
// #[cfg(all(not(feature = "vdr_proxy_ledger"), not(feature = "credx"),))]
// async fn test_pool_rotate_verkey_fails() {
// use super::*;
//
Expand Down
2 changes: 0 additions & 2 deletions aries_vcx/src/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@ pub mod ledger;
pub mod primitives;
pub mod proofs;
pub mod signing;
#[cfg(feature = "vdrtools")]
// TODO: Used by tests/ so not "hideable" by #[cfg(test)]
pub mod test_utils;
3 changes: 0 additions & 3 deletions aries_vcx/src/common/primitives/revocation_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,3 @@ pub async fn generate_rev_reg(

Ok((rev_reg_id, rev_reg_def, rev_reg_entry_json))
}

// consider impl revoke_credential_local in a generic (non-vdrtools) fashion
// consider impl publish_local_revocations in a generic (non-vdrtools) fashion
Loading