From eeeb0c69cd3b39fa1b6107cca12aef6ea434fc18 Mon Sep 17 00:00:00 2001 From: Saarko Date: Fri, 24 Jan 2025 16:36:10 +0200 Subject: [PATCH] fpush-fcm: update fcm crate to 7.0, update hyper to v1 --- Cargo.lock | 561 ++++++++++++++++++++++++------------------ Cargo.toml | 10 +- fpush-fcm/Cargo.toml | 5 +- fpush-fcm/src/push.rs | 32 +-- fpush/Cargo.toml | 1 + fpush/src/main.rs | 3 + 6 files changed, 356 insertions(+), 256 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a85119f..7f64586 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "a2" @@ -10,15 +10,15 @@ checksum = "f279fc8b1f1a64138f0f4b9cda9be488ae35bc2f8556c7ffe60730f1c07d005a" dependencies = [ "base64 0.21.7", "erased-serde", - "http 1.1.0", + "http", "http-body-util", - "hyper 1.4.1", + "hyper", "hyper-rustls 0.26.0", "hyper-util", "openssl", "parking_lot", "rustls 0.22.4", - "rustls-pemfile 2.1.3", + "rustls-pemfile", "serde", "serde_json", "thiserror", @@ -142,6 +142,31 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +[[package]] +name = "aws-lc-rs" +version = "1.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c2b7ddaa2c56a367ad27a094ad8ef4faacf8a617c2575acb2ba88949df999ca" +dependencies = [ + "aws-lc-sys", + "paste", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71b2ddd3ada61a305e1d8bb6c005d1eaa7d14d903681edfc400406d523a9b491" +dependencies = [ + "bindgen", + "cc", + "cmake", + "dunce", + "fs_extra", + "paste", +] + [[package]] name = "backtrace" version = "0.3.73" @@ -169,6 +194,29 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +[[package]] +name = "bindgen" +version = "0.69.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "itertools 0.12.1", + "lazy_static", + "lazycell", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn", + "which", +] + [[package]] name = "bitflags" version = "2.6.0" @@ -225,6 +273,19 @@ name = "cc" version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9e8aabfac534be767c909e0690571677d49f41bd8465ae876fe043d52ba5292" +dependencies = [ + "jobserver", + "libc", +] + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] [[package]] name = "cfg-if" @@ -247,6 +308,26 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "cmake" +version = "0.1.52" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c682c223677e0e5b6b7f63a64b9351844c3f1b1678a68b7ee617e30fb082620e" +dependencies = [ + "cc", +] + [[package]] name = "colorchoice" version = "1.0.2" @@ -439,6 +520,12 @@ dependencies = [ "syn", ] +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + [[package]] name = "either" version = "1.13.0" @@ -495,6 +582,16 @@ dependencies = [ "serde", ] +[[package]] +name = "errno" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + [[package]] name = "fnv" version = "1.0.7" @@ -522,7 +619,7 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ - "percent-encoding 2.3.1", + "percent-encoding", ] [[package]] @@ -541,6 +638,7 @@ dependencies = [ "serde_derive", "serde_json", "tokio", + "tokio-rustls 0.26.0", "tokio-xmpp", "xmpp", "xmpp-parsers", @@ -577,8 +675,9 @@ dependencies = [ "async-trait", "fpush-traits", "google-fcm1", - "hyper 0.14.30", - "hyper-rustls 0.24.2", + "hyper", + "hyper-rustls 0.27.5", + "hyper-util", "log", "serde", "serde_derive", @@ -640,6 +739,12 @@ dependencies = [ "derive_more", ] +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + [[package]] name = "futures" version = "0.3.30" @@ -756,65 +861,53 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +[[package]] +name = "glob" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + [[package]] name = "google-apis-common" -version = "6.0.4" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2efe58cc89d6670229d0ab84bfc4bbe35d2572571accaf2201526360b358414f" +checksum = "7530ee92a7e9247c3294ae1b84ea98474dbc27563c49a14d3938e816499bf38f" dependencies = [ "base64 0.22.1", "chrono", - "http 0.2.12", - "hyper 0.14.30", - "itertools 0.12.1", + "http", + "http-body-util", + "hyper", + "hyper-util", + "itertools 0.13.0", "mime", - "percent-encoding 2.3.1", + "percent-encoding", "serde", "serde_json", "serde_with", "tokio", - "tower-service", - "url 2.5.2", + "url", "yup-oauth2", ] [[package]] name = "google-fcm1" -version = "5.0.5+20240621" +version = "6.0.0+20240621" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda2c7b1321914ded2b247e094da2dbc4202cc887983ffbb22631d34c8466530" +checksum = "d8012fe5af943d56009d8f1bdb6d8e304fb0cbe38b1a8008bc7679ae8945fccc" dependencies = [ - "anyhow", + "chrono", "google-apis-common", - "http 0.2.12", - "hyper 0.14.30", - "hyper-rustls 0.25.0", - "itertools 0.13.0", + "hyper", + "hyper-rustls 0.27.5", + "hyper-util", "mime", "serde", "serde_json", + "serde_with", "tokio", - "tower-service", - "url 1.7.2", -] - -[[package]] -name = "h2" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http 0.2.12", - "indexmap 2.3.0", - "slab", - "tokio", - "tokio-util", - "tracing", + "url", + "yup-oauth2", ] [[package]] @@ -828,7 +921,7 @@ dependencies = [ "fnv", "futures-core", "futures-sink", - "http 1.1.0", + "http", "indexmap 2.3.0", "slab", "tokio", @@ -887,7 +980,7 @@ dependencies = [ "tinyvec", "tokio", "tracing", - "url 2.5.2", + "url", ] [[package]] @@ -920,6 +1013,15 @@ dependencies = [ "digest", ] +[[package]] +name = "home" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" +dependencies = [ + "windows-sys 0.59.0", +] + [[package]] name = "hostname" version = "0.3.1" @@ -931,17 +1033,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "http" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - [[package]] name = "http" version = "1.1.0" @@ -953,17 +1044,6 @@ dependencies = [ "itoa", ] -[[package]] -name = "http-body" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" -dependencies = [ - "bytes", - "http 0.2.12", - "pin-project-lite", -] - [[package]] name = "http-body" version = "1.0.1" @@ -971,7 +1051,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", - "http 1.1.0", + "http", ] [[package]] @@ -982,8 +1062,8 @@ checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", "futures-util", - "http 1.1.0", - "http-body 1.0.1", + "http", + "http-body", "pin-project-lite", ] @@ -1014,30 +1094,6 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" -[[package]] -name = "hyper" -version = "0.14.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2 0.3.26", - "http 0.2.12", - "http-body 0.4.6", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", - "want", -] - [[package]] name = "hyper" version = "1.4.1" @@ -1047,10 +1103,11 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.5", - "http 1.1.0", - "http-body 1.0.1", + "h2", + "http", + "http-body", "httparse", + "httpdate", "itoa", "pin-project-lite", "smallvec", @@ -1060,53 +1117,39 @@ dependencies = [ [[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.30", - "log", - "rustls 0.21.12", - "rustls-native-certs 0.6.3", - "tokio", - "tokio-rustls 0.24.1", -] - -[[package]] -name = "hyper-rustls" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "399c78f9338483cb7e630c8474b07268983c6bd5acee012e4211f9f7bb21b070" +checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c" dependencies = [ "futures-util", - "http 0.2.12", - "hyper 0.14.30", - "log", + "http", + "hyper", + "hyper-util", "rustls 0.22.4", - "rustls-native-certs 0.7.1", "rustls-pki-types", "tokio", "tokio-rustls 0.25.0", + "tower-service", + "webpki-roots", ] [[package]] name = "hyper-rustls" -version = "0.26.0" +version = "0.27.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c" +checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" dependencies = [ "futures-util", - "http 1.1.0", - "hyper 1.4.1", + "http", + "hyper", "hyper-util", - "rustls 0.22.4", + "log", + "rustls 0.23.12", + "rustls-native-certs", "rustls-pki-types", "tokio", - "tokio-rustls 0.25.0", + "tokio-rustls 0.26.0", "tower-service", - "webpki-roots", ] [[package]] @@ -1118,9 +1161,9 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "http 1.1.0", - "http-body 1.0.1", - "hyper 1.4.1", + "http", + "http-body", + "hyper", "pin-project-lite", "socket2", "tokio", @@ -1276,17 +1319,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -[[package]] -name = "idna" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" -dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "idna" version = "0.4.0" @@ -1399,6 +1431,15 @@ dependencies = [ "stringprep", ] +[[package]] +name = "jobserver" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +dependencies = [ + "libc", +] + [[package]] name = "js-sys" version = "0.3.70" @@ -1417,18 +1458,46 @@ dependencies = [ "cpufeatures", ] +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + [[package]] name = "libc" version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +[[package]] +name = "libloading" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +dependencies = [ + "cfg-if", + "windows-targets 0.52.6", +] + [[package]] name = "linked-hash-map" version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + [[package]] name = "litemap" version = "0.7.3" @@ -1466,12 +1535,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" -[[package]] -name = "matches" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" - [[package]] name = "memchr" version = "2.7.4" @@ -1492,6 +1555,12 @@ dependencies = [ "rxml", ] +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.7.4" @@ -1513,6 +1582,16 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "num-conv" version = "0.1.0" @@ -1619,6 +1698,12 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + [[package]] name = "pbkdf2" version = "0.12.2" @@ -1628,12 +1713,6 @@ dependencies = [ "digest", ] -[[package]] -name = "percent-encoding" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" - [[package]] name = "percent-encoding" version = "2.3.1" @@ -1693,6 +1772,16 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "prettyplease" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" +dependencies = [ + "proc-macro2", + "syn", +] + [[package]] name = "proc-macro2" version = "1.0.86" @@ -1795,17 +1884,17 @@ dependencies = [ "bytes", "futures-core", "futures-util", - "http 1.1.0", - "http-body 1.0.1", + "http", + "http-body", "http-body-util", - "hyper 1.4.1", + "hyper", "hyper-util", "ipnet", "js-sys", "log", "mime", "once_cell", - "percent-encoding 2.3.1", + "percent-encoding", "pin-project-lite", "serde", "serde_json", @@ -1814,7 +1903,7 @@ dependencies = [ "tokio", "tokio-util", "tower-service", - "url 2.5.2", + "url", "wasm-bindgen", "wasm-bindgen-futures", "wasm-streams", @@ -1854,15 +1943,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustls" -version = "0.21.12" +name = "rustc-hash" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustix" +version = "0.38.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "log", - "ring", - "rustls-webpki 0.101.7", - "sct", + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", ] [[package]] @@ -1874,45 +1970,40 @@ dependencies = [ "log", "ring", "rustls-pki-types", - "rustls-webpki 0.102.6", + "rustls-webpki", "subtle", "zeroize", ] [[package]] -name = "rustls-native-certs" -version = "0.6.3" +name = "rustls" +version = "0.23.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" dependencies = [ - "openssl-probe", - "rustls-pemfile 1.0.4", - "schannel", - "security-framework", + "aws-lc-rs", + "log", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", ] [[package]] name = "rustls-native-certs" -version = "0.7.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a88d6d420651b496bdd98684116959239430022a115c1240e6c3993be0b15fba" +checksum = "fcaf18a4f2be7326cd874a5fa579fae794320a0f388d365dca7e480e55f83f8a" dependencies = [ "openssl-probe", - "rustls-pemfile 2.1.3", + "rustls-pemfile", "rustls-pki-types", "schannel", "security-framework", ] -[[package]] -name = "rustls-pemfile" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" -dependencies = [ - "base64 0.21.7", -] - [[package]] name = "rustls-pemfile" version = "2.1.3" @@ -1929,22 +2020,13 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" -[[package]] -name = "rustls-webpki" -version = "0.101.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "rustls-webpki" version = "0.102.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e" dependencies = [ + "aws-lc-rs", "ring", "rustls-pki-types", "untrusted", @@ -2023,16 +2105,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "sct" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "seahash" version = "4.1.0" @@ -2178,6 +2250,12 @@ dependencies = [ "keccak", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook-registry" version = "1.4.2" @@ -2255,9 +2333,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" -version = "2.0.74" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fceb41e3d546d0bd83421d3409b1460cc7444cd389341a4c880fe7a042cb3d7" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" dependencies = [ "proc-macro2", "quote", @@ -2390,21 +2468,22 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.24.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" dependencies = [ - "rustls 0.21.12", + "rustls 0.22.4", + "rustls-pki-types", "tokio", ] [[package]] name = "tokio-rustls" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.22.4", + "rustls 0.23.12", "rustls-pki-types", "tokio", ] @@ -2562,17 +2641,6 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" -[[package]] -name = "url" -version = "1.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" -dependencies = [ - "idna 0.1.5", - "matches", - "percent-encoding 1.0.1", -] - [[package]] name = "url" version = "2.5.2" @@ -2581,7 +2649,7 @@ checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna 0.5.0", - "percent-encoding 2.3.1", + "percent-encoding", ] [[package]] @@ -2737,6 +2805,18 @@ dependencies = [ "rustls-pki-types", ] +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + [[package]] name = "widestring" version = "1.1.0" @@ -2792,6 +2872,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-targets" version = "0.48.5" @@ -3027,29 +3116,29 @@ dependencies = [ [[package]] name = "yup-oauth2" -version = "9.0.0" +version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f75463c432f5d4ca9c75047514df3d768f8ac3276ac22c9a6531af6d0a3da7ee" +checksum = "4ed5f19242090128c5809f6535cc7b8d4e2c32433f6c6005800bbc20a644a7f0" dependencies = [ "anyhow", "async-trait", - "base64 0.21.7", + "base64 0.22.1", "futures", - "http 0.2.12", - "hyper 0.14.30", - "hyper-rustls 0.25.0", - "itertools 0.12.1", + "http", + "http-body-util", + "hyper", + "hyper-rustls 0.27.5", + "hyper-util", "log", - "percent-encoding 2.3.1", - "rustls 0.22.4", - "rustls-pemfile 1.0.4", + "percent-encoding", + "rustls 0.23.12", + "rustls-pemfile", "seahash", "serde", "serde_json", "time", "tokio", - "tower-service", - "url 2.5.2", + "url", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 01097b8..567015b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,6 +31,7 @@ serde-humantime = { version = "^0.1" } serde_json = { version = "1.0" } tokio = { version = "^1.39" } +tokio-rustls = { version = "0.26.0", default-features = false, features = ["ring"] } futures = { version = "^0.3" } derive_more = { version = "^1.0", features = ["from", "display"] } @@ -38,9 +39,10 @@ dashmap = { version = "^6.0" } rand = { version = "^0.8", features = ["std_rng"] } -google-fcm1 = { version = "5.0.2" } -hyper-rustls = { version = "0.24", features = ["http2"] } -hyper = { version = "0.14", features = ["client", "http2"] } +google-fcm1 = { version = "6.0" } +hyper-rustls = { version = "0.27", features = ["http2", "ring"] } +hyper = { version = "1.0", features = ["http2"] } +hyper-util = { version = "0.1", features = ["client-legacy"] } a2 = { version = "0.10" } @@ -65,4 +67,4 @@ release_max_level_info = ["log/release_max_level_info"] monal_prod = ["fpush-push/random_delay_before_push", "release_max_level_info", "fpush-push/enable_apns_support"] monal_debug = ["fpush-push/random_delay_before_push", "fpush-push/enable_apns_support", "fpush-push/enable_fcm_support"] -default = ["monal_debug"] \ No newline at end of file +default = ["monal_debug"] diff --git a/fpush-fcm/Cargo.toml b/fpush-fcm/Cargo.toml index 09bf58e..0d75af6 100644 --- a/fpush-fcm/Cargo.toml +++ b/fpush-fcm/Cargo.toml @@ -14,8 +14,9 @@ serde = { workspace = true, features = ["derive"] } serde_json.workspace = true google-fcm1.workspace = true -hyper-rustls = { workspace = true, features = ["http2"] } -hyper = { workspace = true, features = ["client", "http2"] } +hyper-rustls = { workspace = true, features = ["http2", "ring"] } +hyper = { workspace = true, features = ["http2"] } +hyper-util = { workspace = true, features = ["client-legacy"] } fpush-traits.workspace = true tokio = { workspace = true, features = ["full"] } diff --git a/fpush-fcm/src/push.rs b/fpush-fcm/src/push.rs index e77221e..f282061 100644 --- a/fpush-fcm/src/push.rs +++ b/fpush-fcm/src/push.rs @@ -5,7 +5,7 @@ use fpush_traits::push::{PushError, PushResult, PushTrait}; use async_trait::async_trait; use google_fcm1::{ api::{Message, SendMessageRequest}, - oauth2, FirebaseCloudMessaging, + hyper_rustls, hyper_util, yup_oauth2, FirebaseCloudMessaging, }; use log::{error, warn}; @@ -13,14 +13,15 @@ use serde::Deserialize; use crate::config::GoogleFcmConfig; pub struct FpushFcm { - fcm_conn: - FirebaseCloudMessaging>, + fcm_conn: FirebaseCloudMessaging< + hyper_rustls::HttpsConnector, + >, fcm_parent: String, } impl FpushFcm { - async fn load_oauth2_app_secret(fcm_config: &GoogleFcmConfig) -> oauth2::ServiceAccountKey { - match oauth2::read_service_account_key(Path::new(fcm_config.fcm_secret_path())).await { + async fn load_oauth2_app_secret(fcm_config: &GoogleFcmConfig) -> yup_oauth2::ServiceAccountKey { + match yup_oauth2::read_service_account_key(Path::new(fcm_config.fcm_secret_path())).await { Ok(s) => s, Err(e) => panic!( "Could not read fcm config file at {} reason: {}", @@ -34,7 +35,7 @@ impl FpushFcm { let fcm_secret = Self::load_oauth2_app_secret(fcm_config).await; // create login auth object - let auth = match oauth2::ServiceAccountAuthenticator::builder(fcm_secret.clone()) + let auth = match yup_oauth2::ServiceAccountAuthenticator::builder(fcm_secret.clone()) .build() .await { @@ -45,13 +46,16 @@ impl FpushFcm { } }; - let hyper_client = hyper::Client::builder().build( - hyper_rustls::HttpsConnectorBuilder::new() - .with_native_roots() - .https_only() - .enable_http2() - .build(), - ); + let hyper_client = + hyper_util::client::legacy::Client::builder(hyper_util::rt::TokioExecutor::new()) + .build( + hyper_rustls::HttpsConnectorBuilder::new() + .with_native_roots() + .unwrap() + .https_only() + .enable_http2() + .build(), + ); let fcm_conn = FirebaseCloudMessaging::new(hyper_client, auth); Ok(Self { fcm_conn, @@ -115,7 +119,7 @@ impl PushTrait for FpushFcm { match fcm_result { Err(e) => { warn!("FCM returned {}", e); - if let google_fcm1::client::Error::BadRequest(error_body) = e { + if let google_fcm1::Error::BadRequest(error_body) = e { let parsed_error_body: FcmErrorResponse = match serde_json::from_value(error_body) { Ok(body) => body, diff --git a/fpush/Cargo.toml b/fpush/Cargo.toml index 3085c56..89aab9b 100644 --- a/fpush/Cargo.toml +++ b/fpush/Cargo.toml @@ -23,6 +23,7 @@ serde.workspace = true serde-humantime.workspace = true tokio = { workspace = true, features = ["time"] } +tokio-rustls = { workspace = true, default-features = false, features = ["ring"] } futures.workspace = true derive_more.workspace = true diff --git a/fpush/src/main.rs b/fpush/src/main.rs index 66d4154..4b939bf 100644 --- a/fpush/src/main.rs +++ b/fpush/src/main.rs @@ -14,6 +14,9 @@ fn setup_logging() { #[tokio::main] async fn main() { setup_logging(); + tokio_rustls::rustls::crypto::ring::default_provider() + .install_default() + .expect("Failed to install rustls crypto provider"); // get settings name let args: Vec = std::env::args().collect();