diff --git a/Cargo.lock b/Cargo.lock index c3deec5..78e4db3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -216,6 +216,28 @@ dependencies = [ "zeroize", ] +[[package]] +name = "aws-lc-rs" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a88aab2464f1f25453baa7a07c84c5b7684e274054ba06817f382357f77a288" +dependencies = [ + "aws-lc-sys", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b45afffdee1e7c9126814751f88dddc747f41d91da16c9551a0f1e8a11e788a1" +dependencies = [ + "cc", + "cmake", + "dunce", + "fs_extra", +] + [[package]] name = "aws-runtime" version = "1.5.5" @@ -493,12 +515,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - [[package]] name = "base64" version = "0.21.7" @@ -533,12 +549,6 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "383d29d513d8764dcdc42ea295d979eb99c3c9f00607b3692cf68a431f7dca72" -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - [[package]] name = "bitflags" version = "2.8.0" @@ -582,16 +592,6 @@ dependencies = [ "syn", ] -[[package]] -name = "bstr" -version = "1.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531a9155a481e2ee699d4f98f43c0ca4ff8ee1bfd55c31e9e98fb29d2b176fe0" -dependencies = [ - "memchr", - "serde", -] - [[package]] name = "bumpalo" version = "3.17.0" @@ -643,19 +643,34 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.13" +version = "1.2.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7777341816418c02e033934a09f20dc0ccaf65a5201ef8a450ae0105a573fda" +checksum = "7a0aeaff4ff1a90589618835a598e545176939b97874f7abc7851caa0618f203" dependencies = [ + "find-msvc-tools", + "jobserver", + "libc", "shlex", ] +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "chrono" version = "0.4.39" @@ -671,28 +686,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "chrono-tz" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93698b29de5e97ad0ae26447b344c482a7284c737d9ddc5f9e52b74a336671bb" -dependencies = [ - "chrono", - "chrono-tz-build", - "phf", -] - -[[package]] -name = "chrono-tz-build" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c088aee841df9c3041febbb73934cfc39708749bf96dc827e3359cd39ef11b1" -dependencies = [ - "parse-zoneinfo", - "phf", - "phf_codegen", -] - [[package]] name = "cipher" version = "0.4.4" @@ -743,12 +736,31 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" +[[package]] +name = "cmake" +version = "0.1.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75443c44cd6b379beb8c5b45d85d0773baf31cce901fe7bb252f4eff3008ef7d" +dependencies = [ + "cc", +] + [[package]] name = "colorchoice" version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + [[package]] name = "compact_str" version = "0.7.1" @@ -796,6 +808,16 @@ dependencies = [ "libc", ] +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -829,47 +851,13 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "crossbeam-channel" -version = "0.5.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ba6d68e24814cb8de6bb986db8222d3a027d15872cabc0d18817bc3c0e4471" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" - [[package]] name = "crossterm" version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" dependencies = [ - "bitflags 2.8.0", + "bitflags", "crossterm_winapi", "libc", "mio 0.8.11", @@ -1062,12 +1050,6 @@ dependencies = [ "syn", ] -[[package]] -name = "deunicode" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "339544cc9e2c4dc3fc7149fd630c5f22263a4fdf18a98afd0075784968b5cf00" - [[package]] name = "devise" version = "0.4.2" @@ -1094,7 +1076,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b035a542cf7abf01f2e3c4d5a7acbaebfefe120ae4efc7bde3df98186e4b8af7" dependencies = [ - "bitflags 2.8.0", + "bitflags", "proc-macro2", "proc-macro2-diagnostics", "quote", @@ -1103,14 +1085,15 @@ dependencies = [ [[package]] name = "diesel" -version = "2.2.7" +version = "2.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04001f23ba8843dc315804fa324000376084dfb1c30794ff68dd279e6e5696d5" +checksum = "e130c806dccc85428c564f2dc5a96e05b6615a27c9a28776bd7761a9af4bb552" dependencies = [ - "bitflags 2.8.0", + "bitflags", "byteorder", "chrono", "diesel_derives", + "downcast-rs", "itoa", "pq-sys", "r2d2", @@ -1119,9 +1102,9 @@ dependencies = [ [[package]] name = "diesel_derives" -version = "2.2.3" +version = "2.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7f2c3de51e2ba6bf2a648285696137aaf0f5f487bcbea93972fe8a364e131a4" +checksum = "c30b2969f923fa1f73744b92bb7df60b858df8832742d9a3aceb79236c0be1d2" dependencies = [ "diesel_table_macro_syntax", "dsl_auto_type", @@ -1132,9 +1115,9 @@ dependencies = [ [[package]] name = "diesel_migrations" -version = "2.2.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a73ce704bad4231f001bff3314d91dce4aba0770cee8b233991859abc15c1f6" +checksum = "745fd255645f0f1135f9ec55c7b00e0882192af9683ab4731e4bba3da82b8f9c" dependencies = [ "diesel", "migrations_internals", @@ -1143,9 +1126,9 @@ dependencies = [ [[package]] name = "diesel_table_macro_syntax" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "209c735641a413bc68c4923a9d6ad4bcb3ca306b794edaa7eb0b3228a99ffb25" +checksum = "fe2444076b48641147115697648dc743c2c00b61adade0f01ce67133c7babe8c" dependencies = [ "syn", ] @@ -1172,13 +1155,19 @@ dependencies = [ "syn", ] +[[package]] +name = "downcast-rs" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "117240f60069e65410b3ae1bb213295bd828f707b5bec6596a1afc8793ce0cbc" + [[package]] name = "dsl_auto_type" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "139ae9aca7527f85f26dd76483eb38533fd84bd571065da1739656ef71c5ff5b" +checksum = "dd122633e4bef06db27737f21d3738fb89c8f6d5360d6d9d7635dda142a7757e" dependencies = [ - "darling 0.20.10", + "darling 0.21.3", "either", "heck", "proc-macro2", @@ -1186,6 +1175,12 @@ dependencies = [ "syn", ] +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + [[package]] name = "ecdsa" version = "0.14.8" @@ -1330,22 +1325,16 @@ dependencies = [ "atomic 0.6.0", "pear", "serde", - "toml", + "toml 0.8.20", "uncased", "version_check", ] [[package]] -name = "filetime" -version = "0.2.25" +name = "find-msvc-tools" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" -dependencies = [ - "cfg-if", - "libc", - "libredox", - "windows-sys 0.59.0", -] +checksum = "645cbb3a84e60b7531617d5ae4e57f7e27308f6445f5abf653209ea76dec8dff" [[package]] name = "fnv" @@ -1384,13 +1373,10 @@ dependencies = [ ] [[package]] -name = "fsevent-sys" -version = "4.1.0" +name = "fs_extra" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2" -dependencies = [ - "libc", -] +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" [[package]] name = "futures" @@ -1499,8 +1485,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", ] [[package]] @@ -1510,8 +1498,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi 0.13.3+wasi-0.2.2", + "wasm-bindgen", "windows-targets 0.52.6", ] @@ -1537,30 +1527,6 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" -[[package]] -name = "globset" -version = "0.4.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15f1ce686646e7f1e19bf7d5533fe443a45dbfb990e00629110797578b42fb19" -dependencies = [ - "aho-corasick", - "bstr", - "log", - "regex-automata 0.4.9", - "regex-syntax 0.8.5", -] - -[[package]] -name = "globwalk" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf760ebf69878d9fd8f110c89703d90ce35095324d1f1edcb595c63945ee757" -dependencies = [ - "bitflags 2.8.0", - "ignore", - "walkdir", -] - [[package]] name = "group" version = "0.12.1" @@ -1746,15 +1712,6 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" -[[package]] -name = "humansize" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cb51c9a029ddc91b07a787f1d86b53ccfa49b0e86688c946ebe8d3555685dd7" -dependencies = [ - "libm", -] - [[package]] name = "humantime" version = "2.1.0" @@ -1778,7 +1735,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.5.8", "tokio", "tower-service", "tracing", @@ -1787,19 +1744,21 @@ dependencies = [ [[package]] name = "hyper" -version = "1.6.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" +checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11" dependencies = [ + "atomic-waker", "bytes", "futures-channel", - "futures-util", + "futures-core", "h2 0.4.7", "http 1.2.0", "http-body 1.0.1", "httparse", "itoa", "pin-project-lite", + "pin-utils", "smallvec", "tokio", "want", @@ -1816,7 +1775,7 @@ dependencies = [ "hyper 0.14.32", "log", "rustls 0.21.12", - "rustls-native-certs", + "rustls-native-certs 0.6.3", "tokio", "tokio-rustls 0.24.1", ] @@ -1829,28 +1788,15 @@ checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" dependencies = [ "futures-util", "http 1.2.0", - "hyper 1.6.0", + "hyper 1.8.1", "hyper-util", - "rustls 0.23.22", + "rustls 0.23.28", "rustls-pki-types", "tokio", "tokio-rustls 0.26.1", "tower-service", ] -[[package]] -name = "hyper-tls" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" -dependencies = [ - "bytes", - "hyper 0.14.32", - "native-tls", - "tokio", - "tokio-native-tls", -] - [[package]] name = "hyper-tls" version = "0.6.0" @@ -1859,7 +1805,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper 1.6.0", + "hyper 1.8.1", "hyper-util", "native-tls", "tokio", @@ -1869,21 +1815,28 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.10" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +checksum = "727805d60e7938b76b826a6ef209eb70eaa1812794f9424d4a4e2d740662df5f" dependencies = [ + "base64 0.22.1", "bytes", "futures-channel", + "futures-core", "futures-util", "http 1.2.0", "http-body 1.0.1", - "hyper 1.6.0", + "hyper 1.8.1", + "ipnet", + "libc", + "percent-encoding", "pin-project-lite", - "socket2", + "socket2 0.6.1", + "system-configuration", "tokio", "tower-service", "tracing", + "windows-registry 0.6.1", ] [[package]] @@ -2054,22 +2007,6 @@ dependencies = [ "icu_properties", ] -[[package]] -name = "ignore" -version = "0.4.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d89fd380afde86567dfba715db065673989d6253f42b88179abd3eae47bda4b" -dependencies = [ - "crossbeam-deque", - "globset", - "log", - "memchr", - "regex-automata 0.4.9", - "same-file", - "walkdir", - "winapi-util", -] - [[package]] name = "indexmap" version = "1.9.3" @@ -2098,26 +2035,6 @@ version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8fae54786f62fb2918dcfae3d568594e50eb9b5c25bf04371af6fe7516452fb" -[[package]] -name = "inotify" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff" -dependencies = [ - "bitflags 1.3.2", - "inotify-sys", - "libc", -] - -[[package]] -name = "inotify-sys" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" -dependencies = [ - "libc", -] - [[package]] name = "inout" version = "0.1.3" @@ -2133,6 +2050,16 @@ version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" +[[package]] +name = "iri-string" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c91338f0783edbd6195decb37bae672fd3b165faffb89bf7b9e6942f8b1a731a" +dependencies = [ + "memchr", + "serde", +] + [[package]] name = "is-terminal" version = "0.4.15" @@ -2168,12 +2095,52 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys", + "log", + "thiserror 1.0.69", + "walkdir", + "windows-sys 0.45.0", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + +[[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.77" @@ -2186,15 +2153,15 @@ dependencies = [ [[package]] name = "jwtk" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f968792e4a4e8ffd2fcd6adab9a096c6bdb42eb584a0ee7068ec91c62a08ff65" +checksum = "14924a83612db7dfb6722e81a30bfe11e25ef89b1df0dc81128974371e3e64d8" dependencies = [ - "base64 0.13.1", + "base64 0.22.1", "foreign-types", "openssl", "openssl-sys", - "reqwest 0.11.27", + "reqwest 0.12.12", "serde", "serde_json", "serde_with", @@ -2202,26 +2169,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "kqueue" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7447f1ca1b7b563588a205fe93dea8df60fd981423a768bc1c0ded35ed147d0c" -dependencies = [ - "kqueue-sys", - "libc", -] - -[[package]] -name = "kqueue-sys" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed9625ffda8729b85e45cf04090035ac368927b8cebc34898e7c120f52e4838b" -dependencies = [ - "bitflags 1.3.2", - "libc", -] - [[package]] name = "lazy_static" version = "1.5.0" @@ -2230,36 +2177,19 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.169" +version = "0.2.179" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +checksum = "c5a2d376baa530d1238d133232d15e239abad80d05838b4b59354e5268af431f" [[package]] -name = "libm" -version = "0.2.11" +name = "linux-raw-sys" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] -name = "libredox" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" -dependencies = [ - "bitflags 2.8.0", - "libc", - "redox_syscall", -] - -[[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.4" +name = "litemap" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" @@ -2303,6 +2233,12 @@ dependencies = [ "hashbrown 0.15.2", ] +[[package]] +name = "lru-slab" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" + [[package]] name = "matchers" version = "0.1.0" @@ -2330,19 +2266,19 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "migrations_internals" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd01039851e82f8799046eabbb354056283fb265c8ec0996af940f4e85a380ff" +checksum = "36c791ecdf977c99f45f23280405d7723727470f6689a5e6dbf513ac547ae10d" dependencies = [ "serde", - "toml", + "toml 0.9.10+spec-1.1.0", ] [[package]] name = "migrations_macros" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb161cc72176cb37aa47f1fc520d3ef02263d67d661f44f05d05a079e1237fd" +checksum = "36fc5ac76be324cfd2d3f2cf0fdf5d5d3c4f14ed8aaebadb09e304ba42282703" dependencies = [ "migrations_internals", "proc-macro2", @@ -2415,42 +2351,14 @@ dependencies = [ "libc", "log", "openssl", - "openssl-probe", + "openssl-probe 0.1.6", "openssl-sys", "schannel", - "security-framework", + "security-framework 2.11.1", "security-framework-sys", "tempfile", ] -[[package]] -name = "normpath" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8911957c4b1549ac0dc74e30db9c8b0e66ddcd6d7acc33098f4c63a64a6d7ed" -dependencies = [ - "windows-sys 0.59.0", -] - -[[package]] -name = "notify" -version = "6.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" -dependencies = [ - "bitflags 2.8.0", - "crossbeam-channel", - "filetime", - "fsevent-sys", - "inotify", - "kqueue", - "libc", - "log", - "mio 0.8.11", - "walkdir", - "windows-sys 0.48.0", -] - [[package]] name = "nu-ansi-term" version = "0.46.0" @@ -2522,7 +2430,7 @@ version = "0.10.70" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61cfb4e166a8bb8c9b55c500bc2308550148ece889be90f609377e58140f42c6" dependencies = [ - "bitflags 2.8.0", + "bitflags", "cfg-if", "foreign-types", "libc", @@ -2548,6 +2456,12 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" +[[package]] +name = "openssl-probe" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f50d9b3dabb09ecd771ad0aa242ca6894994c130308ca3d7684634df8037391" + [[package]] name = "openssl-sys" version = "0.9.105" @@ -2606,15 +2520,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "parse-zoneinfo" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f2a05b18d44e2957b88f96ba460715e295bc1d7510468a2f3d3b44535d26c24" -dependencies = [ - "regex", -] - [[package]] name = "paste" version = "1.0.15" @@ -2650,89 +2555,6 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" -[[package]] -name = "pest" -version = "2.7.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc" -dependencies = [ - "memchr", - "thiserror 2.0.11", - "ucd-trie", -] - -[[package]] -name = "pest_derive" -version = "2.7.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "816518421cfc6887a0d62bf441b6ffb4536fcc926395a69e1a85852d4363f57e" -dependencies = [ - "pest", - "pest_generator", -] - -[[package]] -name = "pest_generator" -version = "2.7.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d1396fd3a870fc7838768d171b4616d5c91f6cc25e377b673d714567d99377b" -dependencies = [ - "pest", - "pest_meta", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "pest_meta" -version = "2.7.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1e58089ea25d717bfd31fb534e4f3afcc2cc569c70de3e239778991ea3b7dea" -dependencies = [ - "once_cell", - "pest", - "sha2", -] - -[[package]] -name = "phf" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" -dependencies = [ - "phf_shared", -] - -[[package]] -name = "phf_codegen" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a" -dependencies = [ - "phf_generator", - "phf_shared", -] - -[[package]] -name = "phf_generator" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" -dependencies = [ - "phf_shared", - "rand 0.8.5", -] - -[[package]] -name = "phf_shared" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" -dependencies = [ - "siphasher", -] - [[package]] name = "pin-project-lite" version = "0.2.16" @@ -2830,6 +2652,62 @@ dependencies = [ "yansi", ] +[[package]] +name = "quinn" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" +dependencies = [ + "bytes", + "cfg_aliases", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls 0.23.28", + "socket2 0.6.1", + "thiserror 2.0.11", + "tokio", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-proto" +version = "0.11.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31" +dependencies = [ + "aws-lc-rs", + "bytes", + "getrandom 0.3.1", + "lru-slab", + "rand 0.9.0", + "ring", + "rustc-hash", + "rustls 0.23.28", + "rustls-pki-types", + "slab", + "thiserror 2.0.11", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-udp" +version = "0.5.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2 0.6.1", + "tracing", + "windows-sys 0.60.2", +] + [[package]] name = "quote" version = "1.0.38" @@ -2917,7 +2795,7 @@ version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f44c9e68fd46eda15c646fbb85e1040b657a58cdc8c98db1d97a55930d991eef" dependencies = [ - "bitflags 2.8.0", + "bitflags", "cassowary", "compact_str", "crossterm", @@ -2938,7 +2816,7 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d16546c5b5962abf8ce6e2881e722b4e0ae3b6f1a08a26ae3573c55853ca68d3" dependencies = [ - "bitflags 2.8.0", + "bitflags", "cassowary", "compact_str", "crossterm", @@ -2959,7 +2837,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2577ff4a85c41c58928abdf2122d968720dab6a496c7b076c50c73fbaf78e5ee" dependencies = [ - "bitflags 2.8.0", + "bitflags", "crossterm", "derive_builder", "itertools 0.13.0", @@ -2974,7 +2852,7 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ - "bitflags 2.8.0", + "bitflags", ] [[package]] @@ -3049,20 +2927,24 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" -version = "0.11.27" +version = "0.12.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "bytes", "encoding_rs", + "futures-channel", "futures-core", "futures-util", - "h2 0.3.26", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.32", - "hyper-tls 0.5.0", + "h2 0.4.7", + "http 1.2.0", + "http-body 1.0.1", + "http-body-util", + "hyper 1.8.1", + "hyper-rustls 0.27.5", + "hyper-tls", + "hyper-util", "ipnet", "js-sys", "log", @@ -3071,65 +2953,61 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls-pemfile 1.0.4", + "rustls-pemfile 2.2.0", "serde", "serde_json", "serde_urlencoded", - "sync_wrapper 0.1.2", - "system-configuration 0.5.1", + "sync_wrapper", + "system-configuration", "tokio", "tokio-native-tls", + "tower", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "winreg", + "windows-registry 0.2.0", ] [[package]] name = "reqwest" -version = "0.12.12" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" +checksum = "04e9018c9d814e5f30cc16a0f03271aeab3571e609612d9fe78c1aa8d11c2f62" dependencies = [ "base64 0.22.1", "bytes", "encoding_rs", - "futures-channel", "futures-core", - "futures-util", "h2 0.4.7", "http 1.2.0", "http-body 1.0.1", "http-body-util", - "hyper 1.6.0", + "hyper 1.8.1", "hyper-rustls 0.27.5", - "hyper-tls 0.6.0", "hyper-util", - "ipnet", "js-sys", "log", "mime", - "native-tls", - "once_cell", "percent-encoding", "pin-project-lite", - "rustls-pemfile 2.2.0", + "quinn", + "rustls 0.23.28", + "rustls-pki-types", + "rustls-platform-verifier", "serde", "serde_json", - "serde_urlencoded", - "sync_wrapper 1.0.2", - "system-configuration 0.6.1", + "sync_wrapper", "tokio", - "tokio-native-tls", + "tokio-rustls 0.26.1", "tower", + "tower-http", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "windows-registry", ] [[package]] @@ -3214,19 +3092,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "rocket_dyn_templates" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bbab919c9e67df3f7ac6624a32ef897df4cd61c0969f4d66f3ced0534660d7a" -dependencies = [ - "normpath", - "notify", - "rocket", - "tera", - "walkdir", -] - [[package]] name = "rocket_http" version = "0.5.1" @@ -3286,6 +3151,12 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +[[package]] +name = "rustc-hash" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" + [[package]] name = "rustc_version" version = "0.4.1" @@ -3301,7 +3172,7 @@ version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags 2.8.0", + "bitflags", "errno", "libc", "linux-raw-sys", @@ -3322,13 +3193,14 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.22" +version = "0.23.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb9263ab4eb695e42321db096e3b8fbd715a59b154d5c88d82db2175b681ba7" +checksum = "7160e3e10bf4535308537f3c4e1641468cd0e485175d6163087c0393c7d46643" dependencies = [ + "aws-lc-rs", "once_cell", "rustls-pki-types", - "rustls-webpki 0.102.8", + "rustls-webpki 0.103.3", "subtle", "zeroize", ] @@ -3339,10 +3211,22 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ - "openssl-probe", + "openssl-probe 0.1.6", "rustls-pemfile 1.0.4", "schannel", - "security-framework", + "security-framework 2.11.1", +] + +[[package]] +name = "rustls-native-certs" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "612460d5f7bea540c490b2b6395d8e34a953e52b491accd6c86c8164c5932a63" +dependencies = [ + "openssl-probe 0.2.0", + "rustls-pki-types", + "schannel", + "security-framework 3.5.1", ] [[package]] @@ -3368,6 +3252,36 @@ name = "rustls-pki-types" version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" +dependencies = [ + "web-time", +] + +[[package]] +name = "rustls-platform-verifier" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d99feebc72bae7ab76ba994bb5e121b8d83d910ca40b36e0921f53becc41784" +dependencies = [ + "core-foundation 0.10.1", + "core-foundation-sys", + "jni", + "log", + "once_cell", + "rustls 0.23.28", + "rustls-native-certs 0.8.3", + "rustls-platform-verifier-android", + "rustls-webpki 0.103.3", + "security-framework 3.5.1", + "security-framework-sys", + "webpki-root-certs", + "windows-sys 0.60.2", +] + +[[package]] +name = "rustls-platform-verifier-android" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" [[package]] name = "rustls-webpki" @@ -3381,10 +3295,11 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.8" +version = "0.103.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +checksum = "e4a72fe2bcf7a6ac6fd7d0b9e5cb68aeb7d4c0a0271730218b3e92d43b4eb435" dependencies = [ + "aws-lc-rs", "ring", "rustls-pki-types", "untrusted", @@ -3471,8 +3386,21 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.8.0", - "core-foundation", + "bitflags", + "core-foundation 0.9.4", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework" +version = "3.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3297343eaf830f66ede390ea39da1d462b6b0c1b000f420d0a83f898bbbe6ef" +dependencies = [ + "bitflags", + "core-foundation 0.10.1", "core-foundation-sys", "libc", "security-framework-sys", @@ -3480,9 +3408,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.14.0" +version = "2.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" +checksum = "cc1f0cbffaac4852523ce30d8bd3c5cdc873501d96ff467ca09b6767bb8cd5c0" dependencies = [ "core-foundation-sys", "libc", @@ -3496,18 +3424,28 @@ checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" [[package]] name = "serde" -version = "1.0.217" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.217" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", @@ -3535,6 +3473,15 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_spanned" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8bbf91e5a4d6315eee45e704372590b30e260ee83af6639d64557f51b067776" +dependencies = [ + "serde_core", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -3667,12 +3614,6 @@ dependencies = [ "rand_core 0.6.4", ] -[[package]] -name = "siphasher" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" - [[package]] name = "slab" version = "0.4.9" @@ -3682,16 +3623,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "slug" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "882a80f72ee45de3cc9a5afeb2da0331d58df69e4e7d8eeb5d3c7784ae67e724" -dependencies = [ - "deunicode", - "wasm-bindgen", -] - [[package]] name = "smallvec" version = "1.13.2" @@ -3729,6 +3660,16 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "socket2" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881" +dependencies = [ + "libc", + "windows-sys 0.60.2", +] + [[package]] name = "spin" version = "0.9.8" @@ -3851,12 +3792,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - [[package]] name = "sync_wrapper" version = "1.0.2" @@ -3877,36 +3812,15 @@ dependencies = [ "syn", ] -[[package]] -name = "system-configuration" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "system-configuration-sys 0.5.0", -] - [[package]] name = "system-configuration" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 2.8.0", - "core-foundation", - "system-configuration-sys 0.6.0", -] - -[[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", + "bitflags", + "core-foundation 0.9.4", + "system-configuration-sys", ] [[package]] @@ -3933,28 +3847,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "tera" -version = "1.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab9d851b45e865f178319da0abdbfe6acbc4328759ff18dafc3a41c16b4cd2ee" -dependencies = [ - "chrono", - "chrono-tz", - "globwalk", - "humansize", - "lazy_static", - "percent-encoding", - "pest", - "pest_derive", - "rand 0.8.5", - "regex", - "serde", - "serde_json", - "slug", - "unic-segment", -] - [[package]] name = "termcolor" version = "1.4.1" @@ -4055,6 +3947,21 @@ dependencies = [ "zerovec", ] +[[package]] +name = "tinyvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + [[package]] name = "tokio" version = "1.43.0" @@ -4068,7 +3975,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.5.8", "tokio-macros", "windows-sys 0.52.0", ] @@ -4110,7 +4017,7 @@ version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" dependencies = [ - "rustls 0.23.22", + "rustls 0.23.28", "tokio", ] @@ -4145,11 +4052,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" dependencies = [ "serde", - "serde_spanned", - "toml_datetime", + "serde_spanned 0.6.8", + "toml_datetime 0.6.8", "toml_edit", ] +[[package]] +name = "toml" +version = "0.9.10+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0825052159284a1a8b4d6c0c86cbc801f2da5afd2b225fa548c72f2e74002f48" +dependencies = [ + "serde_core", + "serde_spanned 1.0.4", + "toml_datetime 0.7.5+spec-1.1.0", + "toml_parser", + "winnow", +] + [[package]] name = "toml_datetime" version = "0.6.8" @@ -4159,6 +4079,15 @@ dependencies = [ "serde", ] +[[package]] +name = "toml_datetime" +version = "0.7.5+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" +dependencies = [ + "serde_core", +] + [[package]] name = "toml_edit" version = "0.22.23" @@ -4167,8 +4096,17 @@ checksum = "02a8b472d1a3d7c18e2d61a489aee3453fd9031c33e4f55bd533f4a7adca1bee" dependencies = [ "indexmap 2.7.1", "serde", - "serde_spanned", - "toml_datetime", + "serde_spanned 0.6.8", + "toml_datetime 0.6.8", + "winnow", +] + +[[package]] +name = "toml_parser" +version = "1.0.6+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3198b4b0a8e11f09dd03e133c0280504d0801269e9afa46362ffde1cbeebf44" +dependencies = [ "winnow", ] @@ -4181,12 +4119,30 @@ dependencies = [ "futures-core", "futures-util", "pin-project-lite", - "sync_wrapper 1.0.2", + "sync_wrapper", "tokio", "tower-layer", "tower-service", ] +[[package]] +name = "tower-http" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" +dependencies = [ + "bitflags", + "bytes", + "futures-util", + "http 1.2.0", + "http-body 1.0.1", + "iri-string", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", +] + [[package]] name = "tower-layer" version = "0.3.3" @@ -4281,12 +4237,6 @@ dependencies = [ "serde", ] -[[package]] -name = "ucd-trie" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" - [[package]] name = "uncased" version = "0.9.10" @@ -4297,56 +4247,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "unic-char-property" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8c57a407d9b6fa02b4795eb81c5b6652060a15a7903ea981f3d723e6c0be221" -dependencies = [ - "unic-char-range", -] - -[[package]] -name = "unic-char-range" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0398022d5f700414f6b899e10b8348231abf9173fa93144cbc1a43b9793c1fbc" - -[[package]] -name = "unic-common" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d7ff825a6a654ee85a63e80f92f054f904f21e7d12da4e22f9834a4aaa35bc" - -[[package]] -name = "unic-segment" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ed5d26be57f84f176157270c112ef57b86debac9cd21daaabbe56db0f88f23" -dependencies = [ - "unic-ucd-segment", -] - -[[package]] -name = "unic-ucd-segment" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2079c122a62205b421f499da10f3ee0f7697f012f55b675e002483c73ea34700" -dependencies = [ - "unic-char-property", - "unic-char-range", - "unic-ucd-version", -] - -[[package]] -name = "unic-ucd-version" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96bd2f2237fe450fcd0a1d2f5f4e91711124f7857ba2e964247776ebeeb7b0c4" -dependencies = [ - "unic-common", -] - [[package]] name = "unicode-ident" version = "1.0.16" @@ -4435,14 +4335,14 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.18.1" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f87b8aa10b915a06587d0dec516c282ff295b475d94abf425d62b57710070a2" +checksum = "e2e054861b4bd027cd373e18e8d8d8e6548085000e41290d95ce0c373a654b4a" dependencies = [ "getrandom 0.3.1", "js-sys", "rand 0.9.0", - "serde", + "serde_core", "wasm-bindgen", ] @@ -4477,20 +4377,18 @@ dependencies = [ "diesel", "diesel_migrations", "env_logger 0.11.6", - "itertools 0.13.0", + "itertools 0.14.0", "jwtk", "log", - "rand 0.8.5", "regex", - "reqwest 0.12.12", + "reqwest 0.13.1", "rocket", - "rocket_dyn_templates", "rocket_sync_db_pools", "serde", "serde_json", "snafu", "strum 0.27.2", - "thiserror 1.0.69", + "thiserror 2.0.11", "tokio", "uuid", ] @@ -4635,6 +4533,25 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-root-certs" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36a29fc0408b113f68cf32637857ab740edfafdf460c326cd2afaa2d84cc05dc" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "which" version = "6.0.3" @@ -4696,17 +4613,34 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + [[package]] name = "windows-registry" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" dependencies = [ - "windows-result", - "windows-strings", + "windows-result 0.2.0", + "windows-strings 0.1.0", "windows-targets 0.52.6", ] +[[package]] +name = "windows-registry" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720" +dependencies = [ + "windows-link", + "windows-result 0.4.1", + "windows-strings 0.5.1", +] + [[package]] name = "windows-result" version = "0.2.0" @@ -4716,16 +4650,43 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + [[package]] name = "windows-strings" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" dependencies = [ - "windows-result", + "windows-result 0.2.0", "windows-targets 0.52.6", ] +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -4753,6 +4714,30 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + [[package]] name = "windows-targets" version = "0.48.5" @@ -4777,13 +4762,36 @@ dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", + "windows_i686_gnullvm 0.52.6", "windows_i686_msvc 0.52.6", "windows_x86_64_gnu 0.52.6", "windows_x86_64_gnullvm 0.52.6", "windows_x86_64_msvc 0.52.6", ] +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -4796,6 +4804,18 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -4808,6 +4828,18 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -4820,12 +4852,30 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -4838,6 +4888,18 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -4850,6 +4912,18 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -4862,6 +4936,18 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -4875,22 +4961,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] -name = "winnow" -version = "0.7.1" +name = "windows_x86_64_msvc" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86e376c75f4f43f44db463cf729e0d3acbf954d13e22c51e26e4c264b4ab545f" -dependencies = [ - "memchr", -] +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" [[package]] -name = "winreg" -version = "0.50.0" +name = "winnow" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" dependencies = [ - "cfg-if", - "windows-sys 0.48.0", + "memchr", ] [[package]] @@ -4905,7 +4987,7 @@ version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" dependencies = [ - "bitflags 2.8.0", + "bitflags", ] [[package]] diff --git a/fairy/Cargo.toml b/fairy/Cargo.toml index ec6222c..f09bc07 100644 --- a/fairy/Cargo.toml +++ b/fairy/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "fairy" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/fairy/src/main.rs b/fairy/src/main.rs index b9e13c2..a195c7f 100644 --- a/fairy/src/main.rs +++ b/fairy/src/main.rs @@ -1,13 +1,12 @@ -use std::process::{exit, Stdio}; -use std::sync::Arc; - use futures_util::{Sink, StreamExt, TryStreamExt}; use hyper::{Body, Client, Method, Request}; +use log::{debug, error, info, warn, LevelFilter}; use rocket::figment::providers::{Env, Format, Toml}; use rocket::figment::{Figment, Profile}; use serde::de::DeserializeOwned; use serde::{Deserialize, Serialize}; use snafu::{ensure, ResultExt}; +use std::time::Duration; use tokio::process::Command; use tokio_util::codec::{FramedRead, LinesCodec}; use uuid::Uuid; @@ -17,7 +16,7 @@ use which::which; mod error; -use crate::error::{Error, Result}; +use crate::error::{Error, Result, TaskExitErr, WaitNixErr}; #[derive(Deserialize)] pub(crate) struct AppConfig { @@ -32,20 +31,20 @@ const CODE_NIX_NOT_INSTALLED: i32 = 1; fn ensure_nix() { if which("nix").is_err() { - log::error!("\"nix\" binary not found. Please install nix or run on a nix-os host."); + error!("\"nix\" binary not found. Please install nix or run on a nix-os host."); exit(CODE_NIX_NOT_INSTALLED); } } fn main() -> Result<()> { env_logger::builder() - .filter_level(log::LevelFilter::Debug) + .filter_level(LevelFilter::Debug) .init(); #[cfg(not(feature = "nixless-test-mode"))] ensure_nix(); - log::info!("Fairy starting up."); + info!("Fairy starting up."); // Took from rocket source code and added .split("__") to be able to add keys in nested structures. let rocket_config_figment = Figment::from(rocket::Config::default()) @@ -71,10 +70,20 @@ async fn api( cfg: &AppConfig, method: Method, endpoint: &str, - q: &BODY, + q: Option<&BODY>, ) -> Result { let client = Client::new(); - let req_data = serde_json::to_vec(q).context(error::SerializeErr)?; + let req_data = q + .map(serde_json::to_vec) + .transpose() + .context(error::SerializeErr)? + .unwrap_or_default(); + // + // let content_type = if req_data.is_empty() { + // "text/plain" + // } else { + // "application/json" + // }; let request = Request::builder() .uri(format!("{}/{}", cfg.vicky_url, endpoint)) @@ -93,10 +102,14 @@ async fn api( } ); - let resp_data = hyper::body::to_bytes(response.into_body()) - .await - .context(error::ReadBodyErr)?; - serde_json::from_slice(&resp_data).context(error::DecodeResponseErr) + if size_of::() == 0 { + serde_json::from_str("null").context(error::DecodeResponseErr) + } else { + let resp_data = hyper::body::to_bytes(response.into_body()) + .await + .context(error::ReadBodyErr)?; + serde_json::from_slice(&resp_data).context(error::DecodeResponseErr) + } } fn log_sink(cfg: Arc, task_id: Uuid) -> impl Sink, Error = Error> + Send { @@ -107,17 +120,17 @@ fn log_sink(cfg: Arc, task_id: Uuid) -> impl Sink, Error &cfg, Method::POST, &format!("api/v1/tasks/{task_id}/logs"), - &serde_json::json!({ "lines": lines }), + Some(&serde_json::json!({ "lines": lines })), ) .await; match response { Ok(_) => { - log::info!("logged {} line(s) from task", lines.len()); + info!("logged {} line(s) from task", lines.len()); Ok(()) } Err(e) => { - log::error!( + error!( "could not log from task. {} lines were dropped", lines.len() ); @@ -190,7 +203,7 @@ async fn run_task(cfg: Arc, task: Task) { #[cfg(not(feature = "nixless-test-mode"))] let result = match try_run_task(cfg.clone(), &task).await { Err(e) => { - log::info!("task failed: {} {} ({})", task.id, task.display_name, e); + info!("task failed: {} {} ({:?})", task.id, task.display_name, e); TaskResult::Error } Ok(_) => TaskResult::Success, @@ -199,32 +212,32 @@ async fn run_task(cfg: Arc, task: Task) { #[cfg(feature = "nixless-test-mode")] let result = TaskResult::Success; - tokio::time::sleep(std::time::Duration::from_secs(1)).await; + tokio::time::sleep(Duration::from_secs(1)).await; let _ = api::<_, ()>( &cfg, Method::POST, &format!("api/v1/tasks/{}/finish", task.id), - &serde_json::json!({ "result": result }), + Some(&serde_json::json!({ "result": result })), ) .await; } async fn try_claim(cfg: Arc) -> Result<()> { - log::debug!("trying to claim task..."); + debug!("trying to claim task..."); if let Some(task) = api::<_, Option>( &cfg, Method::POST, "api/v1/tasks/claim", - &serde_json::json!({ "features": cfg.features }), + Some(&serde_json::json!({ "features": cfg.features })), ) .await? { - log::info!("task claimed: {} {} 🎉", task.id, task.display_name); - log::debug!("{:#?}", task); + info!("task claimed: {} {} 🎉", task.id, task.display_name); + debug!("{:#?}", task); tokio::task::spawn(run_task(cfg.clone(), task)); } else { - log::debug!("no work available..."); + debug!("no work available..."); } Ok(()) @@ -232,15 +245,15 @@ async fn try_claim(cfg: Arc) -> Result<()> { #[tokio::main(flavor = "current_thread")] async fn run(cfg: AppConfig) -> Result<()> { - log::info!("config valid, starting communication with vicky"); - log::info!("waiting for tasks..."); + info!("config valid, starting communication with vicky"); + info!("waiting for tasks..."); let cfg = Arc::new(cfg); loop { if let Err(e) = try_claim(cfg.clone()).await { - log::error!("{e}"); - tokio::time::sleep(std::time::Duration::from_secs(5)).await; + error!("{e}"); + tokio::time::sleep(Duration::from_secs(5)).await; } - tokio::time::sleep(std::time::Duration::from_secs(1)).await; + tokio::time::sleep(Duration::from_secs(1)).await; } } diff --git a/vicky/Cargo.toml b/vicky/Cargo.toml index 60743da..cec68d4 100644 --- a/vicky/Cargo.toml +++ b/vicky/Cargo.toml @@ -1,35 +1,33 @@ [package] name = "vicky" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -clap = { version = "4.3.17", features = ["derive"] } -env_logger = "0.11.3" -log = "0.4.19" -rand = "0.8.5" +clap = { version = "4.5", features = ["derive"] } +env_logger = "0.11" +log = "0.4" snafu = "0.8" -thiserror = "1.0.43" +thiserror = "2.0" tokio = { version = "1", features = ["full", "sync"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" -async-trait = "0.1.71" +async-trait = "0.1" # https://github.com/awesomized/crc64fast-nvme/issues/5 aws-sdk-s3 = "=1.34.0" -uuid = { version = "1.18.1", features = ["fast-rng", "v4", "serde"] } -rocket = { version = "0.5.1", features = ["json", "secrets", "uuid"] } -rocket_dyn_templates = { version = "0.2.0", features = ["tera"] } +uuid = { version = "1.19", features = ["fast-rng", "v4", "serde"] } +rocket = { version = "0.5", features = ["json", "secrets", "uuid"] } rocket_sync_db_pools = { version = "0.1", features = ["diesel_postgres_pool"] } -reqwest = { version = "0.12.4", features = ["json"] } -jwtk = "0.3.0" -diesel = { version = "2.1.6", features = ["postgres", "uuid", "r2d2", "chrono"] } -itertools = { version = "0.13.0" } -diesel_migrations = { version = "2.2.0", features = ["postgres"] } -chrono = { version= "0.4.39", features=["serde"] } -delegate = "0.13.5" -strum = { version = "0.27.2", features = ["derive"] } +reqwest = { version = "0.13", features = ["json"] } +jwtk = "0.4" +diesel = { version = "2.3", features = ["postgres", "uuid", "r2d2", "chrono", "postgres_backend"] } +itertools = { version = "0.14" } +diesel_migrations = { version = "2.3", features = ["postgres"] } +chrono = { version= "0.4", features=["serde"] } +delegate = "0.13" +strum = { version = "0.27", features = ["derive"] } bon = "3.8" [[bin]] diff --git a/vicky/src/bin/vicky/auth.rs b/vicky/src/bin/vicky/auth.rs index 21a6b3f..e6c44be 100644 --- a/vicky/src/bin/vicky/auth.rs +++ b/vicky/src/bin/vicky/auth.rs @@ -1,7 +1,7 @@ use jwtk::jwk::RemoteJwksVerifier; use log::warn; use rocket::http::Status; -use rocket::{request, Request, State}; +use rocket::{Request, State, request}; use serde_json::{Map, Value}; use std::str::FromStr; use uuid::Uuid; diff --git a/vicky/src/bin/vicky/config.rs b/vicky/src/bin/vicky/config.rs index 4c1ac85..b739720 100644 --- a/vicky/src/bin/vicky/config.rs +++ b/vicky/src/bin/vicky/config.rs @@ -1,4 +1,5 @@ use aws_sdk_s3::config::{BehaviorVersion, Credentials, Region}; +use log::info; use rocket::figment::providers::{Env, Format, Toml}; use rocket::figment::{Figment, Profile}; use rocket::serde::{Deserialize, Serialize}; @@ -66,7 +67,7 @@ impl S3Config { } pub fn build_config(&self) -> aws_sdk_s3::Config { - log::info!("building s3 client"); + info!("building s3 client"); aws_sdk_s3::Config::builder() .behavior_version(BehaviorVersion::v2024_03_28()) diff --git a/vicky/src/bin/vicky/errors.rs b/vicky/src/bin/vicky/errors.rs index f980259..fb267be 100644 --- a/vicky/src/bin/vicky/errors.rs +++ b/vicky/src/bin/vicky/errors.rs @@ -1,5 +1,5 @@ use log::error; -use rocket::{http::Status, response::Responder, Request}; +use rocket::{Request, http::Status, response::Responder}; use thiserror::Error; use tokio::sync::broadcast::error::SendError; use vickylib::errors::VickyError; diff --git a/vicky/src/bin/vicky/events.rs b/vicky/src/bin/vicky/events.rs index 236f492..769b1b6 100644 --- a/vicky/src/bin/vicky/events.rs +++ b/vicky/src/bin/vicky/events.rs @@ -1,5 +1,5 @@ use rocket::response::stream::{Event, EventStream}; -use rocket::{get, State}; +use rocket::{State, get}; use serde::{Deserialize, Serialize}; use std::time; use tokio::sync::broadcast::{self, error::TryRecvError}; diff --git a/vicky/src/bin/vicky/main.rs b/vicky/src/bin/vicky/main.rs index b7ab306..52a598c 100644 --- a/vicky/src/bin/vicky/main.rs +++ b/vicky/src/bin/vicky/main.rs @@ -1,5 +1,5 @@ -use crate::config::{build_rocket_config, Config, OIDCConfigResolved}; -use crate::events::{get_global_events, GlobalEvent}; +use crate::config::{Config, OIDCConfigResolved, build_rocket_config}; +use crate::events::{GlobalEvent, get_global_events}; use crate::locks::{ locks_get_active, locks_get_detailed_poisoned, locks_get_poisoned, locks_unlock, }; @@ -10,9 +10,10 @@ use crate::tasks::{ }; use crate::user::get_user; use crate::webconfig::get_web_config; -use diesel_migrations::{embed_migrations, EmbeddedMigrations, MigrationHarness}; +use diesel_migrations::{EmbeddedMigrations, MigrationHarness, embed_migrations}; use errors::AppError; use jwtk::jwk::RemoteJwksVerifier; +use log::{error, info, trace, warn, LevelFilter}; use rocket::fairing::AdHoc; use rocket::{routes, Build, Rocket}; use snafu::ResultExt; @@ -37,21 +38,21 @@ pub const MIGRATIONS: EmbeddedMigrations = embed_migrations!(); fn run_migrations(connection: &mut impl MigrationHarness) -> Result<(), AppError> { match connection.run_pending_migrations(MIGRATIONS) { Ok(_) => { - log::info!("Migrations successfully completed"); + info!("Migrations successfully completed"); Ok(()) } Err(e) => { - log::error!("Error running migrations {e}"); + error!("Error running migrations {e}"); Err(AppError::MigrationError(e.to_string())) } } } async fn run_rocket_migrations(rocket: Rocket) -> Result, Rocket> { - log::info!("Running database migrations"); + info!("Running database migrations"); let Some(db) = Database::get_one(&rocket).await else { - log::error!("Failed to get a database connection"); + error!("Failed to get a database connection"); return Err(rocket); }; @@ -64,31 +65,31 @@ async fn run_rocket_migrations(rocket: Rocket) -> Result, R #[tokio::main] async fn main() { if let Err(e) = inner_main().await { - log::error!("Fatal: {e}"); + error!("Fatal: {e}"); } } async fn inner_main() -> Result<()> { env_logger::builder() - .filter_module("vicky", log::LevelFilter::Debug) + .filter_module("vicky", LevelFilter::Debug) .init(); - log::info!("vicky starting..."); + info!("vicky starting..."); - log::info!("loading service config..."); + info!("loading service config..."); let rocket_config = build_rocket_config(); let app_config = rocket_config .extract::() .context(startup::ConfigErr)?; let build_rocket = rocket::custom(build_rocket_config()); - log::info!( + info!( "fetching OIDC discovery from {}", app_config.oidc_config.well_known_uri ); let oidc_config_resolved = startup::fetch_oidc_config(&app_config.oidc_config.well_known_uri).await?; - log::info!( + info!( "Fetched OIDC configuration, found jwks_uri={}", oidc_config_resolved.jwks_uri ); @@ -127,7 +128,8 @@ async fn serve_web_api( log_drain: LogDrain, tx_global_events: Sender, ) -> Result<()> { - log::info!("starting web api"); + info!("starting web api"); + build_rocket .manage(s3_log_bucket_client) .manage(log_drain) diff --git a/vicky/src/bin/vicky/startup.rs b/vicky/src/bin/vicky/startup.rs index 9f3efe4..7e08b57 100644 --- a/vicky/src/bin/vicky/startup.rs +++ b/vicky/src/bin/vicky/startup.rs @@ -1,5 +1,6 @@ use crate::config::OIDCConfigResolved; -use aws_sdk_s3::{error::SdkError, operation::create_bucket::CreateBucketError, Client}; +use aws_sdk_s3::{Client, error::SdkError, operation::create_bucket::CreateBucketError}; +use log::{error, info}; use rocket::figment; use snafu::{ResultExt, Snafu}; @@ -46,10 +47,10 @@ pub async fn fetch_oidc_config(uri: &str) -> Result { } pub async fn ensure_bucket(client: &Client, bucket: &str) -> Result<()> { - log::info!("ensuring log bucket {}", bucket); + info!("ensuring log bucket {}", bucket); match client.create_bucket().bucket(bucket).send().await { Ok(b) => { - log::info!( + info!( "Bucket \"{}\" was successfully created on the log drain.", b.location().unwrap_or_default() ); @@ -61,16 +62,16 @@ pub async fn ensure_bucket(client: &Client, bucket: &str) -> Result<()> { if c.err().is_bucket_already_exists() || c.err().is_bucket_already_owned_by_you() => { - log::info!("Bucket \"{bucket}\" is already present on the log drain."); + info!("Bucket \"{bucket}\" is already present on the log drain."); return Ok(()); } SdkError::DispatchFailure(_) => { - log::error!( + error!( "Failed to communicate with Log Drain / S3 Bucket Connector (is the bucket running and available?): {err:?}" ); } _ => { - log::error!( + error!( "Log Drain / S3 Bucket Connector ran into an irrecoverable error: {err:?}" ); } diff --git a/vicky/src/bin/vicky/tasks.rs b/vicky/src/bin/vicky/tasks.rs index a4c4f9e..d925359 100644 --- a/vicky/src/bin/vicky/tasks.rs +++ b/vicky/src/bin/vicky/tasks.rs @@ -2,7 +2,7 @@ use chrono::Utc; use log::{error, warn}; use rocket::http::Status; use rocket::response::stream::{Event, EventStream}; -use rocket::{get, post, serde::json::Json, State}; +use rocket::{State, get, post, serde::json::Json}; use serde::{Deserialize, Serialize}; use std::time; use tokio::sync::broadcast::{self, error::TryRecvError}; @@ -14,6 +14,21 @@ use vickylib::{ errors::VickyError, logs::LogDrain, s3::client::S3Client, vicky::scheduler::Scheduler, }; +macro_rules! task_or { + ($db:expr, $id:expr => $( $or:tt )+) => { + $db + .get_task($id) + .await? + $( $or )+ + }; +} + +macro_rules! task_or_not_found { + ($db:expr, $id:expr) => { + task_or!($db, $id => .ok_or(AppError::HttpError(Status::NotFound))) + }; +} + use crate::auth::AnyAuthGuard; use crate::{ auth::{MachineGuard, UserGuard}, @@ -183,7 +198,7 @@ pub async fn tasks_get_logs<'a>( } } Err(err) => { - log::error!("failed to load logs for {id}: {err}"); + error!("failed to load logs for {id}: {err}"); } } }, @@ -219,10 +234,7 @@ pub async fn tasks_put_logs( _machine: MachineGuard, log_drain: &State, ) -> Result, AppError> { - let task = db - .get_task(id) - .await? - .ok_or(AppError::HttpError(Status::NotFound))?; + let task: Task = task_or_not_found!(db, id)?; match task.status { TaskStatus::Running => { @@ -248,10 +260,7 @@ pub async fn tasks_claim( match next_task { Some(next_task) => { - let mut task = db - .get_task(next_task.id) - .await? - .ok_or(AppError::HttpError(Status::NotFound))?; + let mut task: Task = task_or_not_found!(db, next_task.id)?; task.status = TaskStatus::Running; task.claimed_at = Some(Utc::now().naive_utc()); @@ -272,10 +281,7 @@ pub async fn tasks_finish( _machine: MachineGuard, log_drain: &State, ) -> Result, AppError> { - let mut task = db - .get_task(id) - .await? - .ok_or(AppError::HttpError(Status::NotFound))?; + let mut task: Task = task_or_not_found!(db, id)?; log_drain.finish_logs(id).await?; @@ -339,15 +345,12 @@ pub async fn tasks_confirm( global_events: &State>, _auth: AnyAuthGuard, ) -> Result, AppError> { - let mut task = db - .get_task(id) - .await? - .ok_or_else(|| AppError::HttpError(Status::NotFound))?; + let mut task = task_or_not_found!(db, id)?; if task.status == TaskStatus::New { return Err(AppError::TaskAlreadyConfirmed); } else if task.status != TaskStatus::NeedsUserValidation { - return Err(AppError::HttpError(Status::PreconditionFailed)); + return Err(AppError::HttpError(Status::Conflict)); } task.status = TaskStatus::New; diff --git a/vicky/src/lib/database/entities/lock.rs b/vicky/src/lib/database/entities/lock.rs index f2694ca..1f2837a 100644 --- a/vicky/src/lib/database/entities/lock.rs +++ b/vicky/src/lib/database/entities/lock.rs @@ -2,9 +2,9 @@ use diesel::{AsExpression, FromSqlRow}; use serde::{Deserialize, Serialize}; use uuid::Uuid; +use crate::database::entities::Task; use crate::database::entities::lock::db_impl::DbLock; use crate::database::entities::task::db_impl::DbTask; -use crate::database::entities::Task; #[derive( Clone, @@ -125,14 +125,14 @@ pub mod db_impl { use diesel::pg::PgValue; use diesel::prelude::*; use diesel::serialize::{IsNull, Output, ToSql}; - use diesel::{update, SqlType}; + use diesel::{SqlType, update}; use serde::Serialize; use std::io::Write; use uuid::Uuid; use crate::database::entities::lock::{Lock, LockKind, PoisonedLock}; - use crate::database::entities::task::db_impl::DbTask; use crate::database::entities::task::TaskStatus; + use crate::database::entities::task::db_impl::DbTask; use crate::database::schema::{locks, tasks}; use crate::errors::VickyError; @@ -201,7 +201,8 @@ pub mod db_impl { fn get_poisoned_locks(&mut self) -> Result, VickyError>; fn get_poisoned_locks_with_tasks(&mut self) -> Result, VickyError>; fn get_active_locks(&mut self) -> Result, VickyError>; - fn unlock_lock(&mut self, lock_uuid: &Uuid) -> Result<(), VickyError>; + fn poison_all_locks_by_task(&mut self, task_id: Uuid) -> Result; + fn unlock_lock(&mut self, lock_uuid: &Uuid) -> Result; } impl LockDatabase for PgConnection { @@ -232,27 +233,27 @@ pub mod db_impl { } fn get_active_locks(&mut self) -> Result, VickyError> { - let locks = { - let db_locks: Vec = locks::table - .select(locks::all_columns) - .left_join(tasks::table.on(locks::task_id.eq(tasks::id))) - .filter( - locks::poisoned_by_task - .is_not_null() - .or(tasks::status.eq(TaskStatus::Running)), - ) - .load(self)?; - db_locks.into_iter().map(Lock::from).collect() - }; + let locks = locks::table + .select(locks::all_columns) + .left_join(tasks::table.on(locks::task_id.eq(tasks::id))) + .filter( + locks::poisoned_by_task + .is_not_null() + .or(tasks::status.eq(TaskStatus::Running)), + ) + .load::(self)? + .into_iter() + .map(Lock::from) + .collect(); Ok(locks) } - fn unlock_lock(&mut self, lock_uuid: &Uuid) -> Result<(), VickyError> { - update(locks::table.filter(locks::id.eq(lock_uuid))) + fn unlock_lock(&mut self, lock_uuid: &Uuid) -> Result { + let affected = update(locks::table.filter(locks::id.eq(lock_uuid))) .set(locks::poisoned_by_task.eq(None::)) .execute(self)?; - Ok(()) + Ok(affected) } } } diff --git a/vicky/src/lib/database/entities/mod.rs b/vicky/src/lib/database/entities/mod.rs index ad70682..ba97ffc 100644 --- a/vicky/src/lib/database/entities/mod.rs +++ b/vicky/src/lib/database/entities/mod.rs @@ -2,12 +2,12 @@ pub mod lock; pub mod task; pub mod user; -use crate::database::entities::lock::db_impl::LockDatabase; use crate::database::entities::lock::PoisonedLock; -use crate::database::entities::task::db_impl::TaskDatabase; +use crate::database::entities::lock::db_impl::LockDatabase; use crate::database::entities::task::TaskStatus; -use crate::database::entities::user::db_impl::UserDatabase; +use crate::database::entities::task::db_impl::TaskDatabase; use crate::database::entities::user::User; +use crate::database::entities::user::db_impl::UserDatabase; use crate::errors::VickyError; use crate::query::FilterParams; use delegate::delegate; @@ -37,9 +37,9 @@ impl Database { ) -> Result, VickyError>; pub async fn get_all_tasks(&self) -> Result, VickyError>; pub async fn get_task(&self, task_id: Uuid) -> Result, VickyError>; - pub async fn put_task(&self, task: Task) -> Result<(), VickyError>; - pub async fn update_task(&self, #[as_ref] task: Task) -> Result<(), VickyError>; - pub async fn confirm_task(&self, uuid: Uuid) -> Result<(), VickyError>; + pub async fn put_task(&self, task: Task) -> Result; + pub async fn update_task(&self, #[as_ref] task: Task) -> Result; + pub async fn confirm_task(&self, uuid: Uuid) -> Result; pub async fn has_task(&self, task_id: Uuid) -> Result; } @@ -50,7 +50,7 @@ impl Database { pub async fn get_poisoned_locks(&self) -> Result, VickyError>; pub async fn get_poisoned_locks_with_tasks(&self) -> Result, VickyError>; pub async fn get_active_locks(&self) -> Result, VickyError>; - pub async fn unlock_lock(&self, #[as_ref] lock_uuid: Uuid) -> Result<(), VickyError>; + pub async fn unlock_lock(&self, #[as_ref] lock_uuid: Uuid) -> Result; } #[await(false)] diff --git a/vicky/src/lib/database/entities/task.rs b/vicky/src/lib/database/entities/task.rs index ce4deab..bfd655b 100644 --- a/vicky/src/lib/database/entities/task.rs +++ b/vicky/src/lib/database/entities/task.rs @@ -1,5 +1,5 @@ -use crate::database::entities::lock::db_impl::DbLock; use crate::database::entities::lock::Lock; +use crate::database::entities::lock::db_impl::DbLock; use crate::database::entities::task::db_impl::DbTask; use bon::Builder; use chrono::naive::serde::ts_seconds; @@ -51,17 +51,22 @@ impl FlakeRef { pub struct Task { #[builder(field)] pub locks: Vec, + #[builder(field = FlakeRef::empty())] pub flake_ref: FlakeRef, + #[builder(field)] pub features: Vec, #[builder(default = Uuid::new_v4())] pub id: Uuid, + #[builder(default = "Task")] pub display_name: String, + #[builder(default = TaskStatus::New)] pub status: TaskStatus, + #[serde(with = "ts_seconds")] #[builder(skip = Utc::now().naive_utc())] pub created_at: NaiveDateTime, @@ -300,9 +305,16 @@ pub mod db_impl { ) -> Result, VickyError>; fn get_all_tasks(&mut self) -> Result, VickyError>; fn get_task(&mut self, task_id: Uuid) -> Result, VickyError>; - fn put_task(&mut self, task: Task) -> Result<(), VickyError>; - fn update_task(&mut self, task: &Task) -> Result<(), VickyError>; - fn confirm_task(&mut self, task_id: Uuid) -> Result<(), VickyError>; + fn put_task(&mut self, task: Task) -> Result; + fn register_task_heartbeat( + &mut self, + task_id: Uuid, + heartbeat: NaiveDateTime, + ) -> Result; + fn timeout_task(&mut self, task_id: Uuid) -> Result; + fn perform_timeout_sweep(&mut self) -> Result<(usize, usize), VickyError>; + fn update_task(&mut self, task: &Task) -> Result; + fn confirm_task(&mut self, task_id: Uuid) -> Result; fn has_task(&mut self, task_id: Uuid) -> Result; } @@ -394,7 +406,7 @@ pub mod db_impl { Ok(Some(task)) } - fn put_task(&mut self, task: Task) -> Result<(), VickyError> { + fn put_task(&mut self, task: Task) -> Result { self.transaction(|conn| { let db_locks: Vec = task .locks @@ -403,18 +415,18 @@ pub mod db_impl { .collect(); let db_task: DbTask = task.into(); - diesel::insert_into(tasks::table) - .values(db_task) + let rows_updated = diesel::insert_into(tasks::table) + .values(&db_task) .execute(conn)?; diesel::insert_into(locks::table) - .values(db_locks) + .values(&db_locks) .execute(conn)?; - Ok(()) + Ok(rows_updated) }) } - fn update_task(&mut self, task: &Task) -> Result<(), VickyError> { - diesel::update(tasks::table.filter(tasks::id.eq(task.id))) + fn update_task(&mut self, task: &Task) -> Result { + let affected = diesel::update(tasks::table.filter(tasks::id.eq(task.id))) .set(( tasks::status.eq(task.status), tasks::claimed_at.eq(task.claimed_at), @@ -431,11 +443,11 @@ pub mod db_impl { .execute(self)?; } - Ok(()) + Ok(affected) } - fn confirm_task(&mut self, task_id: Uuid) -> Result<(), VickyError> { - diesel::update( + fn confirm_task(&mut self, task_id: Uuid) -> Result { + let affected = diesel::update( tasks::table.filter( tasks::id .eq(task_id) @@ -445,7 +457,7 @@ pub mod db_impl { .set(tasks::status.eq(TaskStatus::New)) .execute(self)?; - Ok(()) + Ok(affected) } fn has_task(&mut self, tid: Uuid) -> Result { diff --git a/vicky/src/lib/errors.rs b/vicky/src/lib/errors.rs index ac90425..0f2c66d 100644 --- a/vicky/src/lib/errors.rs +++ b/vicky/src/lib/errors.rs @@ -3,7 +3,7 @@ use aws_sdk_s3::{ primitives::ByteStreamError, }; use log::error; -use rocket::{http::Status, response::Responder, Request}; +use rocket::{Request, http::Status, response::Responder}; use thiserror::Error; use tokio::sync::broadcast::error::SendError; use uuid::Uuid; diff --git a/vicky/src/lib/logs/mod.rs b/vicky/src/lib/logs/mod.rs index e3fd562..0821d22 100644 --- a/vicky/src/lib/logs/mod.rs +++ b/vicky/src/lib/logs/mod.rs @@ -5,7 +5,7 @@ use std::time; use crate::{errors::VickyError, s3::client::S3Client}; use log::error; use rocket::futures::lock::Mutex; -use tokio::sync::broadcast::{self, error::TryRecvError, Sender}; +use tokio::sync::broadcast::{self, Sender, error::TryRecvError}; use uuid::Uuid; const LOG_BUFFER: usize = 10000; diff --git a/vicky/src/lib/vicky/scheduler.rs b/vicky/src/lib/vicky/scheduler.rs index e5b6243..98f686e 100644 --- a/vicky/src/lib/vicky/scheduler.rs +++ b/vicky/src/lib/vicky/scheduler.rs @@ -316,10 +316,12 @@ mod tests { #[test] fn schedule_with_poisoned_lock() { - let tasks = vec![Task::builder() - .display_name("I need to do something") - .write_lock("Entire Prod Cluster") - .build_expect()]; + let tasks = vec![ + Task::builder() + .display_name("I need to do something") + .write_lock("Entire Prod Cluster") + .build_expect(), + ]; let mut poisoned_lock = Lock::write("Entire Prod Cluster"); poisoned_lock.poison(&Uuid::new_v4()); let poisoned_locks = vec![poisoned_lock]; @@ -355,10 +357,12 @@ mod tests { #[test] fn schedule_different_tasks_with_poisoned_lock_ro() { - let tasks = vec![Task::builder() - .display_name("I need to do something") - .read_lock("Entire Prod Cluster") - .build_expect()]; + let tasks = vec![ + Task::builder() + .display_name("I need to do something") + .read_lock("Entire Prod Cluster") + .build_expect(), + ]; let mut poisoned_lock = Lock::read("Entire Prod Cluster"); poisoned_lock.poison(&Uuid::new_v4()); let poisoned_locks = vec![poisoned_lock]; diff --git a/vickyctl/Cargo.toml b/vickyctl/Cargo.toml index bdf3733..bf21160 100644 --- a/vickyctl/Cargo.toml +++ b/vickyctl/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "vickyctl" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] clap = { version = "4.5.4", features = ["derive", "env", "suggestions"] } diff --git a/vickyctl/src/cli.rs b/vickyctl/src/cli.rs index de3db69..1c6a395 100644 --- a/vickyctl/src/cli.rs +++ b/vickyctl/src/cli.rs @@ -1,7 +1,7 @@ use clap::{Args, Parser, Subcommand}; use uuid::Uuid; -use vickylib::database::entities::task::TaskResult; use vickylib::database::entities::LockKind; +use vickylib::database::entities::task::TaskResult; // TODO: Add abouts to arguments #[derive(Parser, Debug, Clone)] diff --git a/vickyctl/src/error.rs b/vickyctl/src/error.rs index e208067..d02cbc8 100644 --- a/vickyctl/src/error.rs +++ b/vickyctl/src/error.rs @@ -40,7 +40,7 @@ impl From for Error { impl Display for Error { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { match self { - Error::Dependency(ref prog, ref dependent) => { + Error::Dependency(prog, dependent) => { write!( f, "{} {} {} {}", @@ -54,8 +54,8 @@ impl Display for Error { Error::Reqwest(e) => write!(f, "{}", format_http_msg(e.status(), &e.to_string())), Error::Io(e) => write!(f, "Filesystem Error: {e}"), Error::Json(e) => write!(f, "Parser Error: {e}"), - Error::Custom(ref str) => write!(f, "Custom Error: {str}"), - Error::ReqwestDetailed(e, ref detail) => { + Error::Custom(str) => write!(f, "Custom Error: {str}"), + Error::ReqwestDetailed(e, detail) => { write!(f, "{}", format_http_msg(e.status(), detail)) } } diff --git a/vickyctl/src/http_client.rs b/vickyctl/src/http_client.rs index 5ea2283..c09c0a3 100644 --- a/vickyctl/src/http_client.rs +++ b/vickyctl/src/http_client.rs @@ -1,8 +1,8 @@ use crate::cli::AppContext; use crate::error::Error; -use reqwest::blocking::Client; -use reqwest::header::{HeaderMap, AUTHORIZATION}; use reqwest::StatusCode; +use reqwest::blocking::Client; +use reqwest::header::{AUTHORIZATION, HeaderMap}; use yansi::Paint; pub fn prepare_client(ctx: &AppContext) -> Result { diff --git a/vickyctl/src/tasks.rs b/vickyctl/src/tasks.rs index 7ea1f08..e852b25 100644 --- a/vickyctl/src/tasks.rs +++ b/vickyctl/src/tasks.rs @@ -6,8 +6,8 @@ use log::debug; use serde::{Deserialize, Serialize}; use serde_json::json; use uuid::Uuid; -use vickylib::database::entities::task::{FlakeRef, TaskResult, TaskStatus}; use vickylib::database::entities::Lock; +use vickylib::database::entities::task::{FlakeRef, TaskResult, TaskStatus}; use yansi::Paint; #[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] @@ -198,18 +198,18 @@ pub fn confirm_task(id: &Uuid, ctx: &AppContext) -> Result<(), Error> { return Ok(()); } - if ctx.humanize { - if let Ok(task) = serde_json::de::from_str::(&text) { - print_http( - Some(status), - &format!( - "Task {} confirmed. New status: {:?}", - task.id.to_string().bright_blue(), - task.status - ), - ); - return Ok(()); - } + if ctx.humanize + && let Ok(task) = serde_json::de::from_str::(&text) + { + print_http( + Some(status), + &format!( + "Task {} confirmed. New status: {:?}", + task.id.to_string().bright_blue(), + task.status + ), + ); + return Ok(()); } match serde_json::de::from_str::(&text) { diff --git a/vickyctl/src/tui/lock_resolver.rs b/vickyctl/src/tui/lock_resolver.rs index 0a20075..2388055 100644 --- a/vickyctl/src/tui/lock_resolver.rs +++ b/vickyctl/src/tui/lock_resolver.rs @@ -6,7 +6,7 @@ use crate::locks::types::{LockType, PoisonedLock}; use crate::tui::utils::{centered_rect, get_longest_len}; use crossterm::event::{Event, KeyCode, KeyEvent}; use crossterm::terminal::{ - disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen, + EnterAlternateScreen, LeaveAlternateScreen, disable_raw_mode, enable_raw_mode, }; use crossterm::{event, execute}; use ratatui::prelude::*;