Skip to content

Commit

Permalink
Merge branch 'main' into testing/err-handling
Browse files Browse the repository at this point in the history
  • Loading branch information
gmulhearn authored Nov 6, 2023
2 parents 32c71a9 + fee4076 commit 2939007
Show file tree
Hide file tree
Showing 79 changed files with 1,028 additions and 830 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ 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 --tests --all-features
cargo clippy --examples --tests --all-features
env:
RUSTFLAGS: -D warnings

Expand Down Expand Up @@ -354,7 +354,7 @@ jobs:
rust-toolchain-version: ${{ env.RUST_TOOLCHAIN_VERSON }}
- name: "Run resolver tests"
run: |
RUST_TEST_THREADS=1 cargo test -p did_doc -p did_parser -p did_resolver -p did_resolver_registry -p did_resolver_sov -p did_resolver_web -p did_doc_sov -p did_key -p did_peer --test "*"
RUST_TEST_THREADS=1 cargo test --examples -p did_doc -p did_parser -p did_resolver -p did_resolver_registry -p did_resolver_sov -p did_resolver_web -p did_doc_sov -p did_key -p did_peer --test "*"
test-integration-node-wrapper:
needs: workflow-setup
Expand Down
44 changes: 27 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ members = [
"shared_vcx",
"diddoc_legacy",
"agents/rust/mediator",
"agents/rust/mediator/client-webapi",
"agents/rust/mediator/client-tui",
"agents/rust/aries-vcx-agent",
"wrappers/vcx-napi-rs",
Expand All @@ -31,7 +30,8 @@ members = [
"wallet_migrator",
"tools/simple_message_relay",
"tools/test_utils",
"tools/libvcx_logger"
"tools/libvcx_logger",
"tools/display_as_json"
]

[workspace.package]
Expand Down
1 change: 1 addition & 0 deletions agents/rust/mediator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@ mediation = { path = "./mediation" }
test_utils = { path = "../../../tools/test_utils" }

[dev-dependencies]
base64-url = "2.0.0"
chrono = "0.4.31"
reqwest = { version = "0.11.20", features = ["blocking"] }
2 changes: 1 addition & 1 deletion agents/rust/mediator/client-tui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ aries_vcx_core = { path = "../../../../aries_vcx_core", features = [
"vdrtools_wallet",
] }
axum = "0.6.20"
client-webapi = { path = "../client-webapi" }
cursive = { version = "0.20.0", features = ["crossterm-backend"] }
futures = "0.3.28"
log = "0.4.20"
mediation = { path = "../mediation" }
mediator = { path = ".." }
messages = { path = "../../../../messages" }
reqwest = "0.11.22"
serde_json = "1.0.107"

tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
25 changes: 25 additions & 0 deletions agents/rust/mediator/client-tui/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
use std::collections::VecDeque;

use aries_vcx_core::wallet::base_wallet::BaseWallet;
use mediation::storage::MediatorPersistence;
use mediator::aries_agent::{client::transports::AriesReqwest, ArcAgent};
use messages::msg_fields::protocols::out_of_band::invitation::Invitation as OOBInvitation;
use serde_json::{json, Value};

pub async fn handle_register(
agent: ArcAgent<impl BaseWallet + 'static, impl MediatorPersistence>,
oob_invite: OOBInvitation,
) -> Result<Value, String> {
let mut aries_transport = AriesReqwest {
response_queue: VecDeque::new(),
client: reqwest::Client::new(),
};
let state = agent
.establish_connection(oob_invite, &mut aries_transport)
.await
.map_err(|err| format!("{err:?}"))?;
Ok(json!({
"status": "success",
"connection_completed": state
}))
}
3 changes: 2 additions & 1 deletion agents/rust/mediator/client-tui/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/// Aries Agent TUI
mod tui;

/// Aries Agent TUI
#[tokio::main]
async fn main() {
use mediator::{
Expand Down
7 changes: 3 additions & 4 deletions agents/rust/mediator/client-tui/src/tui.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use std::sync::Arc;

use aries_vcx_core::wallet::base_wallet::BaseWallet;
use axum::{extract::State, Json};
use client_webapi::http_routes::handle_register;
use client_tui::handle_register;
use cursive::{
direction::Orientation,
event::Key,
Expand Down Expand Up @@ -103,8 +102,8 @@ pub fn client_register_connect_cb<T: BaseWallet + 'static, P: MediatorPersistenc
let agent: &mut Arc<Agent<T, P>> = s.user_data().expect("Userdata should contain Agent");

output.set_content(format!("{:#?}", oob_invite));
match block_on(handle_register(State(agent.to_owned()), Json(oob_invite))) {
Ok(Json(res_json)) => output.set_content(serde_json::to_string_pretty(&res_json).unwrap()),
match block_on(handle_register(agent.to_owned(), oob_invite)) {
Ok(res_json) => output.set_content(serde_json::to_string_pretty(&res_json).unwrap()),
Err(err) => output.set_content(err),
};
}
Expand Down
20 changes: 0 additions & 20 deletions agents/rust/mediator/client-webapi/Cargo.toml

This file was deleted.

9 changes: 0 additions & 9 deletions agents/rust/mediator/client-webapi/README.md

This file was deleted.

35 changes: 0 additions & 35 deletions agents/rust/mediator/client-webapi/src/http_routes.rs

This file was deleted.

1 change: 0 additions & 1 deletion agents/rust/mediator/client-webapi/src/lib.rs

This file was deleted.

32 changes: 0 additions & 32 deletions agents/rust/mediator/client-webapi/src/main.rs

This file was deleted.

7 changes: 5 additions & 2 deletions agents/rust/mediator/mediation/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mediation"
version = "0.2.3"
version = "0.2.4"
edition = "2021"

[lib]
Expand All @@ -10,23 +10,26 @@ path = "src/lib.rs"
[features]
default = ["mysql_db", "mediator_persistence_extras"]
# postgres_db=["sqlx/postgres"]
mysql_db=["sqlx/mysql"]
mysql_db = ["sqlx/mysql"]
# any_db=["sqlx/all-databases"]
mediator_persistence_extras = []

[dependencies]
async-trait = "0.1.72"
axum = "0.6.18"
base64-url = "2.0.0"
dotenvy = "0.15.7"
env_logger = "0.10.0"
futures = "0.3.28"
log = "0.4.19"
messages = { path = "../../../../messages" }
serde = { version = "1.0.164", features = ["derive"] }
serde_json = "1.0.104"
serde_with = { version = "3.1.0", features = ["base64"] }
sqlx = { version = "0.7", features = ["runtime-tokio"], optional = true }
# sqlx = { version = "0.5.8", git = "https://github.com/jovfer/sqlx", branch = "feature/json_no_preserve_order_v5", features = [ "sqlite", "mysql", "json_no_preserve_order", "runtime-tokio-rustls"], optional = true }
tokio = { version = "1.28.2", features = ["rt-multi-thread", "macros"] }
uuid = { version = "1.5.0", features = ["v4"] }

# Workaround required because of bug in sqlx pre v6 https://github.com/launchbadge/sqlx/issues/2418
# [build-dependencies]
Expand Down
Loading

0 comments on commit 2939007

Please sign in to comment.