From 396216e612a35c8c6b3083788aa2e5bb4f0342da Mon Sep 17 00:00:00 2001 From: Ignacio Duart Date: Sun, 22 Dec 2024 19:40:30 +0100 Subject: [PATCH] Load hosts from remote --- Cargo.lock | 680 ++++++++++++++++++++++++++++---------- crates/core/Cargo.toml | 2 +- crates/core/src/config.rs | 109 +++++- 3 files changed, 596 insertions(+), 195 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b63932768..d862f5772 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -33,7 +33,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "cipher", "cpufeatures", ] @@ -69,7 +69,7 @@ version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "once_cell", "version_check", "zerocopy", @@ -216,7 +216,7 @@ dependencies = [ "concurrent-queue", "event-listener-strategy", "futures-core", - "pin-project-lite", + "pin-project-lite 0.2.14", ] [[package]] @@ -226,7 +226,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8" dependencies = [ "async-lock", - "cfg-if", + "cfg-if 1.0.0", "concurrent-queue", "futures-io", "futures-lite 2.3.0", @@ -246,7 +246,7 @@ checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ "event-listener 5.3.1", "event-listener-strategy", - "pin-project-lite", + "pin-project-lite 0.2.14", ] [[package]] @@ -257,7 +257,7 @@ checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" dependencies = [ "async-stream-impl", "futures-core", - "pin-project-lite", + "pin-project-lite 0.2.14", ] [[package]] @@ -288,11 +288,11 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a860072022177f903e59730004fb5dc13db9275b79bb2aef7ba8ce831956c233" dependencies = [ - "bytes", + "bytes 1.7.2", "futures-sink", "futures-util", "memchr", - "pin-project-lite", + "pin-project-lite 0.2.14", ] [[package]] @@ -334,27 +334,27 @@ dependencies = [ "async-trait", "axum-core", "base64 0.22.1", - "bytes", + "bytes 1.7.2", "futures-util", "http 1.1.0", - "http-body", + "http-body 1.0.1", "http-body-util", - "hyper", + "hyper 1.5.0", "hyper-util", - "itoa", + "itoa 1.0.11", "matchit", "memchr", "mime", "percent-encoding", - "pin-project-lite", + "pin-project-lite 0.2.14", "rustversion", "serde", "serde_json", "serde_path_to_error", - "serde_urlencoded", + "serde_urlencoded 0.7.1", "sha1", "sync_wrapper 1.0.1", - "tokio", + "tokio 1.40.0", "tokio-tungstenite", "tower 0.5.1", "tower-layer", @@ -368,13 +368,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" dependencies = [ "async-trait", - "bytes", + "bytes 1.7.2", "futures-util", "http 1.1.0", - "http-body", + "http-body 1.0.1", "http-body-util", "mime", - "pin-project-lite", + "pin-project-lite 0.2.14", "rustversion", "sync_wrapper 1.0.1", "tower-layer", @@ -388,7 +388,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cfg-if", + "cfg-if 1.0.0", "libc", "miniz_oxide", "object", @@ -459,7 +459,7 @@ dependencies = [ "arrayref", "arrayvec", "cc", - "cfg-if", + "cfg-if 1.0.0", "constant_time_eq", "digest", ] @@ -482,6 +482,17 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "bstr" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" +dependencies = [ + "lazy_static", + "memchr", + "regex-automata 0.1.10", +] + [[package]] name = "bumpalo" version = "3.16.0" @@ -522,6 +533,12 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +[[package]] +name = "bytes" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" + [[package]] name = "bytes" version = "1.7.2" @@ -549,6 +566,12 @@ dependencies = [ "shlex", ] +[[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.0" @@ -567,7 +590,7 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "cipher", "cpufeatures", ] @@ -664,7 +687,7 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ - "crossbeam-utils", + "crossbeam-utils 0.8.20", "portable-atomic", ] @@ -713,7 +736,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "80128832c58ea9cbd041d2a759ec449224487b2c1e400453d99d244eead87a8e" dependencies = [ "autocfg", - "cfg-if", + "cfg-if 1.0.0", "libc", "scopeguard", "windows-sys 0.33.0", @@ -832,11 +855,21 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8" dependencies = [ - "crossbeam-channel", + "crossbeam-channel 0.5.13", "crossbeam-deque", "crossbeam-epoch", "crossbeam-queue", - "crossbeam-utils", + "crossbeam-utils 0.8.20", +] + +[[package]] +name = "crossbeam-channel" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87" +dependencies = [ + "crossbeam-utils 0.7.2", + "maybe-uninit", ] [[package]] @@ -845,7 +878,7 @@ version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ - "crossbeam-utils", + "crossbeam-utils 0.8.20", ] [[package]] @@ -855,7 +888,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ "crossbeam-epoch", - "crossbeam-utils", + "crossbeam-utils 0.8.20", ] [[package]] @@ -864,7 +897,7 @@ version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "crossbeam-utils", + "crossbeam-utils 0.8.20", ] [[package]] @@ -873,7 +906,18 @@ version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" dependencies = [ - "crossbeam-utils", + "crossbeam-utils 0.8.20", +] + +[[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", ] [[package]] @@ -900,7 +944,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac574ff4d437a7b5ad237ef331c17ccca63c46479e5b5453eb8e10bb99a759fe" dependencies = [ "csv-core", - "itoa", + "itoa 1.0.11", "ryu", "serde", ] @@ -944,7 +988,7 @@ dependencies = [ "openssl-probe", "openssl-sys", "schannel", - "socket2", + "socket2 0.5.7", "windows-sys 0.52.0", ] @@ -1004,8 +1048,8 @@ version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" dependencies = [ - "cfg-if", - "crossbeam-utils", + "cfg-if 1.0.0", + "crossbeam-utils 0.8.20", "hashbrown 0.14.5", "lock_api", "once_cell", @@ -1099,7 +1143,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "dirs-sys-next", ] @@ -1123,7 +1167,7 @@ checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" dependencies = [ "libc", "redox_users", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -1132,6 +1176,12 @@ version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" +[[package]] +name = "dtoa" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56899898ce76aaf4a0f24d914c97ea6ed976d42fec6ad33fcbb0a1103e07b2b0" + [[package]] name = "either" version = "1.13.0" @@ -1153,7 +1203,7 @@ version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] @@ -1231,7 +1281,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "home", "windows-sys 0.48.0", ] @@ -1250,7 +1300,7 @@ checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" dependencies = [ "concurrent-queue", "parking", - "pin-project-lite", + "pin-project-lite 0.2.14", "portable-atomic", "portable-atomic-util", ] @@ -1262,7 +1312,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" dependencies = [ "event-listener 5.3.1", - "pin-project-lite", + "pin-project-lite 0.2.14", ] [[package]] @@ -1313,7 +1363,7 @@ dependencies = [ "serde_with", "tar", "thiserror", - "tokio", + "tokio 1.40.0", "tokio-tungstenite", "toml", "tracing", @@ -1327,7 +1377,7 @@ version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "libc", "libredox", "windows-sys 0.59.0", @@ -1398,7 +1448,7 @@ dependencies = [ "blake3", "bs58", "byteorder", - "bytes", + "bytes 1.7.2", "cache-padded", "chacha20poly1305", "chrono", @@ -1415,6 +1465,7 @@ dependencies = [ "futures", "headers", "hickory-resolver", + "httptest", "itertools", "notify", "once_cell", @@ -1442,7 +1493,7 @@ dependencies = [ "tempfile", "thiserror", "time", - "tokio", + "tokio 1.40.0", "tokio-tungstenite", "toml", "tower-http", @@ -1475,7 +1526,7 @@ dependencies = [ "futures", "names", "serde_json", - "tokio", + "tokio 1.40.0", "tokio-tungstenite", "tracing", "tracing-subscriber", @@ -1525,7 +1576,7 @@ dependencies = [ "serde_json", "serde_with", "thiserror", - "tokio", + "tokio 1.40.0", "tokio-tungstenite", "tracing", "tracing-subscriber", @@ -1543,6 +1594,22 @@ dependencies = [ "libc", ] +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" + [[package]] name = "funty" version = "2.0.0" @@ -1619,7 +1686,7 @@ dependencies = [ "futures-io", "memchr", "parking", - "pin-project-lite", + "pin-project-lite 0.2.14", "waker-fn", ] @@ -1630,7 +1697,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" dependencies = [ "futures-core", - "pin-project-lite", + "pin-project-lite 0.2.14", ] [[package]] @@ -1669,7 +1736,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite", + "pin-project-lite 0.2.14", "pin-utils", "slab", ] @@ -1699,7 +1766,7 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "js-sys", "libc", "wasi", @@ -1739,6 +1806,26 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +[[package]] +name = "h2" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e4728fd124914ad25e99e3d15a9361a879f6620f63cb56bbb08f95abb97a535" +dependencies = [ + "bytes 0.5.6", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http 0.2.12", + "indexmap 1.9.3", + "slab", + "tokio 0.2.25", + "tokio-util 0.3.1", + "tracing", + "tracing-futures", +] + [[package]] name = "h2" version = "0.4.6" @@ -1746,15 +1833,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" dependencies = [ "atomic-waker", - "bytes", + "bytes 1.7.2", "fnv", "futures-core", "futures-sink", "http 1.1.0", "indexmap 2.6.0", "slab", - "tokio", - "tokio-util", + "tokio 1.40.0", + "tokio-util 0.7.12", "tracing", ] @@ -1799,10 +1886,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "322106e6bd0cba2d5ead589ddb8150a13d7c4217cf80d7c4f682ca994ccc6aa9" dependencies = [ "base64 0.21.7", - "bytes", + "bytes 1.7.2", "headers-core", "http 1.1.0", - "httpdate", + "httpdate 1.0.3", "mime", "sha1", ] @@ -1847,7 +1934,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07698b8420e2f0d6447a436ba999ec85d8fbf2a398bbd737b82cac4a2e96e512" dependencies = [ "async-trait", - "cfg-if", + "cfg-if 1.0.0", "data-encoding", "enum-as-inner", "futures-channel", @@ -1861,7 +1948,7 @@ dependencies = [ "rustls-pemfile 1.0.4", "thiserror", "tinyvec", - "tokio", + "tokio 1.40.0", "tokio-rustls 0.24.1", "tracing", "url", @@ -1873,7 +1960,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28757f23aa75c98f254cf0405e6d8c25b831b32921b050a66692427679b1f243" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "futures-util", "hickory-proto", "ipconfig", @@ -1885,7 +1972,7 @@ dependencies = [ "rustls 0.21.12", "smallvec", "thiserror", - "tokio", + "tokio 1.40.0", "tokio-rustls 0.24.1", "tracing", ] @@ -1925,7 +2012,7 @@ checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" dependencies = [ "libc", "match_cfg", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -1934,9 +2021,9 @@ version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ - "bytes", + "bytes 1.7.2", "fnv", - "itoa", + "itoa 1.0.11", ] [[package]] @@ -1945,9 +2032,19 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ - "bytes", + "bytes 1.7.2", "fnv", - "itoa", + "itoa 1.0.11", +] + +[[package]] +name = "http-body" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" +dependencies = [ + "bytes 0.5.6", + "http 0.2.12", ] [[package]] @@ -1956,7 +2053,7 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ - "bytes", + "bytes 1.7.2", "http 1.1.0", ] @@ -1966,11 +2063,11 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ - "bytes", + "bytes 1.7.2", "futures-util", "http 1.1.0", - "http-body", - "pin-project-lite", + "http-body 1.0.1", + "pin-project-lite 0.2.14", ] [[package]] @@ -1985,12 +2082,39 @@ version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" +[[package]] +name = "httpdate" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" + [[package]] name = "httpdate" version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +[[package]] +name = "httptest" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecafd360a692fece514f86821e81761ab2079f2002d6818a8fd5afb520ea8ea3" +dependencies = [ + "bstr", + "crossbeam-channel 0.4.4", + "futures", + "http 0.2.12", + "hyper 0.13.10", + "log", + "once_cell", + "regex", + "serde", + "serde_json", + "serde_urlencoded 0.6.1", + "tokio 0.2.25", + "url", +] + [[package]] name = "humantime" version = "2.1.0" @@ -2007,24 +2131,48 @@ dependencies = [ "serde", ] +[[package]] +name = "hyper" +version = "0.13.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a6f157065790a3ed2f88679250419b5cdd96e714a0d65f7797fd337186e96bb" +dependencies = [ + "bytes 0.5.6", + "futures-channel", + "futures-core", + "futures-util", + "h2 0.2.7", + "http 0.2.12", + "http-body 0.3.1", + "httparse", + "httpdate 0.3.2", + "itoa 0.4.8", + "pin-project", + "socket2 0.3.19", + "tokio 0.2.25", + "tower-service", + "tracing", + "want", +] + [[package]] name = "hyper" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" dependencies = [ - "bytes", + "bytes 1.7.2", "futures-channel", "futures-util", - "h2", + "h2 0.4.6", "http 1.1.0", - "http-body", + "http-body 1.0.1", "httparse", - "httpdate", - "itoa", - "pin-project-lite", + "httpdate 1.0.3", + "itoa 1.0.11", + "pin-project-lite 0.2.14", "smallvec", - "tokio", + "tokio 1.40.0", "want", ] @@ -2036,11 +2184,11 @@ checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http 1.1.0", - "hyper", + "hyper 1.5.0", "hyper-util", "rustls 0.23.15", "rustls-pki-types", - "tokio", + "tokio 1.40.0", "tokio-rustls 0.26.0", "tower-service", ] @@ -2051,10 +2199,10 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3203a961e5c83b6f5498933e78b6b263e208c197b63e9c6c53cc82ffd3f63793" dependencies = [ - "hyper", + "hyper 1.5.0", "hyper-util", - "pin-project-lite", - "tokio", + "pin-project-lite 0.2.14", + "tokio 1.40.0", "tower-service", ] @@ -2064,12 +2212,12 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ - "bytes", + "bytes 1.7.2", "http-body-util", - "hyper", + "hyper 1.5.0", "hyper-util", "native-tls", - "tokio", + "tokio 1.40.0", "tokio-native-tls", "tower-service", ] @@ -2080,15 +2228,15 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" dependencies = [ - "bytes", + "bytes 1.7.2", "futures-channel", "futures-util", "http 1.1.0", - "http-body", - "hyper", - "pin-project-lite", - "socket2", - "tokio", + "http-body 1.0.1", + "hyper 1.5.0", + "pin-project-lite 0.2.14", + "socket2 0.5.7", + "tokio 1.40.0", "tower-service", "tracing", ] @@ -2199,7 +2347,7 @@ version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] @@ -2208,13 +2356,22 @@ version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8bb03732005da905c88227371639bf1ad885cc712789c011c31c5fb3ab3ccf02" +[[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" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2", + "socket2 0.5.7", "widestring", "windows-sys 0.48.0", "winreg", @@ -2251,7 +2408,7 @@ checksum = "334e04b4d781f436dc315cb1e7515bd96826426345d498149e4bde36b67f8ee9" dependencies = [ "async-channel 1.9.0", "castaway", - "crossbeam-utils", + "crossbeam-utils 0.8.20", "curl", "curl-sys", "event-listener 2.5.3", @@ -2277,6 +2434,12 @@ dependencies = [ "either", ] +[[package]] +name = "itoa" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" + [[package]] name = "itoa" version = "1.0.11" @@ -2292,6 +2455,16 @@ 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 = "kqueue" version = "1.0.8" @@ -2461,13 +2634,19 @@ dependencies = [ "rawpointer", ] +[[package]] +name = "maybe-uninit" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" + [[package]] name = "md-5" version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "digest", ] @@ -2526,6 +2705,25 @@ dependencies = [ "adler2", ] +[[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 = "0.8.11" @@ -2550,6 +2748,18 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "miow" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" +dependencies = [ + "kernel32-sys", + "net2", + "winapi 0.2.8", + "ws2_32-sys", +] + [[package]] name = "more-asserts" version = "0.2.2" @@ -2611,6 +2821,17 @@ dependencies = [ "tempfile", ] +[[package]] +name = "net2" +version = "0.2.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b13b648036a2339d06de780866fbdfda0dde886de7b3af2ddeba8b14f4ee34ac" +dependencies = [ + "cfg-if 0.1.10", + "libc", + "winapi 0.3.9", +] + [[package]] name = "nix" version = "0.29.0" @@ -2618,7 +2839,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ "bitflags 2.6.0", - "cfg-if", + "cfg-if 1.0.0", "cfg_aliases", "libc", ] @@ -2640,7 +2861,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" dependencies = [ "bitflags 2.6.0", - "crossbeam-channel", + "crossbeam-channel 0.5.13", "filetime", "fsevent-sys", "inotify", @@ -2659,7 +2880,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" dependencies = [ "overload", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -2773,7 +2994,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" dependencies = [ "bitflags 2.6.0", - "cfg-if", + "cfg-if 1.0.0", "foreign-types", "libc", "once_cell", @@ -2820,7 +3041,7 @@ dependencies = [ "futures-sink", "js-sys", "once_cell", - "pin-project-lite", + "pin-project-lite 0.2.14", "thiserror", ] @@ -2834,7 +3055,7 @@ dependencies = [ "futures-sink", "js-sys", "once_cell", - "pin-project-lite", + "pin-project-lite 0.2.14", "thiserror", ] @@ -2848,7 +3069,7 @@ dependencies = [ "futures-sink", "js-sys", "once_cell", - "pin-project-lite", + "pin-project-lite 0.2.14", "thiserror", ] @@ -2859,7 +3080,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b0ba633e55c5ea6f431875ba55e71664f2fa5d3a90bd34ec9302eecc41c865dd" dependencies = [ "async-trait", - "bytes", + "bytes 1.7.2", "http 0.2.12", "opentelemetry 0.23.0", ] @@ -2880,7 +3101,7 @@ dependencies = [ "opentelemetry-semantic-conventions", "opentelemetry_sdk 0.23.0", "thrift", - "tokio", + "tokio 1.40.0", ] [[package]] @@ -2897,7 +3118,7 @@ dependencies = [ "opentelemetry_sdk 0.26.0", "prost", "thiserror", - "tokio", + "tokio 1.40.0", "tonic", ] @@ -2936,7 +3157,7 @@ dependencies = [ "percent-encoding", "rand", "thiserror", - "tokio", + "tokio 1.40.0", "tokio-stream", ] @@ -2975,7 +3196,7 @@ dependencies = [ "rand", "serde_json", "thiserror", - "tokio", + "tokio 1.40.0", "tokio-stream", ] @@ -3040,7 +3261,7 @@ version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "libc", "redox_syscall", "smallvec", @@ -3104,6 +3325,12 @@ dependencies = [ "syn 2.0.80", ] +[[package]] +name = "pin-project-lite" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" + [[package]] name = "pin-project-lite" version = "0.2.14" @@ -3151,11 +3378,11 @@ checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" dependencies = [ "autocfg", "bitflags 1.3.2", - "cfg-if", + "cfg-if 1.0.0", "concurrent-queue", "libc", "log", - "pin-project-lite", + "pin-project-lite 0.2.14", "windows-sys 0.48.0", ] @@ -3165,10 +3392,10 @@ version = "3.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "concurrent-queue", "hermit-abi 0.4.0", - "pin-project-lite", + "pin-project-lite 0.2.14", "rustix", "tracing", "windows-sys 0.59.0", @@ -3191,7 +3418,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "cpufeatures", "opaque-debug", "universal-hash", @@ -3280,7 +3507,7 @@ version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b0487d90e047de87f984913713b85c601c05609aad5b0df4b4573fbf69aa13f" dependencies = [ - "bytes", + "bytes 1.7.2", "prost-derive", ] @@ -3401,7 +3628,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ "crossbeam-deque", - "crossbeam-utils", + "crossbeam-utils 0.8.20", ] [[package]] @@ -3517,15 +3744,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64 0.22.1", - "bytes", + "bytes 1.7.2", "encoding_rs", "futures-core", "futures-util", - "h2", + "h2 0.4.6", "http 1.1.0", - "http-body", + "http-body 1.0.1", "http-body-util", - "hyper", + "hyper 1.5.0", "hyper-rustls", "hyper-tls", "hyper-util", @@ -3536,14 +3763,14 @@ dependencies = [ "native-tls", "once_cell", "percent-encoding", - "pin-project-lite", + "pin-project-lite 0.2.14", "rustls-pemfile 2.2.0", "serde", "serde_json", - "serde_urlencoded", + "serde_urlencoded 0.7.1", "sync_wrapper 1.0.1", "system-configuration", - "tokio", + "tokio 1.40.0", "tokio-native-tls", "tower-service", "url", @@ -3570,7 +3797,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", - "cfg-if", + "cfg-if 1.0.0", "getrandom", "libc", "spin", @@ -3586,7 +3813,7 @@ checksum = "9008cd6385b9e161d8229e1f6549dd23c3d022f132a2ea37ac3a10ac4935779b" dependencies = [ "bitvec", "bytecheck", - "bytes", + "bytes 1.7.2", "hashbrown 0.12.3", "indexmap 1.9.3", "ptr_meta", @@ -3884,7 +4111,7 @@ version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ - "itoa", + "itoa 1.0.11", "memchr", "ryu", "serde", @@ -3896,7 +4123,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" dependencies = [ - "itoa", + "itoa 1.0.11", "serde", ] @@ -3909,6 +4136,18 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_urlencoded" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" +dependencies = [ + "dtoa", + "itoa 0.4.8", + "serde", + "url", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -3916,7 +4155,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", - "itoa", + "itoa 1.0.11", "ryu", "serde", ] @@ -3957,7 +4196,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "cpufeatures", "digest", ] @@ -3968,7 +4207,7 @@ version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "cpufeatures", "digest", ] @@ -3988,7 +4227,7 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6c99835bad52957e7aa241d3975ed17c1e5f8c92026377d117a606f36b84b16" dependencies = [ - "bytes", + "bytes 1.7.2", "memmap2", ] @@ -4071,6 +4310,17 @@ dependencies = [ "serde", ] +[[package]] +name = "socket2" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "winapi 0.3.9", +] + [[package]] name = "socket2" version = "0.5.7" @@ -4131,7 +4381,7 @@ checksum = "d4d8060b456358185f7d50c55d9b5066ad956956fddec42ee2e8567134a8936e" dependencies = [ "atoi", "byteorder", - "bytes", + "bytes 1.7.2", "crc", "crossbeam-queue", "either", @@ -4158,7 +4408,7 @@ dependencies = [ "smallvec", "sqlformat", "thiserror", - "tokio", + "tokio 1.40.0", "tokio-stream", "tracing", "url", @@ -4200,7 +4450,7 @@ dependencies = [ "sqlx-sqlite", "syn 2.0.80", "tempfile", - "tokio", + "tokio 1.40.0", "url", ] @@ -4214,7 +4464,7 @@ dependencies = [ "base64 0.22.1", "bitflags 2.6.0", "byteorder", - "bytes", + "bytes 1.7.2", "crc", "digest", "dotenvy", @@ -4227,7 +4477,7 @@ dependencies = [ "hex", "hkdf", "hmac", - "itoa", + "itoa 1.0.11", "log", "md-5", "memchr", @@ -4267,7 +4517,7 @@ dependencies = [ "hkdf", "hmac", "home", - "itoa", + "itoa 1.0.11", "log", "md-5", "memchr", @@ -4301,7 +4551,7 @@ dependencies = [ "log", "percent-encoding", "serde", - "serde_urlencoded", + "serde_urlencoded 0.7.1", "sqlx-core", "tracing", "url", @@ -4334,7 +4584,7 @@ dependencies = [ "async-channel 2.3.1", "async-io", "atomic", - "crossbeam-channel", + "crossbeam-channel 0.5.13", "futures", "getrandom", "parking_lot", @@ -4456,7 +4706,7 @@ version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "fastrand 2.1.1", "once_cell", "rustix", @@ -4471,7 +4721,7 @@ checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" dependencies = [ "dirs-next", "rustversion", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -4500,7 +4750,7 @@ version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "once_cell", ] @@ -4533,7 +4783,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", - "itoa", + "itoa 1.0.11", "num-conv", "powerfmt", "serde", @@ -4572,6 +4822,25 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +[[package]] +name = "tokio" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6703a273949a90131b290be1fe7b039d0fc884aa1935860dfcbe056f28cd8092" +dependencies = [ + "bytes 0.5.6", + "fnv", + "futures-core", + "iovec", + "lazy_static", + "memchr", + "mio 0.6.23", + "num_cpus", + "pin-project-lite 0.1.12", + "slab", + "tokio-macros 0.2.6", +] + [[package]] name = "tokio" version = "1.40.0" @@ -4579,17 +4848,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ "backtrace", - "bytes", + "bytes 1.7.2", "libc", "mio 1.0.2", "parking_lot", - "pin-project-lite", + "pin-project-lite 0.2.14", "signal-hook-registry", - "socket2", - "tokio-macros", + "socket2 0.5.7", + "tokio-macros 2.4.0", "windows-sys 0.52.0", ] +[[package]] +name = "tokio-macros" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e44da00bfc73a25f814cd8d7e57a68a5c31b74b3152a0a1d1f590c97ed06265a" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "tokio-macros" version = "2.4.0" @@ -4608,7 +4888,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" dependencies = [ "native-tls", - "tokio", + "tokio 1.40.0", ] [[package]] @@ -4618,7 +4898,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ "rustls 0.21.12", - "tokio", + "tokio 1.40.0", ] [[package]] @@ -4629,7 +4909,7 @@ checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ "rustls 0.23.15", "rustls-pki-types", - "tokio", + "tokio 1.40.0", ] [[package]] @@ -4639,8 +4919,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" dependencies = [ "futures-core", - "pin-project-lite", - "tokio", + "pin-project-lite 0.2.14", + "tokio 1.40.0", ] [[package]] @@ -4651,21 +4931,35 @@ checksum = "edc5f74e248dc973e0dbb7b74c7e0d6fcc301c694ff50049504004ef4d0cdcd9" dependencies = [ "futures-util", "log", - "tokio", + "tokio 1.40.0", "tungstenite", ] +[[package]] +name = "tokio-util" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" +dependencies = [ + "bytes 0.5.6", + "futures-core", + "futures-sink", + "log", + "pin-project-lite 0.1.12", + "tokio 0.2.25", +] + [[package]] name = "tokio-util" version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ - "bytes", + "bytes 1.7.2", "futures-core", "futures-sink", - "pin-project-lite", - "tokio", + "pin-project-lite 0.2.14", + "tokio 1.40.0", ] [[package]] @@ -4713,19 +5007,19 @@ dependencies = [ "async-trait", "axum", "base64 0.22.1", - "bytes", - "h2", + "bytes 1.7.2", + "h2 0.4.6", "http 1.1.0", - "http-body", + "http-body 1.0.1", "http-body-util", - "hyper", + "hyper 1.5.0", "hyper-timeout", "hyper-util", "percent-encoding", "pin-project", "prost", - "socket2", - "tokio", + "socket2 0.5.7", + "tokio 1.40.0", "tokio-stream", "tower 0.4.13", "tower-layer", @@ -4743,11 +5037,11 @@ dependencies = [ "futures-util", "indexmap 1.9.3", "pin-project", - "pin-project-lite", + "pin-project-lite 0.2.14", "rand", "slab", - "tokio", - "tokio-util", + "tokio 1.40.0", + "tokio-util 0.7.12", "tower-layer", "tower-service", "tracing", @@ -4761,9 +5055,9 @@ checksum = "2873938d487c3cfb9aed7546dc9f2711d867c9f90c46b889989a2cb84eba6b4f" dependencies = [ "futures-core", "futures-util", - "pin-project-lite", + "pin-project-lite 0.2.14", "sync_wrapper 0.1.2", - "tokio", + "tokio 1.40.0", "tower-layer", "tower-service", "tracing", @@ -4776,19 +5070,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8437150ab6bbc8c5f0f519e3d5ed4aa883a83dd4cdd3d1b21f9482936046cb97" dependencies = [ "bitflags 2.6.0", - "bytes", + "bytes 1.7.2", "futures-util", "http 1.1.0", - "http-body", + "http-body 1.0.1", "http-body-util", "http-range-header", - "httpdate", + "httpdate 1.0.3", "mime", "mime_guess", "percent-encoding", - "pin-project-lite", - "tokio", - "tokio-util", + "pin-project-lite 0.2.14", + "tokio 1.40.0", + "tokio-util 0.7.12", "tower-layer", "tower-service", "tracing", @@ -4813,7 +5107,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ "log", - "pin-project-lite", + "pin-project-lite 0.2.14", "tracing-attributes", "tracing-core", ] @@ -4919,7 +5213,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "18e5b8366ee7a95b16d32197d0b2604b43a0be89dc5fac9f8e96ccafbaedda8a" dependencies = [ "byteorder", - "bytes", + "bytes 1.7.2", "data-encoding", "http 1.1.0", "httparse", @@ -5010,8 +5304,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb066959b24b5196ae73cb057f45598450d2c5f71460e98c49b738086eff9c06" dependencies = [ "asynchronous-codec", - "bytes", - "tokio-util", + "bytes 1.7.2", + "tokio-util 0.7.12", ] [[package]] @@ -5110,7 +5404,7 @@ version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "once_cell", "serde", "serde_json", @@ -5138,7 +5432,7 @@ version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "js-sys", "wasm-bindgen", "web-sys", @@ -5188,8 +5482,8 @@ version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d920d06243e9f456c336c428a34560357dedf59d9febaae14f1995ac120cff6" dependencies = [ - "bytes", - "cfg-if", + "bytes 1.7.2", + "cfg-if 1.0.0", "derivative", "indexmap 1.9.3", "js-sys", @@ -5218,8 +5512,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e01832173aa52345e480965f18c638a8a5a9e5e4d85a48675bdf1964147dc7f" dependencies = [ "backtrace", - "bytes", - "cfg-if", + "bytes 1.7.2", + "cfg-if 1.0.0", "enum-iterator", "enumset", "lazy_static", @@ -5299,7 +5593,7 @@ checksum = "e38e9301f5bb9f18da9cda4002d74d2cb6ac1f36dcf919fd77f91fca321fb1e5" dependencies = [ "backtrace", "cc", - "cfg-if", + "cfg-if 1.0.0", "corosensei", "crossbeam-queue", "dashmap", @@ -5389,7 +5683,7 @@ dependencies = [ "event-listener 5.3.1", "futures-core", "parking_lot", - "pin-project-lite", + "pin-project-lite 0.2.14", "triomphe", ] @@ -5419,6 +5713,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" +[[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" @@ -5429,6 +5729,12 @@ 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" @@ -5695,10 +6001,20 @@ version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "windows-sys 0.48.0", ] +[[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/crates/core/Cargo.toml b/crates/core/Cargo.toml index 5293234fc..2ac98465a 100644 --- a/crates/core/Cargo.toml +++ b/crates/core/Cargo.toml @@ -83,7 +83,7 @@ freenet-stdlib = { features = ["net"], workspace = true } arbitrary = { features = ["derive"], version = "1" } chrono = { features = ["arbitrary"], workspace = true } freenet-stdlib = { features = ["net", "testing"], workspace = true } -pav_regression = "0.4" +httptest = "0.7" pico-args = "0.5" statrs = "0.17" tempfile = "3" diff --git a/crates/core/src/config.rs b/crates/core/src/config.rs index a5233b1bf..d3652cb2d 100644 --- a/crates/core/src/config.rs +++ b/crates/core/src/config.rs @@ -1,9 +1,10 @@ use std::{ + collections::HashSet, fs::{self, File}, future::Future, io::{Read, Write}, net::{IpAddr, Ipv4Addr, SocketAddr}, - path::PathBuf, + path::{Path, PathBuf}, sync::{atomic::AtomicBool, Arc}, time::Duration, }; @@ -223,15 +224,18 @@ impl ConfigArgs { ) }); let gateways_file = config_paths.config_dir.join("gateways.toml"); - let gateways = match File::open(&*gateways_file) { + let remotely_loaded_gateways = futures::executor::block_on(load_gateways_from_index( + "https://freenet.org/gateways.toml", + &config_paths.secrets_dir, + )) + .unwrap_or_default(); + let mut gateways = match File::open(&*gateways_file) { Ok(mut file) => { let mut content = String::new(); file.read_to_string(&mut content)?; - toml::from_str::(&content) - .map_err(|e| { - std::io::Error::new(std::io::ErrorKind::InvalidData, e.to_string()) - })? - .gateways + toml::from_str::(&content).map_err(|e| { + std::io::Error::new(std::io::ErrorKind::InvalidData, e.to_string()) + })? } Err(err) => { // TODO: remove local-simulation feature and use runtime flags @@ -248,9 +252,11 @@ impl ConfigArgs { } let _ = err; tracing::warn!("No gateways file found, initializing disjoint gateway."); - vec![] + Gateways { gateways: vec![] } } }; + gateways.merge_and_deduplicate(remotely_loaded_gateways); + gateways.save_to_file(&gateways_file)?; let this = Config { mode, @@ -280,7 +286,7 @@ impl ConfigArgs { secrets, log_level: self.log_level.unwrap_or(tracing::log::LevelFilter::Info), config_paths: Arc::new(config_paths), - gateways, + gateways: gateways.gateways, is_gateway: self.network_listener.is_gateway, }; @@ -780,12 +786,28 @@ impl Config { } } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize, Default)] struct Gateways { pub gateways: Vec, } -#[derive(Debug, Serialize, Deserialize)] +impl Gateways { + pub fn merge_and_deduplicate(&mut self, other: Gateways) { + let mut existing_gateways: HashSet<_> = self.gateways.drain(..).collect(); + for gateway in other.gateways { + existing_gateways.insert(gateway); + } + self.gateways = existing_gateways.into_iter().collect(); + } + + pub fn save_to_file(&self, path: &Path) -> anyhow::Result<()> { + let content = toml::to_string(self)?; + fs::write(path, content)?; + Ok(()) + } +} + +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Hash)] pub struct GatewayConfig { /// Address of the gateway. It can be either a hostname or an IP address and port. pub address: Address, @@ -795,7 +817,7 @@ pub struct GatewayConfig { pub public_key_path: PathBuf, } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Hash)] pub enum Address { #[serde(rename = "hostname")] Hostname(String), @@ -855,8 +877,33 @@ pub fn set_logger(level: Option, endpoint: } } +async fn load_gateways_from_index(url: &str, pub_keys_dir: &Path) -> anyhow::Result { + let response = reqwest::get(url).await?.error_for_status()?.text().await?; + let mut gateways: Gateways = toml::from_str(&response)?; + let mut base_url = reqwest::Url::parse(url)?; + base_url.set_path(""); + + for gateway in &mut gateways.gateways { + let public_key_url = base_url.join(&gateway.public_key_path.to_string_lossy())?; + let public_key_response = reqwest::get(public_key_url).await?.error_for_status()?; + let file_name = gateway + .public_key_path + .file_name() + .ok_or_else(|| anyhow::anyhow!("Invalid public key path"))?; + let local_path = pub_keys_dir.join(file_name); + let mut public_key_file = File::create(&local_path)?; + let content = public_key_response.bytes().await?; + std::io::copy(&mut content.as_ref(), &mut public_key_file)?; + gateway.public_key_path = local_path; + } + + Ok(gateways) +} + #[cfg(test)] mod tests { + use httptest::{mappers::*, responders::*, Expectation, Server}; + use super::*; #[test] @@ -867,6 +914,44 @@ mod tests { let _: Config = toml::from_str(&serialized).unwrap(); } + #[tokio::test] + async fn test_load_gateways_from_index() { + let server = Server::run(); + server.expect( + Expectation::matching(all_of!(request::method("GET"), request::path("/gateways"))) + .respond_with(status_code(200).body( + r#" + [[gateways]] + address = { hostname = "example.com" } + public_key = "/path/to/public_key.pem" + "#, + )), + ); + + let url = server.url_str("/gateways"); + + server.expect( + Expectation::matching(request::path("/path/to/public_key.pem")) + .respond_with(status_code(200).body("-----BEGIN PUBLIC KEY-----\n...")), + ); + + let pub_keys_dir = tempfile::tempdir().unwrap(); + let gateways = load_gateways_from_index(&url, pub_keys_dir.path()) + .await + .unwrap(); + + assert_eq!(gateways.gateways.len(), 1); + assert_eq!( + gateways.gateways[0].address, + Address::Hostname("example.com".to_string()) + ); + assert_eq!( + gateways.gateways[0].public_key_path, + pub_keys_dir.path().join("public_key.pem") + ); + assert!(pub_keys_dir.path().join("public_key.pem").exists()); + } + #[test] fn test_gateways() { let gateways = Gateways {