From 28b22f6b222bbe2207e57237726a9d69f628e20e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Stuczy=C5=84ski?= Date: Fri, 22 May 2026 15:39:33 +0100 Subject: [PATCH] upgrade axum to 0.8.9 (and side deps) (#6808) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * upgrade axum to 0.8.9 (and side deps) Bumps axum 0.7.5 → 0.8.9, axum-extra 0.9.4 → 0.12.6, axum-client-ip 0.6.1 → 1.3.1, axum-test 16.2.0 → 20.0.0, utoipa-swagger-ui 8.1 → 9.0.2. * warn upon using fallback ip Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * chore: replace use of deprecated try_next() * update console-subscriber to ensure single version of axum in the lock file * removed unused axum-test dev-dep --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- Cargo.lock | 832 ++++++++---------- Cargo.toml | 12 +- .../src/middleware/client_ip.rs | 39 + .../http-api-common/src/middleware/logging.rs | 12 +- common/http-api-common/src/middleware/mod.rs | 1 + .../tests/src/mock_connect_info.rs | 2 - .../tests/src/v2/network.rs | 2 +- gateway/src/node/upgrade_mode/watcher.rs | 2 +- nym-api/src/ecash/api_routes/issued.rs | 6 +- nym-api/src/ecash/tests/mod.rs | 3 +- nym-api/src/node_families/handlers/mod.rs | 4 +- nym-api/src/node_families/tests.rs | 3 +- .../handlers/network_monitor.rs | 10 +- nym-api/src/nym_nodes/handlers/v1.rs | 15 +- nym-api/src/unstable_routes/v1/account/mod.rs | 2 +- .../nym-credential-proxy-requests/src/lib.rs | 4 +- nym-data-observatory/src/http/api/mod.rs | 10 + nym-network-monitor/src/http.rs | 42 +- .../nym-node-status-api/Cargo.toml | 1 - .../src/http/api/dvpn/country.rs | 2 +- .../src/http/api/dvpn/entry.rs | 2 +- .../src/http/api/dvpn/exit.rs | 2 +- .../src/http/api/gateways.rs | 2 +- .../src/http/api/metrics/sessions.rs | 4 +- .../src/http/api/nym_nodes.rs | 2 +- .../src/http/api/testruns.rs | 4 +- nym-node/src/node/http/mod.rs | 11 +- nym-node/src/node/http/router/landing_page.rs | 2 +- nym-node/src/node/http/router/mod.rs | 28 +- nym-node/src/node/http/state/mod.rs | 26 + nym-node/src/node/mod.rs | 19 +- nym-statistics-api/src/http/api/stats.rs | 22 +- nyx-chain-watcher/src/http/api/mod.rs | 10 + 33 files changed, 580 insertions(+), 558 deletions(-) create mode 100644 common/http-api-common/src/middleware/client_ip.rs diff --git a/Cargo.lock b/Cargo.lock index 6e2144a4fd..86c27fcced 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11,7 +11,7 @@ dependencies = [ "macroific", "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -24,15 +24,6 @@ dependencies = [ "psl-types", ] -[[package]] -name = "addr2line" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" -dependencies = [ - "gimli", -] - [[package]] name = "adler2" version = "2.0.1" @@ -165,12 +156,6 @@ dependencies = [ "url", ] -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - [[package]] name = "android_system_properties" version = "0.1.5" @@ -451,7 +436,7 @@ dependencies = [ "rustc-hash", "serde", "serde_derive", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -468,7 +453,7 @@ dependencies = [ "rustc-hash", "serde", "serde_derive", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -495,16 +480,6 @@ dependencies = [ "winnow", ] -[[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 = "async-compression" version = "0.4.27" @@ -551,7 +526,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -562,7 +537,7 @@ checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -608,12 +583,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "auto-future" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c1e7e457ea78e524f48639f551fd79703ac3f2237f5ecccdf4708f8a75ad373" - [[package]] name = "autocfg" version = "1.5.0" @@ -652,96 +621,49 @@ dependencies = [ [[package]] name = "axum" -version = "0.7.9" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" +checksum = "31b698c5f9a010f6573133b09e0de5408834d0c82f8d7475a89fc1867a71cd90" dependencies = [ - "async-trait", - "axum-core 0.4.5", + "axum-core", "axum-macros", "bytes", + "form_urlencoded", "futures-util", - "http 1.3.1", + "http 1.4.0", "http-body 1.0.1", "http-body-util", - "hyper 1.6.0", + "hyper 1.9.0", "hyper-util", "itoa", - "matchit 0.7.3", - "memchr", - "mime", - "percent-encoding", - "pin-project-lite", - "rustversion", - "serde", - "serde_json", - "serde_path_to_error", - "serde_urlencoded", - "sync_wrapper 1.0.2", - "tokio", - "tower 0.5.2", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "axum" -version = "0.8.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b52af3cb4058c895d37317bb27508dccc8e5f2d39454016b297bf4a400597b8" -dependencies = [ - "axum-core 0.5.6", - "bytes", - "futures-util", - "http 1.3.1", - "http-body 1.0.1", - "http-body-util", - "itoa", - "matchit 0.8.4", + "matchit", "memchr", "mime", "percent-encoding", "pin-project-lite", "serde_core", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", "sync_wrapper 1.0.2", - "tower 0.5.2", + "tokio", + "tower", "tower-layer", "tower-service", + "tracing", ] [[package]] name = "axum-client-ip" -version = "0.6.1" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eefda7e2b27e1bda4d6fa8a06b50803b8793769045918bc37ad062d48a6efac" +checksum = "a8ba1af5b620232acf37f2eb6d22151ea465491e0b4c25f552d1990f64ec5a67" dependencies = [ - "axum 0.7.9", - "forwarded-header-value", + "axum", + "client-ip", "serde", ] -[[package]] -name = "axum-core" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" -dependencies = [ - "async-trait", - "bytes", - "futures-util", - "http 1.3.1", - "http-body 1.0.1", - "http-body-util", - "mime", - "pin-project-lite", - "rustversion", - "sync_wrapper 1.0.2", - "tower-layer", - "tower-service", - "tracing", -] - [[package]] name = "axum-core" version = "0.5.6" @@ -750,7 +672,7 @@ checksum = "08c78f31d7b1291f7ee735c1c6780ccde7785daae9a9206026862dab7d8792d1" dependencies = [ "bytes", "futures-core", - "http 1.3.1", + "http 1.4.0", "http-body 1.0.1", "http-body-util", "mime", @@ -758,59 +680,57 @@ dependencies = [ "sync_wrapper 1.0.2", "tower-layer", "tower-service", + "tracing", ] [[package]] name = "axum-extra" -version = "0.9.6" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c794b30c904f0a1c2fb7740f7df7f7972dfaa14ef6f57cb6178dc63e5dca2f04" +checksum = "be44683b41ccb9ab2d23a5230015c9c3c55be97a25e4428366de8873103f7970" dependencies = [ - "axum 0.7.9", - "axum-core 0.4.5", + "axum", + "axum-core", "bytes", - "fastrand", + "futures-core", "futures-util", "headers", - "http 1.3.1", + "http 1.4.0", "http-body 1.0.1", "http-body-util", "mime", - "multer", "pin-project-lite", - "serde", - "tower 0.5.2", "tower-layer", "tower-service", + "tracing", ] [[package]] name = "axum-macros" -version = "0.4.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d123550fa8d071b7255cb0cc04dc302baa6c8c4a79f55701552684d8399bce" +checksum = "7aa268c23bfbbd2c4363b9cd302a4f504fb2a9dfe7e3451d66f35dd392e20aca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] name = "axum-test" -version = "16.4.1" +version = "20.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63e3a443d2608936a02a222da7b746eb412fede7225b3030b64fe9be99eab8dc" +checksum = "3a86bfe2ef15bee102ac34912f7f4542b0bb37dc464fa55461763999c4d625e7" dependencies = [ "anyhow", - "assert-json-diff", - "auto-future", - "axum 0.7.9", + "axum", "bytes", "bytesize", "cookie", - "http 1.3.1", + "expect-json", + "http 1.4.0", "http-body-util", - "hyper 1.6.0", + "hyper 1.9.0", "hyper-util", "mime", "pretty_assertions", @@ -819,27 +739,11 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", - "smallvec", "tokio", - "tower 0.5.2", + "tower", "url", ] -[[package]] -name = "backtrace" -version = "0.3.75" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" -dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", - "windows-targets 0.52.6", -] - [[package]] name = "base16ct" version = "0.2.0" @@ -1157,9 +1061,9 @@ dependencies = [ [[package]] name = "bytesize" -version = "1.3.3" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e93abca9e28e0a1b9877922aacb20576e05d4679ffa78c3d6dc22a26a216659" +checksum = "6bd91ee7b2422bcb158d90ef4d14f75ef67f340943fc4149891dcce8f8b972a3" [[package]] name = "camino" @@ -1368,17 +1272,16 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.41" +version = "0.4.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" +checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0" dependencies = [ - "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "serde", "wasm-bindgen", - "windows-link 0.1.3", + "windows-link 0.2.1", ] [[package]] @@ -1500,7 +1403,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -1520,6 +1423,15 @@ dependencies = [ "zeroize", ] +[[package]] +name = "client-ip" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39d2056bf065c8b4bce5a8898d40e175211ff4410add2a84d695845d3937c729" +dependencies = [ + "http 1.4.0", +] + [[package]] name = "cmake" version = "0.1.57" @@ -1624,22 +1536,23 @@ dependencies = [ [[package]] name = "console-api" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8030735ecb0d128428b64cd379809817e620a40e5001c54465b99ec5feec2857" +checksum = "e8599749b6667e2f0c910c1d0dff6901163ff698a52d5a39720f61b5be4b20d3" dependencies = [ "futures-core", - "prost 0.13.5", + "prost 0.14.3", "prost-types", - "tonic 0.12.3", + "tonic 0.14.4", + "tonic-prost", "tracing-core", ] [[package]] name = "console-subscriber" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6539aa9c6a4cd31f4b1c040f860a1eac9aa80e7df6b05d506a6e7179936d6a01" +checksum = "fb4915b7d8dd960457a1b6c380114c2944f728e7c65294ab247ae6b6f1f37592" dependencies = [ "console-api", "crossbeam-channel", @@ -1648,14 +1561,14 @@ dependencies = [ "hdrhistogram", "humantime", "hyper-util", - "prost 0.13.5", + "prost 0.14.3", "prost-types", "serde", "serde_json", "thread_local", "tokio", "tokio-stream", - "tonic 0.12.3", + "tonic 0.14.4", "tracing", "tracing-core", "tracing-subscriber", @@ -1840,7 +1753,7 @@ checksum = "a782b93fae93e57ca8ad3e9e994e784583f5933aeaaa5c80a545c4b437be2047" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -1864,7 +1777,7 @@ checksum = "e01c9214319017f6ebd8e299036e1f717fa9bb6724e758f7d6fb2477599d1a29" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -2134,7 +2047,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" dependencies = [ "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -2217,7 +2130,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -2369,7 +2282,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -2380,7 +2293,7 @@ checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ "darling_core", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -2484,7 +2397,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -2507,7 +2420,7 @@ dependencies = [ "macroific", "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -2560,7 +2473,7 @@ checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -2581,7 +2494,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -2591,7 +2504,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" dependencies = [ "derive_builder_core", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -2620,7 +2533,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", "unicode-xid", ] @@ -2632,7 +2545,7 @@ checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", "unicode-xid", ] @@ -2711,7 +2624,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -2770,7 +2683,7 @@ version = "1.21.0" dependencies = [ "cosmwasm-std", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -2908,6 +2821,15 @@ dependencies = [ "zeroize", ] +[[package]] +name = "email_address" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e079f19b08ca6239f47f8ba8509c11cf3ea30095831f7fed61441475edd8c449" +dependencies = [ + "serde", +] + [[package]] name = "encode_unicode" version = "1.0.0" @@ -3014,6 +2936,35 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "expect-json" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "869f97f4abe8e78fc812a94ad6b721d72c4fb5532877c79610f2c238d7ccf6c4" +dependencies = [ + "chrono", + "email_address", + "expect-json-macros", + "num", + "regex", + "serde", + "serde_json", + "thiserror 2.0.18", + "typetag", + "uuid", +] + +[[package]] +name = "expect-json-macros" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e6fdf550180a6c29a28cb9aac262dc0064c25735641d2317f670075e9a469d9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + [[package]] name = "extension-storage" version = "1.4.1" @@ -3055,7 +3006,7 @@ dependencies = [ "macroific", "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -3111,6 +3062,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d" dependencies = [ "crc32fast", + "libz-rs-sys", "miniz_oxide", ] @@ -3156,16 +3108,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "forwarded-header-value" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8835f84f38484cc86f110a805655697908257fb9a7af005234060891557198e9" -dependencies = [ - "nonempty", - "thiserror 1.0.69", -] - [[package]] name = "fs-err" version = "2.11.0" @@ -3223,9 +3165,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" dependencies = [ "futures-core", "futures-sink", @@ -3233,9 +3175,9 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" [[package]] name = "futures-executor" @@ -3261,38 +3203,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" +checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" [[package]] name = "futures-macro" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] name = "futures-sink" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" +checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" [[package]] name = "futures-task" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" [[package]] name = "futures-util" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" dependencies = [ "futures-channel", "futures-core", @@ -3302,7 +3244,6 @@ dependencies = [ "futures-task", "memchr", "pin-project-lite", - "pin-utils", "slab", ] @@ -3400,12 +3341,6 @@ dependencies = [ "polyval", ] -[[package]] -name = "gimli" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" - [[package]] name = "glob" version = "0.3.2" @@ -3422,7 +3357,7 @@ dependencies = [ "futures-core", "futures-sink", "gloo-utils 0.2.0", - "http 1.3.1", + "http 1.4.0", "js-sys", "pin-project", "serde", @@ -3523,7 +3458,7 @@ dependencies = [ "fnv", "futures-core", "futures-sink", - "http 1.3.1", + "http 1.4.0", "indexmap 2.13.0", "slab", "tokio", @@ -3636,7 +3571,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -3674,7 +3609,7 @@ dependencies = [ "base64 0.22.1", "bytes", "headers-core", - "http 1.3.1", + "http 1.4.0", "httpdate", "mime", "sha1", @@ -3686,7 +3621,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "54b4a22553d4242c49fddb9ba998a99962b5cc6f22cb5a3482bec22522403ce4" dependencies = [ - "http 1.3.1", + "http 1.4.0", ] [[package]] @@ -3759,7 +3694,7 @@ dependencies = [ "futures-util", "h2 0.4.11", "hickory-proto", - "http 1.3.1", + "http 1.4.0", "idna", "ipnet", "jni 0.22.4", @@ -3910,12 +3845,11 @@ dependencies = [ [[package]] name = "http" -version = "1.3.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" +checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" dependencies = [ "bytes", - "fnv", "itoa", ] @@ -3937,7 +3871,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", - "http 1.3.1", + "http 1.4.0", ] [[package]] @@ -3948,7 +3882,7 @@ checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" dependencies = [ "bytes", "futures-core", - "http 1.3.1", + "http 1.4.0", "http-body 1.0.1", "pin-project-lite", ] @@ -4039,15 +3973,16 @@ dependencies = [ [[package]] name = "hyper" -version = "1.6.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" +checksum = "6299f016b246a94207e63da54dbe807655bf9e00044f73ded42c3ac5305fbcca" dependencies = [ + "atomic-waker", "bytes", "futures-channel", - "futures-util", + "futures-core", "h2 0.4.11", - "http 1.3.1", + "http 1.4.0", "http-body 1.0.1", "httparse", "httpdate", @@ -4078,8 +4013,8 @@ version = "0.27.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" dependencies = [ - "http 1.3.1", - "hyper 1.6.0", + "http 1.4.0", + "hyper 1.9.0", "hyper-util", "rustls 0.23.37", "rustls-native-certs 0.8.3", @@ -4096,7 +4031,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0" dependencies = [ - "hyper 1.6.0", + "hyper 1.9.0", "hyper-util", "pin-project-lite", "tokio", @@ -4105,23 +4040,22 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.15" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f66d5bd4c6f02bf0542fad85d626775bab9258cf795a4256dcaf3161114d1df" +checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" dependencies = [ "base64 0.22.1", "bytes", "futures-channel", - "futures-core", "futures-util", - "http 1.3.1", + "http 1.4.0", "http-body 1.0.1", - "hyper 1.6.0", + "hyper 1.9.0", "ipnet", "libc", "percent-encoding", "pin-project-lite", - "socket2 0.5.10", + "socket2 0.6.0", "tokio", "tower-service", "tracing", @@ -4311,7 +4245,7 @@ checksum = "0ab604ee7085efba6efc65e4ebca0e9533e3aff6cb501d7d77b211e3a781c6d5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -4380,7 +4314,7 @@ dependencies = [ "macroific", "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -4517,17 +4451,6 @@ dependencies = [ "rustversion", ] -[[package]] -name = "io-uring" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b86e202f00093dcba4275d4636b93ef9dd75d025ae560d2521b45ea28ab49013" -dependencies = [ - "bitflags 2.9.1", - "cfg-if", - "libc", -] - [[package]] name = "ip_network" version = "0.4.1" @@ -4652,7 +4575,7 @@ checksum = "03343451ff899767262ec32146f6d559dd759fdadf42ff0e227c7c48f72594b4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -4698,7 +4621,7 @@ dependencies = [ "quote", "rustc_version 0.4.1", "simd_cesu8", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -4723,7 +4646,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" dependencies = [ "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -5015,7 +4938,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffd6aa2dcd5be681662001b81d493f1569c6d49a32361f470b0c955465cd0338" dependencies = [ "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -5184,6 +5107,15 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "libz-rs-sys" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c10501e7805cee23da17c7790e59df2870c0d4043ec6d03f67d31e2b53e77415" +dependencies = [ + "zlib-rs", +] + [[package]] name = "linux-raw-sys" version = "0.4.15" @@ -5321,7 +5253,7 @@ dependencies = [ "proc-macro2", "quote", "sealed", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -5333,7 +5265,7 @@ dependencies = [ "proc-macro2", "quote", "sealed", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -5346,7 +5278,7 @@ dependencies = [ "macroific_core", "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -5380,7 +5312,7 @@ checksum = "ac84fd3f360fcc43dc5f5d186f02a94192761a080e8bc58621ad4d12296a58cf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -5392,12 +5324,6 @@ dependencies = [ "regex-automata", ] -[[package]] -name = "matchit" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" - [[package]] name = "matchit" version = "0.8.4" @@ -5589,23 +5515,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "multer" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83e87776546dc87511aa5ee218730c92b666d7264ab6ed41f9d215af9cd5224b" -dependencies = [ - "bytes", - "encoding_rs", - "futures-util", - "http 1.3.1", - "httparse", - "memchr", - "mime", - "spin", - "version_check", -] - [[package]] name = "ndk-context" version = "0.1.1" @@ -5750,12 +5659,6 @@ dependencies = [ "minimal-lexical", ] -[[package]] -name = "nonempty" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9e591e719385e6ebaeb5ce5d3887f7d5676fceca6411d1925ccc95745f3d6f7" - [[package]] name = "notify" version = "5.2.0" @@ -5792,6 +5695,20 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "num" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + [[package]] name = "num-bigint" version = "0.4.6" @@ -5818,6 +5735,15 @@ dependencies = [ "zeroize", ] +[[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.1.0" @@ -5844,6 +5770,17 @@ dependencies = [ "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" @@ -5873,7 +5810,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -5891,7 +5828,7 @@ version = "1.1.79" dependencies = [ "anyhow", "async-trait", - "axum 0.7.9", + "axum", "axum-test", "bincode", "bip39", @@ -6266,7 +6203,7 @@ dependencies = [ "gloo-timers", "http-body-util", "humantime", - "hyper 1.6.0", + "hyper 1.9.0", "hyper-util", "nym-bandwidth-controller", "nym-client-core-config-types", @@ -6529,7 +6466,7 @@ name = "nym-credential-proxy" version = "0.3.2-rc" dependencies = [ "anyhow", - "axum 0.7.9", + "axum", "bip39", "bs58", "cfg-if", @@ -6578,7 +6515,7 @@ name = "nym-credential-proxy-lib" version = "1.21.0" dependencies = [ "anyhow", - "axum 0.7.9", + "axum", "bip39", "bs58", "futures", @@ -6790,7 +6727,7 @@ version = "1.0.1" dependencies = [ "anyhow", "async-trait", - "axum 0.7.9", + "axum", "blake3", "chrono", "clap", @@ -7183,7 +7120,7 @@ dependencies = [ "encoding_rs", "fastrand", "hickory-resolver", - "http 1.3.1", + "http 1.4.0", "inventory", "itertools 0.14.0", "mime", @@ -7215,7 +7152,7 @@ dependencies = [ "proc-macro2", "quote", "reqwest 0.13.1", - "syn 2.0.106", + "syn 2.0.117", "uuid", ] @@ -7223,7 +7160,7 @@ dependencies = [ name = "nym-http-api-common" version = "1.21.0" dependencies = [ - "axum 0.7.9", + "axum", "axum-client-ip", "bincode", "bytes", @@ -7235,7 +7172,7 @@ dependencies = [ "serde_yaml", "subtle 2.6.1", "time", - "tower 0.5.2", + "tower", "tracing", "utoipa", "zeroize", @@ -7609,7 +7546,7 @@ name = "nym-network-monitor" version = "1.0.2" dependencies = [ "anyhow", - "axum 0.7.9", + "axum", "clap", "dashmap", "futures", @@ -7697,7 +7634,7 @@ dependencies = [ "arc-swap", "arrayref", "async-trait", - "axum 0.7.9", + "axum", "bincode", "bip39", "blake2 0.8.1", @@ -7869,8 +7806,7 @@ version = "4.6.1" dependencies = [ "ammonia", "anyhow", - "axum 0.7.9", - "axum-test", + "axum", "bip39", "bs58", "celes", @@ -8159,7 +8095,7 @@ dependencies = [ "dotenvy", "futures", "hex", - "http 1.3.1", + "http 1.4.0", "httpcodec", "log", "nym-bandwidth-controller", @@ -8538,7 +8474,7 @@ name = "nym-statistics-api" version = "0.3.1" dependencies = [ "anyhow", - "axum 0.7.9", + "axum", "axum-client-ip", "axum-extra", "celes", @@ -8994,7 +8930,7 @@ version = "1.21.0" dependencies = [ "anyhow", "async-trait", - "axum 0.7.9", + "axum", "futures", "nym-credential-verification", "nym-credentials-interface", @@ -9012,7 +8948,7 @@ dependencies = [ name = "nym-wireguard-private-metadata-shared" version = "1.21.0" dependencies = [ - "axum 0.7.9", + "axum", "bincode", "nym-credentials-interface", "schemars 0.8.22", @@ -9026,7 +8962,7 @@ name = "nym-wireguard-private-metadata-tests" version = "1.21.0" dependencies = [ "async-trait", - "axum 0.7.9", + "axum", "futures", "nym-credential-verification", "nym-credentials-interface", @@ -9040,7 +8976,7 @@ dependencies = [ "nym-wireguard-private-metadata-shared", "time", "tokio", - "tower 0.5.2", + "tower", "tower-http", "utoipa", ] @@ -9094,7 +9030,7 @@ version = "0.1.15" dependencies = [ "anyhow", "async-trait", - "axum 0.7.9", + "axum", "chrono", "clap", "nym-bin-common", @@ -9196,15 +9132,6 @@ dependencies = [ "objc2-core-foundation", ] -[[package]] -name = "object" -version = "0.36.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" -dependencies = [ - "memchr", -] - [[package]] name = "once_cell" version = "1.21.3" @@ -9273,7 +9200,7 @@ checksum = "d7a6d09a73194e6b66df7c8f1b680f156d916a1a942abf2de06823dd02b7855d" dependencies = [ "async-trait", "bytes", - "http 1.3.1", + "http 1.4.0", "opentelemetry", "reqwest 0.12.22", ] @@ -9284,7 +9211,7 @@ version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a2366db2dca4d2ad033cad11e6ee42844fd727007af5ad04a1730f4cb8163bf" dependencies = [ - "http 1.3.1", + "http 1.4.0", "opentelemetry", "opentelemetry-http", "opentelemetry-proto", @@ -9521,7 +9448,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -9584,7 +9511,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -9613,7 +9540,7 @@ checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -9717,7 +9644,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -9866,7 +9793,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" dependencies = [ "proc-macro2", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -9906,14 +9833,14 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] name = "proc-macro2" -version = "1.0.95" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" dependencies = [ "unicode-ident", ] @@ -9972,7 +9899,7 @@ dependencies = [ "itertools 0.14.0", "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -9985,16 +9912,16 @@ dependencies = [ "itertools 0.14.0", "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] name = "prost-types" -version = "0.13.5" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52c2c1bf36ddb1a1c396b3601a3cec27c2462e45f07c386894ec3ccf5332bd16" +checksum = "8991c4cbdb8bc5b11f0b074ffe286c30e523de90fee5ba8132f1399f23cb3dd7" dependencies = [ - "prost 0.13.5", + "prost 0.14.3", ] [[package]] @@ -10106,9 +10033,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.40" +version = "1.0.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" dependencies = [ "proc-macro2", ] @@ -10268,7 +10195,7 @@ checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -10354,10 +10281,10 @@ dependencies = [ "futures-core", "futures-util", "h2 0.4.11", - "http 1.3.1", + "http 1.4.0", "http-body 1.0.1", "http-body-util", - "hyper 1.6.0", + "hyper 1.9.0", "hyper-rustls 0.27.7", "hyper-util", "js-sys", @@ -10375,7 +10302,7 @@ dependencies = [ "tokio", "tokio-rustls 0.26.2", "tokio-util", - "tower 0.5.2", + "tower", "tower-http", "tower-service", "url", @@ -10395,10 +10322,10 @@ dependencies = [ "bytes", "futures-core", "futures-util", - "http 1.3.1", + "http 1.4.0", "http-body 1.0.1", "http-body-util", - "hyper 1.6.0", + "hyper 1.9.0", "hyper-rustls 0.27.7", "hyper-util", "js-sys", @@ -10416,7 +10343,7 @@ dependencies = [ "tokio", "tokio-rustls 0.26.2", "tokio-util", - "tower 0.5.2", + "tower", "tower-http", "tower-service", "url", @@ -10428,9 +10355,9 @@ dependencies = [ [[package]] name = "reserve-port" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21918d6644020c6f6ef1993242989bf6d4952d2e025617744f184c02df51c356" +checksum = "94070964579245eb2f76e62a7668fe87bd9969ed6c41256f3bf614e3323dd3cc" dependencies = [ "thiserror 2.0.18", ] @@ -10546,7 +10473,7 @@ dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn 2.0.106", + "syn 2.0.117", "walkdir", ] @@ -10562,26 +10489,19 @@ dependencies = [ [[package]] name = "rust-multipart-rfc7578_2" -version = "0.6.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b748410c0afdef2ebbe3685a6a862e2ee937127cdaae623336a459451c8d57" +checksum = "00bdaa068902270ca7fa8619775e1838e23a63620abac0947ce0f715819b8cec" dependencies = [ "bytes", "futures-core", "futures-util", - "http 0.2.12", + "http 1.4.0", "mime", - "mime_guess", - "rand 0.8.6", - "thiserror 1.0.69", + "rand 0.10.1", + "thiserror 2.0.18", ] -[[package]] -name = "rustc-demangle" -version = "0.1.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f" - [[package]] name = "rustc-hash" version = "2.1.1" @@ -10882,7 +10802,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals 0.29.1", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -10914,7 +10834,7 @@ checksum = "1783eabc414609e28a5ba76aee5ddd52199f7107a0b24c2e9746a1ecc34a683d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -10935,7 +10855,7 @@ checksum = "22f968c5ea23d555e670b449c1c5e7b2fc399fdaec1d304a17cd48e288abc107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -11121,7 +11041,7 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -11132,7 +11052,7 @@ checksum = "e578a843d40b4189a4d66bba51d7684f57da5bd7c304c64e14bd63efbef49509" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -11143,7 +11063,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -11206,7 +11126,7 @@ checksum = "aafbefbe175fa9bf03ca83ef89beecff7d2a95aaacd5732325b90ac8c3bd7b90" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -11236,7 +11156,7 @@ checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -11298,7 +11218,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -11533,7 +11453,7 @@ dependencies = [ "hickory-proto", "hickory-resolver", "http-body-util", - "hyper 1.6.0", + "hyper 1.9.0", "hyper-util", "nym-bin-common", "nym-ip-packet-requests", @@ -11740,7 +11660,7 @@ dependencies = [ "quote", "sqlx-core", "sqlx-macros-core", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -11763,7 +11683,7 @@ dependencies = [ "sqlx-mysql", "sqlx-postgres", "sqlx-sqlite", - "syn 2.0.106", + "syn 2.0.117", "tokio", "url", ] @@ -11968,7 +11888,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -11980,7 +11900,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -12039,9 +11959,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.106" +version = "2.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" dependencies = [ "proc-macro2", "quote", @@ -12071,7 +11991,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -12146,7 +12066,7 @@ dependencies = [ "camino", "crossbeam-channel", "home", - "http 1.3.1", + "http 1.4.0", "libc", "memchr", "rayon", @@ -12326,7 +12246,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -12364,7 +12284,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -12375,7 +12295,7 @@ checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -12474,39 +12394,36 @@ checksum = "2d2e76690929402faae40aebdda620a2c0e25dd6d3b9afe48867dfd95991f4bd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] name = "tokio" -version = "1.47.1" +version = "1.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89e49afdadebb872d3145a5638b59eb0691ea23e46ca484037cfab3b76b95038" +checksum = "27ad5e34374e03cfffefc301becb44e9dc3c17584f414349ebe29ed26661822d" dependencies = [ - "backtrace", "bytes", - "io-uring", "libc", "mio 1.0.4", "parking_lot", "pin-project-lite", "signal-hook-registry", - "slab", "socket2 0.6.0", "tokio-macros", "tracing", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] name = "tokio-macros" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" +checksum = "5c55a2eff8b69ce66c84f85e1da1c233edc36ceb85a2058d11b0d6a3c7e7569c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -12669,7 +12586,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37e04c1865c281139e5ccf633cb9f76ffdaabeebfe53b703984cf82878e2aabb" dependencies = [ "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -12783,36 +12700,6 @@ 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.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" -dependencies = [ - "async-stream", - "async-trait", - "axum 0.7.9", - "base64 0.22.1", - "bytes", - "h2 0.4.11", - "http 1.3.1", - "http-body 1.0.1", - "http-body-util", - "hyper 1.6.0", - "hyper-timeout", - "hyper-util", - "percent-encoding", - "pin-project", - "prost 0.13.5", - "socket2 0.5.10", - "tokio", - "tokio-stream", - "tower 0.4.13", - "tower-layer", - "tower-service", - "tracing", -] - [[package]] name = "tonic" version = "0.13.1" @@ -12823,10 +12710,10 @@ dependencies = [ "base64 0.22.1", "bytes", "h2 0.4.11", - "http 1.3.1", + "http 1.4.0", "http-body 1.0.1", "http-body-util", - "hyper 1.6.0", + "hyper 1.9.0", "hyper-timeout", "hyper-util", "percent-encoding", @@ -12835,7 +12722,7 @@ dependencies = [ "socket2 0.5.10", "tokio", "tokio-stream", - "tower 0.5.2", + "tower", "tower-layer", "tower-service", "tracing", @@ -12848,14 +12735,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f32a6f80051a4111560201420c7885d0082ba9efe2ab61875c587bb6b18b9a0" dependencies = [ "async-trait", - "axum 0.8.8", + "axum", "base64 0.22.1", "bytes", "h2 0.4.11", - "http 1.3.1", + "http 1.4.0", "http-body 1.0.1", "http-body-util", - "hyper 1.6.0", + "hyper 1.9.0", "hyper-timeout", "hyper-util", "percent-encoding", @@ -12866,7 +12753,7 @@ dependencies = [ "tokio", "tokio-rustls 0.26.2", "tokio-stream", - "tower 0.5.2", + "tower", "tower-layer", "tower-service", "tracing", @@ -12885,29 +12772,9 @@ dependencies = [ [[package]] name = "tower" -version = "0.4.13" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "indexmap 1.9.3", - "pin-project", - "pin-project-lite", - "rand 0.8.6", - "slab", - "tokio", - "tokio-util", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" dependencies = [ "futures-core", "futures-util", @@ -12933,7 +12800,7 @@ dependencies = [ "bytes", "futures-core", "futures-util", - "http 1.3.1", + "http 1.4.0", "http-body 1.0.1", "http-body-util", "http-range-header", @@ -12945,7 +12812,7 @@ dependencies = [ "pin-project-lite", "tokio", "tokio-util", - "tower 0.5.2", + "tower", "tower-layer", "tower-service", "tracing", @@ -12983,7 +12850,7 @@ checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -13071,7 +12938,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04659ddb06c87d233c566112c1c9c5b9e98256d9af50ec3bc9c8327f873a7568" dependencies = [ "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -13142,7 +13009,7 @@ checksum = "38d90eea51bc7988ef9e674bf80a85ba6804739e535e9cab48e4bb34a8b652aa" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", "termcolor", ] @@ -13169,7 +13036,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals 0.28.0", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -13202,7 +13069,7 @@ dependencies = [ "byteorder", "bytes", "data-encoding", - "http 1.3.1", + "http 1.4.0", "httparse", "log", "rand 0.8.6", @@ -13237,7 +13104,7 @@ checksum = "016c26257f448222014296978b2c8456e2cad4de308c35bdb1e383acd569ef5b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -13252,6 +13119,30 @@ version = "1.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40ce102ab67701b8526c123c1bab5cbe42d7040ccfd0f64af1a385808d2f43de" +[[package]] +name = "typetag" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be2212c8a9b9bcfca32024de14998494cf9a5dfa59ea1b829de98bac374b86bf" +dependencies = [ + "erased-serde", + "inventory", + "once_cell", + "serde", + "typetag-impl", +] + +[[package]] +name = "typetag-impl" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27a7a9b72ba121f6f1f6c3632b85604cac41aedb5ddc70accbebb6cac83de846" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + [[package]] name = "ucd-trie" version = "0.1.7" @@ -13457,7 +13348,7 @@ dependencies = [ "indexmap 2.13.0", "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -13470,7 +13361,7 @@ dependencies = [ "indexmap 2.13.0", "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -13485,7 +13376,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.106", + "syn 2.0.117", "toml 0.5.11", "uniffi_meta 0.29.3", ] @@ -13502,7 +13393,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.106", + "syn 2.0.117", "toml 0.9.12+spec-1.1.0", "uniffi_meta 0.31.0", ] @@ -13661,17 +13552,17 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.106", + "syn 2.0.117", "uuid", ] [[package]] name = "utoipa-swagger-ui" -version = "8.1.0" +version = "9.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db4b5ac679cc6dfc5ea3f2823b0291c777750ffd5e13b21137e0f7ac0e8f9617" +checksum = "d047458f1b5b65237c2f6dc6db136945667f40a7668627b3490b9513a3d43a55" dependencies = [ - "axum 0.7.9", + "axum", "base64 0.22.1", "mime_guess", "regex", @@ -13700,7 +13591,7 @@ checksum = "268d76aaebb80eba79240b805972e52d7d410d4bcc52321b951318b0f440cd60" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -13711,7 +13602,7 @@ checksum = "382673bda1d05c85b4550d32fd4192ccd4cffe9a908543a0795d1e7682b36246" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", "utoipauto-core", ] @@ -13942,7 +13833,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", "wasm-bindgen-shared", ] @@ -13977,7 +13868,7 @@ checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -14012,7 +13903,7 @@ checksum = "17d5042cc5fa009658f9a7333ef24291b1291a25b6382dd68862a7f3b969f69b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -14312,7 +14203,7 @@ checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -14323,7 +14214,7 @@ checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -14782,7 +14673,7 @@ dependencies = [ "heck 0.5.0", "indexmap 2.13.0", "prettyplease", - "syn 2.0.106", + "syn 2.0.117", "wasm-metadata", "wit-bindgen-core", "wit-component", @@ -14798,7 +14689,7 @@ dependencies = [ "prettyplease", "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", "wit-bindgen-core", "wit-bindgen-rust", ] @@ -14903,7 +14794,7 @@ checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", "synstructure", ] @@ -14924,7 +14815,7 @@ checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -14944,7 +14835,7 @@ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", "synstructure", ] @@ -14965,7 +14856,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] @@ -14998,23 +14889,20 @@ checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.117", ] [[package]] name = "zip" -version = "2.4.2" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fabe6324e908f85a1c52063ce7aa26b68dcb7eb6dbc83a2d148403c9bc3eba50" +checksum = "12598812502ed0105f607f941c386f43d441e00148fce9dec3ca5ffb0bde9308" dependencies = [ "arbitrary", "crc32fast", - "crossbeam-utils", - "displaydoc", "flate2", "indexmap 2.13.0", "memchr", - "thiserror 2.0.18", "zopfli", ] @@ -15037,6 +14925,12 @@ dependencies = [ "zeroize", ] +[[package]] +name = "zlib-rs" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40990edd51aae2c2b6907af74ffb635029d5788228222c4bb811e9351c0caad3" + [[package]] name = "zmij" version = "1.0.21" diff --git a/Cargo.toml b/Cargo.toml index 95d08ed7be..41bdb09cf1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -222,10 +222,10 @@ anyhow = "1.0.98" arc-swap = "1.7.1" argon2 = "0.5.0" async-trait = "0.1.88" -axum = "0.7.5" -axum-client-ip = "0.6.1" -axum-extra = "0.9.4" -axum-test = "16.2.0" +axum = "0.8.9" +axum-client-ip = "1.3.1" +axum-extra = "0.12.6" +axum-test = "20.0.0" base64 = "0.22.1" base85rs = "0.1.3" bincode = "1.3.3" @@ -250,7 +250,7 @@ clap_complete_fig = "4.5" colored = "2.2" comfy-table = "7.1.4" console = "0.16.0" -console-subscriber = "0.4.1" +console-subscriber = "0.5.0" console_error_panic_hook = "0.1" const-str = "0.5.6" const_format = "0.2.34" @@ -392,7 +392,7 @@ uniffi = "0.29.2" uniffi_build = "0.29.0" url = "2.5" utoipa = "5.2" -utoipa-swagger-ui = "8.1" +utoipa-swagger-ui = "9.0.2" utoipauto = "0.2" uuid = "1.19.0" vergen = { version = "=8.3.1", default-features = false } diff --git a/common/http-api-common/src/middleware/client_ip.rs b/common/http-api-common/src/middleware/client_ip.rs new file mode 100644 index 0000000000..a206ce9ec8 --- /dev/null +++ b/common/http-api-common/src/middleware/client_ip.rs @@ -0,0 +1,39 @@ +// Copyright 2026 - Nym Technologies SA +// SPDX-License-Identifier: Apache-2.0 + +use axum::extract::{ConnectInfo, FromRequestParts}; +use axum::http::request::Parts; +use axum_client_ip::RightmostXForwardedFor; +use std::convert::Infallible; +use std::net::{IpAddr, Ipv4Addr, SocketAddr}; +use tracing::warn; + +/// Best-effort client IP extractor. +/// +/// Prefers the rightmost entry of `X-Forwarded-For` (set by a trusted reverse +/// proxy); falls back to the TCP peer address when the header is absent, and to +/// the unspecified address when neither is available (tests). +#[derive(Debug, Clone, Copy)] +pub struct ClientIpAddr(pub IpAddr); + +impl FromRequestParts for ClientIpAddr +where + S: Send + Sync, +{ + type Rejection = Infallible; + + async fn from_request_parts(parts: &mut Parts, state: &S) -> Result { + if let Ok(RightmostXForwardedFor(ip)) = + RightmostXForwardedFor::from_request_parts(parts, state).await + { + return Ok(ClientIpAddr(ip)); + } + if let Ok(ConnectInfo(addr)) = + ConnectInfo::::from_request_parts(parts, state).await + { + return Ok(ClientIpAddr(addr.ip())); + } + warn!("ClientIpAddr: no X-Forwarded-For or ConnectInfo found; using 0.0.0.0 fallback"); + Ok(ClientIpAddr(IpAddr::V4(Ipv4Addr::UNSPECIFIED))) + } +} diff --git a/common/http-api-common/src/middleware/logging.rs b/common/http-api-common/src/middleware/logging.rs index dfa03d5b50..f5ca3639d9 100644 --- a/common/http-api-common/src/middleware/logging.rs +++ b/common/http-api-common/src/middleware/logging.rs @@ -1,12 +1,12 @@ // Copyright 2024 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 +use crate::middleware::client_ip::ClientIpAddr; use axum::extract::Request; use axum::http::HeaderValue; use axum::http::header::{HOST, USER_AGENT}; use axum::middleware::Next; use axum::response::IntoResponse; -use axum_client_ip::InsecureClientIp; use colored::Colorize; use std::time::Instant; use tracing::{debug, info}; @@ -17,24 +17,24 @@ enum LogLevel { } pub async fn log_request_info( - insecure_client_ip: InsecureClientIp, + client_ip: ClientIpAddr, request: Request, next: Next, ) -> impl IntoResponse { - log_request(insecure_client_ip, request, next, LogLevel::Info).await + log_request(client_ip, request, next, LogLevel::Info).await } pub async fn log_request_debug( - insecure_client_ip: InsecureClientIp, + client_ip: ClientIpAddr, request: Request, next: Next, ) -> impl IntoResponse { - log_request(insecure_client_ip, request, next, LogLevel::Debug).await + log_request(client_ip, request, next, LogLevel::Debug).await } /// Simple logger for requests async fn log_request( - InsecureClientIp(addr): InsecureClientIp, + ClientIpAddr(addr): ClientIpAddr, request: Request, next: Next, level: LogLevel, diff --git a/common/http-api-common/src/middleware/mod.rs b/common/http-api-common/src/middleware/mod.rs index d81923bce5..13763b71dd 100644 --- a/common/http-api-common/src/middleware/mod.rs +++ b/common/http-api-common/src/middleware/mod.rs @@ -2,4 +2,5 @@ // SPDX-License-Identifier: Apache-2.0 pub mod bearer_auth; +pub mod client_ip; pub mod logging; diff --git a/common/wireguard-private-metadata/tests/src/mock_connect_info.rs b/common/wireguard-private-metadata/tests/src/mock_connect_info.rs index 95633d9e01..d9b05695ee 100644 --- a/common/wireguard-private-metadata/tests/src/mock_connect_info.rs +++ b/common/wireguard-private-metadata/tests/src/mock_connect_info.rs @@ -1,7 +1,6 @@ // Copyright 2025 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 -use async_trait::async_trait; use axum::extract::FromRequestParts; use axum::http::Request; use axum::http::request::Parts; @@ -56,7 +55,6 @@ impl DummyConnectInfo { } } -#[async_trait] impl FromRequestParts for DummyConnectInfo where S: Send + Sync, diff --git a/common/wireguard-private-metadata/tests/src/v2/network.rs b/common/wireguard-private-metadata/tests/src/v2/network.rs index fd2520e8e5..3d289ae97e 100644 --- a/common/wireguard-private-metadata/tests/src/v2/network.rs +++ b/common/wireguard-private-metadata/tests/src/v2/network.rs @@ -57,7 +57,7 @@ pub(crate) mod test { async fn handle_check_request(&mut self, polled_request: CheckRequest) { let mut requests = vec![polled_request]; - while let Ok(Some(queued_up)) = self.check_request_receiver.try_next() { + while let Ok(queued_up) = self.check_request_receiver.try_recv() { requests.push(queued_up); } diff --git a/gateway/src/node/upgrade_mode/watcher.rs b/gateway/src/node/upgrade_mode/watcher.rs index 509e89c5f5..34bab4346e 100644 --- a/gateway/src/node/upgrade_mode/watcher.rs +++ b/gateway/src/node/upgrade_mode/watcher.rs @@ -121,7 +121,7 @@ impl UpgradeModeWatcher { async fn handle_check_request(&mut self, polled_request: CheckRequest) { let mut requests = vec![polled_request]; - while let Ok(Some(queued_up)) = self.check_request_receiver.try_next() { + while let Ok(queued_up) = self.check_request_receiver.try_recv() { requests.push(queued_up); } diff --git a/nym-api/src/ecash/api_routes/issued.rs b/nym-api/src/ecash/api_routes/issued.rs index 914b087b97..34c0db5aa5 100644 --- a/nym-api/src/ecash/api_routes/issued.rs +++ b/nym-api/src/ecash/api_routes/issued.rs @@ -32,15 +32,15 @@ pub(crate) fn issued_routes() -> Router { axum::routing::get(issued_ticketbooks_count), ) .route( - "/issued-ticketbooks-for-count/:expiration_date", + "/issued-ticketbooks-for-count/{expiration_date}", axum::routing::get(issued_ticketbooks_for_count), ) .route( - "/issued-ticketbooks-on-count/:issuance_date", + "/issued-ticketbooks-on-count/{issuance_date}", axum::routing::get(issued_ticketbooks_on_count), ) .route( - "/issued-ticketbooks-for/:expiration_date", + "/issued-ticketbooks-for/{expiration_date}", axum::routing::get(issued_ticketbooks_for), ) .route( diff --git a/nym-api/src/ecash/tests/mod.rs b/nym-api/src/ecash/tests/mod.rs index 20781ccbaf..78394fbd75 100644 --- a/nym-api/src/ecash/tests/mod.rs +++ b/nym-api/src/ecash/tests/mod.rs @@ -1369,8 +1369,7 @@ impl TestFixture { Router::new() .nest("/v1/ecash", ecash_routes()) .with_state(app_state), - ) - .unwrap(), + ), storage, chain_state: bundle.chain_state, epoch: bundle.epoch, diff --git a/nym-api/src/node_families/handlers/mod.rs b/nym-api/src/node_families/handlers/mod.rs index f0a587c783..bda7dc06d6 100644 --- a/nym-api/src/node_families/handlers/mod.rs +++ b/nym-api/src/node_families/handlers/mod.rs @@ -23,8 +23,8 @@ const MAX_FAMILIES_PAGE_SIZE: u32 = 200; pub(crate) fn routes() -> Router { Router::new() .route("/", get(get_families)) - .route("/:family_id", get(get_family_by_id)) - .route("/by-node/:node_id", get(get_family_for_node)) + .route("/{family_id}", get(get_family_by_id)) + .route("/by-node/{node_id}", get(get_family_for_node)) } #[utoipa::path( diff --git a/nym-api/src/node_families/tests.rs b/nym-api/src/node_families/tests.rs index 9db626acc8..e6f5014218 100644 --- a/nym-api/src/node_families/tests.rs +++ b/nym-api/src/node_families/tests.rs @@ -52,8 +52,7 @@ impl NodeFamiliesTestFixture { Router::new() .nest("/v1/node-families", handlers::routes()) .with_state(app_state), - ) - .unwrap(); + ); NodeFamiliesTestFixture { axum: server, diff --git a/nym-api/src/node_status_api/handlers/network_monitor.rs b/nym-api/src/node_status_api/handlers/network_monitor.rs index 5a29f09b30..14942d520e 100644 --- a/nym-api/src/node_status_api/handlers/network_monitor.rs +++ b/nym-api/src/node_status_api/handlers/network_monitor.rs @@ -25,7 +25,7 @@ use utoipa::IntoParams; pub(super) fn network_monitor_routes() -> Router { Router::new() .nest( - "/gateway/:identity", + "/gateway/{identity}", Router::new() .route("/history", axum::routing::get(gateway_uptime_history)) .route( @@ -34,7 +34,7 @@ pub(super) fn network_monitor_routes() -> Router { ), ) .nest( - "/mixnode/:mix_id", + "/mixnode/{mix_id}", Router::new() .route("/history", axum::routing::get(mixnode_uptime_history)) .route( @@ -45,14 +45,14 @@ pub(super) fn network_monitor_routes() -> Router { .nest( "/mixnodes", Router::new().route( - "/unstable/:mix_id/test-results", + "/unstable/{mix_id}/test-results", axum::routing::get(unstable::mixnode_test_results), ), ) .nest( "/gateways", Router::new().route( - "/unstable/:gateway_identity/test-results", + "/unstable/{gateway_identity}/test-results", axum::routing::get(unstable::gateway_test_results), ), ) @@ -60,7 +60,7 @@ pub(super) fn network_monitor_routes() -> Router { "/network-monitor/unstable", Router::new() .route( - "/run/:monitor_run_id/details", + "/run/{monitor_run_id}/details", axum::routing::get(monitor_run_report), ) .route( diff --git a/nym-api/src/nym_nodes/handlers/v1.rs b/nym-api/src/nym_nodes/handlers/v1.rs index ce004731ed..1b0968084f 100644 --- a/nym-api/src/nym_nodes/handlers/v1.rs +++ b/nym-api/src/nym_nodes/handlers/v1.rs @@ -30,19 +30,22 @@ pub(crate) fn routes() -> Router { .route("/noise", get(nodes_noise)) .route("/bonded", get(get_bonded_nodes)) .route("/described", get(get_described_nodes)) - .route("/annotation/:node_id", get(get_node_annotation)) - .route("/performance/:node_id", get(get_current_node_performance)) - .route("/stake-saturation/:node_id", get(get_node_stake_saturation)) + .route("/annotation/{node_id}", get(get_node_annotation)) + .route("/performance/{node_id}", get(get_current_node_performance)) .route( - "/historical-performance/:node_id", + "/stake-saturation/{node_id}", + get(get_node_stake_saturation), + ) + .route( + "/historical-performance/{node_id}", get(get_historical_performance), ) .route( - "/performance-history/:node_id", + "/performance-history/{node_id}", get(get_node_performance_history), ) // to make it compatible with all the explorers that were used to using 0-100 values - .route("/uptime-history/:node_id", get(get_node_uptime_history)) + .route("/uptime-history/{node_id}", get(get_node_uptime_history)) .route("/rewarded-set", get(rewarded_set)) .layer(CompressionLayer::new()) } diff --git a/nym-api/src/unstable_routes/v1/account/mod.rs b/nym-api/src/unstable_routes/v1/account/mod.rs index 8b7b83d11c..7186f50105 100644 --- a/nym-api/src/unstable_routes/v1/account/mod.rs +++ b/nym-api/src/unstable_routes/v1/account/mod.rs @@ -22,7 +22,7 @@ pub(crate) mod data_collector; pub(crate) mod models; pub(crate) fn routes() -> Router { - Router::new().route("/:address", get(address)) + Router::new().route("/{address}", get(address)) } #[derive(Clone, Debug, Serialize, Deserialize, ToSchema, utoipa::IntoParams)] diff --git a/nym-credential-proxy/nym-credential-proxy-requests/src/lib.rs b/nym-credential-proxy/nym-credential-proxy-requests/src/lib.rs index 54ba8126b5..9a0e5ea7c4 100644 --- a/nym-credential-proxy/nym-credential-proxy-requests/src/lib.rs +++ b/nym-credential-proxy/nym-credential-proxy-requests/src/lib.rs @@ -62,9 +62,9 @@ pub mod routes { pub mod shares { use super::*; - pub const SHARE_BY_ID: &str = "/:share_id"; + pub const SHARE_BY_ID: &str = "/{share_id}"; pub const SHARE_BY_DEVICE_AND_CREDENTIAL_ID: &str = - "/device/:device_id/credential/:credential_id"; + "/device/{device_id}/credential/{credential_id}"; absolute_route!(share_by_id_absolute, shares_absolute(), SHARE_BY_ID); absolute_route!( diff --git a/nym-data-observatory/src/http/api/mod.rs b/nym-data-observatory/src/http/api/mod.rs index ee0fbe8563..1cd024c4f8 100644 --- a/nym-data-observatory/src/http/api/mod.rs +++ b/nym-data-observatory/src/http/api/mod.rs @@ -77,3 +77,13 @@ fn setup_cors() -> CorsLayer { .allow_headers(tower_http::cors::Any) .allow_credentials(false) } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn router_constructs_without_panic() { + let _ = RouterBuilder::with_default_routes().finalize_routes(); + } +} diff --git a/nym-network-monitor/src/http.rs b/nym-network-monitor/src/http.rs index b2eedd53fc..57fc0bcfa9 100644 --- a/nym-network-monitor/src/http.rs +++ b/nym-network-monitor/src/http.rs @@ -58,6 +58,21 @@ impl AppState { } } +fn build_router(state: AppState) -> Router { + Router::new() + .route("/v1/send", post(send_handler).with_state(state)) + .merge(SwaggerUi::new("/v1/ui").url("/v1/docs/openapi.json", ApiDoc::openapi())) + .route("/v1/accounting", get(accounting_handler)) + .route("/v1/sent", get(sent_handler)) + .route("/v1/dot/{mix_id}", get(mix_dot_handler)) + .route("/v1/dot", get(graph_handler)) + .route("/v1/mermaid", get(mermaid_handler)) + .route("/v1/stats", get(stats_handler)) + .route("/v1/node_stats/{mix_id}", get(node_stats_handler)) + .route("/v1/node_stats", get(all_nodes_stats_handler)) + .route("/v1/received", get(recv_handler)) +} + impl HttpServer { pub fn new(listener: SocketAddr, cancel: CancellationToken) -> Self { HttpServer { listener, cancel } @@ -66,18 +81,7 @@ impl HttpServer { pub async fn run(self, clients: ClientsWrapper) -> anyhow::Result<()> { let n_clients = clients.read().await.len(); let state = AppState { clients }; - let app = Router::new() - .route("/v1/send", post(send_handler).with_state(state)) - .merge(SwaggerUi::new("/v1/ui").url("/v1/docs/openapi.json", ApiDoc::openapi())) - .route("/v1/accounting", get(accounting_handler)) - .route("/v1/sent", get(sent_handler)) - .route("/v1/dot/:mix_id", get(mix_dot_handler)) - .route("/v1/dot", get(graph_handler)) - .route("/v1/mermaid", get(mermaid_handler)) - .route("/v1/stats", get(stats_handler)) - .route("/v1/node_stats/:mix_id", get(node_stats_handler)) - .route("/v1/node_stats", get(all_nodes_stats_handler)) - .route("/v1/received", get(recv_handler)); + let app = build_router(state); let listener = tokio::net::TcpListener::bind(self.listener).await?; let server_future = @@ -98,3 +102,17 @@ impl HttpServer { Ok(()) } } + +#[cfg(test)] +mod tests { + use super::*; + use std::collections::VecDeque; + use std::sync::Arc; + use tokio::sync::RwLock; + + #[test] + fn router_constructs_without_panic() { + let clients: ClientsWrapper = Arc::new(RwLock::new(VecDeque::new())); + let _ = build_router(AppState { clients }); + } +} diff --git a/nym-node-status-api/nym-node-status-api/Cargo.toml b/nym-node-status-api/nym-node-status-api/Cargo.toml index 94fd77efe1..4cc150bc6f 100644 --- a/nym-node-status-api/nym-node-status-api/Cargo.toml +++ b/nym-node-status-api/nym-node-status-api/Cargo.toml @@ -84,6 +84,5 @@ sqlx = { workspace = true, features = [ ] } [dev-dependencies] -axum-test = { workspace = true } time = { workspace = true, features = ["macros"] } nym-gateway-probe = { workspace = true, features = ["test-utils"] } diff --git a/nym-node-status-api/nym-node-status-api/src/http/api/dvpn/country.rs b/nym-node-status-api/nym-node-status-api/src/http/api/dvpn/country.rs index 3279a08447..0a4db47549 100644 --- a/nym-node-status-api/nym-node-status-api/src/http/api/dvpn/country.rs +++ b/nym-node-status-api/nym-node-status-api/src/http/api/dvpn/country.rs @@ -13,7 +13,7 @@ use crate::http::{error::HttpResult, state::AppState}; pub(crate) fn routes() -> Router { Router::new() .route( - "/country/:two_letter_country_code", + "/country/{two_letter_country_code}", axum::routing::get(get_gateways_by_country), ) .route("/countries", axum::routing::get(get_gateway_countries)) diff --git a/nym-node-status-api/nym-node-status-api/src/http/api/dvpn/entry.rs b/nym-node-status-api/nym-node-status-api/src/http/api/dvpn/entry.rs index 03bfa3f0b6..d1ede3b909 100644 --- a/nym-node-status-api/nym-node-status-api/src/http/api/dvpn/entry.rs +++ b/nym-node-status-api/nym-node-status-api/src/http/api/dvpn/entry.rs @@ -18,7 +18,7 @@ pub(crate) fn routes() -> Router { axum::routing::get(get_entry_gateway_countries), ) .route( - "/entry/country/:two_letter_country_code", + "/entry/country/{two_letter_country_code}", axum::routing::get(get_entry_gateways_by_country), ) } diff --git a/nym-node-status-api/nym-node-status-api/src/http/api/dvpn/exit.rs b/nym-node-status-api/nym-node-status-api/src/http/api/dvpn/exit.rs index e745df9068..7f3341e92c 100644 --- a/nym-node-status-api/nym-node-status-api/src/http/api/dvpn/exit.rs +++ b/nym-node-status-api/nym-node-status-api/src/http/api/dvpn/exit.rs @@ -18,7 +18,7 @@ pub(crate) fn routes() -> Router { axum::routing::get(get_entry_gateway_countries), ) .route( - "/exit/country/:two_letter_country_code", + "/exit/country/{two_letter_country_code}", axum::routing::get(get_exit_gateways_by_country), ) } diff --git a/nym-node-status-api/nym-node-status-api/src/http/api/gateways.rs b/nym-node-status-api/nym-node-status-api/src/http/api/gateways.rs index ac24be2351..0270de9abf 100644 --- a/nym-node-status-api/nym-node-status-api/src/http/api/gateways.rs +++ b/nym-node-status-api/nym-node-status-api/src/http/api/gateways.rs @@ -16,7 +16,7 @@ pub(crate) fn routes() -> Router { Router::new() .route("/", axum::routing::get(gateways)) .route("/skinny", axum::routing::get(gateways_skinny)) - .route("/:identity_key", axum::routing::get(get_gateway)) + .route("/{identity_key}", axum::routing::get(get_gateway)) } #[utoipa::path( diff --git a/nym-node-status-api/nym-node-status-api/src/http/api/metrics/sessions.rs b/nym-node-status-api/nym-node-status-api/src/http/api/metrics/sessions.rs index f65389f8d8..707a12393b 100644 --- a/nym-node-status-api/nym-node-status-api/src/http/api/metrics/sessions.rs +++ b/nym-node-status-api/nym-node-status-api/src/http/api/metrics/sessions.rs @@ -14,8 +14,8 @@ use crate::http::{ pub(crate) fn routes() -> Router { Router::new().route("/", axum::routing::get(get_all_sessions)) - // .route("/:node_id", axum::routing::get(get_node_sessions)) - // .route("/:day", axum::routing::get(get_daily_sessions)) + // .route("/{node_id}", axum::routing::get(get_node_sessions)) + // .route("/{day}", axum::routing::get(get_daily_sessions)) } #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, utoipa::IntoParams)] diff --git a/nym-node-status-api/nym-node-status-api/src/http/api/nym_nodes.rs b/nym-node-status-api/nym-node-status-api/src/http/api/nym_nodes.rs index ab8e4539c0..e125fa8bac 100644 --- a/nym-node-status-api/nym-node-status-api/src/http/api/nym_nodes.rs +++ b/nym-node-status-api/nym-node-status-api/src/http/api/nym_nodes.rs @@ -18,7 +18,7 @@ pub(crate) fn routes() -> Router { Router::new() .route("/", axum::routing::get(nym_nodes)) .route( - "/:node_id/delegations", + "/{node_id}/delegations", axum::routing::get(node_delegations), ) } diff --git a/nym-node-status-api/nym-node-status-api/src/http/api/testruns.rs b/nym-node-status-api/nym-node-status-api/src/http/api/testruns.rs index d26db1d7df..a449be4ed0 100644 --- a/nym-node-status-api/nym-node-status-api/src/http/api/testruns.rs +++ b/nym-node-status-api/nym-node-status-api/src/http/api/testruns.rs @@ -26,8 +26,8 @@ use tracing::error; pub(crate) fn routes() -> Router { Router::new() .route("/", axum::routing::get(request_testrun)) - .route("/:testrun_id", axum::routing::post(submit_testrun)) - .route("/:testrun_id/v2", axum::routing::post(submit_testrun_v2)) + .route("/{testrun_id}", axum::routing::post(submit_testrun)) + .route("/{testrun_id}/v2", axum::routing::post(submit_testrun_v2)) .layer(DefaultBodyLimit::max(1024 * 1024 * 5)) } diff --git a/nym-node/src/node/http/mod.rs b/nym-node/src/node/http/mod.rs index 17943a71cd..ce3f153b2c 100644 --- a/nym-node/src/node/http/mod.rs +++ b/nym-node/src/node/http/mod.rs @@ -5,8 +5,10 @@ use axum::Router; use axum::extract::ConnectInfo; use axum::extract::connect_info::IntoMakeServiceWithConnectInfo; use axum::middleware::AddExtension; -use axum::serve::Serve; +use axum::serve::WithGracefulShutdown; use std::net::SocketAddr; +use tokio::net::TcpListener; +use tokio_util::sync::WaitForCancellationFutureOwned; pub use router::{HttpServerConfig, NymNodeRouter, api}; @@ -15,6 +17,7 @@ pub mod helpers; pub mod router; pub mod state; -type InnerService = IntoMakeServiceWithConnectInfo; -type ConnectInfoExt = AddExtension>; -pub type NymNodeHttpServer = Serve; +type MakeService = IntoMakeServiceWithConnectInfo; +type InnerService = AddExtension>; +pub type NymNodeHttpServer = + WithGracefulShutdown; diff --git a/nym-node/src/node/http/router/landing_page.rs b/nym-node/src/node/http/router/landing_page.rs index ed3536e371..65d3427dd0 100644 --- a/nym-node/src/node/http/router/landing_page.rs +++ b/nym-node/src/node/http/router/landing_page.rs @@ -14,7 +14,7 @@ pub struct Config { pub(super) fn routes(config: Config) -> Router { if let Some(assets) = config.assets_path { - Router::new().nest_service("/", ServeDir::new(assets)) + Router::new().fallback_service(ServeDir::new(assets)) } else { Router::new().route("/", get(default)) } diff --git a/nym-node/src/node/http/router/mod.rs b/nym-node/src/node/http/router/mod.rs index 4c3618c76f..dfb0c84b08 100644 --- a/nym-node/src/node/http/router/mod.rs +++ b/nym-node/src/node/http/router/mod.rs @@ -22,6 +22,7 @@ use nym_node_requests::routes; use std::net::SocketAddr; use std::path::Path; use std::sync::Arc; +use tokio_util::sync::WaitForCancellationFutureOwned; use zeroize::Zeroizing; pub mod api; @@ -176,7 +177,7 @@ impl NymNodeRouter { Redirect::to(&routes::api::v1::metrics::prometheus_absolute()) }), ) - .nest(routes::LANDING_PAGE, landing_page::routes(config.landing)) + .merge(landing_page::routes(config.landing)) .nest(routes::API, api::routes(config.api)) .layer(axum::middleware::from_fn(logging::log_request_info)) .with_state(state), @@ -186,6 +187,7 @@ impl NymNodeRouter { pub async fn build_server( self, bind_address: &SocketAddr, + shutdown: WaitForCancellationFutureOwned, ) -> Result { let listener = tokio::net::TcpListener::bind(bind_address) .await @@ -198,6 +200,28 @@ impl NymNodeRouter { listener, self.inner .into_make_service_with_connect_info::(), - )) + ) + .with_graceful_shutdown(shutdown)) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use nym_crypto::asymmetric::{ed25519, x25519}; + use nym_node_requests::api::SignedData; + use nym_node_requests::api::v1::lewes_protocol::models::LewesProtocol; + use nym_test_utils::helpers::deterministic_rng; + use std::collections::BTreeMap; + + #[test] + fn router_constructs_without_panic() { + let mut rng = deterministic_rng(); + let signing = ed25519::KeyPair::new(&mut rng); + let x25519_pub: x25519::DHPublicKey = x25519::PrivateKey::new(&mut rng).public_key().into(); + let lp = LewesProtocol::new(false, 0, 0, x25519_pub, BTreeMap::new()); + let signed = SignedData::new(lp, signing.private_key()).unwrap(); + let config = HttpServerConfig::new(signed); + let _ = NymNodeRouter::new(config, AppState::dummy()); } } diff --git a/nym-node/src/node/http/state/mod.rs b/nym-node/src/node/http/state/mod.rs index f1c9f2d81b..cc72217439 100644 --- a/nym-node/src/node/http/state/mod.rs +++ b/nym-node/src/node/http/state/mod.rs @@ -73,4 +73,30 @@ impl AppState { }, } } + + #[cfg(test)] + pub(crate) fn dummy() -> Self { + use crate::node::key_rotation::key::SphinxPrivateKey; + use rand::rngs::OsRng; + + let ed25519_keys = ed25519::KeyPair::new(&mut OsRng); + let attester_pk = *ed25519_keys.public_key(); + let static_information = StaticNodeInformation { + ed25519_identity_keys: Arc::new(ed25519_keys), + x25519_versioned_noise_key: None, + ip_addresses: vec![], + hostname: None, + }; + let active_sphinx = ActiveSphinxKeys::new_fresh(SphinxPrivateKey::new(&mut OsRng, 0)); + + AppState::new( + static_information, + active_sphinx, + NymNodeMetrics::new(), + SharedVerlocStats::default(), + Url::parse("https://attestation.test").unwrap(), + UpgradeModeState::new(attester_pk), + Duration::from_secs(60), + ) + } } diff --git a/nym-node/src/node/mod.rs b/nym-node/src/node/mod.rs index 7f857f3a5b..fef5c629ef 100644 --- a/nym-node/src/node/mod.rs +++ b/nym-node/src/node/mod.rs @@ -81,6 +81,7 @@ use std::ops::Deref; use std::path::Path; use std::sync::Arc; use tokio::sync::mpsc; +use tokio_util::sync::WaitForCancellationFutureOwned; use tracing::{debug, info, trace}; use zeroize::Zeroizing; @@ -872,7 +873,10 @@ impl NymNode { .collect() } - pub(crate) async fn build_http_server(&self) -> Result { + pub(crate) async fn build_http_server( + &self, + shutdown: WaitForCancellationFutureOwned, + ) -> Result { let auxiliary_details = api_requests::v1::node::models::AuxiliaryDetails { location: self.config.host.location, announce_ports: AnnouncePorts { @@ -1023,7 +1027,7 @@ impl NymNode { ); Ok(NymNodeRouter::new(config, app_state) - .build_server(&self.config.http.bind_address) + .build_server(&self.config.http.bind_address, shutdown) .await?) } @@ -1342,16 +1346,17 @@ impl NymNode { ); debug!("config: {:#?}", self.config); - let http_server = self.build_http_server().await?; let bind_address = self.config.http.bind_address; - let server_shutdown = self.shutdown_manager.clone_shutdown_token(); + let shutdown = self + .shutdown_manager + .clone_shutdown_token() + .cancelled_owned(); + let http_server = self.build_http_server(shutdown).await?; self.shutdown_manager.try_spawn_named( async move { info!("starting NymNodeHTTPServer on {bind_address}"); - http_server - .with_graceful_shutdown(async move { server_shutdown.cancelled().await }) - .await + http_server.await }, "HttpApi", ); diff --git a/nym-statistics-api/src/http/api/stats.rs b/nym-statistics-api/src/http/api/stats.rs index 79a3a1180b..5fca0f61b8 100644 --- a/nym-statistics-api/src/http/api/stats.rs +++ b/nym-statistics-api/src/http/api/stats.rs @@ -1,6 +1,6 @@ use axum::{Json, Router, extract::State}; -use axum_client_ip::InsecureClientIp; use axum_extra::{TypedHeader, headers::UserAgent}; +use nym_http_api_common::middleware::client_ip::ClientIpAddr; use nym_statistics_common::report::vpn_client::{ ActiveDeviceReport, StaticInformationReport, VpnClientStatsReport, VpnClientStatsReportV2, }; @@ -35,15 +35,12 @@ pub(crate) fn routes() -> Router { async fn submit_stats_report( State(mut state): State, TypedHeader(user_agent): TypedHeader, - insecure_ip_addr: InsecureClientIp, + ClientIpAddr(client_ip): ClientIpAddr, Json(report): Json, ) -> HttpResult> { let now = time::OffsetDateTime::now_utc(); - let gateway_record = state - .network_view() - .get_country_by_ip(&insecure_ip_addr.0) - .await; + let gateway_record = state.network_view().get_country_by_ip(&client_ip).await; let from_mixnet = gateway_record.is_some(); let maybe_location = gateway_record.unwrap_or_default(); @@ -60,7 +57,7 @@ async fn submit_stats_report( &report, user_agent, from_mixnet, - insecure_ip_addr.0, + client_ip, maybe_location, ); @@ -93,15 +90,12 @@ async fn submit_stats_report( async fn submit_active_device( State(mut state): State, TypedHeader(user_agent): TypedHeader, - insecure_ip_addr: InsecureClientIp, + ClientIpAddr(client_ip): ClientIpAddr, Json(report): Json, ) -> HttpResult> { let now = time::OffsetDateTime::now_utc(); - let gateway_record = state - .network_view() - .get_country_by_ip(&insecure_ip_addr.0) - .await; + let gateway_record = state.network_view().get_country_by_ip(&client_ip).await; let from_mixnet = gateway_record.is_some(); @@ -140,7 +134,7 @@ async fn submit_active_device( async fn submit_session_report( State(mut state): State, TypedHeader(user_agent): TypedHeader, - insecure_ip_addr: InsecureClientIp, // This is the reverse proxy IP for now, but maybe in the future? + ClientIpAddr(client_ip): ClientIpAddr, Json(report): Json, ) -> HttpResult> { let now = time::OffsetDateTime::now_utc(); @@ -164,7 +158,7 @@ async fn submit_session_report( &report, user_agent, from_mixnet, - insecure_ip_addr.0, + client_ip, maybe_location, ); diff --git a/nyx-chain-watcher/src/http/api/mod.rs b/nyx-chain-watcher/src/http/api/mod.rs index 50f95d84ca..8d5ef97599 100644 --- a/nyx-chain-watcher/src/http/api/mod.rs +++ b/nyx-chain-watcher/src/http/api/mod.rs @@ -79,3 +79,13 @@ fn setup_cors() -> CorsLayer { .allow_headers(tower_http::cors::Any) .allow_credentials(false) } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn router_constructs_without_panic() { + let _ = RouterBuilder::with_default_routes().finalize_routes(); + } +}