diff --git a/Cargo.lock b/Cargo.lock index 6b92633..1b1a034 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -94,9 +94,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.73" +version = "0.1.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +checksum = "fdf6721fb0140e4f897002dd086c06f6c27775df19cfe1fccb21181a48fd2c98" dependencies = [ "proc-macro2", "quote", @@ -188,9 +188,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.4" +version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" [[package]] name = "bitflags" @@ -200,9 +200,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" [[package]] name = "block-buffer" @@ -567,10 +567,11 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.8" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" +checksum = "8eb30d70a07a3b04884d2677f06bec33509dc67ca60d92949e5535352d3191dc" dependencies = [ + "powerfmt", "serde", ] @@ -595,9 +596,9 @@ checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" [[package]] name = "digest" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", "crypto-common", @@ -705,9 +706,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.27" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", "miniz_oxide", @@ -730,9 +731,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -745,9 +746,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -755,15 +756,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -772,15 +773,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", @@ -789,21 +790,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -829,9 +830,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if", "libc", @@ -976,9 +977,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.27" +version = "0.14.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" dependencies = [ "bytes", "futures-channel", @@ -1015,15 +1016,15 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http", "hyper", "log", - "rustls 0.21.7", + "rustls 0.21.10", "rustls-native-certs", "tokio", "tokio-rustls 0.24.1", @@ -1107,9 +1108,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "iprange" @@ -1167,9 +1168,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.148" +version = "0.2.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" +checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" [[package]] name = "libgit2-sys" @@ -1185,12 +1186,12 @@ dependencies = [ [[package]] name = "libunftp" -version = "0.19.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5477655b6a73b7f735f39b62ab02cc8db974863ad68f6e08f699da662d520004" +checksum = "1f49971080b2ea8c8f254a94bd98d7873e236b32c1f2b486ab514009e09fdb4b" dependencies = [ "async-trait", - "bitflags 2.4.0", + "bitflags 2.4.1", "bytes", "chrono", "dashmap", @@ -1203,7 +1204,7 @@ dependencies = [ "moka", "prometheus", "proxy-protocol", - "rustls 0.21.7", + "rustls 0.21.10", "rustls-pemfile", "slog", "slog-stdlog", @@ -1283,10 +1284,11 @@ checksum = "b87248edafb776e59e6ee64a79086f65890d3510f2c656c000bf2a7e8a0aea40" [[package]] name = "md-5" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" dependencies = [ + "cfg-if", "digest", ] @@ -1328,9 +1330,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.8" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "wasi", @@ -1510,9 +1512,9 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project" @@ -1552,6 +1554,12 @@ version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -1796,14 +1804,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.5" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.8", - "regex-syntax 0.7.5", + "regex-automata 0.4.3", + "regex-syntax 0.8.2", ] [[package]] @@ -1817,13 +1825,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.8" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.5", + "regex-syntax 0.8.2", ] [[package]] @@ -1834,9 +1842,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.5" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "ring" @@ -1847,12 +1855,26 @@ dependencies = [ "cc", "libc", "once_cell", - "spin", - "untrusted", + "spin 0.5.2", + "untrusted 0.7.1", "web-sys", "winapi", ] +[[package]] +name = "ring" +version = "0.17.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +dependencies = [ + "cc", + "getrandom", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys 0.48.0", +] + [[package]] name = "rustc-demangle" version = "0.1.23" @@ -1912,19 +1934,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" dependencies = [ "log", - "ring", + "ring 0.16.20", "sct", "webpki", ] [[package]] name = "rustls" -version = "0.21.7" +version = "0.21.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", - "ring", + "ring 0.17.7", "rustls-webpki", "sct", ] @@ -1943,21 +1965,21 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64 0.21.4", + "base64 0.21.5", ] [[package]] name = "rustls-webpki" -version = "0.101.5" +version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45a27e3b59326c16e23d30aeb7a36a24cc0d29e71d68ff611cdfb4a01d013bed" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring", - "untrusted", + "ring 0.17.7", + "untrusted 0.9.0", ] [[package]] @@ -2017,8 +2039,8 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" dependencies = [ - "ring", - "untrusted", + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] @@ -2061,18 +2083,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.188" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", @@ -2081,9 +2103,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ "itoa 1.0.9", "ryu", @@ -2252,9 +2274,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ "libc", "windows-sys 0.48.0", @@ -2266,6 +2288,12 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "std_prelude" version = "0.2.12" @@ -2381,18 +2409,18 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" [[package]] name = "thiserror" -version = "1.0.48" +version = "1.0.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" +checksum = "f11c217e1416d6f036b870f14e0413d480dbf28edbee1f877abaf0206af43bb7" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.48" +version = "1.0.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" +checksum = "01742297787513b79cf8e29d1056ede1313e2420b7b3b15d0a768b4921f549df" dependencies = [ "proc-macro2", "quote", @@ -2411,14 +2439,15 @@ dependencies = [ [[package]] name = "time" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f6bb557fd245c28e6411aa56b6403c689ad95061f50e4be16c274e70a17e48" +checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" dependencies = [ "deranged", "itoa 1.0.9", "libc", "num_threads", + "powerfmt", "serde", "time-core", "time-macros", @@ -2426,15 +2455,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.14" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a942f44339478ef67935ab2bbaec2fb0322496cf3cbe84b261e06ac3814c572" +checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" dependencies = [ "time-core", ] @@ -2456,9 +2485,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.32.0" +version = "1.35.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" +checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" dependencies = [ "backtrace", "bytes", @@ -2467,7 +2496,7 @@ dependencies = [ "num_cpus", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.4", + "socket2 0.5.5", "tokio-macros", "tracing", "windows-sys 0.48.0", @@ -2485,9 +2514,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", @@ -2511,7 +2540,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.7", + "rustls 0.21.10", "tokio", ] @@ -2528,9 +2557,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", @@ -2558,7 +2587,7 @@ checksum = "3082666a3a6433f7f511c7192923fa1fe07c69332d3c6a2e6bb040b569199d5a" dependencies = [ "async-trait", "axum", - "base64 0.21.4", + "base64 0.21.5", "bytes", "futures-core", "futures-util", @@ -2612,11 +2641,10 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -2624,9 +2652,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", @@ -2635,9 +2663,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", "valuable", @@ -2713,18 +2741,18 @@ dependencies = [ [[package]] name = "unftp-auth-jsonfile" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9a81f6b71dee6dbf563b0daf074a9a0129e74cdca5b82ba001c1953c52393f7" +checksum = "6e70b92dc601a8b364a9048879f0d0866eee41d700da1c825cd32a714dadb85d" dependencies = [ "async-trait", - "base64 0.21.4", + "base64 0.21.5", "bytes", "flate2", "ipnet", "iprange", "libunftp", - "ring", + "ring 0.16.20", "serde", "serde_json", "tokio", @@ -2748,13 +2776,13 @@ dependencies = [ [[package]] name = "unftp-auth-rest" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22d15a51f1a58c712ad660f7747013e6d4cf11a3b656b70a5082f909eba0f966" +checksum = "092ea9a32364a7160dadddd277bd386ed679bdf272cd3f74d50a81645dc58395" dependencies = [ "async-trait", "hyper", - "hyper-rustls 0.24.1", + "hyper-rustls 0.24.2", "libunftp", "percent-encoding", "regex", @@ -2767,9 +2795,9 @@ dependencies = [ [[package]] name = "unftp-sbe-fs" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e773735518812692e795347490f7e111e4c52615900d3416dda74b8dcaba910f" +checksum = "3f7165a6e8d96504e2515247fec05fac7f3add1b295d53d81f6aa3c0eee69ace" dependencies = [ "async-trait", "cfg-if", @@ -2784,17 +2812,17 @@ dependencies = [ [[package]] name = "unftp-sbe-gcs" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3e159ce613dd6240a3bb359f3cbf22ff51194662fc0189d8a3bc62b25a50e4f" +checksum = "539b07479f2139bab50bcef472f0169abda057fdd00ae86313b22350701d18b0" dependencies = [ "async-trait", - "base64 0.21.4", + "base64 0.21.5", "bytes", "chrono", "futures", "hyper", - "hyper-rustls 0.24.1", + "hyper-rustls 0.24.2", "libunftp", "mime", "percent-encoding", @@ -2816,7 +2844,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3a8e70163045039e0ae0a045c12b4db8751e5fc99f5a0f5cfdc848bc269b668" dependencies = [ "async-trait", - "bitflags 2.4.0", + "bitflags 2.4.1", "libunftp", "tokio", ] @@ -2880,6 +2908,12 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "url" version = "2.3.1" @@ -2902,9 +2936,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.4.1" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" +checksum = "5e395fcf16a7a3d8127ec99782007af141946b4795001f876d54fb0d55978560" dependencies = [ "getrandom", ] @@ -3030,8 +3064,8 @@ version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" dependencies = [ - "ring", - "untrusted", + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] @@ -3247,9 +3281,9 @@ checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] name = "yup-oauth2" -version = "8.3.0" +version = "8.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "364ca376b5c04d9b2be9693054e3e0d2d146b363819d0f9a10c6ee66e4c8406b" +checksum = "24bea7df5a9a74a9a0de92f22e5ab3fb9505dd960c7f1f00de5b7231d9d97206" dependencies = [ "anyhow", "async-trait", @@ -3257,11 +3291,11 @@ dependencies = [ "futures", "http", "hyper", - "hyper-rustls 0.24.1", + "hyper-rustls 0.24.2", "itertools", "log", "percent-encoding", - "rustls 0.21.7", + "rustls 0.21.10", "rustls-pemfile", "seahash", "serde", diff --git a/Cargo.toml b/Cargo.toml index 3b881f2..83c26e1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,7 +37,7 @@ http = "0.2.9" hyper = { version = "0.14.27", features = ["server", "http1"] } hyper-rustls = "0.23.2" lazy_static = "1.4.0" -libunftp = "0.19.0" +libunftp = "0.19.1" prometheus = { version = "0.13.3", features = ["process"] } serde = { version = "1.0.188", features = ["derive"] } serde_json = "1.0.107" @@ -46,10 +46,10 @@ slog-async = "2.8.0" slog-term = "2.9.0" thiserror = "1.0.48" tokio = { version = "1.32.0", features = ["signal", "rt-multi-thread"] } -unftp-sbe-fs = "0.2.3" -unftp-sbe-gcs = { version = "0.2.4", optional = true } -unftp-auth-rest = { version = "0.2.3", optional = true } -unftp-auth-jsonfile = { version = "0.3.2", optional = true } +unftp-sbe-fs = "0.2.4" +unftp-sbe-gcs = { version = "0.2.5", optional = true } +unftp-auth-rest = { version = "0.2.4", optional = true } +unftp-auth-jsonfile = { version = "0.3.3", optional = true } unftp-sbe-rooter = "0.2.0" unftp-sbe-restrict = "0.1.1" diff --git a/RELEASE-CHECKLIST.md b/RELEASE-CHECKLIST.md index 9abc1a7..1e488c9 100644 --- a/RELEASE-CHECKLIST.md +++ b/RELEASE-CHECKLIST.md @@ -21,5 +21,5 @@ > slog-redis-v0.1.2 * Wait for the Github Actions pipeline to finish. You should see all artifacts in the release page. * Build and push the docker containers -* Publish the docs site unftp.rs by running `make site` +* Publish the docs site unftp.rs by running `make site`. * Notify the Telegram channel. diff --git a/crates/redislog/src/lib.rs b/crates/redislog/src/lib.rs index 559e967..70e3d4e 100644 --- a/crates/redislog/src/lib.rs +++ b/crates/redislog/src/lib.rs @@ -94,7 +94,7 @@ pub struct Builder { connection_pool_size: u32, } -/// Errors returned by the [`Builder`](crate::Builder) and the [`Logger`](crate::Logger) +/// Errors returned by the [`Builder`] and the [`Logger`] #[derive(Debug)] pub enum Error { ConnectionPoolErr(r2d2::Error), diff --git a/docs/server/rest.md b/docs/server/rest.md new file mode 100644 index 0000000..0b77164 --- /dev/null +++ b/docs/server/rest.md @@ -0,0 +1,43 @@ +--- +title: REST auth +--- + +There are multiple ways to externalize authentication, rather than [local JSON authentication](/server/jsonconfig). +This page explains how to use the REST authenticator. +With the REST method, you provide your own HTTP endpoint. +You can use any method like GET or POST, and you can customize unFTP to support your API. + +## Set up + +Example: + +```sh +unftp \ + --auth-type rest \ + --auth-rest-method POST \ + --auth-rest-url http://localhost:5000/v1/ftp-auth \ + --auth-rest-body '{"username":"{USER}","password":"{PASS}"}' \ + --auth-rest-selector /status \ + --auth-rest-regex successful +``` + +Let's say, a user `alice` logs in on the unFTP server. +With the above configuration unFTP will build an HTTP POST authentication request for http://localhost:5000/v1/ftp-auth +It will replace the placeholders `{USER}`, and `{PASS}` with the given FTP username and password: + +```json +{"username":"alice","password":"abc1234"} +``` + +And, if the login was successful, the server should respond with something like: + +```json +{"message":"User logged in.","status":"successful"} +``` + +The REST authenticator uses the `/status` JSON pointer, and matches it to `"successful"`. + +Aside from the placeholders `{USER}` and `{PASS}` you can use `{IP}`. +That will add the source IP address of the connected client. +That is in case if you want to perform client-IP whitelisting, next to regular username and password. + diff --git a/doctave.yaml b/doctave.yaml index c3453bd..96af978 100644 --- a/doctave.yaml +++ b/doctave.yaml @@ -16,6 +16,7 @@ navigation: - path: docs/server/ftps.md - path: docs/server/gcs.md - path: docs/server/jsonconfig.md + - path: docs/server/rest.md - path: docs/server/pubsub.md - path: docs/server/anti-brute.md - path: docs/server/proxy-protocol.md diff --git a/src/args.rs b/src/args.rs index c0202ab..1dba43d 100644 --- a/src/args.rs +++ b/src/args.rs @@ -373,7 +373,7 @@ pub(crate) fn clap_app(tmp_dir: &str) -> clap::Command { Arg::new(AUTH_REST_URL) .long("auth-rest-url") .value_name("URL") - .help("Define REST endpoint. {USER} and {PASS} are replaced by provided credentials.") + .help("Define REST endpoint. {USER}, {PASS} and/or {IP} are replaced by provided credentials and source IP respectively.") .env("UNFTP_AUTH_REST_URL") .takes_value(true), ) @@ -389,9 +389,9 @@ pub(crate) fn clap_app(tmp_dir: &str) -> clap::Command { .arg( Arg::new(AUTH_REST_BODY) .long("auth-rest-body") - .value_name("URL") - .help("If HTTP method contains body, it can be specified here. {USER} and {PASS} \ - are replaced by provided credentials.") + .value_name("TEMPLATE") + .help("If HTTP method contains body, it can be specified here. {USER}, {PASS} and/or {IP}\ + are replaced by provided credentials and source IP respectively.") .env("UNFTP_AUTH_REST_BODY") .takes_value(true), ) diff --git a/src/infra/pubsub.rs b/src/infra/pubsub.rs index 8dfbc3a..9f6008c 100644 --- a/src/infra/pubsub.rs +++ b/src/infra/pubsub.rs @@ -16,7 +16,7 @@ use std::sync::Arc; // - API Docs for publishing: https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics/publish // -/// An [EventDispatcher](crate::domain::EventDispatcher) that dispatches to Google Pub/sub +/// An [EventDispatcher] that dispatches to Google Pub/sub #[derive(Debug)] pub struct PubsubEventDispatcher { log: Arc, diff --git a/src/main.rs b/src/main.rs index dd0a4e2..791da92 100644 --- a/src/main.rs +++ b/src/main.rs @@ -136,7 +136,6 @@ fn make_pam_auth(m: &clap::ArgMatches) -> Result { } } -// FIXME: add user support fn make_rest_auth(m: &clap::ArgMatches) -> Result { #[cfg(not(feature = "rest_auth"))] { @@ -161,23 +160,33 @@ fn make_rest_auth(m: &clap::ArgMatches) -> Result { ); } - let authenticator: unftp_auth_rest::RestAuthenticator = - match unftp_auth_rest::Builder::new() - .with_username_placeholder("{USER}".to_string()) - .with_password_placeholder("{PASS}".to_string()) - .with_url(String::from(url)) - .with_method( - hyper::Method::from_str(method) - .map_err(|e| format!("error creating REST auth: {}", e))?, - ) - .with_body(String::from(m.value_of(args::AUTH_REST_BODY).unwrap_or(""))) - .with_selector(String::from(selector)) - .with_regex(String::from(regex)) - .build() - { - Ok(res) => res, - Err(e) => return Err(format!("Unable to create RestAuthenticator: {}", e)), - }; + let body = String::from(m.value_of(args::AUTH_REST_BODY).unwrap_or("")); + let mut builder = unftp_auth_rest::Builder::new() + .with_url(String::from(url)) + .with_method( + hyper::Method::from_str(method) + .map_err(|e| format!("error creating REST auth: {}", e))?, + ) + .with_body(String::from(m.value_of(args::AUTH_REST_BODY).unwrap_or(""))) + .with_selector(String::from(selector)) + .with_regex(String::from(regex)); + + if url.contains("{USER}") || body.contains("{USER}") { + builder = builder.with_username_placeholder("{USER}".to_string()); + } + + if url.contains("{PASS}") || body.contains("{PASS}") { + builder = builder.with_password_placeholder("{PASS}".to_string()); + } + + if url.contains("{IP}") || body.contains("{IP}") { + builder = builder.with_source_ip_placeholder("{IP}".to_string()); + } + + let authenticator: unftp_auth_rest::RestAuthenticator = match builder.build() { + Ok(res) => res, + Err(e) => return Err(format!("Unable to create RestAuthenticator: {}", e)), + }; Ok(LookupAuthenticator::new(authenticator)) }