From 0224605c596719dc98492aa9e0dfe9626b224b36 Mon Sep 17 00:00:00 2001 From: charlesgauthereau Date: Sun, 8 Mar 2026 10:02:17 +0100 Subject: [PATCH 1/4] fix: docker-compose.yml --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 82b5455..2a1ec4f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,7 +18,7 @@ services: APP_ENV: development LOG: debug TZ: "Europe/Paris" - EDGE_KEY: "eyJzZXJ2ZXJVcmwiOiJodHRwOi8vbG9jYWxob3N0Ojg4ODciLCJhZ2VudElkIjoiZjg4Y2E0MDMtNDgwOS00NGM4LTlkZjItY2VkNWYwYzhkNTM2IiwibWFzdGVyS2V5QjY0IjoiQlhWM1hvbEM2NTZTVjdkTmdjV1BHUWxrKytycExJNmxHRGk3Q1BCNWllbz0ifQ==" + EDGE_KEY: "eyJzZXJ2ZXJVcmwiOiJodHRwOi8vbG9jYWxob3N0Ojg4ODciLCJhZ2VudElkIjoiMTA4MGM1ZDEtMjg5My00MTAyLTgxNjktODMxMThlNjVhOGJmIiwibWFzdGVyS2V5QjY0IjoiQlhWM1hvbEM2NTZTVjdkTmdjV1BHUWxrKytycExJNmxHRGk3Q1BCNWllbz0ifQ==" #POOLING: 1 #DATABASES_CONFIG_FILE: "config.toml" extra_hosts: From 678df8e2bcb300a313fb2efb6f9ba124d3d110e9 Mon Sep 17 00:00:00 2001 From: charlesgauthereau Date: Sun, 8 Mar 2026 20:46:47 +0100 Subject: [PATCH 2/4] fix: docker.yml --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 12e94d0..61a7aac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2872,7 +2872,7 @@ dependencies = [ [[package]] name = "portabase-agent" -version = "1.1.6" +version = "1.2.0" dependencies = [ "aes", "aes-gcm", From 824a5d52a300de19c930392fb7a96df0476484e1 Mon Sep 17 00:00:00 2001 From: charlesgauthereau Date: Thu, 12 Mar 2026 18:56:07 +0100 Subject: [PATCH 3/4] feat: add test for util functions and start working on database providers tests procedures --- Cargo.lock | 1540 ++++++++++++---------- Cargo.toml | 10 +- Makefile | 4 + docker-compose.yml | 1 - docker/entrypoints/app-dev-entrypoint.sh | 39 + src/main.rs | 2 + src/tests/domain/mod.rs | 1 + src/tests/domain/postgres.rs | 35 + src/tests/mod.rs | 2 + src/tests/utils/common_tests.rs | 46 + src/tests/utils/compress_tests.rs | 73 + src/tests/utils/deserializer.rs | 104 ++ src/tests/utils/edge_key_tests.rs | 53 + src/tests/utils/mod.rs | 5 + src/tests/utils/normalize_cron_tests.rs | 49 + src/utils/compress.rs | 1 - src/utils/deserializer.rs | 9 +- 17 files changed, 1301 insertions(+), 673 deletions(-) create mode 100755 docker/entrypoints/app-dev-entrypoint.sh create mode 100644 src/tests/domain/mod.rs create mode 100644 src/tests/domain/postgres.rs create mode 100644 src/tests/mod.rs create mode 100644 src/tests/utils/common_tests.rs create mode 100644 src/tests/utils/compress_tests.rs create mode 100644 src/tests/utils/deserializer.rs create mode 100644 src/tests/utils/edge_key_tests.rs create mode 100644 src/tests/utils/mod.rs create mode 100644 src/tests/utils/normalize_cron_tests.rs diff --git a/Cargo.lock b/Cargo.lock index 050af45..d693b31 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -49,7 +49,7 @@ version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" dependencies = [ - "cfg-if 1.0.4", + "cfg-if", "getrandom 0.3.4", "once_cell", "version_check", @@ -80,6 +80,12 @@ dependencies = [ "libc", ] +[[package]] +name = "anstyle" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" + [[package]] name = "anyhow" version = "1.0.102" @@ -92,6 +98,32 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03918c3dbd7701a85c6b9887732e2921175f26c350b4563841d0958c21d57e6d" +[[package]] +name = "assert-json-diff" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47e4f2b81832e72834d7518d8487a0396a28cc408186a2e8854c0f98011faf12" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "astral-tokio-tar" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec179a06c1769b1e42e1e2cbe74c7dcdb3d6383c838454d063eaac5bbb7ebbe5" +dependencies = [ + "filetime", + "futures-core", + "libc", + "portable-atomic", + "rustc-hash", + "tokio", + "tokio-stream", + "xattr", +] + [[package]] name = "async-compression" version = "0.4.41" @@ -101,19 +133,7 @@ dependencies = [ "compression-codecs", "compression-core", "pin-project-lite", - "tokio 1.50.0", -] - -[[package]] -name = "async-http-client" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0dceaebe5edf15a6462758b464a4c14ad8480b51503068e9c46196d09bd6d69" -dependencies = [ - "futures 0.1.31", - "nom", - "tokio-core", - "url 1.7.2", + "tokio", ] [[package]] @@ -179,15 +199,15 @@ dependencies = [ "aws-smithy-runtime-api", "aws-smithy-types", "aws-types", - "bytes 1.11.1", + "bytes", "fastrand", "hex", "http 1.4.0", "sha1", "time", - "tokio 1.50.0", + "tokio", "tracing", - "url 2.5.8", + "url", "zeroize", ] @@ -240,14 +260,14 @@ dependencies = [ "aws-smithy-runtime-api", "aws-smithy-types", "aws-types", - "bytes 1.11.1", + "bytes", "bytes-utils", "fastrand", "http 0.2.12", "http 1.4.0", "http-body 0.4.6", "http-body 1.0.1", - "percent-encoding 2.3.2", + "percent-encoding", "pin-project-lite", "tracing", "uuid", @@ -273,7 +293,7 @@ dependencies = [ "aws-smithy-types", "aws-smithy-xml", "aws-types", - "bytes 1.11.1", + "bytes", "fastrand", "hex", "hmac", @@ -281,11 +301,11 @@ dependencies = [ "http 1.4.0", "http-body 1.0.1", "lru", - "percent-encoding 2.3.2", + "percent-encoding", "regex-lite", "sha2", "tracing", - "url 2.5.8", + "url", ] [[package]] @@ -304,7 +324,7 @@ dependencies = [ "aws-smithy-runtime-api", "aws-smithy-types", "aws-types", - "bytes 1.11.1", + "bytes", "fastrand", "http 0.2.12", "http 1.4.0", @@ -328,7 +348,7 @@ dependencies = [ "aws-smithy-runtime-api", "aws-smithy-types", "aws-types", - "bytes 1.11.1", + "bytes", "fastrand", "http 0.2.12", "http 1.4.0", @@ -372,7 +392,7 @@ dependencies = [ "aws-smithy-http", "aws-smithy-runtime-api", "aws-smithy-types", - "bytes 1.11.1", + "bytes", "crypto-bigint 0.5.5", "form_urlencoded", "hex", @@ -380,7 +400,7 @@ dependencies = [ "http 0.2.12", "http 1.4.0", "p256", - "percent-encoding 2.3.2", + "percent-encoding", "ring", "sha2", "subtle", @@ -397,7 +417,7 @@ checksum = "2ffcaf626bdda484571968400c326a244598634dc75fd451325a54ad1a59acfc" dependencies = [ "futures-util", "pin-project-lite", - "tokio 1.50.0", + "tokio", ] [[package]] @@ -408,7 +428,7 @@ checksum = "6750f3dd509b0694a4377f0293ed2f9630d710b1cebe281fa8bac8f099f88bc6" dependencies = [ "aws-smithy-http", "aws-smithy-types", - "bytes 1.11.1", + "bytes", "crc-fast", "hex", "http 1.4.0", @@ -428,7 +448,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "faf09d74e5e32f76b8762da505a3cd59303e367a664ca67295387baa8c1d7548" dependencies = [ "aws-smithy-types", - "bytes 1.11.1", + "bytes", "crc32fast", ] @@ -441,14 +461,14 @@ dependencies = [ "aws-smithy-eventstream", "aws-smithy-runtime-api", "aws-smithy-types", - "bytes 1.11.1", + "bytes", "bytes-utils", "futures-core", "futures-util", "http 1.4.0", "http-body 1.0.1", "http-body-util", - "percent-encoding 2.3.2", + "percent-encoding", "pin-project-lite", "pin-utils", "tracing", @@ -478,7 +498,7 @@ dependencies = [ "rustls 0.23.37", "rustls-native-certs", "rustls-pki-types", - "tokio 1.50.0", + "tokio", "tokio-rustls 0.26.4", "tower", "tracing", @@ -524,7 +544,7 @@ dependencies = [ "aws-smithy-observability", "aws-smithy-runtime-api", "aws-smithy-types", - "bytes 1.11.1", + "bytes", "fastrand", "http 0.2.12", "http 1.4.0", @@ -533,7 +553,7 @@ dependencies = [ "http-body-util", "pin-project-lite", "pin-utils", - "tokio 1.50.0", + "tokio", "tracing", ] @@ -545,11 +565,11 @@ checksum = "876ab3c9c29791ba4ba02b780a3049e21ec63dabda09268b175272c3733a79e6" dependencies = [ "aws-smithy-async", "aws-smithy-types", - "bytes 1.11.1", + "bytes", "http 0.2.12", "http 1.4.0", "pin-project-lite", - "tokio 1.50.0", + "tokio", "tracing", "zeroize", ] @@ -561,7 +581,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2b1117b3b2bbe166d11199b540ceed0d0f7676e36e7b962b5a437a9971eac75" dependencies = [ "base64-simd", - "bytes 1.11.1", + "bytes", "bytes-utils", "futures-core", "http 0.2.12", @@ -576,7 +596,7 @@ dependencies = [ "ryu", "serde", "time", - "tokio 1.50.0", + "tokio", "tokio-util", ] @@ -599,16 +619,65 @@ dependencies = [ "aws-smithy-async", "aws-smithy-runtime-api", "aws-smithy-types", - "rustc_version 0.4.1", + "rustc_version", "tracing", ] +[[package]] +name = "axum" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b52af3cb4058c895d37317bb27508dccc8e5f2d39454016b297bf4a400597b8" +dependencies = [ + "axum-core", + "bytes", + "futures-util", + "http 1.4.0", + "http-body 1.0.1", + "http-body-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "serde_core", + "sync_wrapper", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-core" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08c78f31d7b1291f7ee735c1c6780ccde7785daae9a9206026862dab7d8792d1" +dependencies = [ + "bytes", + "futures-core", + "http 1.4.0", + "http-body 1.0.1", + "http-body-util", + "mime", + "pin-project-lite", + "sync_wrapper", + "tower-layer", + "tower-service", +] + [[package]] name = "base16ct" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + [[package]] name = "base64" version = "0.22.1" @@ -673,6 +742,80 @@ dependencies = [ "hybrid-array", ] +[[package]] +name = "bollard" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "227aa051deec8d16bd9c34605e7aaf153f240e35483dd42f6f78903847934738" +dependencies = [ + "async-stream", + "base64 0.22.1", + "bitflags 2.11.0", + "bollard-buildkit-proto", + "bollard-stubs", + "bytes", + "futures-core", + "futures-util", + "hex", + "home", + "http 1.4.0", + "http-body-util", + "hyper 1.8.1", + "hyper-named-pipe", + "hyper-rustls 0.27.7", + "hyper-util", + "hyperlocal", + "log", + "num", + "pin-project-lite", + "rand 0.9.2", + "rustls 0.23.37", + "rustls-native-certs", + "rustls-pki-types", + "serde", + "serde_derive", + "serde_json", + "serde_urlencoded", + "thiserror 2.0.18", + "time", + "tokio", + "tokio-stream", + "tokio-util", + "tonic", + "tower-service", + "url", + "winapi", +] + +[[package]] +name = "bollard-buildkit-proto" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85a885520bf6249ab931a764ffdb87b0ceef48e6e7d807cfdb21b751e086e1ad" +dependencies = [ + "prost", + "prost-types", + "tonic", + "tonic-prost", + "ureq", +] + +[[package]] +name = "bollard-stubs" +version = "1.52.1-rc.29.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f0a8ca8799131c1837d1282c3f81f31e76ceb0ce426e04a7fe1ccee3287c066" +dependencies = [ + "base64 0.22.1", + "bollard-buildkit-proto", + "bytes", + "prost", + "serde", + "serde_json", + "serde_repr", + "time", +] + [[package]] name = "bson" version = "2.15.0" @@ -680,12 +823,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7969a9ba84b0ff843813e7249eed1678d9b6607ce5a3b8f0a47af3fcf7978e6e" dependencies = [ "ahash", - "base64", + "base64 0.22.1", "bitvec", "getrandom 0.2.17", "getrandom 0.3.4", "hex", - "indexmap", + "indexmap 2.13.0", "js-sys", "once_cell", "rand 0.9.2", @@ -708,16 +851,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" -[[package]] -name = "bytes" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" -dependencies = [ - "byteorder", - "iovec", -] - [[package]] name = "bytes" version = "1.11.1" @@ -730,7 +863,7 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dafe3a8757b027e2be6e4e5601ed563c55989fcf1546e933c66c8eb3a058d35" dependencies = [ - "bytes 1.11.1", + "bytes", "either", ] @@ -752,12 +885,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.4" @@ -795,15 +922,6 @@ dependencies = [ "inout", ] -[[package]] -name = "cloudabi" -version = "0.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "cmake" version = "0.1.57" @@ -825,11 +943,11 @@ version = "4.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" dependencies = [ - "bytes 1.11.1", + "bytes", "futures-core", "memchr", "pin-project-lite", - "tokio 1.50.0", + "tokio", "tokio-util", ] @@ -968,7 +1086,7 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" dependencies = [ - "cfg-if 1.0.4", + "cfg-if", ] [[package]] @@ -994,33 +1112,7 @@ version = "0.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" dependencies = [ - "crossbeam-utils 0.8.21", -] - -[[package]] -name = "crossbeam-deque" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20ff29ded3204c5106278a81a38f4b482636ed4fa1e6cfbeef193291beb29ed" -dependencies = [ - "crossbeam-epoch 0.8.2", - "crossbeam-utils 0.7.2", - "maybe-uninit", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" -dependencies = [ - "autocfg", - "cfg-if 0.1.10", - "crossbeam-utils 0.7.2", - "lazy_static", - "maybe-uninit", - "memoffset", - "scopeguard", + "crossbeam-utils", ] [[package]] @@ -1029,29 +1121,7 @@ version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "crossbeam-utils 0.8.21", -] - -[[package]] -name = "crossbeam-queue" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" -dependencies = [ - "cfg-if 0.1.10", - "crossbeam-utils 0.7.2", - "maybe-uninit", -] - -[[package]] -name = "crossbeam-utils" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" -dependencies = [ - "autocfg", - "cfg-if 0.1.10", - "lazy_static", + "crossbeam-utils", ] [[package]] @@ -1168,6 +1238,24 @@ version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7a1e2f27636f116493b8b860f5546edb47c8d8f8ea73e1d2a20be88e28d1fea" +[[package]] +name = "deadpool" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0be2b1d1d6ec8d846f05e137292d0b89133caf95ef33695424c09568bdd39b1b" +dependencies = [ + "deadpool-runtime", + "lazy_static", + "num_cpus", + "tokio", +] + +[[package]] +name = "deadpool-runtime" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "092966b41edc516079bdf31ec78a2e0588d1d0c08f78b91d8307215928642b2b" + [[package]] name = "der" version = "0.6.1" @@ -1185,6 +1273,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" dependencies = [ "powerfmt", + "serde_core", ] [[package]] @@ -1227,7 +1316,7 @@ dependencies = [ "convert_case", "proc-macro2", "quote", - "rustc_version 0.4.1", + "rustc_version", "syn", "unicode-xid", ] @@ -1254,18 +1343,41 @@ dependencies = [ "syn", ] +[[package]] +name = "docker_credential" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d89dfcba45b4afad7450a99b39e751590463e45c04728cf555d36bb66940de8" +dependencies = [ + "base64 0.21.7", + "serde", + "serde_json", +] + [[package]] name = "dotenvy" version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" +[[package]] +name = "downcast" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" + [[package]] name = "dunce" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" +[[package]] +name = "dyn-clone" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" + [[package]] name = "ecdsa" version = "0.14.8" @@ -1310,7 +1422,7 @@ version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ - "cfg-if 1.0.4", + "cfg-if", ] [[package]] @@ -1341,6 +1453,16 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "etcetera" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de48cc4d1c1d97a20fd819def54b890cadde72ed3ad0c614822a0a433361be96" +dependencies = [ + "cfg-if", + "windows-sys 0.61.2", +] + [[package]] name = "fallible-iterator" version = "0.2.0" @@ -1353,6 +1475,17 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" +[[package]] +name = "ferroid" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb330bbd4cb7a5b9f559427f06f98a4f853a137c8298f3bd3f8ca57663e21986" +dependencies = [ + "portable-atomic", + "rand 0.9.2", + "web-time", +] + [[package]] name = "ff" version = "0.12.1" @@ -1369,7 +1502,7 @@ version = "0.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f98844151eee8917efc50bd9e8318cb963ae8b297431495d3f758616ea5c57db" dependencies = [ - "cfg-if 1.0.4", + "cfg-if", "libc", "libredox", ] @@ -1429,30 +1562,20 @@ version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" dependencies = [ - "percent-encoding 2.3.2", + "percent-encoding", ] [[package]] -name = "fs_extra" -version = "1.3.0" +name = "fragile" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" +checksum = "28dd6caf6059519a65843af8fe2a3ae298b14b80179855aeb4adc2c1934ee619" [[package]] -name = "fuchsia-zircon" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -dependencies = [ - "bitflags 1.3.2", - "fuchsia-zircon-sys", -] - -[[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" +name = "fs_extra" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" [[package]] name = "funty" @@ -1460,12 +1583,6 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" -[[package]] -name = "futures" -version = "0.1.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" - [[package]] name = "futures" version = "0.3.32" @@ -1570,7 +1687,7 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" dependencies = [ - "cfg-if 1.0.4", + "cfg-if", "js-sys", "libc", "wasi 0.11.1+wasi-snapshot-preview1", @@ -1583,7 +1700,7 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" dependencies = [ - "cfg-if 1.0.4", + "cfg-if", "js-sys", "libc", "r-efi 5.3.0", @@ -1597,7 +1714,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" dependencies = [ - "cfg-if 1.0.4", + "cfg-if", "libc", "r-efi 6.0.0", "rand_core 0.10.0", @@ -1631,15 +1748,15 @@ version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0beca50380b1fc32983fc1cb4587bfa4bb9e78fc259aad4a0032d2080309222d" dependencies = [ - "bytes 1.11.1", + "bytes", "fnv", "futures-core", "futures-sink", "futures-util", "http 0.2.12", - "indexmap", + "indexmap 2.13.0", "slab", - "tokio 1.50.0", + "tokio", "tokio-util", "tracing", ] @@ -1651,18 +1768,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2f44da3a8150a6703ed5d34e164b875fd14c2cdab9af1252a9a1020bde2bdc54" dependencies = [ "atomic-waker", - "bytes 1.11.1", + "bytes", "fnv", "futures-core", "futures-sink", "http 1.4.0", - "indexmap", + "indexmap 2.13.0", "slab", - "tokio 1.50.0", + "tokio", "tokio-util", "tracing", ] +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + [[package]] name = "hashbrown" version = "0.15.5" @@ -1708,22 +1831,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8a6fe56c0038198998a6f217ca4e7ef3a5e51f46163bd6dd60b5c71ca6c6502" dependencies = [ "async-trait", - "cfg-if 1.0.4", + "cfg-if", "data-encoding", "enum-as-inner", "futures-channel", "futures-io", "futures-util", - "idna 1.1.0", + "idna", "ipnet", "once_cell", "rand 0.9.2", "ring", "thiserror 2.0.18", "tinyvec", - "tokio 1.50.0", + "tokio", "tracing", - "url 2.5.8", + "url", ] [[package]] @@ -1732,18 +1855,18 @@ version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc62a9a99b0bfb44d2ab95a7208ac952d31060efc16241c87eaf36406fecf87a" dependencies = [ - "cfg-if 1.0.4", + "cfg-if", "futures-util", "hickory-proto", "ipconfig", "moka", "once_cell", - "parking_lot 0.12.5", + "parking_lot", "rand 0.9.2", "resolv-conf", - "smallvec 1.15.1", + "smallvec", "thiserror 2.0.18", - "tokio 1.50.0", + "tokio", "tracing", ] @@ -1756,13 +1879,22 @@ dependencies = [ "digest", ] +[[package]] +name = "home" +version = "0.5.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc627f471c528ff0c4a49e1d5e60450c8f6461dd6d10ba9dcd3a61d3dff7728d" +dependencies = [ + "windows-sys 0.61.2", +] + [[package]] name = "http" version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ - "bytes 1.11.1", + "bytes", "fnv", "itoa", ] @@ -1773,7 +1905,7 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" dependencies = [ - "bytes 1.11.1", + "bytes", "itoa", ] @@ -1783,7 +1915,7 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ - "bytes 1.11.1", + "bytes", "http 0.2.12", "pin-project-lite", ] @@ -1794,7 +1926,7 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ - "bytes 1.11.1", + "bytes", "http 1.4.0", ] @@ -1804,7 +1936,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" dependencies = [ - "bytes 1.11.1", + "bytes", "futures-core", "http 1.4.0", "http-body 1.0.1", @@ -1838,7 +1970,7 @@ version = "0.14.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" dependencies = [ - "bytes 1.11.1", + "bytes", "futures-channel", "futures-core", "futures-util", @@ -1850,7 +1982,7 @@ dependencies = [ "itoa", "pin-project-lite", "socket2 0.5.10", - "tokio 1.50.0", + "tokio", "tower-service", "tracing", "want", @@ -1863,21 +1995,37 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11" dependencies = [ "atomic-waker", - "bytes 1.11.1", + "bytes", "futures-channel", "futures-core", "h2 0.4.13", "http 1.4.0", "http-body 1.0.1", "httparse", + "httpdate", "itoa", "pin-project-lite", "pin-utils", - "smallvec 1.15.1", - "tokio 1.50.0", + "smallvec", + "tokio", "want", ] +[[package]] +name = "hyper-named-pipe" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73b7d8abf35697b81a825e386fc151e0d503e8cb5fcb93cc8669c376dfd6f278" +dependencies = [ + "hex", + "hyper 1.8.1", + "hyper-util", + "pin-project-lite", + "tokio", + "tower-service", + "winapi", +] + [[package]] name = "hyper-rustls" version = "0.24.2" @@ -1889,7 +2037,7 @@ dependencies = [ "hyper 0.14.32", "log", "rustls 0.21.12", - "tokio 1.50.0", + "tokio", "tokio-rustls 0.24.1", ] @@ -1905,20 +2053,33 @@ dependencies = [ "rustls 0.23.37", "rustls-native-certs", "rustls-pki-types", - "tokio 1.50.0", + "tokio", "tokio-rustls 0.26.4", "tower-service", "webpki-roots", ] +[[package]] +name = "hyper-timeout" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0" +dependencies = [ + "hyper 1.8.1", + "hyper-util", + "pin-project-lite", + "tokio", + "tower-service", +] + [[package]] name = "hyper-util" version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" dependencies = [ - "base64", - "bytes 1.11.1", + "base64 0.22.1", + "bytes", "futures-channel", "futures-util", "http 1.4.0", @@ -1926,16 +2087,31 @@ dependencies = [ "hyper 1.8.1", "ipnet", "libc", - "percent-encoding 2.3.2", + "percent-encoding", "pin-project-lite", "socket2 0.6.3", "system-configuration", - "tokio 1.50.0", + "tokio", "tower-service", "tracing", "windows-registry", ] +[[package]] +name = "hyperlocal" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "986c5ce3b994526b3cd75578e62554abd09f0899d6206de48b3e96ab34ccc8c7" +dependencies = [ + "hex", + "http-body-util", + "hyper 1.8.1", + "hyper-util", + "pin-project-lite", + "tokio", + "tower-service", +] + [[package]] name = "iana-time-zone" version = "0.1.65" @@ -1996,7 +2172,7 @@ dependencies = [ "icu_normalizer_data", "icu_properties", "icu_provider", - "smallvec 1.15.1", + "smallvec", "zerovec", ] @@ -2053,17 +2229,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -[[package]] -name = "idna" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" -dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "idna" version = "1.1.0" @@ -2071,7 +2236,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" dependencies = [ "idna_adapter", - "smallvec 1.15.1", + "smallvec", "utf8_iter", ] @@ -2085,6 +2250,17 @@ dependencies = [ "icu_properties", ] +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + [[package]] name = "indexmap" version = "2.13.0" @@ -2106,15 +2282,6 @@ dependencies = [ "hybrid-array", ] -[[package]] -name = "iovec" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" -dependencies = [ - "libc", -] - [[package]] name = "ipconfig" version = "0.3.2" @@ -2143,6 +2310,15 @@ dependencies = [ "serde", ] +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.17" @@ -2156,7 +2332,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" dependencies = [ "cesu8", - "cfg-if 1.0.4", + "cfg-if", "combine", "jni-sys", "log", @@ -2191,16 +2367,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "kernel32-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - [[package]] name = "lazy_static" version = "1.5.0" @@ -2243,15 +2409,6 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" -[[package]] -name = "lock_api" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" -dependencies = [ - "scopeguard", -] - [[package]] name = "lock_api" version = "0.4.14" @@ -2340,16 +2497,10 @@ dependencies = [ ] [[package]] -name = "matches" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" - -[[package]] -name = "maybe-uninit" -version = "2.0.0" +name = "matchit" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" +checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" [[package]] name = "md-5" @@ -2357,7 +2508,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" dependencies = [ - "cfg-if 1.0.4", + "cfg-if", "digest", ] @@ -2367,15 +2518,6 @@ version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" -[[package]] -name = "memoffset" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" -dependencies = [ - "autocfg", -] - [[package]] name = "mime" version = "0.3.17" @@ -2402,25 +2544,6 @@ dependencies = [ "simd-adler32", ] -[[package]] -name = "mio" -version = "0.6.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" -dependencies = [ - "cfg-if 0.1.10", - "fuchsia-zircon", - "fuchsia-zircon-sys", - "iovec", - "kernel32-sys", - "libc", - "log", - "miow", - "net2", - "slab", - "winapi 0.2.8", -] - [[package]] name = "mio" version = "1.1.1" @@ -2433,26 +2556,29 @@ dependencies = [ ] [[package]] -name = "mio-uds" -version = "0.6.8" +name = "mockall" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afcb699eb26d4332647cc848492bbc15eafb26f08d0304550d5aa1f612e066f0" +checksum = "39a6bfcc6c8c7eed5ee98b9c3e33adc726054389233e201c95dab2d41a3839d2" dependencies = [ - "iovec", - "libc", - "mio 0.6.23", + "cfg-if", + "downcast", + "fragile", + "mockall_derive", + "predicates", + "predicates-tree", ] [[package]] -name = "miow" -version = "0.2.2" +name = "mockall_derive" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" +checksum = "25ca3004c2efe9011bd4e461bd8256445052b9615405b4f7ea43fc8ca5c20898" dependencies = [ - "kernel32-sys", - "net2", - "winapi 0.2.8", - "ws2_32-sys", + "cfg-if", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -2462,12 +2588,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85f8024e1c8e71c778968af91d43700ce1d11b219d127d79fb2934153b82b42b" dependencies = [ "crossbeam-channel", - "crossbeam-epoch 0.9.18", - "crossbeam-utils 0.8.21", + "crossbeam-epoch", + "crossbeam-utils", "equivalent", - "parking_lot 0.12.5", + "parking_lot", "portable-atomic", - "smallvec 1.15.1", + "smallvec", "tagptr", "uuid", ] @@ -2496,7 +2622,7 @@ version = "3.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "803dd859e8afa084c255a8effd8000ff86f7c8076a50cd6d8c99e8f3496f75c2" dependencies = [ - "base64", + "base64 0.22.1", "bitflags 2.11.0", "bson", "derive-where", @@ -2513,7 +2639,7 @@ dependencies = [ "mongocrypt", "mongodb-internal-macros", "pbkdf2", - "percent-encoding 2.3.2", + "percent-encoding", "rand 0.9.2", "rustc_version_runtime", "rustls 0.23.37", @@ -2528,7 +2654,7 @@ dependencies = [ "strsim", "take_mut", "thiserror 2.0.18", - "tokio 1.50.0", + "tokio", "tokio-rustls 0.26.4", "tokio-util", "typed-builder", @@ -2549,29 +2675,26 @@ dependencies = [ ] [[package]] -name = "net2" -version = "0.2.39" +name = "nu-ansi-term" +version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b13b648036a2339d06de780866fbdfda0dde886de7b3af2ddeba8b14f4ee34ac" +checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "cfg-if 0.1.10", - "libc", - "winapi 0.3.9", + "windows-sys 0.61.2", ] [[package]] -name = "nom" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf51a729ecf40266a2368ad335a5fdde43471f545a967109cd62146ecf8b66ff" - -[[package]] -name = "nu-ansi-term" -version = "0.50.3" +name = "num" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" dependencies = [ - "windows-sys 0.61.2", + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", ] [[package]] @@ -2584,6 +2707,15 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits", +] + [[package]] name = "num-conv" version = "0.2.0" @@ -2599,6 +2731,28 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -2633,7 +2787,7 @@ version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51e219e79014df21a225b1860a479e2dcd7cbd9130f4defd4bd0e191ea31d67d" dependencies = [ - "base64", + "base64 0.22.1", "chrono", "getrandom 0.2.17", "http 1.4.0", @@ -2644,7 +2798,7 @@ dependencies = [ "serde_path_to_error", "sha2", "thiserror 1.0.69", - "url 2.5.8", + "url", ] [[package]] @@ -2682,7 +2836,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08838db121398ad17ab8531ce9de97b244589089e290a384c900cb9ff7434328" dependencies = [ "bitflags 2.11.0", - "cfg-if 1.0.4", + "cfg-if", "foreign-types", "libc", "once_cell", @@ -2738,51 +2892,50 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.9.0" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" dependencies = [ - "lock_api 0.3.4", - "parking_lot_core 0.6.3", - "rustc_version 0.2.3", + "lock_api", + "parking_lot_core", ] [[package]] -name = "parking_lot" -version = "0.12.5" +name = "parking_lot_core" +version = "0.9.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" dependencies = [ - "lock_api 0.4.14", - "parking_lot_core 0.9.12", + "cfg-if", + "libc", + "redox_syscall 0.5.18", + "smallvec", + "windows-link", ] [[package]] -name = "parking_lot_core" -version = "0.6.3" +name = "parse-display" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66b810a62be75176a80873726630147a5ca780cd33921e0b5709033e66b0a" +checksum = "914a1c2265c98e2446911282c6ac86d8524f495792c38c5bd884f80499c7538a" dependencies = [ - "cfg-if 0.1.10", - "cloudabi", - "libc", - "redox_syscall 0.1.57", - "rustc_version 0.2.3", - "smallvec 0.6.14", - "winapi 0.3.9", + "parse-display-derive", + "regex", + "regex-syntax", ] [[package]] -name = "parking_lot_core" -version = "0.9.12" +name = "parse-display-derive" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +checksum = "2ae7800a4c974efd12df917266338e79a7a74415173caf7e70aa0a0707345281" dependencies = [ - "cfg-if 1.0.4", - "libc", - "redox_syscall 0.5.18", - "smallvec 1.15.1", - "windows-link", + "proc-macro2", + "quote", + "regex", + "regex-syntax", + "structmeta", + "syn", ] [[package]] @@ -2794,12 +2947,6 @@ dependencies = [ "digest", ] -[[package]] -name = "percent-encoding" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" - [[package]] name = "percent-encoding" version = "2.3.2" @@ -2825,6 +2972,26 @@ dependencies = [ "siphasher", ] +[[package]] +name = "pin-project" +version = "1.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1749c7ed4bcaf4c3d0a3efc28538844fb29bcdd7d2b67b2be7e20ba861ff517" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b20ed30f105399776b9c883e68e536ef602a16ae6f596d2c473591d6ad64c6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "pin-project-lite" version = "0.2.17" @@ -2878,27 +3045,28 @@ dependencies = [ "aes-gcm", "anyhow", "async-compression", - "async-http-client", "async-stream", "async-trait", "aws-config", "aws-sdk-s3", - "base64", - "bytes 1.11.1", + "base64 0.22.1", + "bytes", "chrono", "cron", "dotenvy", "flate2", - "futures 0.3.32", + "futures", "futures-util", "generic-array", "hex", "hyper 1.8.1", "log", + "mockall", "mongodb", "oauth2", "once_cell", "openssl", + "postgres", "rand 0.9.2", "redis", "reqwest 0.13.2", @@ -2906,9 +3074,11 @@ dependencies = [ "serde_json", "tar", "tempfile", + "testcontainers", + "testcontainers-modules", "thiserror 2.0.18", "time", - "tokio 1.50.0", + "tokio", "tokio-postgres", "tokio-stream", "tokio-tar", @@ -2919,6 +3089,7 @@ dependencies = [ "tracing-subscriber", "typenum", "uuid", + "wiremock", ] [[package]] @@ -2927,15 +3098,29 @@ version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" +[[package]] +name = "postgres" +version = "0.19.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7c48ece1c6cda0db61b058c1721378da76855140e9214339fa1317decacb176" +dependencies = [ + "bytes", + "fallible-iterator", + "futures-util", + "log", + "tokio", + "tokio-postgres", +] + [[package]] name = "postgres-protocol" version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ee9dd5fe15055d2b6806f4736aa0c9637217074e224bbec46d4041b91bb9491" dependencies = [ - "base64", + "base64 0.22.1", "byteorder", - "bytes 1.11.1", + "bytes", "fallible-iterator", "hmac", "md-5", @@ -2951,7 +3136,7 @@ version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "54b858f82211e84682fecd373f68e1ceae642d8d751a1ebd13f33de6257b3e20" dependencies = [ - "bytes 1.11.1", + "bytes", "fallible-iterator", "postgres-protocol", ] @@ -2980,6 +3165,32 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "predicates" +version = "3.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ada8f2932f28a27ee7b70dd6c1c39ea0675c55a36879ab92f3a715eaa1e63cfe" +dependencies = [ + "anstyle", + "predicates-core", +] + +[[package]] +name = "predicates-core" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cad38746f3166b4031b1a0d39ad9f954dd291e7854fcc0eed52ee41a0b50d144" + +[[package]] +name = "predicates-tree" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0de1b847b39c8131db0467e9df1ff60e6d0562ab8e9a16e568ad0fdb372e2f2" +dependencies = [ + "predicates-core", + "termtree", +] + [[package]] name = "prettyplease" version = "0.2.37" @@ -2999,13 +3210,45 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "prost" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2ea70524a2f82d518bce41317d0fae74151505651af45faf1ffbd6fd33f0568" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-derive" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27c6023962132f4b30eb4c172c91ce92d933da334c59c23cddee82358ddafb0b" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "prost-types" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8991c4cbdb8bc5b11f0b074ffe286c30e523de90fee5ba8132f1399f23cb3dd7" +dependencies = [ + "prost", +] + [[package]] name = "quinn" version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" dependencies = [ - "bytes 1.11.1", + "bytes", "cfg_aliases", "pin-project-lite", "quinn-proto", @@ -3014,7 +3257,7 @@ dependencies = [ "rustls 0.23.37", "socket2 0.6.3", "thiserror 2.0.18", - "tokio 1.50.0", + "tokio", "tracing", "web-time", ] @@ -3026,7 +3269,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31" dependencies = [ "aws-lc-rs", - "bytes 1.11.1", + "bytes", "getrandom 0.3.4", "lru-slab", "rand 0.9.2", @@ -3154,29 +3397,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b36964393906eb775b89b25b05b7b95685b8dd14062f1663a31ff93e75c452e5" dependencies = [ "arcstr", - "bytes 1.11.1", - "cfg-if 1.0.4", + "bytes", + "cfg-if", "combine", "futures-util", "itoa", "num-bigint", - "percent-encoding 2.3.2", + "percent-encoding", "pin-project-lite", "ryu", "sha1_smol", "socket2 0.6.3", - "tokio 1.50.0", + "tokio", "tokio-util", - "url 2.5.8", + "url", "xxhash-rust", ] -[[package]] -name = "redox_syscall" -version = "0.1.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" - [[package]] name = "redox_syscall" version = "0.3.5" @@ -3204,6 +3441,38 @@ dependencies = [ "bitflags 2.11.0", ] +[[package]] +name = "ref-cast" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f354300ae66f76f1c85c5f84693f0ce81d747e2c3f21a45fef496d89c960bf7d" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "regex" +version = "1.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + [[package]] name = "regex-automata" version = "0.4.14" @@ -3233,8 +3502,8 @@ version = "0.12.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" dependencies = [ - "base64", - "bytes 1.11.1", + "base64 0.22.1", + "bytes", "futures-core", "http 1.4.0", "http-body 1.0.1", @@ -3244,7 +3513,7 @@ dependencies = [ "hyper-util", "js-sys", "log", - "percent-encoding 2.3.2", + "percent-encoding", "pin-project-lite", "quinn", "rustls 0.23.37", @@ -3253,12 +3522,12 @@ dependencies = [ "serde_json", "serde_urlencoded", "sync_wrapper", - "tokio 1.50.0", + "tokio", "tokio-rustls 0.26.4", "tower", "tower-http", "tower-service", - "url 2.5.8", + "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -3271,8 +3540,8 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab3f43e3283ab1488b624b44b0e988d0acea0b3214e694730a055cb6b2efa801" dependencies = [ - "base64", - "bytes 1.11.1", + "base64 0.22.1", + "bytes", "encoding_rs", "futures-channel", "futures-core", @@ -3288,7 +3557,7 @@ dependencies = [ "log", "mime", "mime_guess", - "percent-encoding 2.3.2", + "percent-encoding", "pin-project-lite", "quinn", "rustls 0.23.37", @@ -3298,13 +3567,13 @@ dependencies = [ "serde_json", "serde_urlencoded", "sync_wrapper", - "tokio 1.50.0", + "tokio", "tokio-rustls 0.26.4", "tokio-util", "tower", "tower-http", "tower-service", - "url 2.5.8", + "url", "wasm-bindgen", "wasm-bindgen-futures", "wasm-streams", @@ -3335,7 +3604,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ "cc", - "cfg-if 1.0.4", + "cfg-if", "getrandom 0.2.17", "libc", "untrusted", @@ -3348,22 +3617,13 @@ version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver 0.9.0", -] - [[package]] name = "rustc_version" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.27", + "semver", ] [[package]] @@ -3372,8 +3632,8 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dd18cd2bae1820af0b6ad5e54f4a51d0f3fcc53b05f845675074efcc7af071d" dependencies = [ - "rustc_version 0.4.1", - "semver 1.0.27", + "rustc_version", + "semver", ] [[package]] @@ -3519,10 +3779,28 @@ dependencies = [ ] [[package]] -name = "scoped-tls" -version = "0.1.2" +name = "schemars" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "332ffa32bf586782a3efaeb58f127980944bbc8c4d6913a86107ac2a5ab24b28" +checksum = "a2b42f36aa1cd011945615b92222f6bf73c599a102a300334cd7f8dbeec726cc" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] [[package]] name = "scopeguard" @@ -3577,27 +3855,12 @@ dependencies = [ "libc", ] -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] - [[package]] name = "semver" version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - [[package]] name = "serde" version = "1.0.228" @@ -3644,7 +3907,7 @@ version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" dependencies = [ - "indexmap", + "indexmap 2.13.0", "itoa", "memchr", "serde", @@ -3663,6 +3926,17 @@ dependencies = [ "serde_core", ] +[[package]] +name = "serde_repr" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "serde_spanned" version = "1.0.4" @@ -3690,8 +3964,17 @@ version = "3.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "381b283ce7bc6b476d903296fb59d0d36633652b633b27f64db4fb46dcbfc3b9" dependencies = [ + "base64 0.22.1", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.13.0", + "schemars 0.9.0", + "schemars 1.2.1", "serde_core", + "serde_json", "serde_with_macros", + "time", ] [[package]] @@ -3712,7 +3995,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ - "cfg-if 1.0.4", + "cfg-if", "cpufeatures 0.2.17", "digest", ] @@ -3729,7 +4012,7 @@ version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ - "cfg-if 1.0.4", + "cfg-if", "cpufeatures 0.2.17", "digest", ] @@ -3787,15 +4070,6 @@ version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" -[[package]] -name = "smallvec" -version = "0.6.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97fcaeba89edba30f044a10c6a3cc39df9c3f17d7cd829dd1446cab35f890e0" -dependencies = [ - "maybe-uninit", -] - [[package]] name = "smallvec" version = "1.15.1" @@ -3861,6 +4135,29 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +[[package]] +name = "structmeta" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e1575d8d40908d70f6fd05537266b90ae71b15dbbe7a8b7dffa2b759306d329" +dependencies = [ + "proc-macro2", + "quote", + "structmeta-derive", + "syn", +] + +[[package]] +name = "structmeta-derive" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "152a0b65a590ff6c3da95cabe2353ee04e6167c896b28e3b14478c2636c922fc" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "subtle" version = "2.6.1" @@ -3961,6 +4258,52 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "termtree" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683" + +[[package]] +name = "testcontainers" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1c0624faaa317c56d6d19136580be889677259caf5c897941c6f446b4655068" +dependencies = [ + "astral-tokio-tar", + "async-trait", + "bollard", + "bytes", + "docker_credential", + "either", + "etcetera", + "ferroid", + "futures", + "http 1.4.0", + "itertools", + "log", + "memchr", + "parse-display", + "pin-project-lite", + "serde", + "serde_json", + "serde_with", + "thiserror 2.0.18", + "tokio", + "tokio-stream", + "tokio-util", + "url", +] + +[[package]] +name = "testcontainers-modules" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5985fde5befe4ffa77a052e035e16c2da86e8bae301baa9f9904ad3c494d357" +dependencies = [ + "testcontainers", +] + [[package]] name = "thiserror" version = "1.0.69" @@ -4007,7 +4350,7 @@ version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" dependencies = [ - "cfg-if 1.0.4", + "cfg-if", ] [[package]] @@ -4077,39 +4420,16 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" -[[package]] -name = "tokio" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.31", - "mio 0.6.23", - "num_cpus", - "tokio-codec", - "tokio-current-thread", - "tokio-executor", - "tokio-fs", - "tokio-io", - "tokio-reactor", - "tokio-sync", - "tokio-tcp", - "tokio-threadpool", - "tokio-timer", - "tokio-udp", - "tokio-uds", -] - [[package]] name = "tokio" version = "1.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27ad5e34374e03cfffefc301becb44e9dc3c17584f414349ebe29ed26661822d" dependencies = [ - "bytes 1.11.1", + "bytes", "libc", - "mio 1.1.1", + "mio", + "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2 0.6.3", @@ -4117,78 +4437,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "tokio-codec" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25b2998660ba0e70d18684de5d06b70b70a3a747469af9dea7618cc59e75976b" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.31", - "tokio-io", -] - -[[package]] -name = "tokio-core" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87b1395334443abca552f63d4f61d0486f12377c2ba8b368e523f89e828cffd4" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.31", - "iovec", - "log", - "mio 0.6.23", - "scoped-tls", - "tokio 0.1.22", - "tokio-executor", - "tokio-io", - "tokio-reactor", - "tokio-timer", -] - -[[package]] -name = "tokio-current-thread" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20e" -dependencies = [ - "futures 0.1.31", - "tokio-executor", -] - -[[package]] -name = "tokio-executor" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671" -dependencies = [ - "crossbeam-utils 0.7.2", - "futures 0.1.31", -] - -[[package]] -name = "tokio-fs" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "297a1206e0ca6302a0eed35b700d292b275256f596e2f3fea7729d5e629b6ff4" -dependencies = [ - "futures 0.1.31", - "tokio-io", - "tokio-threadpool", -] - -[[package]] -name = "tokio-io" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.31", - "log", -] - [[package]] name = "tokio-macros" version = "2.6.1" @@ -4208,43 +4456,24 @@ checksum = "dcea47c8f71744367793f16c2db1f11cb859d28f436bdb4ca9193eb1f787ee42" dependencies = [ "async-trait", "byteorder", - "bytes 1.11.1", + "bytes", "fallible-iterator", "futures-channel", "futures-util", "log", - "parking_lot 0.12.5", - "percent-encoding 2.3.2", + "parking_lot", + "percent-encoding", "phf", "pin-project-lite", "postgres-protocol", "postgres-types", "rand 0.9.2", "socket2 0.6.3", - "tokio 1.50.0", + "tokio", "tokio-util", "whoami", ] -[[package]] -name = "tokio-reactor" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351" -dependencies = [ - "crossbeam-utils 0.7.2", - "futures 0.1.31", - "lazy_static", - "log", - "mio 0.6.23", - "num_cpus", - "parking_lot 0.9.0", - "slab", - "tokio-executor", - "tokio-io", - "tokio-sync", -] - [[package]] name = "tokio-rustls" version = "0.24.1" @@ -4252,7 +4481,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ "rustls 0.21.12", - "tokio 1.50.0", + "tokio", ] [[package]] @@ -4262,7 +4491,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" dependencies = [ "rustls 0.23.37", - "tokio 1.50.0", + "tokio", ] [[package]] @@ -4273,17 +4502,7 @@ checksum = "32da49809aab5c3bc678af03902d4ccddea2a87d028d86392a4b1560c6906c70" dependencies = [ "futures-core", "pin-project-lite", - "tokio 1.50.0", -] - -[[package]] -name = "tokio-sync" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87dee" -dependencies = [ - "fnv", - "futures 0.1.31", + "tokio", ] [[package]] @@ -4296,99 +4515,23 @@ dependencies = [ "futures-core", "libc", "redox_syscall 0.3.5", - "tokio 1.50.0", + "tokio", "tokio-stream", "xattr", ] -[[package]] -name = "tokio-tcp" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.31", - "iovec", - "mio 0.6.23", - "tokio-io", - "tokio-reactor", -] - -[[package]] -name = "tokio-threadpool" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df720b6581784c118f0eb4310796b12b1d242a7eb95f716a8367855325c25f89" -dependencies = [ - "crossbeam-deque", - "crossbeam-queue", - "crossbeam-utils 0.7.2", - "futures 0.1.31", - "lazy_static", - "log", - "num_cpus", - "slab", - "tokio-executor", -] - -[[package]] -name = "tokio-timer" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296" -dependencies = [ - "crossbeam-utils 0.7.2", - "futures 0.1.31", - "slab", - "tokio-executor", -] - -[[package]] -name = "tokio-udp" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2a0b10e610b39c38b031a2fcab08e4b82f16ece36504988dcbd81dbba650d82" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.31", - "log", - "mio 0.6.23", - "tokio-codec", - "tokio-io", - "tokio-reactor", -] - -[[package]] -name = "tokio-uds" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab57a4ac4111c8c9dbcf70779f6fc8bc35ae4b2454809febac840ad19bd7e4e0" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.31", - "iovec", - "libc", - "log", - "mio 0.6.23", - "mio-uds", - "tokio-codec", - "tokio-io", - "tokio-reactor", -] - [[package]] name = "tokio-util" version = "0.7.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" dependencies = [ - "bytes 1.11.1", + "bytes", "futures-core", "futures-io", "futures-sink", "pin-project-lite", - "tokio 1.50.0", + "tokio", ] [[package]] @@ -4397,7 +4540,7 @@ version = "0.9.12+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf92845e79fc2e2def6a5d828f0801e29a2f8acc037becc5ab08595c7d5e9863" dependencies = [ - "indexmap", + "indexmap 2.13.0", "serde_core", "serde_spanned", "toml_datetime", @@ -4430,6 +4573,46 @@ version = "1.0.6+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab16f14aed21ee8bfd8ec22513f7287cd4a91aa92e44edfe2c17ddd004e92607" +[[package]] +name = "tonic" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fec7c61a0695dc1887c1b53952990f3ad2e3a31453e1f49f10e75424943a93ec" +dependencies = [ + "async-trait", + "axum", + "base64 0.22.1", + "bytes", + "h2 0.4.13", + "http 1.4.0", + "http-body 1.0.1", + "http-body-util", + "hyper 1.8.1", + "hyper-timeout", + "hyper-util", + "percent-encoding", + "pin-project", + "socket2 0.6.3", + "sync_wrapper", + "tokio", + "tokio-stream", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tonic-prost" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a55376a0bbaa4975a3f10d009ad763d8f4108f067c7c2e74f3001fb49778d309" +dependencies = [ + "bytes", + "prost", + "tonic", +] + [[package]] name = "tower" version = "0.5.3" @@ -4438,11 +4621,15 @@ checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" dependencies = [ "futures-core", "futures-util", + "indexmap 2.13.0", "pin-project-lite", + "slab", "sync_wrapper", - "tokio 1.50.0", + "tokio", + "tokio-util", "tower-layer", "tower-service", + "tracing", ] [[package]] @@ -4452,7 +4639,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" dependencies = [ "bitflags 2.11.0", - "bytes 1.11.1", + "bytes", "futures-util", "http 1.4.0", "http-body 1.0.1", @@ -4542,7 +4729,7 @@ dependencies = [ "once_cell", "regex-automata", "sharded-slab", - "smallvec 1.15.1", + "smallvec", "thread_local", "time", "tracing", @@ -4644,14 +4831,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] -name = "url" -version = "1.7.2" +name = "ureq" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc97a28575b85cfedf2a7e7d3cc64b3e11bd8ac766666318003abbacc7a21fc" +dependencies = [ + "base64 0.22.1", + "log", + "percent-encoding", + "rustls 0.23.37", + "rustls-pki-types", + "ureq-proto", + "utf-8", +] + +[[package]] +name = "ureq-proto" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" +checksum = "d81f9efa9df032be5934a46a068815a10a042b494b6a58cb0a1a97bb5467ed6f" dependencies = [ - "idna 0.1.5", - "matches", - "percent-encoding 1.0.1", + "base64 0.22.1", + "http 1.4.0", + "httparse", + "log", ] [[package]] @@ -4661,8 +4864,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" dependencies = [ "form_urlencoded", - "idna 1.1.0", - "percent-encoding 2.3.2", + "idna", + "percent-encoding", "serde", "serde_derive", ] @@ -4673,6 +4876,12 @@ version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + [[package]] name = "utf8_iter" version = "1.0.4" @@ -4782,7 +4991,7 @@ version = "0.2.114" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6532f9a5c1ece3798cb1c2cfdba640b9b3ba884f5db45973a6f442510a87d38e" dependencies = [ - "cfg-if 1.0.4", + "cfg-if", "once_cell", "rustversion", "wasm-bindgen-macro", @@ -4795,7 +5004,7 @@ version = "0.4.64" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9c5522b3a28661442748e09d40924dfb9ca614b21c00d3fd135720e48b67db8" dependencies = [ - "cfg-if 1.0.4", + "cfg-if", "futures-util", "js-sys", "once_cell", @@ -4852,7 +5061,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" dependencies = [ "anyhow", - "indexmap", + "indexmap 2.13.0", "wasm-encoder", "wasmparser", ] @@ -4878,8 +5087,8 @@ checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" dependencies = [ "bitflags 2.11.0", "hashbrown 0.15.5", - "indexmap", - "semver 1.0.27", + "indexmap 2.13.0", + "semver", ] [[package]] @@ -4939,12 +5148,6 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72069c3113ab32ab29e5584db3c6ec55d416895e60715417b5b883a357c3e471" -[[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" - [[package]] name = "winapi" version = "0.3.9" @@ -4955,12 +5158,6 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu", ] -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" - [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" @@ -5361,10 +5558,33 @@ version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "cfg-if 1.0.4", + "cfg-if", "windows-sys 0.48.0", ] +[[package]] +name = "wiremock" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08db1edfb05d9b3c1542e521aea074442088292f00b5f28e435c714a98f85031" +dependencies = [ + "assert-json-diff", + "base64 0.22.1", + "deadpool", + "futures", + "http 1.4.0", + "http-body-util", + "hyper 1.8.1", + "hyper-util", + "log", + "once_cell", + "regex", + "serde", + "serde_json", + "tokio", + "url", +] + [[package]] name = "wit-bindgen" version = "0.51.0" @@ -5393,7 +5613,7 @@ checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" dependencies = [ "anyhow", "heck", - "indexmap", + "indexmap 2.13.0", "prettyplease", "syn", "wasm-metadata", @@ -5424,7 +5644,7 @@ checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" dependencies = [ "anyhow", "bitflags 2.11.0", - "indexmap", + "indexmap 2.13.0", "log", "serde", "serde_derive", @@ -5443,9 +5663,9 @@ checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" dependencies = [ "anyhow", "id-arena", - "indexmap", + "indexmap 2.13.0", "log", - "semver 1.0.27", + "semver", "serde", "serde_derive", "serde_json", @@ -5459,16 +5679,6 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" -[[package]] -name = "ws2_32-sys" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/Cargo.toml b/Cargo.toml index 5de5a74..31d176c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,13 +42,21 @@ async-compression = { version = "0.4.37", features = ["tokio", "gzip"] } tokio-tar = "0.3.1" oauth2 = "5.0.0" hyper = "1.8.1" -async-http-client = "0.2.0" aes-gcm = "0.11.0-rc.3" generic-array = "0.14.7" futures-util = "0.3.31" tokio-stream = "0.1.18" aes = "0.9.0-rc.4" typenum = "1.19.0" +testcontainers = "0.27.1" +testcontainers-modules = { version = "0.15.0", features = ["postgres"] } +postgres = "0.19.12" + +[dev-dependencies] +tokio = { version = "1", features = ["full"] } +mockall = "0.13" +testcontainers = "0.27.1" +wiremock = "0.6" [[bin]] diff --git a/Makefile b/Makefile index a363fa2..b05eebb 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,12 @@ include .env export $(shell sed 's/=.*//' .env) +CLUSTER_SCRIPT=docker/entrypoints/app-dev-entrypoint.sh .PHONY: seed-mongo seed-mysql seed-postgres +up: + @bash $(CLUSTER_SCRIPT) + seed-mongo: @echo "Seeding MongoDB..." bash ./scripts/mongo/seed-mongo.sh diff --git a/docker-compose.yml b/docker-compose.yml index acbdf21..5d1c66a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -120,4 +120,3 @@ networks: name: portabase_network external: true -# docker network create portabase_network \ No newline at end of file diff --git a/docker/entrypoints/app-dev-entrypoint.sh b/docker/entrypoints/app-dev-entrypoint.sh new file mode 100755 index 0000000..3e3fb46 --- /dev/null +++ b/docker/entrypoints/app-dev-entrypoint.sh @@ -0,0 +1,39 @@ +#!/bin/bash +set -euo pipefail + +check_docker() { + if ! docker info > /dev/null 2>&1; then + echo "Docker is not running. Attempting to start Docker..." + if [[ "$OSTYPE" == "darwin"* ]]; then + open -a Docker + echo "Waiting for Docker to start..." + until docker info > /dev/null 2>&1; do + sleep 2 + done + elif command -v systemctl >/dev/null 2>&1; then + sudo systemctl start docker + else + echo "Cannot start Docker automatically. Please start Docker manually." + exit 1 + fi + else + echo "Docker is running." + fi +} + +check_network() { + local network_name="portabase_network" + if ! docker network ls --format '{{.Name}}' | grep -q "^${network_name}$"; then + echo "Docker network '${network_name}' not found. Creating..." + docker network create "${network_name}" + else + echo "Docker network '${network_name}' already exists." + fi +} + +check_docker +check_network + +echo "Starting docker-compose..." +docker-compose -f ./docker-compose.yml up +echo "Docker-compose started successfully." \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index af7c18f..a391593 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,6 +4,8 @@ mod services; mod settings; mod tasks; mod utils; +#[cfg(test)] +mod tests; use crate::tasks::ping::ping_server; use crate::utils::locks::FileLock; diff --git a/src/tests/domain/mod.rs b/src/tests/domain/mod.rs new file mode 100644 index 0000000..bc79954 --- /dev/null +++ b/src/tests/domain/mod.rs @@ -0,0 +1 @@ +mod postgres; \ No newline at end of file diff --git a/src/tests/domain/postgres.rs b/src/tests/domain/postgres.rs new file mode 100644 index 0000000..f413838 --- /dev/null +++ b/src/tests/domain/postgres.rs @@ -0,0 +1,35 @@ +use oauth2::url; +use testcontainers::runners::AsyncRunner; +use testcontainers_modules::postgres::Postgres; +use crate::services::config::{DatabaseConfig, DbType}; +use url::Host; +use crate::domain::factory::DatabaseFactory; + +#[tokio::test] +async fn postgres_ping_test() { + + let container = Postgres::default() + .start() + .await + .unwrap(); + + let host = container.get_host().await.unwrap_or(Host::parse("127.0.0.1").unwrap()); + let port = container.get_host_port_ipv4(5432).await.unwrap_or(5432) ; + + let config = DatabaseConfig { + name: "My test Postgres Database".to_string(), + database: "postgres".to_string(), + db_type: DbType::Postgresql, + username: "postgres".to_string(), + password: "postgres".to_string(), + port, + host: host.to_string(), + generated_id: "40875631-e3d2-4dfe-a26b-2a347ecc64fd".to_string(), + path: "".to_string(), + }; + + let db = DatabaseFactory::create_for_backup(config.clone()).await; + let reachable = db.ping().await.unwrap_or_else(|_| false); + + assert_eq!(reachable, true); +} \ No newline at end of file diff --git a/src/tests/mod.rs b/src/tests/mod.rs new file mode 100644 index 0000000..b7ad210 --- /dev/null +++ b/src/tests/mod.rs @@ -0,0 +1,2 @@ +mod utils; +mod domain; \ No newline at end of file diff --git a/src/tests/utils/common_tests.rs b/src/tests/utils/common_tests.rs new file mode 100644 index 0000000..ad5ccbd --- /dev/null +++ b/src/tests/utils/common_tests.rs @@ -0,0 +1,46 @@ +use serde_json::json; +use crate::utils::common::{vec_to_option_json, BackupMethod}; + +#[test] +fn backup_method_to_string_automatic() { + let method = BackupMethod::Automatic; + assert_eq!(method.to_string(), "automatic"); +} + +#[test] +fn backup_method_to_string_manual() { + let method = BackupMethod::Manual; + assert_eq!(method.to_string(), "manual"); +} + +#[test] +fn vec_to_option_json_returns_none_when_empty() { + let v: Vec = vec![]; + let result = vec_to_option_json(v); + + assert!(result.is_none()); +} + +#[test] +fn vec_to_option_json_serializes_vector() { + let v = vec![1, 2, 3]; + let result = vec_to_option_json(v); + + assert_eq!(result, Some(json!([1, 2, 3]))); +} + +#[test] +fn vec_to_option_json_serializes_struct_vector() { + #[derive(serde::Serialize)] + struct Item { + id: u32, + } + + let v = vec![Item { id: 1 }, Item { id: 2 }]; + let result = vec_to_option_json(v); + + assert_eq!(result, Some(json!([ + { "id": 1 }, + { "id": 2 } + ]))); +} \ No newline at end of file diff --git a/src/tests/utils/compress_tests.rs b/src/tests/utils/compress_tests.rs new file mode 100644 index 0000000..f4d3b42 --- /dev/null +++ b/src/tests/utils/compress_tests.rs @@ -0,0 +1,73 @@ +use tempfile::tempdir; +use tokio::fs::{write, read}; +use anyhow::Result; +use crate::utils::compress::{compress_to_tar_gz_large, decompress_large_tar_gz}; + +#[tokio::test] +async fn compress_creates_tar_gz() -> Result<()> { + let tmp = tempdir()?; + let file_path = tmp.path().join("test.txt"); + write(&file_path, b"hello world").await?; + + let result = compress_to_tar_gz_large(&file_path).await?; + assert!(result.compressed_path.exists()); + assert_eq!(result.compressed_path.extension().unwrap(), "gz"); + + Ok(()) +} + +#[tokio::test] +async fn compress_skips_existing_tar_gz() -> Result<()> { + let tmp = tempdir()?; + let file_path = tmp.path().join("already.tar.gz"); + write(&file_path, b"compressed").await?; + + let result = compress_to_tar_gz_large(&file_path).await?; + // Should return same path without creating a new file + assert_eq!(result.compressed_path, file_path); + + Ok(()) +} + +#[tokio::test] +async fn decompress_restores_file() -> Result<()> { + let tmp = tempdir()?; + let file_path = tmp.path().join("file.txt"); + write(&file_path, b"data for decompress").await?; + + let compress_result = compress_to_tar_gz_large(&file_path).await?; + let output_dir = tmp.path().join("out"); + tokio::fs::create_dir_all(&output_dir).await?; + + let extracted_files = decompress_large_tar_gz(&compress_result.compressed_path, &output_dir).await?; + assert_eq!(extracted_files.len(), 1); + + let extracted_content = read(&extracted_files[0]).await?; + assert_eq!(extracted_content, b"data for decompress"); + + Ok(()) +} + +#[tokio::test] +async fn decompress_multiple_files() -> Result<()> { + let tmp = tempdir()?; + let file1 = tmp.path().join("file1.txt"); + let file2 = tmp.path().join("file2.txt"); + write(&file1, b"file1").await?; + write(&file2, b"file2").await?; + + // Compress both files individually (for simplicity in this test) + let compress1 = compress_to_tar_gz_large(&file1).await?; + let compress2 = compress_to_tar_gz_large(&file2).await?; + + let output_dir = tmp.path().join("out_multi"); + tokio::fs::create_dir_all(&output_dir).await?; + + let extracted1 = decompress_large_tar_gz(&compress1.compressed_path, &output_dir).await?; + let extracted2 = decompress_large_tar_gz(&compress2.compressed_path, &output_dir).await?; + + assert_eq!(extracted1.len(), 1); + assert_eq!(extracted2.len(), 1); + + Ok(()) +} diff --git a/src/tests/utils/deserializer.rs b/src/tests/utils/deserializer.rs new file mode 100644 index 0000000..df1fd4e --- /dev/null +++ b/src/tests/utils/deserializer.rs @@ -0,0 +1,104 @@ +#[cfg(test)] +mod tests { + use serde::Deserialize; + use toml::map::Map; + use toml::Value; + use crate::utils::deserializer::{camel_to_snake, deserialize_snake_case, to_snake_case}; + + #[test] + fn camel_to_snake_simple() { + assert_eq!(camel_to_snake("CamelCase"), "camel_case"); + assert_eq!(camel_to_snake("simpleTest"), "simple_test"); + assert_eq!(camel_to_snake("already_snake"), "already_snake"); + assert_eq!(camel_to_snake("X"), "x"); + assert_eq!(camel_to_snake("ABTest"), "a_b_test"); + } + + #[test] + fn to_snake_case_nested_table() { + let mut inner_table = Map::new(); + inner_table.insert("InnerKey".into(), Value::String("value".into())); + + let mut outer_table = Map::new(); + outer_table.insert("OuterKey".into(), Value::Table(inner_table)); + + let value = Value::Table(outer_table); + + // Expected snake_case + let mut expected_inner = Map::new(); + expected_inner.insert("inner_key".into(), Value::String("value".into())); + + let mut expected_outer = Map::new(); + expected_outer.insert("outer_key".into(), Value::Table(expected_inner)); + + let expected = Value::Table(expected_outer); + + let result = to_snake_case(value); + assert_eq!(result, expected); + } + + #[test] + fn to_snake_case_array_of_tables() { + let mut table1 = Map::new(); + table1.insert("CamelKey".into(), Value::Integer(1)); + + let mut table2 = Map::new(); + table2.insert("AnotherKey".into(), Value::Integer(2)); + + let value = Value::Array(vec![ + Value::Table(table1), + Value::Table(table2), + ]); + + let mut expected_table1 = Map::new(); + expected_table1.insert("camel_key".into(), Value::Integer(1)); + + let mut expected_table2 = Map::new(); + expected_table2.insert("another_key".into(), Value::Integer(2)); + + let expected = Value::Array(vec![ + Value::Table(expected_table1), + Value::Table(expected_table2), + ]); + + let result = to_snake_case(value); + assert_eq!(result, expected); + } + + #[test] + fn deserialize_snake_case_works_with_struct() { + #[derive(Deserialize, Debug, PartialEq)] + struct Config { + some_value: i32, + nested_table: Nested, + } + + #[derive(Deserialize, Debug, PartialEq)] + struct Nested { + inner_value: String, + } + + let toml_str = r#" + SomeValue = 42 + + [NestedTable] + InnerValue = "hello" + "#; + + let value: Value = toml::from_str(toml_str).unwrap(); + let snake_value = deserialize_snake_case(value).unwrap(); + + // Deserialize to struct + let config: Config = snake_value.try_into().unwrap(); + + assert_eq!(config.some_value, 42); + assert_eq!(config.nested_table.inner_value, "hello"); + } + + #[test] + fn to_snake_case_non_table_value() { + let value = Value::String("unchanged".into()); + let result = to_snake_case(value.clone()); + assert_eq!(result, value); + } +} \ No newline at end of file diff --git a/src/tests/utils/edge_key_tests.rs b/src/tests/utils/edge_key_tests.rs new file mode 100644 index 0000000..948c61f --- /dev/null +++ b/src/tests/utils/edge_key_tests.rs @@ -0,0 +1,53 @@ +use base64::{engine::general_purpose, Engine as _}; +use serde_json::json; +use crate::utils::edge_key::{decode_edge_key, EdgeKeyError}; + +#[test] +fn decode_valid_edge_key() { + let edge_key_b64 = "eyJzZXJ2ZXJVcmwiOiJodHRwOi8vbG9jYWxob3N0Ojg4ODciLCJhZ2VudElkIjoiNjI1MDQzY2YtN2MwMC00M2M4LWJjYzktZDM1MTk5ODk2ZGNkIiwibWFzdGVyS2V5QjY0IjoiQlhWM1hvbEM2NTZTVjdkTmdjV1BHUWxrKytycExJNmxHRGk3Q1BCNWllbz0ifQ=="; + let decoded = decode_edge_key(edge_key_b64).unwrap(); + + assert_eq!(decoded.server_url, "http://localhost:8887"); + assert_eq!(decoded.agent_id, "625043cf-7c00-43c8-bcc9-d35199896dcd"); + assert_eq!(decoded.master_key_b64, "BXV3XolC656SV7dNgcWPGQlk++rpLI6lGDi7CPB5ieo="); +} + +#[test] +fn decode_edge_key_missing_field() { + let incomplete_json = json!({ + "serverUrl": "http://localhost:8887", + "agentId": "123" + // masterKeyB64 is missing + }) + .to_string(); + + let b64 = general_purpose::URL_SAFE.encode(incomplete_json); + let result = decode_edge_key(&b64); + + match result { + Err(EdgeKeyError::InvalidKey) => {} + _ => panic!("Expected InvalidKey error"), + } +} + +#[test] +fn decode_edge_key_invalid_base64() { + let invalid_b64 = "!!!notbase64!!!"; + let result = decode_edge_key(invalid_b64); + + match result { + Err(EdgeKeyError::Base64Error(_)) => {} + _ => panic!("Expected Base64Error"), + } +} + +#[test] +fn decode_edge_key_invalid_json() { + let invalid_json_b64 = general_purpose::URL_SAFE.encode("not a json string"); + let result = decode_edge_key(&invalid_json_b64); + + match result { + Err(EdgeKeyError::JsonError(_)) => {} + _ => panic!("Expected JsonError"), + } +} diff --git a/src/tests/utils/mod.rs b/src/tests/utils/mod.rs new file mode 100644 index 0000000..c942141 --- /dev/null +++ b/src/tests/utils/mod.rs @@ -0,0 +1,5 @@ +mod normalize_cron_tests; +mod common_tests; +mod compress_tests; +mod deserializer; +mod edge_key_tests; \ No newline at end of file diff --git a/src/tests/utils/normalize_cron_tests.rs b/src/tests/utils/normalize_cron_tests.rs new file mode 100644 index 0000000..2c9a1ab --- /dev/null +++ b/src/tests/utils/normalize_cron_tests.rs @@ -0,0 +1,49 @@ +use crate::utils::text::normalize_cron; +use cron::Schedule; +use std::str::FromStr; +use crate::utils::task_manager::cron::next_run_timestamp; + +#[test] +fn normalize_adds_seconds_to_five_field_cron() { + let input = "*/5 * * * *"; + let normalized = normalize_cron(input); + + assert_eq!(normalized, "0 */5 * * * *"); +} + +#[test] +fn normalize_keeps_six_field_cron() { + let input = "0 */5 * * * *"; + let normalized = normalize_cron(input); + + assert_eq!(normalized, "0 */5 * * * *"); +} + +#[test] +fn normalized_expression_is_valid_for_cron_schedule() { + let input = "*/5 * * * *"; + let normalized = normalize_cron(input); + + let schedule = Schedule::from_str(&normalized); + assert!(schedule.is_ok()); +} + +#[test] +fn next_run_timestamp_returns_future_timestamp() { + let expr = normalize_cron("*/1 * * * *"); + let ts = next_run_timestamp(&expr); + + let now = chrono::Local::now().timestamp(); + assert!(ts > now); +} + +#[test] +fn normalization_does_not_break_schedule_parsing() { + let input = "0 */10 * * * *"; + let normalized = normalize_cron(input); + + let schedule = Schedule::from_str(&normalized).unwrap(); + let next = schedule.upcoming(chrono::Local).next(); + + assert!(next.is_some()); +} diff --git a/src/utils/compress.rs b/src/utils/compress.rs index 6b89ff3..f354b36 100644 --- a/src/utils/compress.rs +++ b/src/utils/compress.rs @@ -90,7 +90,6 @@ pub async fn decompress_large_tar_gz( extracted_files.push(full_path); } - // remove_file(tar_gz_path).await?; info!("Decompressed {:?} into {:?}", tar_gz_path, output_dir); Ok(extracted_files) diff --git a/src/utils/deserializer.rs b/src/utils/deserializer.rs index b68343a..01e77f9 100644 --- a/src/utils/deserializer.rs +++ b/src/utils/deserializer.rs @@ -8,7 +8,8 @@ where let value = Value::deserialize(deserializer)?; Ok(to_snake_case(value)) } -fn to_snake_case(value: Value) -> Value { + +pub fn to_snake_case(value: Value) -> Value { match value { Value::Table(table) => Value::Table( table @@ -16,14 +17,12 @@ fn to_snake_case(value: Value) -> Value { .map(|(k, v)| (camel_to_snake(&k), to_snake_case(v))) .collect(), ), - Value::Array(arr) => { - Value::Array(arr.into_iter().map(to_snake_case).collect()) - } + Value::Array(arr) => Value::Array(arr.into_iter().map(to_snake_case).collect()), other => other, } } -fn camel_to_snake(s: &str) -> String { +pub fn camel_to_snake(s: &str) -> String { let mut out = String::new(); for (i, c) in s.chars().enumerate() { if c.is_uppercase() { From df5b16a15388faaac7b588343734c1913eb198e4 Mon Sep 17 00:00:00 2001 From: charlesgauthereau Date: Thu, 12 Mar 2026 19:16:12 +0100 Subject: [PATCH 4/4] fix: docker-compose.yml --- docker-compose.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 5d1c66a..e746f02 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,14 +11,14 @@ services: # - ./databases.toml:/config/config.toml - cargo-registry:/usr/local/cargo/registry - cargo-git:/usr/local/cargo/git - # - cargo-target:/app/target + - cargo-target:/app/target # - sqlite-data:/sqlite-data/workspace/data # - ./scripts/sqlite/test-db:/sqlite-data-2/workspace/data environment: APP_ENV: development LOG: debug TZ: "Europe/Paris" - EDGE_KEY: "eyJzZXJ2ZXJVcmwiOiJodHRwOi8vbG9jYWxob3N0Ojg4ODciLCJhZ2VudElkIjoiNjI1MDQzY2YtN2MwMC00M2M4LWJjYzktZDM1MTk5ODk2ZGNkIiwibWFzdGVyS2V5QjY0IjoiQlhWM1hvbEM2NTZTVjdkTmdjV1BHUWxrKytycExJNmxHRGk3Q1BCNWllbz0ifQ==" + EDGE_KEY: "eyJzZXJ2ZXJVcmwiOiJodHRwOi8vbG9jYWxob3N0Ojg4ODciLCJhZ2VudElkIjoiOGYwMmExZTAtNDY0NC00MWFmLWIzYjctYjZkYWNjNzQ4OWVhIiwibWFzdGVyS2V5QjY0IjoiQlhWM1hvbEM2NTZTVjdkTmdjV1BHUWxrKytycExJNmxHRGk3Q1BCNWllbz0ifQ==" #POOLING: 1 #DATABASES_CONFIG_FILE: "config.toml" extra_hosts: @@ -107,7 +107,7 @@ services: volumes: cargo-registry: cargo-git: - # cargo-target: + cargo-target: postgres-data: # mariadb-data: