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

(chore) rust 1.83 update, dependency updates and workspace deps usage #1320

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
1,361 changes: 825 additions & 536 deletions Cargo.lock

Large diffs are not rendered by default.

65 changes: 59 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ panic = 'unwind'
incremental = false

[workspace.lints.clippy]
all = "warn"
pedantic = "warn"
all = { level = "warn", priority = -1 }
pedantic = { level = "warn", priority = -1 }
struct_excessive_bools = "allow"
trivially_copy_pass_by_ref = "allow"
must_use_candidate = "allow"
Expand All @@ -66,8 +66,6 @@ missing_copy_implementations = "warn"
missing_debug_implementations = "warn"
non_ascii_idents = "warn"
pointer_structural_match = "warn"
rust_2018_idioms = "warn"
rust_2021_compatibility = "warn"
trivial_casts = "warn"
trivial_numeric_casts = "warn"
unused_extern_crates = "warn"
Expand All @@ -77,10 +75,65 @@ unused_qualifications = "warn"
let_underscore_drop = "allow"

[workspace.dependencies]
# aries
indy-vdr = { git = "https://github.com/hyperledger/indy-vdr.git", tag = "v0.4.3", default-features = false, features = [
"log",
] }
indy-vdr-proxy-client = { git = "https://github.com/hyperledger/indy-vdr.git", tag = "v0.4.3" }
anoncreds = { git = "https://github.com/hyperledger/anoncreds-rs.git", tag = "v0.2.0" }
aries-askar = { version = "0.3.1" }
askar-crypto = { version = "0.3.1", default-features = false }
anoncreds-clsignatures = "0.3.2"
aries-askar = { version = "0.4.0" }
askar-crypto = { version = "0.3.3", default-features = false }

# common
base64 = "0.22.1"
bs58 = "0.5.1"
multibase = "0.9.1"
hex = "0.4.3"
pem = "3.0.4"
serde = { version = "1.0.217", default-features = false }
serde_json = "1.0.134"
derive_more = "1.0.0"
async-trait = "0.1.83"
futures = { version = "0.3.31", default-features = false }
log = "0.4.22"
url = { version = "2.5.4", default-features = false }
uuid = { version = "1.11.0", default-features = false, features = ["v4"] }
chrono = { version = "0.4.39", default-features = false }
typed-builder = "0.20.0"
thiserror = "2.0.9"
anyhow = "1.0.95"
regex = "1.11.1"
lazy_static = "1.5.0"
once_cell = "1.20.2"
rand = "0.8.5"
time = "0.3.37"
bitvec = "1.0.1"
sha2 = "0.10.8"
unsigned-varint = "0.8.0"
strum = "0.26.3"
strum_macros = "0.26.4"
syn = "2.0.93"
quote = "1.0.38"

# common drivers
tokio = { version = "1.42.0", default-features = false }
sqlx = "0.8.2"
reqwest = "0.12.11"
axum = "0.7.9"
axum-macros = "0.4.2"
tower-http = "0.6.2"
hyper= "1.5.2"
hyper-tls = "0.6.0"
hyper-util = "0.1.10"
http-body-util = "0.1.2"

# common dev
mockall = "0.13.1"
env_logger = "0.11.6"
uniffi = "0.23.0"

# TODO - await new indy-vdr release
[patch.'https://github.com/hyperledger/indy-vdr']
indy-vdr = { git = "https://github.com/anonyome/indy-vdr.git", rev = "34ada55" }
indy-vdr-proxy-client = { git = "https://github.com/anonyome/indy-vdr.git", rev = "34ada55" }
27 changes: 17 additions & 10 deletions aries/agents/aath-backchannel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,28 @@
name = "aries-vcx-backchannel"
version = "0.1.0"
edition = "2018"
authors = ["Absa Group Limited", "Hyperledger Indy Contributors <hyperledger-indy@lists.hyperledger.org>"]
authors = [
"Absa Group Limited",
"Hyperledger Indy Contributors <hyperledger-indy@lists.hyperledger.org>",
]
description = "Backchannel for aries-vcx"

[dependencies]
derive_more = { workspace = true, features = [
"from",
"try_into",
"display",
"error",
] }
actix-web = "4"
derive_more = "0.99.14"
clap = { version = "4.5.6", features = ["derive"] }
reqwest = { version = "0.12.4", features = ["json", "multipart", "blocking"] }
rand = "0.8.5"
serde = "1.0.97"
serde_json = "1.0.40"
serde_derive = "1.0.97"
log = "^0.4.20"
env_logger = "0.11.3"
uuid = { version = "1.8.0", features = ["serde", "v4"] }
reqwest = { workspace = true, features = ["json", "multipart", "blocking"] }
rand.workspace = true
serde.workspace = true
serde_json.workspace = true
log.workspace = true
env_logger.workspace = true
uuid = { workspace = true, features = ["serde"] }
aries-vcx-agent = { path = "../../../aries/agents/aries-vcx-agent" }
anoncreds_types = { path = "../../../aries/misc/anoncreds_types" }
display_as_json = { path = "../../../misc/display_as_json" }
Expand Down
20 changes: 10 additions & 10 deletions aries/agents/aath-backchannel/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,28 @@ pub type HarnessResult<T> = Result<T, HarnessError>;

#[derive(Debug, Display, Error, Clone)]
pub enum HarnessErrorType {
#[display(fmt = "Internal server error")]
#[display("Internal server error")]
InternalServerError,
#[display(fmt = "Request not accepted")]
#[display("Request not accepted")]
RequestNotAcceptedError,
#[display(fmt = "Request not received")]
#[display("Request not received")]
RequestNotReceived,
#[display(fmt = "Not found")]
#[display("Not found")]
NotFoundError,
#[display(fmt = "Invalid JSON")]
#[display("Invalid JSON")]
InvalidJson,
#[display(fmt = "Protocol error")]
#[display("Protocol error")]
ProtocolError,
#[display(fmt = "Invalid state for requested operation")]
#[display("Invalid state for requested operation")]
InvalidState,
#[display(fmt = "Encryption error")]
#[display("Encryption error")]
EncryptionError,
#[display(fmt = "Multiple credential definitions found")]
#[display("Multiple credential definitions found")]
MultipleCredDefinitions,
}

#[derive(Debug, Display, Error, Clone)]
#[display(fmt = "Error: {}", message)]
#[display("Error: {}", message)]
pub struct HarnessError {
pub message: String,
pub kind: HarnessErrorType,
Expand Down
3 changes: 1 addition & 2 deletions aries/agents/aath-backchannel/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ mod controllers;
mod error;
mod setup;

extern crate serde;
#[macro_use]
extern crate serde_derive;
extern crate serde;
#[macro_use]
extern crate serde_json;
#[macro_use]
Expand Down
14 changes: 7 additions & 7 deletions aries/agents/aries-vcx-agent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ license.workspace = true
edition.workspace = true

[dependencies]
serde = "1.0.145"
serde.workspace = true
serde_json.workspace = true
aries_vcx = { path = "../../aries_vcx" }
aries_vcx_wallet = { path = "../../aries_vcx_wallet", features = [
"askar_wallet",
Expand All @@ -20,10 +21,9 @@ did_resolver_sov = { path = "../../../did_core/did_methods/did_resolver_sov" }
did_peer = { path = "../../../did_core/did_methods/did_peer" }
did_key = { path = "../../../did_core/did_methods/did_key" }
public_key = { path = "../../../did_core/public_key" }
async-trait = "0.1.64"
serde_json = "1.0.85"
log = "0.4.17"
uuid = "1.2.1"
thiserror = "1.0.37"
url = { version = "2.3.1", features = ["serde"] }
async-trait.workspace = true
log.workspace = true
uuid.workspace = true
thiserror.workspace = true
url = { workspace = true, features = ["serde"] }
display_as_json = { path = "../../../misc/display_as_json" }
36 changes: 18 additions & 18 deletions aries/agents/mediator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,31 @@ default = ["client"]
client = []

[dependencies]
anyhow = "1.0.75"
anyhow.workspace = true
aries_vcx = { path = "../../aries_vcx" }
aries_vcx_wallet = { path = "../../aries_vcx_wallet", features = [
"askar_wallet",
] }
async-trait = "0.1.73"
axum = "0.7.5"
axum-macros = "0.4.1"
async-trait.workspace = true
axum.workspace = true
axum-macros.workspace = true
diddoc_legacy = { path = "../../misc/legacy/diddoc_legacy" }
dotenvy = "0.15"
env_logger = "0.11.3"
futures = "0.3.28"
log = "0.4.20"
env_logger.workspace = true
futures.workspace = true
log.workspace = true
messages = { path = "../../messages" }
reqwest = { version = "0.12.5", features = ["json"] }
serde = "1.0.188"
serde_json = "1.0.106"
sqlx = { version = "0.7", features = ["mysql"] }
thiserror = "1.0.49"
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
tower-http = { version = "0.5.2", features = ["catch-panic"] }
url = "2.4.1"
uuid = "1.4.1"
reqwest = { workspace = true, features = ["json"] }
serde.workspace = true
serde_json.workspace = true
sqlx = { workspace = true, features = ["mysql"] }
thiserror.workspace = true
tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }
tower-http = { workspace = true, features = ["catch-panic"] }
url.workspace = true
uuid.workspace = true
test_utils = { path = "../../misc/test_utils" }
base64-url = "3.0.0"
base64.workspace = true

[dev-dependencies]
chrono = "0.4.31"
chrono.workspace = true
12 changes: 6 additions & 6 deletions aries/agents/mediator/client-tui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ edition = "2021"
aries_vcx_wallet = { path = "../../../aries_vcx_wallet", features = [
"askar_wallet",
] }
axum = "0.7.5"
axum.workspace = true
cursive = { version = "0.20.0", features = ["crossterm-backend"] }
futures = "0.3.28"
log = "0.4.20"
futures = { workspace = true, default-features = true }
log.workspace = true
mediator = { path = ".." }
messages = { path = "../../../messages" }
reqwest = "0.12.5"
serde_json = "1.0.107"
reqwest.workspace = true
serde_json.workspace = true

tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }
5 changes: 4 additions & 1 deletion aries/agents/mediator/src/mediation/pickup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
use std::sync::Arc;

use base64::{engine::general_purpose::URL_SAFE_NO_PAD, Engine};
use log::info;
use messages::{
decorators::attachment::{Attachment, AttachmentData, AttachmentType},
Expand Down Expand Up @@ -95,7 +96,9 @@ async fn handle_pickup_delivery_req<T: MediatorPersistence>(
.id(message_id)
.data(
AttachmentData::builder()
.content(AttachmentType::Base64(base64_url::encode(&message_content)))
.content(AttachmentType::Base64(
URL_SAFE_NO_PAD.encode(&message_content),
))
.build(),
)
.build()
Expand Down
1 change: 0 additions & 1 deletion aries/agents/mediator/src/persistence/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ pub struct DecodeError(#[from] pub Box<dyn std::error::Error>);
/// with the help of thiserror.
/// Usage:
/// errorset!(ComposedError\[ErrorVariant1, ErrorVariant2\]);

macro_rules! error_compose {
($errorset_name:ident[$($error_name: ident),*]) => {
#[derive(Error, Debug)]
Expand Down
3 changes: 2 additions & 1 deletion aries/agents/mediator/tests/mediator-protocol-pickup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ mod common;

use aries_vcx::utils::encryption_envelope::EncryptionEnvelope;
use aries_vcx_wallet::wallet::askar::AskarWallet;
use base64::{engine::general_purpose::URL_SAFE_NO_PAD, Engine};
use diddoc_legacy::aries::diddoc::AriesDidDoc;
use mediator::aries_agent::client::transports::AriesTransport;
use messages::{
Expand Down Expand Up @@ -158,7 +159,7 @@ async fn test_pickup_flow() -> Result<()> {
if let AttachmentType::Base64(base64message) =
&delivery.content.attach.first().unwrap().data.content
{
let encrypted_message_bytes = base64_url::decode(base64message)?;
let encrypted_message_bytes = URL_SAFE_NO_PAD.decode(base64message)?;
info!(
"Decoding attachment to packed_message {}",
String::from_utf8(message_bytes.clone())?
Expand Down
43 changes: 21 additions & 22 deletions aries/aries_vcx/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,34 +40,33 @@ did_key = { path = "../../did_core/did_methods/did_key" }
public_key = { path = "../../did_core/public_key" }
did_peer = { path = "../../did_core/did_methods/did_peer" }
did_resolver_registry = { path = "../../did_core/did_resolver_registry" }
bs58 = "0.5.0"
async-trait = "0.1.53"
env_logger = "0.11.3"
log = "0.4.16"
chrono = "0.4.23"
time = "0.3.20"
lazy_static = "1.3"
rand = "0.8.5"
serde = "1.0.97"
serde_json = "1.0.40"
serde_derive = "1.0.97"
regex = "1.1.0"
base64 = "0.22.1"
sha2 = "0.10.7"
bs58.workspace = true
async-trait.workspace = true
env_logger.workspace = true
log.workspace = true
chrono.workspace = true
time.workspace = true
lazy_static.workspace = true
rand.workspace = true
serde.workspace = true
serde_json.workspace = true
regex.workspace = true
base64.workspace = true
sha2.workspace = true
num-bigint = "0.4.5"
futures = { version = "0.3", default-features = false }
uuid = { version = "1.4.1", default-features = false, features = ["v4"] }
strum = "0.26.3"
strum_macros = "0.26.4"
futures = { workspace = true, default-features = false }
uuid = { workspace = true }
strum.workspace = true
strum_macros.workspace = true
derive_builder = "0.20.0"
tokio = { version = "1.38.0" }
thiserror = "1.0.37"
url = { version = "2.3", features = ["serde"] }
tokio = { workspace = true }
thiserror.workspace = true
url = { workspace = true, features = ["serde"] }
backtrace = { optional = true, version = "0.3" }

[dev-dependencies]
test_utils = { path = "../misc/test_utils" }
async-channel = "2.3.1"
tokio = { version = "1.38", features = ["rt", "macros", "rt-multi-thread"] }
tokio = { workspace = true, features = ["rt", "macros", "rt-multi-thread"] }
pretty_assertions = "1.4.0"
did_resolver_sov = { path = "../../did_core/did_methods/did_resolver_sov" }
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ pub async fn build_schemas_json_verifier(
let mut schemas_json = json!({});

for cred_info in credential_data.iter() {
if schemas_json.get(&cred_info.schema_id.to_string()).is_none() {
if schemas_json.get(cred_info.schema_id.to_string()).is_none() {
let schema_id = &cred_info.schema_id;
let schema_json = ledger.get_schema(schema_id, None).await.map_err(|_err| {
AriesVcxError::from_msg(AriesVcxErrorKind::InvalidSchema, "Cannot get schema")
Expand Down
2 changes: 1 addition & 1 deletion aries/aries_vcx/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ extern crate lazy_static;
extern crate log;

#[macro_use]
extern crate serde_derive;
extern crate serde;

#[macro_use]
extern crate serde_json;
Expand Down
Loading
Loading