Skip to content

Commit

Permalink
upgrade all dependencies to their latest versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Hermann-Core committed Dec 17, 2024
1 parent c4996cc commit 03d24ca
Show file tree
Hide file tree
Showing 22 changed files with 155 additions and 133 deletions.
75 changes: 39 additions & 36 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,50 +48,52 @@ mediator-coordination = { path = "./crates/web-plugins/didcomm-messaging/protoco
# Other common dependencies
serde = "1.0"
sha2 = "0.10"
cfg-if = "0.1"
cfg-if = "1.0"
getrandom = "0.2"
hyper-tls = "0.5.0"
json-patch = "1.0.0"
x25519-dalek = "2.0.0-rc.3"
multibase = "0.8.0"
hyper-tls = "0.6.0"
json-patch = "3.0.1"
x25519-dalek = "2.0.1"
multibase = "0.9.1"
json-canon = "0.1.3"
qrcode = "0.12.0"
image = "0.23"
reqwest = "0.11"
qrcode = "0.14.1"
image = "0.25"
reqwest = "0.12"
tempdir = "0.3.7"
headers = "0.3"
thiserror = "1.0.48"
url = "2.4.1"
num-bigint = "0.4.4"
base64 = "0.13.0"
headers = "0.4"
thiserror = "2.0.7"
url = "2.5.4"
num-bigint = "0.4.6"
base64 = "0.22.1"
hex = "0.4.3"
eyre = "0.6"
anyhow = "1"
subtle = "2.5.0"
regex = "1.10.2"
mongodb = "2.7.1"
once_cell = "1.20.0"
tower = "0.4"
nix = "0.22.0"
uuid = "1.4.1"
axum = "0.6.20"
tokio = "1.30.0"
tracing = "0.1.37"
chrono = "0.4.26"
paste = "0.1"
subtle = "2.6.1"
regex = "1.11.1"
mongodb = "3.1.1"
once_cell = "1.20.2"
tower = "0.5"
nix = "0.29.0"
uuid = "1.11.0"
axum = "0.7.9"
tokio = "1.42.0"
tracing = "0.1.41"
chrono = "0.4.39"
paste = "1.0"
didcomm = "0.4.1"
hyper = "0.14.27"
lazy_static = "1.4.0"
async-trait = "0.1.73"
dotenv-flow = "0.15.0"
hyper = "1.5.2"
hyper-util = "0.1"
http-body-util = "0.1"
lazy_static = "1.5.0"
async-trait = "0.1.83"
dotenv-flow = "0.16.2"
serde_json = "1.0"
parking_lot = "0.12.0"
curve25519-dalek = "4.0.0-rc.3"
ed25519-dalek = "2.0.0-rc.3"
tracing-subscriber = "0.3.17"
tower-http = "0.4.3"
parking_lot = "0.12.3"
curve25519-dalek = "4.1.3"
ed25519-dalek = "2.1.1"
tracing-subscriber = "0.3.19"
tower-http = "0.6.2"
base64ct = { version = "1.6.0", default-features = false }
zeroize = { version = "1.6.0", default-features = false }
zeroize = { version = "1.8.1", default-features = false }


[dependencies]
Expand All @@ -105,6 +107,7 @@ tracing.workspace = true
lazy_static.workspace = true
serde_json.workspace = true
hyper.workspace = true
http-body-util.workspace = true
tokio = { workspace = true, features = ["full"] }
tracing-subscriber = { workspace = true, features = ["json"] }
tower-http = { workspace = true, features = ["catch-panic", "trace", "cors"] }
Expand Down Expand Up @@ -136,4 +139,4 @@ mediator-coordination = ["plugin-didcomm_messaging", "didcomm-messaging/mediator


[dev-dependencies]
tower = { version = "0.4.13", features = ["util"] }
tower = { version = "0.5.2", features = ["util"] }
15 changes: 7 additions & 8 deletions crates/database/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ where
let collection = self.get_collection();

// Lock the Mutex and get the Collection
let mut cursor = collection.read().await.find(None, None).await?;
let mut cursor = collection.read().await.find(doc! {}).await?;
while cursor.advance().await? {
entities.push(cursor.deserialize_current()?);
}
Expand All @@ -91,7 +91,7 @@ where
// Lock the Mutex and get the Collection
let collection = collection.read().await;
Ok(collection
.count_documents(filter, None)
.count_documents(filter)
.await?
.try_into()
.map_err(|_| RepositoryError::Generic("count overflow".to_owned()))?)
Expand All @@ -108,7 +108,7 @@ where

// Lock the Mutex and get the Collection
let collection = collection.read().await;
Ok(collection.find_one(filter, None).await?)
Ok(collection.find_one(filter).await?)
}

/// Stores a new entity.
Expand All @@ -119,7 +119,7 @@ where
let collection = collection.read().await;

// Insert the new entity into the database
let metadata = collection.insert_one(entity.clone(), None).await?;
let metadata = collection.insert_one(entity.clone()).await?;

// Set the ID if it was inserted and return the updated entity
if let Bson::ObjectId(oid) = metadata.inserted_id {
Expand All @@ -144,7 +144,7 @@ where
let collection = collection.read().await;

// Retrieve all entities from the database
let mut cursor = collection.find(filter, find_options).await?;
let mut cursor = collection.find(filter).with_options(find_options).await?;
while cursor.advance().await? {
entities.push(cursor.deserialize_current()?);
}
Expand All @@ -160,7 +160,7 @@ where
let collection = collection.read().await;

// Delete the entity from the database
collection.delete_one(doc! {"_id": id}, None).await?;
collection.delete_one(doc! {"_id": id}).await?;

Ok(())
}
Expand All @@ -179,8 +179,7 @@ where
let metadata = collection
.update_one(
doc! {"_id": entity.id().unwrap()},
doc! {"$set": bson::to_document(&entity).map_err(|_| RepositoryError::BsonConversionError)?},
None,
doc! {"$set": bson::to_document(&entity).map_err(|_| RepositoryError::BsonConversionError)?}
)
.await?;

Expand Down
2 changes: 1 addition & 1 deletion crates/filesystem/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2021"

[dependencies]
nix.workspace = true
nix ={ workspace = true, features = ["fs"] }

[features]
test-utils = []
9 changes: 4 additions & 5 deletions crates/filesystem/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
use nix::fcntl::{flock, FlockArg};
use nix::fcntl::{Flock, FlockArg};
use std::{
fs::OpenOptions,
io::{Error as IoError, ErrorKind, Result as IoResult},
os::unix::io::AsRawFd,
path::Path,
};

#[doc(hidden)]
// Define a trait for file system operations
pub trait FileSystem: Send + Sync + 'static {
pub trait FileSystem: Send + 'static {
fn read_to_string(&self, path: &Path) -> IoResult<String>;
fn write(&mut self, path: &Path, content: &str) -> IoResult<()>;
fn read_dir_files(&self, path: &Path) -> IoResult<Vec<String>>;
Expand Down Expand Up @@ -59,7 +58,7 @@ impl FileSystem for StdFileSystem {
.open(path)?;

// Acquire an exclusive lock before writing to the file
flock(file.as_raw_fd(), FlockArg::LockExclusive)
let file = Flock::lock(file, FlockArg::LockExclusive)
.map_err(|_| IoError::new(ErrorKind::Other, "Error acquiring file lock"))?;

std::fs::write(path, content).map_err(|_| {
Expand All @@ -70,7 +69,7 @@ impl FileSystem for StdFileSystem {
})?;

// Release the lock after writing to the file
flock(file.as_raw_fd(), FlockArg::Unlock)
file.unlock()
.map_err(|_| IoError::new(ErrorKind::Other, "Error releasing file lock"))?;

Ok(())
Expand Down
5 changes: 3 additions & 2 deletions crates/web-plugins/did-endpoint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@ serde_json.workspace = true
dotenv-flow.workspace = true
multibase.workspace = true
tracing.workspace = true
http-body-util.workspace = true
uuid = { workspace = true, features = ["v4"] }
hyper = { workspace = true, features = ["full"] }
tokio = { workspace = true, features = ["full"] }
axum = { workspace = true, features = ["macros"] }

[dev-dependencies]
async-trait.workspace = true
mockall = "0.13.0"
mockall = "0.13.1"
json-canon = "0.1.3"
filesystem = { workspace = true, features = ["test-utils"] }
keystore = { workspace = true, features = ["test-utils"] }
tower = { version = "0.4.13", features = ["util"] }
tower = { version = "0.5.2", features = ["util"] }
5 changes: 3 additions & 2 deletions crates/web-plugins/did-endpoint/src/web.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ mod tests {
proof::{CryptoProof, EdDsaJcs2022},
vc::VerifiablePresentation,
};
use http_body_util::BodyExt;
use serde_json::json;
use tower::util::ServiceExt;

Expand Down Expand Up @@ -284,8 +285,8 @@ mod tests {

assert_eq!(response.status(), StatusCode::OK);

let body = hyper::body::to_bytes(response.into_body()).await.unwrap();
let vp: VerifiablePresentation = serde_json::from_slice(&body).unwrap();
let body = BodyExt::collect(response.into_body()).await.unwrap();
let vp: VerifiablePresentation = serde_json::from_slice(&body.to_bytes()).unwrap();

let vc = vp.verifiable_credential.get(0).unwrap();
let diddoc = serde_json::from_value(json!(vc.credential_subject)).unwrap();
Expand Down
5 changes: 3 additions & 2 deletions crates/web-plugins/didcomm-messaging/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ tracing.workspace = true
once_cell.workspace = true
serde_json.workspace = true
thiserror.workspace = true
http-body-util.workspace = true
tokio = { workspace = true, features = ["full"] }
hyper = { workspace = true, features = ["full"] }
axum = { workspace = true, features = ["macros"] }
Expand All @@ -52,8 +53,8 @@ async-trait.workspace = true
uuid = { workspace = true, features = ["v4"] }
json-canon = "0.1.3"
shared = { workspace = true, features = ["test-utils"] }
tokio = { version = "1.27.0", default-features = false, features = [
tokio = { version = "1.42.0", default-features = false, features = [
"macros",
"rt",
] }
tower = { version = "0.4.13", features = ["util"] }
tower = { version = "0.5.2", features = ["util"] }
13 changes: 8 additions & 5 deletions crates/web-plugins/didcomm-messaging/did-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ edition = "2021"

[dependencies]
serde_json.workspace = true
chrono = { workspace = true, features = ["serde"] }
hyper = { workspace = true, features = ["client", "http2"] }
tokio.workspace = true
serde.workspace = true
axum.workspace = true
hyper-tls.workspace = true
http-body-util.workspace = true
hyper-util ={ workspace = true, features = ["full"] }
hyper = { workspace = true, features = ["full"] }
chrono = { workspace = true, features = ["serde"] }

# Cross-platform random number generator from os
getrandom = { workspace = true, features = ["js"] }
Expand Down Expand Up @@ -38,10 +41,10 @@ subtle.workspace = true
regex.workspace = true

[dev-dependencies]
hyper = { version = "0.14.26", features = ["server"] }
async-std = { version = "1.12.0", features = ["attributes"] }
hyper = { version = "1.5.2", features = ["server"] }
async-std = { version = "1.13.0", features = ["attributes"] }
hex = "0.4.3"
tokio = { version = "1.27.0", default-features = false, features = [
tokio = { version = "1.42.0", default-features = false, features = [
"macros",
"rt",
] }
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ pub enum DidWebError {
#[error("Parsing error: {0}")]
ParsingError(#[from] ParsingErrorSource),
#[error("URL parsing error: {0}")]
HttpClientError(#[from] hyper_util::client::legacy::Error),
#[error("URL parsing error: {0}")]
HttpError(#[from] hyper::Error),
#[error("Non-success server response: {0}")]
NonSuccessResponse(StatusCode),
Expand Down
Loading

0 comments on commit 03d24ca

Please sign in to comment.