diff --git a/Cargo.lock b/Cargo.lock index f33ae924..2bed765f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -111,17 +111,6 @@ dependencies = [ "zstd-safe", ] -[[package]] -name = "async-recursion" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30c5ef0ede93efbf733c1a727f3b6b5a1060bbedd5600183e66f6e4be4af0ec5" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.60", -] - [[package]] name = "async-trait" version = "0.1.80" @@ -130,7 +119,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.58", ] [[package]] @@ -150,19 +139,19 @@ checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" [[package]] name = "axum" -version = "0.6.20" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" +checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" dependencies = [ "async-trait", "axum-core", - "bitflags 1.3.2", "bytes", "futures-util", - "headers", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.28", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", + "hyper 1.3.1", + "hyper-util", "itoa", "matchit", "memchr", @@ -174,7 +163,7 @@ dependencies = [ "serde_json", "serde_path_to_error", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 1.0.1", "tower", "tower-layer", "tower-service", @@ -182,17 +171,42 @@ dependencies = [ [[package]] name = "axum-core" -version = "0.3.4" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" +checksum = "a15c63fd72d41492dc4f497196f5da1fb04fb7529e631d73630d1b491e47a2e3" dependencies = [ "async-trait", "bytes", "futures-util", - "http 0.2.12", - "http-body 0.4.6", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", "mime", + "pin-project-lite", "rustversion", + "sync_wrapper 0.1.2", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-extra" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0be6ea09c9b96cb5076af0de2e383bd2bc0c18f827cf1967bdd353e0b910d733" +dependencies = [ + "axum", + "axum-core", + "bytes", + "futures-util", + "headers", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", + "mime", + "pin-project-lite", + "serde", + "tower", "tower-layer", "tower-service", ] @@ -210,20 +224,43 @@ dependencies = [ "http-body 0.4.6", "hyper 0.14.28", "pin-project-lite", - "rustls 0.21.10", + "rustls 0.21.11", "rustls-pemfile 1.0.4", "tokio", "tokio-rustls 0.24.1", "tower-service", ] +[[package]] +name = "axum-server" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ad46c3ec4e12f4a4b6835e173ba21c25e484c9d02b49770bf006ce5367c036" +dependencies = [ + "arc-swap", + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", + "hyper 1.3.1", + "hyper-util", + "pin-project-lite", + "rustls 0.21.11", + "rustls-pemfile 2.1.2", + "tokio", + "tokio-rustls 0.24.1", + "tower", + "tower-service", +] + [[package]] name = "axum-server-dual-protocol" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d1a8f5076b5dbfeb706bcce30fe73caf20971e6e5ca80b83a7f1d990e73e185" dependencies = [ - "axum-server", + "axum-server 0.5.1", "bytes", "http 0.2.12", "hyper 0.14.28", @@ -284,7 +321,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.60", + "syn 2.0.58", ] [[package]] @@ -356,6 +393,12 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +[[package]] +name = "byteorder-lite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" + [[package]] name = "bytes" version = "1.6.0" @@ -453,7 +496,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.58", ] [[package]] @@ -475,7 +518,8 @@ dependencies = [ "argon2", "async-trait", "axum", - "axum-server", + "axum-extra", + "axum-server 0.6.0", "axum-server-dual-protocol", "base64 0.22.0", "bytes", @@ -486,11 +530,12 @@ dependencies = [ "figment", "futures-util", "hardened_malloc-rs", - "hickory-resolver 0.24.1", + "hickory-resolver", "hmac", - "http 0.2.12", - "hyper 0.14.28", - "hyperlocal", + "http 1.1.0", + "http-body-util", + "hyper 1.3.1", + "hyper-util", "image", "ipaddress", "itertools 0.12.1", @@ -504,9 +549,10 @@ dependencies = [ "opentelemetry-jaeger", "opentelemetry_sdk", "parking_lot", + "proc-macro2", "rand", "regex", - "reqwest 0.11.27", + "reqwest", "ring", "ruma", "rusqlite", @@ -633,7 +679,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.58", ] [[package]] @@ -728,15 +774,6 @@ dependencies = [ "serde", ] -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - [[package]] name = "enum-as-inner" version = "0.6.0" @@ -746,7 +783,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.58", ] [[package]] @@ -884,7 +921,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.58", ] [[package]] @@ -980,6 +1017,25 @@ dependencies = [ "tracing", ] +[[package]] +name = "h2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "816ec7294445779408f36fe57bc5b7fc1cf59664059096c65f905c1c61f58069" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http 1.1.0", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "hardened_malloc-rs" version = "0.1.1+12" @@ -1007,14 +1063,14 @@ dependencies = [ [[package]] name = "headers" -version = "0.3.9" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" +checksum = "322106e6bd0cba2d5ead589ddb8150a13d7c4217cf80d7c4f682ca994ccc6aa9" dependencies = [ "base64 0.21.7", "bytes", "headers-core", - "http 0.2.12", + "http 1.1.0", "httpdate", "mime", "sha1", @@ -1022,11 +1078,11 @@ dependencies = [ [[package]] name = "headers-core" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" +checksum = "54b4a22553d4242c49fddb9ba998a99962b5cc6f22cb5a3482bec22522403ce4" dependencies = [ - "http 0.2.12", + "http 1.1.0", ] [[package]] @@ -1053,36 +1109,12 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" -[[package]] -name = "hickory-proto" -version = "0.24.0" -source = "git+https://github.com/hickory-dns/hickory-dns?rev=94ac564c3f677e038f7255ddb762e9301d0f2c5d#94ac564c3f677e038f7255ddb762e9301d0f2c5d" -dependencies = [ - "async-recursion", - "async-trait", - "cfg-if", - "data-encoding", - "enum-as-inner", - "futures-channel", - "futures-io", - "futures-util", - "idna", - "ipnet", - "once_cell", - "rand", - "thiserror", - "tinyvec", - "tokio", - "tracing", - "url", -] - [[package]] name = "hickory-proto" version = "0.24.1" -source = "git+https://github.com/hickory-dns/hickory-dns?rev=76a4b84216fa4984eafd4c4ceb5f0892ae3edbbf#76a4b84216fa4984eafd4c4ceb5f0892ae3edbbf" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07698b8420e2f0d6447a436ba999ec85d8fbf2a398bbd737b82cac4a2e96e512" dependencies = [ - "async-recursion", "async-trait", "cfg-if", "data-encoding", @@ -1090,7 +1122,7 @@ dependencies = [ "futures-channel", "futures-io", "futures-util", - "idna", + "idna 0.4.0", "ipnet", "once_cell", "rand", @@ -1101,34 +1133,15 @@ dependencies = [ "url", ] -[[package]] -name = "hickory-resolver" -version = "0.24.0" -source = "git+https://github.com/hickory-dns/hickory-dns?rev=94ac564c3f677e038f7255ddb762e9301d0f2c5d#94ac564c3f677e038f7255ddb762e9301d0f2c5d" -dependencies = [ - "cfg-if", - "futures-util", - "hickory-proto 0.24.0", - "ipconfig", - "lru-cache", - "once_cell", - "parking_lot", - "rand", - "resolv-conf", - "smallvec", - "thiserror", - "tokio", - "tracing", -] - [[package]] name = "hickory-resolver" version = "0.24.1" -source = "git+https://github.com/hickory-dns/hickory-dns?rev=76a4b84216fa4984eafd4c4ceb5f0892ae3edbbf#76a4b84216fa4984eafd4c4ceb5f0892ae3edbbf" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28757f23aa75c98f254cf0405e6d8c25b831b32921b050a66692427679b1f243" dependencies = [ "cfg-if", "futures-util", - "hickory-proto 0.24.1", + "hickory-proto", "ipconfig", "lru-cache", "once_cell", @@ -1242,12 +1255,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "http-range-header" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" - [[package]] name = "httparse" version = "1.8.0" @@ -1270,7 +1277,7 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2", + "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", "httparse", @@ -1293,9 +1300,11 @@ dependencies = [ "bytes", "futures-channel", "futures-util", + "h2 0.4.4", "http 1.1.0", "http-body 1.0.0", "httparse", + "httpdate", "itoa", "pin-project-lite", "smallvec", @@ -1303,20 +1312,6 @@ dependencies = [ "want", ] -[[package]] -name = "hyper-rustls" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" -dependencies = [ - "futures-util", - "http 0.2.12", - "hyper 0.14.28", - "rustls 0.21.10", - "tokio", - "tokio-rustls 0.24.1", -] - [[package]] name = "hyper-rustls" version = "0.26.0" @@ -1327,7 +1322,7 @@ dependencies = [ "http 1.1.0", "hyper 1.3.1", "hyper-util", - "rustls 0.22.3", + "rustls 0.22.4", "rustls-pki-types", "tokio", "tokio-rustls 0.25.0", @@ -1355,14 +1350,13 @@ dependencies = [ ] [[package]] -name = "hyperlocal" -version = "0.8.0" -source = "git+https://github.com/softprops/hyperlocal?rev=2ee4d149644600d326559af0d2b235c945b05c04#2ee4d149644600d326559af0d2b235c945b05c04" +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" dependencies = [ - "hex", - "hyper 0.14.28", - "pin-project-lite", - "tokio", + "unicode-bidi", + "unicode-normalization", ] [[package]] @@ -1394,11 +1388,11 @@ dependencies = [ [[package]] name = "image-webp" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a84a25dcae3ac487bc24ef280f9e20c79c9b1a3e5e32cbed3041d1c514aa87c" +checksum = "d730b085583c4d789dfd07fdcf185be59501666a90c97c40162b37e4fdad272d" dependencies = [ - "byteorder", + "byteorder-lite", "thiserror", ] @@ -2054,7 +2048,7 @@ dependencies = [ "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.60", + "syn 2.0.58", ] [[package]] @@ -2128,7 +2122,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.58", ] [[package]] @@ -2208,9 +2202,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.81" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" +checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" dependencies = [ "unicode-ident", ] @@ -2223,7 +2217,7 @@ checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.58", "version_check", "yansi", ] @@ -2328,64 +2322,22 @@ checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "reqwest" -version = "0.11.27" -source = "git+https://github.com/girlbossceo/reqwest?rev=319335e000fdea2e3d01f44245c8a21864d0c1c3#319335e000fdea2e3d01f44245c8a21864d0c1c3" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" dependencies = [ "async-compression", - "base64 0.21.7", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2", - "hickory-resolver 0.24.0", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.28", - "hyper-rustls 0.24.2", - "ipnet", - "js-sys", - "log", - "mime", - "once_cell", - "percent-encoding", - "pin-project-lite", - "rustls 0.21.10", - "rustls-native-certs", - "rustls-pemfile 1.0.4", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper", - "system-configuration", - "tokio", - "tokio-rustls 0.24.1", - "tokio-socks", - "tokio-util", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "winreg 0.50.0", -] - -[[package]] -name = "reqwest" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e6cc1e89e689536eb5aeede61520e874df5a4707df811cd5da4aa5fbb2aae19" -dependencies = [ "base64 0.22.0", "bytes", "futures-channel", "futures-core", "futures-util", + "hickory-resolver", "http 1.1.0", "http-body 1.0.0", "http-body-util", "hyper 1.3.1", - "hyper-rustls 0.26.0", + "hyper-rustls", "hyper-util", "ipnet", "js-sys", @@ -2394,15 +2346,18 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.22.3", + "rustls 0.22.4", + "rustls-native-certs", "rustls-pemfile 2.1.2", "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 0.1.2", "tokio", "tokio-rustls 0.25.0", + "tokio-socks", + "tokio-util", "tower-service", "url", "wasm-bindgen", @@ -2440,7 +2395,7 @@ dependencies = [ [[package]] name = "ruma" version = "0.9.4" -source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#5194ea186118109ce81b8a471f001212042302bd" +source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#3d0308ca2f3d7c0254ce8097a28f36c313bed4fb" dependencies = [ "assign", "js_int", @@ -2460,7 +2415,7 @@ dependencies = [ [[package]] name = "ruma-appservice-api" version = "0.9.0" -source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#5194ea186118109ce81b8a471f001212042302bd" +source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#3d0308ca2f3d7c0254ce8097a28f36c313bed4fb" dependencies = [ "js_int", "ruma-common", @@ -2472,13 +2427,13 @@ dependencies = [ [[package]] name = "ruma-client-api" version = "0.17.4" -source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#5194ea186118109ce81b8a471f001212042302bd" +source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#3d0308ca2f3d7c0254ce8097a28f36c313bed4fb" dependencies = [ "as_variant", "assign", "bytes", "date_header", - "http 0.2.12", + "http 1.1.0", "js_int", "js_option", "maplit", @@ -2494,13 +2449,13 @@ dependencies = [ [[package]] name = "ruma-common" version = "0.12.1" -source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#5194ea186118109ce81b8a471f001212042302bd" +source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#3d0308ca2f3d7c0254ce8097a28f36c313bed4fb" dependencies = [ "as_variant", "base64 0.21.7", "bytes", "form_urlencoded", - "http 0.2.12", + "http 1.1.0", "indexmap", "js_int", "konst", @@ -2524,7 +2479,7 @@ dependencies = [ [[package]] name = "ruma-events" version = "0.27.11" -source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#5194ea186118109ce81b8a471f001212042302bd" +source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#3d0308ca2f3d7c0254ce8097a28f36c313bed4fb" dependencies = [ "as_variant", "indexmap", @@ -2546,7 +2501,7 @@ dependencies = [ [[package]] name = "ruma-federation-api" version = "0.8.0" -source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#5194ea186118109ce81b8a471f001212042302bd" +source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#3d0308ca2f3d7c0254ce8097a28f36c313bed4fb" dependencies = [ "js_int", "ruma-common", @@ -2558,7 +2513,7 @@ dependencies = [ [[package]] name = "ruma-identifiers-validation" version = "0.9.3" -source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#5194ea186118109ce81b8a471f001212042302bd" +source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#3d0308ca2f3d7c0254ce8097a28f36c313bed4fb" dependencies = [ "js_int", "thiserror", @@ -2567,7 +2522,7 @@ dependencies = [ [[package]] name = "ruma-identity-service-api" version = "0.8.0" -source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#5194ea186118109ce81b8a471f001212042302bd" +source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#3d0308ca2f3d7c0254ce8097a28f36c313bed4fb" dependencies = [ "js_int", "ruma-common", @@ -2577,7 +2532,7 @@ dependencies = [ [[package]] name = "ruma-macros" version = "0.12.0" -source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#5194ea186118109ce81b8a471f001212042302bd" +source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#3d0308ca2f3d7c0254ce8097a28f36c313bed4fb" dependencies = [ "once_cell", "proc-macro-crate", @@ -2585,14 +2540,14 @@ dependencies = [ "quote", "ruma-identifiers-validation", "serde", - "syn 2.0.60", + "syn 2.0.58", "toml", ] [[package]] name = "ruma-push-gateway-api" version = "0.8.0" -source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#5194ea186118109ce81b8a471f001212042302bd" +source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#3d0308ca2f3d7c0254ce8097a28f36c313bed4fb" dependencies = [ "js_int", "ruma-common", @@ -2604,7 +2559,7 @@ dependencies = [ [[package]] name = "ruma-signatures" version = "0.14.0" -source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#5194ea186118109ce81b8a471f001212042302bd" +source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#3d0308ca2f3d7c0254ce8097a28f36c313bed4fb" dependencies = [ "base64 0.21.7", "ed25519-dalek", @@ -2620,7 +2575,7 @@ dependencies = [ [[package]] name = "ruma-state-res" version = "0.10.0" -source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#5194ea186118109ce81b8a471f001212042302bd" +source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#3d0308ca2f3d7c0254ce8097a28f36c313bed4fb" dependencies = [ "itertools 0.11.0", "js_int", @@ -2694,9 +2649,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.10" +version = "0.21.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +checksum = "7fecbfb7b1444f477b345853b1fce097a2c6fb637b2bfb87e6bc5db0f043fae4" dependencies = [ "log", "ring", @@ -2706,9 +2661,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.22.3" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99008d7ad0bbbea527ec27bddbc0e432c5b87d8175178cee68d2eec9c4a1813c" +checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" dependencies = [ "log", "ring", @@ -2720,12 +2675,13 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.6.3" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" dependencies = [ "openssl-probe", - "rustls-pemfile 1.0.4", + "rustls-pemfile 2.1.2", + "rustls-pki-types", "schannel", "security-framework", ] @@ -2855,8 +2811,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00421ed8fa0c995f07cde48ba6c89e80f2b312f74ff637326f392fbfd23abe02" dependencies = [ "httpdate", - "reqwest 0.12.3", - "rustls 0.21.10", + "reqwest", + "rustls 0.21.11", "sentry-backtrace", "sentry-contexts", "sentry-core", @@ -3000,7 +2956,7 @@ checksum = "e88edab869b01783ba905e7d0153f9fc1a6505a96e4ad3018011eedb838566d9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.58", ] [[package]] @@ -3266,9 +3222,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.60" +version = "2.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" +checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687" dependencies = [ "proc-macro2", "quote", @@ -3282,25 +3238,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] -name = "system-configuration" -version = "0.5.1" +name = "sync_wrapper" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" -dependencies = [ - "core-foundation-sys", - "libc", -] +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" [[package]] name = "tendril" @@ -3330,7 +3271,7 @@ checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.58", ] [[package]] @@ -3468,7 +3409,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.58", ] [[package]] @@ -3477,7 +3418,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.10", + "rustls 0.21.11", "tokio", ] @@ -3487,7 +3428,7 @@ version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" dependencies = [ - "rustls 0.22.3", + "rustls 0.22.4", "rustls-pki-types", "tokio", ] @@ -3581,18 +3522,17 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.4.4" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" +checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" dependencies = [ "async-compression", "bitflags 2.5.0", "bytes", "futures-core", - "futures-util", - "http 0.2.12", - "http-body 0.4.6", - "http-range-header", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", "pin-project-lite", "tokio", "tokio-util", @@ -3634,7 +3574,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.58", ] [[package]] @@ -3792,7 +3732,7 @@ dependencies = [ "base64 0.21.7", "log", "once_cell", - "rustls 0.22.3", + "rustls 0.22.4", "rustls-pki-types", "rustls-webpki 0.102.2", "url", @@ -3806,7 +3746,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", - "idna", + "idna 0.5.0", "percent-encoding", "serde", ] @@ -3887,7 +3827,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.58", "wasm-bindgen-shared", ] @@ -3921,7 +3861,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.58", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4250,7 +4190,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.58", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index bac268dd..95bfdc66 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,8 +41,6 @@ itertools = "0.12.1" # jwt jsonwebtokens jsonwebtoken = "9.3.0" -lru-cache = "0.1.2" - # Used for ruma wrapper serde_html_form = "0.2.6" @@ -50,8 +48,6 @@ serde_html_form = "0.2.6" hmac = "0.12.1" sha-1 = "0.10.1" -async-trait = "0.1.80" - # used for checking if an IP is in specific subnets / CIDR ranges easier ipaddress = "0.1.3" @@ -67,7 +63,8 @@ cyborgtime = "2.1.1" # all the web/HTTP dependencies # Used for the http request / response body type for Ruma endpoints used with reqwest bytes = "1.6.0" -http = "0.2.12" +http = "1.1.0" +http-body-util = "0.1.1" # used to replace the channels of the tokio runtime loole = "0.3.0" @@ -75,6 +72,12 @@ loole = "0.3.0" # Validating urls in config, was already a transitive dependency url = { version = "2", features = ["serde"] } +async-trait = "0.1.80" + +lru-cache = "0.1.2" + +proc-macro2 = "=1.0.79" + # standard date and time tools [dependencies.chrono] version = "0.4.38" @@ -83,12 +86,17 @@ default-features = false # Web framework [dependencies.axum] -version = "0.6.20" +version = "0.7.5" default-features = false -features = ["form", "headers", "http1", "http2", "json", "matched-path"] +features = ["form", "http1", "http2", "json", "matched-path"] + +[dependencies.axum-extra] +version = "0.9.3" +default-features = false +features = ["typed-header"] [dependencies.axum-server] -version = "0.5.1" +version = "0.6.0" features = ["tls-rustls"] [dependencies.tower] @@ -96,17 +104,18 @@ version = "0.4.13" features = ["util"] [dependencies.tower-http] -version = "0.4.4" +version = "0.5.2" features = ["add-extension", "cors", "sensitive-headers", "trace", "util"] [dependencies.hyper] -version = "0.14" +version = "1.3.1" features = ["server", "http1", "http2"] +[dependencies.hyper-util] +version = "0.1.3" + [dependencies.reqwest] -#version = "0.11.27" -git = "https://github.com/girlbossceo/reqwest" -rev = "319335e000fdea2e3d01f44245c8a21864d0c1c3" +version = "0.12.4" default-features = false features = ["rustls-tls-native-roots", "socks", "hickory-dns"] @@ -240,14 +249,9 @@ version = "0.10.17" features = ["env", "toml"] # Used for matrix spec type definitions and helpers -#ruma = { version = "0.4.0", features = ["compat", "rand", "appservice-api-c", "client-api", "federation-api", "push-gateway-api-c", "state-res", "unstable-pre-spec", "unstable-exhaustive-types"] } -#ruma = { git = "https://github.com/ruma/ruma", rev = "4d9f754657a099df8e61533787b8eebd12946435", features = ["compat", "rand", "appservice-api-c", "client-api", "federation-api", "push-gateway-api-c", "state-res", "unstable-msc2448", "unstable-msc3575", "unstable-exhaustive-types", "ring-compat", "unstable-unspecified", "unstable-msc2870", "unstable-msc3061", "unstable-msc2867", "unstable-extensible-events"] } -#ruma = { path = "../ruma/crates/ruma", features = ["compat", "rand", "appservice-api-c", "client-api", "federation-api", "push-gateway-api-c", "state-res", "unstable-msc2448", "unstable-msc3575", "unstable-exhaustive-types", "ring-compat", "unstable-unspecified" ] } [dependencies.ruma] git = "https://github.com/girlbossceo/ruma" -#rev = "c988b5ff158ede9c10aeffc76ad5e31604f19ddb" branch = "conduwuit-changes" -#path = "../ruma/crates/ruma" features = [ "compat", "rand", @@ -272,13 +276,12 @@ features = [ ] [dependencies.hickory-resolver] -git = "https://github.com/hickory-dns/hickory-dns" -rev = "76a4b84216fa4984eafd4c4ceb5f0892ae3edbbf" +version = "0.24.1" +default-features = false [dependencies.rust-rocksdb] git = "https://github.com/zaidoon1/rust-rocksdb" branch = "master" -#rev = "7814116b2d7d0e218b2e349d2f41a276f22bea82" optional = true default-features = true features = ["multi-threaded-cf", "zstd"] @@ -313,9 +316,6 @@ features = ["fs", "macros", "sync", "signal"] [target.'cfg(unix)'.dependencies] nix = { version = "0.28.0", features = ["resource"] } sd-notify = { version = "0.4.1", optional = true } # systemd is only available/relevant on *nix platforms -hyperlocal = { git = "https://github.com/softprops/hyperlocal", rev = "2ee4d149644600d326559af0d2b235c945b05c04", features = [ - "server", -] } # unix socket support [target.'cfg(all(not(target_env = "msvc"), not(target_os = "macos"), target_os = "linux"))'.dependencies] hardened_malloc-rs = { version = "0.1", optional = true, features = [ diff --git a/src/api/ruma_wrapper/axum.rs b/src/api/ruma_wrapper/axum.rs index 3de3b842..6246324f 100644 --- a/src/api/ruma_wrapper/axum.rs +++ b/src/api/ruma_wrapper/axum.rs @@ -2,17 +2,22 @@ use std::{collections::BTreeMap, str}; use axum::{ async_trait, - body::{Full, HttpBody}, - extract::{rejection::TypedHeaderRejectionReason, FromRequest, Path, TypedHeader}, + extract::{FromRequest, Path}, + response::{IntoResponse, Response}, + RequestExt, RequestPartsExt, +}; +use axum_extra::{ headers::{ authorization::{Bearer, Credentials}, Authorization, }, - response::{IntoResponse, Response}, - BoxError, RequestExt, RequestPartsExt, + typed_header::TypedHeaderRejectionReason, + TypedHeader, }; -use bytes::{Buf, BufMut, Bytes, BytesMut}; -use http::{uri::PathAndQuery, Request, StatusCode}; +use bytes::{BufMut, BytesMut}; +use http::{uri::PathAndQuery, StatusCode}; +use http_body_util::Full; +use hyper::Request; use ruma::{ api::{client::error::ErrorKind, AuthScheme, IncomingRequest, OutgoingResponse}, CanonicalJsonValue, OwnedDeviceId, OwnedServerName, OwnedUserId, UserId, @@ -36,34 +41,22 @@ struct QueryParams { user_id: Option, } +const MAX_BODY_SIZE: usize = 1024 * 1024 * 128; //TODO: conf? + #[async_trait] -impl FromRequest for Ruma +impl FromRequest for Ruma where T: IncomingRequest, - B: HttpBody + Send + 'static, - B::Data: Send, - B::Error: Into, { type Rejection = Error; #[allow(unused_qualifications)] // async traits - async fn from_request(req: Request, _state: &S) -> Result { - let (mut parts, mut body) = match req.with_limited_body() { - Ok(limited_req) => { - let (parts, body) = limited_req.into_parts(); - let body = to_bytes(body) - .await - .map_err(|_| Error::BadRequest(ErrorKind::MissingToken, "Missing token."))?; - (parts, body) - }, - Err(original_req) => { - let (parts, body) = original_req.into_parts(); - let body = to_bytes(body) - .await - .map_err(|_| Error::BadRequest(ErrorKind::MissingToken, "Missing token."))?; - (parts, body) - }, - }; + async fn from_request(req: Request, _state: &S) -> Result { + let limited = req.with_limited_body(); + let (mut parts, body) = limited.into_parts(); + let mut body = axum::body::to_bytes(body, MAX_BODY_SIZE) + .await + .map_err(|_| Error::BadRequest(ErrorKind::MissingToken, "Missing token."))?; let metadata = T::METADATA; let auth_header: Option>> = parts.extract().await?; @@ -397,55 +390,3 @@ impl IntoResponse for RumaResponse { } } } - -// copied from hyper under the following license: -// Copyright (c) 2014-2021 Sean McArthur - -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -pub(crate) async fn to_bytes(body: T) -> Result -where - T: HttpBody, -{ - futures_util::pin_mut!(body); - - // If there's only 1 chunk, we can just return Buf::to_bytes() - let mut first = if let Some(buf) = body.data().await { - buf? - } else { - return Ok(Bytes::new()); - }; - - let second = if let Some(buf) = body.data().await { - buf? - } else { - return Ok(first.copy_to_bytes(first.remaining())); - }; - - // With more than 1 buf, we gotta flatten into a Vec first. - let cap = first.remaining() + second.remaining() + body.size_hint().lower() as usize; - let mut vec = Vec::with_capacity(cap); - vec.put(first); - vec.put(second); - - while let Some(buf) = body.data().await { - vec.put(buf?); - } - - Ok(vec.into()) -} diff --git a/src/main.rs b/src/main.rs index 08af119c..1d3b678f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -19,7 +19,6 @@ use http::{ Method, StatusCode, }; #[cfg(unix)] -use hyperlocal::SocketIncoming; use ruma::api::client::{ error::{Error as RumaError, ErrorBody, ErrorKind}, uiaa::UiaaResponse, @@ -186,6 +185,7 @@ async fn run_tls_server( } #[cfg(unix)] +#[allow(unused_variables)] async fn run_unix_socket_server( server: &Server, app: axum::routing::IntoMakeService, rx: oneshot::Receiver<()>, ) -> io::Result<()> { @@ -203,25 +203,15 @@ async fn run_unix_socket_server( let socket_perms = server.config.unix_socket_perms.to_string(); let octal_perms = u32::from_str_radix(&socket_perms, 8).unwrap(); - - let listener = tokio::net::UnixListener::bind(path.clone())?; - tokio::fs::set_permissions(path, Permissions::from_mode(octal_perms)) + tokio::fs::set_permissions(&path, Permissions::from_mode(octal_perms)) .await .unwrap(); - let socket = SocketIncoming::from_listener(listener); #[allow(clippy::let_underscore_untyped)] // error[E0658]: attributes on expressions are experimental #[cfg(feature = "systemd")] let _ = sd_notify::notify(true, &[sd_notify::NotifyState::Ready]); + let bind = tokio::net::UnixListener::bind(&path)?; info!("Listening at {:?}", path); - let server = hyper::Server::builder(socket).serve(app); - let graceful = server.with_graceful_shutdown(async { - rx.await.ok(); - }); - - if let Err(e) = graceful.await { - error!("Server error: {:?}", e); - } Ok(()) } @@ -319,8 +309,8 @@ async fn build(server: &Server) -> io::Result( - req: http::Request, next: axum::middleware::Next, +async fn request_spawn( + req: http::Request, next: axum::middleware::Next, ) -> Result { if services().globals.shutdown.load(atomic::Ordering::Relaxed) { return Err(StatusCode::SERVICE_UNAVAILABLE); @@ -330,8 +320,8 @@ async fn request_spawn( .map_err(|_| StatusCode::INTERNAL_SERVER_ERROR) } -async fn request_handler( - req: http::Request, next: axum::middleware::Next, +async fn request_handler( + req: http::Request, next: axum::middleware::Next, ) -> Result { let method = req.method().clone(); let uri = req.uri().clone(); diff --git a/src/service/globals/resolver.rs b/src/service/globals/resolver.rs index d958309d..e0c7132f 100644 --- a/src/service/globals/resolver.rs +++ b/src/service/globals/resolver.rs @@ -7,8 +7,7 @@ use std::{ }; use hickory_resolver::TokioAsyncResolver; -use hyper::client::connect::dns::Name; -use reqwest::dns::{Addrs, Resolve, Resolving}; +use reqwest::dns::{Addrs, Name, Resolve, Resolving}; use ruma::OwnedServerName; use tokio::sync::RwLock; use tracing::error;