Skip to content

Commit a93a462

Browse files
committed
fix(app): Bump dependencies
1 parent 33cd21a commit a93a462

File tree

8 files changed

+919
-286
lines changed

8 files changed

+919
-286
lines changed

clearing-house-app/Cargo.lock

Lines changed: 846 additions & 243 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

clearing-house-app/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ chrono = { version = "0.4.26", features = ["serde", "clock", "std"], default-fea
2525
# Encryption and hashing
2626
ring = "0.16.20"
2727
# Config reader
28-
config = { version = "0.13.3", default-features = false, features = ["toml"] }
28+
config = { version = "0.14.0", default-features = false, features = ["toml"] }
2929
# Logging/Tracing
3030
tracing = "0.1"
3131
tracing-subscriber = { version = "0.3.17", features = ["env-filter"] }
@@ -52,8 +52,8 @@ futures = "0.3.29"
5252
# Helper for creating custom error types
5353
thiserror = "1.0.48"
5454
# Optional: Sentry integration
55-
sentry = { version = "0.32.1", optional = true }
56-
sqlx = { version = "0.7.3", features = ["runtime-tokio-rustls", "postgres", "chrono", "uuid"], optional = true }
55+
sentry = { version = "0.34.0", optional = true }
56+
sqlx = { version = "0.8.0", features = ["runtime-tokio-rustls", "postgres", "chrono", "uuid"], optional = true }
5757

5858
[dev-dependencies]
5959
# Controlling execution of unit test cases, which could interfere with each other
@@ -62,8 +62,8 @@ serial_test = "3"
6262
tempfile = "3.8"
6363
tower = { version = "0.4", features = ["util"] }
6464
hyper = { version = "1", features = ["full"] }
65-
testcontainers = "0.15.0"
66-
testcontainers-modules = { version = "0.3.4", features = ["postgres"] }
65+
testcontainers = "0.21.1"
66+
testcontainers-modules = { version = "0.9.0", features = ["postgres"] }
6767

6868
[features]
6969
default = ["postgres"]

clearing-house-app/src/config.rs

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@ pub(crate) fn read_config(config_file_override: Option<&std::path::Path>) -> CHC
7979
pub(crate) fn configure_logging(config: &CHConfig) {
8080
if std::env::var("RUST_LOG").is_err() {
8181
if let Some(level) = &config.log_level {
82-
std::env::set_var("RUST_LOG", level.to_string());
82+
#[allow(unsafe_code)] // Deprecated safe from rust edition 2024
83+
unsafe {
84+
std::env::set_var("RUST_LOG", level.to_string());
85+
}
8386
}
8487
}
8588

@@ -104,10 +107,13 @@ mod test {
104107
#[test]
105108
#[serial]
106109
fn test_read_config_from_env() {
107-
std::env::set_var("CH_APP_DATABASE_URL", "mongodb://localhost:27117");
108-
std::env::set_var("CH_APP_CLEAR_DB", "true");
109-
std::env::set_var("CH_APP_LOG_LEVEL", "INFO");
110-
std::env::set_var("CH_APP_STATIC_PROCESS_OWNER", "ABC");
110+
#[allow(unsafe_code)] // Deprecated safe from rust edition 2024
111+
unsafe {
112+
std::env::set_var("CH_APP_DATABASE_URL", "mongodb://localhost:27117");
113+
std::env::set_var("CH_APP_CLEAR_DB", "true");
114+
std::env::set_var("CH_APP_LOG_LEVEL", "INFO");
115+
std::env::set_var("CH_APP_STATIC_PROCESS_OWNER", "ABC");
116+
}
111117

112118
let conf = super::read_config(None);
113119
assert_eq!(conf.database_url, "mongodb://localhost:27117");
@@ -116,10 +122,13 @@ mod test {
116122
assert_eq!(conf.static_process_owner, Some("ABC".to_string()));
117123

118124
// Cleanup
119-
std::env::remove_var("CH_APP_DATABASE_URL");
120-
std::env::remove_var("CH_APP_CLEAR_DB");
121-
std::env::remove_var("CH_APP_LOG_LEVEL");
122-
std::env::remove_var("CH_APP_STATIC_PROCESS_OWNER");
125+
#[allow(unsafe_code)] // Deprecated safe from rust edition 2024
126+
unsafe {
127+
std::env::remove_var("CH_APP_DATABASE_URL");
128+
std::env::remove_var("CH_APP_CLEAR_DB");
129+
std::env::remove_var("CH_APP_LOG_LEVEL");
130+
std::env::remove_var("CH_APP_STATIC_PROCESS_OWNER");
131+
}
123132
}
124133

125134
/// Test reading config from toml file

clearing-house-app/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#![forbid(unsafe_code)]
2-
#![warn(clippy::all, clippy::pedantic, clippy::unwrap_used)]
1+
#![deny(unsafe_code)]
2+
#![warn(clippy::all, clippy::pedantic, clippy::unwrap_used, rust_2018_idioms, rust_2024_compatibility)]
33
#![allow(clippy::module_name_repetitions)]
44

55
#[macro_use]

clearing-house-app/src/model/ids/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl InfoModelId {
5656
}
5757

5858
impl std::fmt::Display for InfoModelId {
59-
fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result {
59+
fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6060
match self {
6161
InfoModelId::SimpleId(id) => fmt.write_str(id)?,
6262
InfoModelId::ComplexId(id) => fmt.write_str(&id.to_string())?,
@@ -85,7 +85,7 @@ impl Default for InfoModelDateTime {
8585
}
8686

8787
impl std::fmt::Display for InfoModelDateTime {
88-
fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result {
88+
fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8989
match self {
9090
InfoModelDateTime::Time(value) => fmt.write_str(&value.to_string())?,
9191
InfoModelDateTime::ComplexTime(value) => fmt.write_str(&value.to_string())?,

clearing-house-app/tests/create_process.rs

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
use axum::http::{Request, StatusCode};
44
use biscuit::jwa::SignatureAlgorithm::PS512;
55
use biscuit::jwk::JWKSet;
6+
use testcontainers::runners::AsyncRunner;
67
use clearing_house_app::model::claims::{get_fingerprint, ChClaims};
78
use clearing_house_app::model::ids::message::IdsMessage;
89
use clearing_house_app::model::ids::request::ClearingHouseMessage;
@@ -17,19 +18,25 @@ async fn log_message() {
1718
const CLIENT_ID: &str = "69:F5:9D:B0:DD:A6:9D:30:5F:58:AA:2D:20:4D:B2:39:F0:54:FC:3B:keyid:4F:66:7D:BD:08:EE:C6:4A:D1:96:D8:7C:6C:A2:32:8A:EC:A6:AD:49";
1819

1920
// Start testcontainer: Postgres
20-
let docker = testcontainers::clients::Cli::default();
21-
let postgres_instance = docker.run(testcontainers_modules::postgres::Postgres::default());
21+
let postgres_instance = testcontainers_modules::postgres::Postgres::default()
22+
.start()
23+
.await
24+
.expect("Failed to start Postgres container");
2225
let connection_string = format!(
23-
"postgres://postgres:[email protected]:{}/postgres",
24-
postgres_instance.get_host_port_ipv4(5432)
26+
"postgres://postgres:postgres@{}:{}/postgres",
27+
postgres_instance.get_host().await.expect("Failed to get host"),
28+
postgres_instance.get_host_port_ipv4(5432).await.expect("Failed to get port")
2529
);
2630

27-
std::env::set_var("SERVICE_ID_LOG", "test");
28-
std::env::set_var("SHARED_SECRET", "test");
29-
std::env::set_var("CH_APP_LOG_LEVEL", "TRACE");
30-
std::env::set_var("CH_APP_CLEAR_DB", "false");
31-
std::env::set_var("CH_APP_STATIC_PROCESS_OWNER", "MDS_EDC_CONNECTOR");
32-
std::env::set_var("CH_APP_DATABASE_URL", connection_string);
31+
#[allow(unsafe_code)] // Deprecated safe from rust edition 2024
32+
unsafe {
33+
std::env::set_var("SERVICE_ID_LOG", "test");
34+
std::env::set_var("SHARED_SECRET", "test");
35+
std::env::set_var("CH_APP_LOG_LEVEL", "TRACE");
36+
std::env::set_var("CH_APP_CLEAR_DB", "false");
37+
std::env::set_var("CH_APP_STATIC_PROCESS_OWNER", "MDS_EDC_CONNECTOR");
38+
std::env::set_var("CH_APP_DATABASE_URL", connection_string);
39+
}
3340

3441
let app = clearing_house_app::app().await.unwrap();
3542

clearing-house-app/tests/log.rs

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
use axum::http::{Request, StatusCode};
44
use biscuit::jwa::SignatureAlgorithm::PS512;
55
use biscuit::jwk::JWKSet;
6+
use testcontainers::runners::AsyncRunner;
67
use clearing_house_app::model::claims::{get_fingerprint, ChClaims};
78
use clearing_house_app::model::ids::message::IdsMessage;
89
use clearing_house_app::model::ids::request::ClearingHouseMessage;
@@ -15,18 +16,24 @@ use tower::ServiceExt;
1516
#[tokio::test]
1617
async fn log_message() {
1718
// Start testcontainer: Postgres
18-
let docker = testcontainers::clients::Cli::default();
19-
let postgres_instance = docker.run(testcontainers_modules::postgres::Postgres::default());
19+
let postgres_instance = testcontainers_modules::postgres::Postgres::default()
20+
.start()
21+
.await
22+
.expect("Failed to start Postgres container");
2023
let connection_string = format!(
21-
"postgres://postgres:[email protected]:{}/postgres",
22-
postgres_instance.get_host_port_ipv4(5432)
24+
"postgres://postgres:postgres@{}:{}/postgres",
25+
postgres_instance.get_host().await.expect("Failed to get host"),
26+
postgres_instance.get_host_port_ipv4(5432).await.expect("Failed to get port")
2327
);
2428

25-
std::env::set_var("SERVICE_ID_LOG", "test");
26-
std::env::set_var("SHARED_SECRET", "test");
27-
std::env::set_var("CH_APP_LOG_LEVEL", "TRACE");
28-
std::env::set_var("CH_APP_CLEAR_DB", "false");
29-
std::env::set_var("CH_APP_DATABASE_URL", connection_string);
29+
#[allow(unsafe_code)] // Deprecated safe from rust edition 2024
30+
unsafe {
31+
std::env::set_var("SERVICE_ID_LOG", "test");
32+
std::env::set_var("SHARED_SECRET", "test");
33+
std::env::set_var("CH_APP_LOG_LEVEL", "TRACE");
34+
std::env::set_var("CH_APP_CLEAR_DB", "false");
35+
std::env::set_var("CH_APP_DATABASE_URL", connection_string);
36+
}
3037

3138
let app = clearing_house_app::app().await.unwrap();
3239

clearing-house-app/tests/public_key.rs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
11
use axum::body::Body;
22
use axum::http::{Request, StatusCode};
33
use biscuit::jwk::JWKSet;
4+
use testcontainers::runners::AsyncRunner;
45
use tower::ServiceExt;
56

67
#[tokio::test]
78
async fn retrieve_public_key() {
89
// Start testcontainer: Postgres
9-
let docker = testcontainers::clients::Cli::default();
10-
let postgres_instance = docker.run(testcontainers_modules::postgres::Postgres::default());
10+
let postgres_instance = testcontainers_modules::postgres::Postgres::default()
11+
.start()
12+
.await
13+
.expect("Failed to start Postgres container");
1114
let connection_string = format!(
12-
"postgres://postgres:[email protected]:{}/postgres",
13-
postgres_instance.get_host_port_ipv4(5432)
15+
"postgres://postgres:postgres@{}:{}/postgres",
16+
postgres_instance.get_host().await.expect("Failed to get host"),
17+
postgres_instance.get_host_port_ipv4(5432).await.expect("Failed to get port")
1418
);
1519

16-
std::env::set_var("SERVICE_ID_LOG", "test");
17-
std::env::set_var("CH_APP_DATABASE_URL", connection_string);
20+
#[allow(unsafe_code)] // Deprecated safe from rust edition 2024
21+
unsafe {
22+
std::env::set_var("SERVICE_ID_LOG", "test");
23+
std::env::set_var("CH_APP_DATABASE_URL", connection_string);
24+
}
1825

1926
let app = clearing_house_app::app().await.unwrap();
2027

0 commit comments

Comments
 (0)