Skip to content

Commit

Permalink
refactor(mediator-client): move to separate package
Browse files Browse the repository at this point in the history
Signed-off-by: Naian <126972030+nain-F49FF806@users.noreply.github.com>
  • Loading branch information
nain-F49FF806 committed Oct 20, 2023
1 parent fbc0987 commit df49c68
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 18 deletions.
16 changes: 16 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ members = [
"shared_vcx",
"diddoc_legacy",
"agents/rust/mediator",
"agents/rust/mediator/client-webapi",
"agents/rust/aries-vcx-agent",
"wrappers/vcx-napi-rs",
"aries_vcx_core",
Expand Down
20 changes: 20 additions & 0 deletions agents/rust/mediator/client-webapi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[package]
name = "client-webapi"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
aries_vcx_core = { path = "../../../../aries_vcx_core", features = [
"vdrtools_wallet",
] }
axum = "0.6.20"
log = "0.4.20"
mediation = { path = "../mediation" }
mediator = { version = "0.1.1", path = ".." }
messages = { path = "../../../../messages" }
reqwest = "0.11.22"
serde_json = "1.0.107"
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
tower-http = { version = "0.4.4", features = ["catch-panic"] }
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
use std::collections::VecDeque;
use std::{collections::VecDeque, sync::Arc};

use aries_vcx_core::wallet::base_wallet::BaseWallet;
use axum::routing::post;
use axum::{extract::State, routing::post, Json, Router};
use mediation::storage::MediatorPersistence;
use mediator::aries_agent::{transports::AriesReqwest, Agent, ArcAgent};
use messages::msg_fields::protocols::out_of_band::invitation::Invitation as OOBInvitation;
use serde_json::json;

use super::*;
use crate::aries_agent::transports::AriesReqwest;
use serde_json::{json, Value};

pub async fn handle_register(
State(agent): State<ArcAgent<impl BaseWallet + 'static, impl MediatorPersistence>>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/// Client-side focused api accessible Aries Agent
#[cfg(feature = "client_http_api")]
mod http_routes;

#[tokio::main]
async fn main() {
use http_routes::build_client_router;
use mediator::{
aries_agent::AgentBuilder,
http_routes::client::build_client_router,
utils::binary_utils::{load_dot_env, setup_logging},
};

Expand All @@ -25,10 +26,9 @@ async fn main() {
.unwrap();
}

#[cfg(not(feature = "client_http_api"))]
fn main() {
print!(
"This is a placeholder binary. Please enable \"client_tui\" feature to to build the \
functional client_tui binary."
)
}
// fn main() {
// print!(
// "This is a placeholder binary. Please enable \"client_tui\" feature to to build the \
// functional client_tui binary."
// )
// }
3 changes: 0 additions & 3 deletions agents/rust/mediator/src/http_routes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ use crate::{
didcomm_handlers,
};

#[cfg(any(test, feature = "client_tui", feature = "client_http_api"))]
pub mod client;

pub async fn oob_invite_qr(
headers: HeaderMap,
State(agent): State<ArcAgent<impl BaseWallet + 'static, impl MediatorPersistence>>,
Expand Down

0 comments on commit df49c68

Please sign in to comment.