Skip to content

Commit

Permalink
Merge pull request #73 from mineshp-mecha/chore/networking
Browse files Browse the repository at this point in the history
Feat/networking
  • Loading branch information
shoaibmerchant authored Apr 20, 2024
2 parents 7e44737 + 84e296d commit 7f7451b
Show file tree
Hide file tree
Showing 24 changed files with 1,668 additions and 2,487 deletions.
168 changes: 167 additions & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[workspace]
default-members = ["agent"]
members = ["agent", "core/services", "core/events", "core/settings", "provisioning", "messaging", "identity", "status", "settings", "grpc-server", "networking","telemetry","commons/crypto", "commons/kv-store", "commons/fs", "client/app"]
members = ["agent", "core/services", "core/events", "core/settings", "provisioning", "messaging", "identity", "status", "settings", "grpc-server", "networking","telemetry","commons/crypto", "commons/kv-store", "commons/fs", "client/app", "commons/wireguard"]
resolver = "2"

[workspace.package]
Expand Down
2 changes: 1 addition & 1 deletion agent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ messaging = { path = "../messaging" }
channel = { path = "../commons/channel" }
provisioning = { path = "../provisioning" }
settings = { path = "../settings" }
networking = { path = "../networking" }
telemetry = { path = "../telemetry" }
networking = { path = "../networking" }
tokio = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
Expand Down
7 changes: 4 additions & 3 deletions commons/kv-store/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,14 @@ impl KeyValueStoreClient {
Ok(true)
}
pub fn get(&self, key: &str) -> Result<Option<String>> {
trace!(func = "get", package = PACKAGE_NAME, " key: {}", key);
let fn_name = "get";
trace!(func = fn_name, package = PACKAGE_NAME, " key: {}", key);
if let Some(database) = DATABASE.as_ref() {
let db = match database.lock() {
Ok(d) => d,
Err(e) => {
error!(
func = "set",
func = fn_name,
package = PACKAGE_NAME,
"failed to acquire lock on db - {}",
e
Expand All @@ -109,7 +110,7 @@ impl KeyValueStoreClient {
match last_inserted {
Ok(s) => {
debug!(
func = "get",
func = fn_name,
package = PACKAGE_NAME,
"retrieved value from db key - {}",
key
Expand Down
21 changes: 21 additions & 0 deletions commons/wireguard/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "wireguard"
version.workspace = true
authors.workspace = true
description.workspace = true
documentation.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true

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

[dependencies]
serde = { version = "1.0.159", features = ["derive"]}
base64 = "0.22.0"
anyhow = { version = "1.0.71", features = ["backtrace"]}
rand = "0.8.5"
x25519-dalek = { version = "2.0", features = ["getrandom", "static_secrets"] }
defguard_wireguard_rs = "0.4.2"
tracing = "0.1"
Loading

0 comments on commit 7f7451b

Please sign in to comment.