diff --git a/backend/Cargo.lock b/backend/Cargo.lock index bb5f05dc6d..2cca2e2b11 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -24,7 +24,7 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cipher", "cpufeatures", "opaque-debug 0.3.0", @@ -59,15 +59,6 @@ dependencies = [ "libc", ] -[[package]] -name = "ansi_term" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi 0.3.9", -] - [[package]] name = "anyhow" version = "1.0.65" @@ -136,10 +127,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7bebccb8d6382e06872cc7d0d801d2286004d1612e4cfcc30af9346f63cb106" dependencies = [ "base64", - "bytes 1.2.1", + "bytes", "http", "rand 0.8.5", - "reqwest 0.11.12", + "reqwest", "serde", "serde-aux", "serde_json", @@ -188,7 +179,7 @@ checksum = "ba5fa6ed76cb2aa820707b4eb9ec46f42da9ce70b0eafab5e5e34942b38a44d5" dependencies = [ "libc", "wasm-bindgen", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -219,7 +210,7 @@ checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ "hermit-abi", "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -246,23 +237,23 @@ dependencies = [ "async-trait", "axum-core", "bitflags", - "bytes 1.2.1", + "bytes", "futures-util", "headers", "http", - "http-body 0.4.5", - "hyper 0.14.20", - "itoa 1.0.3", + "http-body", + "hyper", + "itoa", "matchit", "memchr", "mime", "percent-encoding", - "pin-project-lite 0.2.9", + "pin-project-lite", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "tokio 1.21.2", + "tokio", "tower", "tower-http", "tower-layer", @@ -276,10 +267,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9f0c0a60006f2a293d82d571f635042a72edf927539b7685bd62d361963839b" dependencies = [ "async-trait", - "bytes 1.2.1", + "bytes", "futures-util", "http", - "http-body 0.4.5", + "http-body", "mime", "tower-layer", "tower-service", @@ -421,12 +412,6 @@ version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" -[[package]] -name = "bytes" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" - [[package]] name = "bytes" version = "1.2.1" @@ -439,12 +424,6 @@ version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -464,7 +443,7 @@ dependencies = [ "serde", "time 0.1.44", "wasm-bindgen", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -485,6 +464,16 @@ dependencies = [ "bitflags", ] +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + [[package]] name = "console-api" version = "0.4.0" @@ -513,7 +502,7 @@ dependencies = [ "serde", "serde_json", "thread_local", - "tokio 1.21.2", + "tokio", "tokio-stream", "tonic", "tracing", @@ -599,7 +588,7 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -619,7 +608,7 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", ] @@ -629,7 +618,7 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1cd42583b04998a5363558e5f9291ee5a5ff6b49944332103f251e7479a82aa7" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", ] @@ -639,7 +628,7 @@ version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -653,13 +642,47 @@ dependencies = [ ] [[package]] -name = "crypto-mac" -version = "0.7.0" +name = "cxx" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5" +checksum = "19f39818dcfc97d45b03953c1292efc4e80954e1583c4aa770bac1383e2310a4" dependencies = [ - "generic-array 0.12.4", - "subtle 1.0.0", + "cc", + "cxxbridge-flags", + "cxxbridge-macro", + "link-cplusplus", +] + +[[package]] +name = "cxx-build" +version = "1.0.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e580d70777c116df50c390d1211993f62d40302881e54d4b79727acb83d0199" +dependencies = [ + "cc", + "codespan-reporting", + "once_cell", + "proc-macro2", + "quote", + "scratch", + "syn", +] + +[[package]] +name = "cxxbridge-flags" +version = "1.0.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56a46460b88d1cec95112c8c363f0e2c39afdb237f60583b0b36343bf627ea9c" + +[[package]] +name = "cxxbridge-macro" +version = "1.0.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "747b608fecf06b0d72d440f27acc99288207324b793be2c17991839f3d4995ea" +dependencies = [ + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -805,7 +828,7 @@ checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c" dependencies = [ "block-buffer 0.10.3", "crypto-common", - "subtle 2.4.1", + "subtle", ] [[package]] @@ -816,7 +839,7 @@ checksum = "3fd78930633bd1c6e35c4b42b1df7b0cbc6bc191146e512bb3bedf243fcc3901" dependencies = [ "libc", "redox_users 0.3.5", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -836,7 +859,7 @@ checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" dependencies = [ "libc", "redox_users 0.4.3", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -906,7 +929,7 @@ version = "0.8.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -948,7 +971,7 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e94a7bbaa59354bc20dd75b67f23e2797b4490e9d6928203fb105c79e448c86c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall 0.2.16", "windows-sys", @@ -1019,7 +1042,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57eafdd0c16f57161105ae1b98a1238f97645f2f588438b2949c99a2af9616bf" dependencies = [ "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1028,22 +1051,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" -[[package]] -name = "fuchsia-zircon" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -dependencies = [ - "bitflags", - "fuchsia-zircon-sys", -] - -[[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" - [[package]] name = "futures" version = "0.3.24" @@ -1139,7 +1146,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.9", + "pin-project-lite", "pin-utils", "slab", ] @@ -1169,7 +1176,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi 0.9.0+wasi-snapshot-preview1", ] @@ -1180,7 +1187,7 @@ version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi 0.11.0+wasi-snapshot-preview1", ] @@ -1207,33 +1214,13 @@ dependencies = [ "syn", ] -[[package]] -name = "h2" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e4728fd124914ad25e99e3d15a9361a879f6620f63cb56bbb08f95abb97a535" -dependencies = [ - "bytes 0.5.6", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap", - "slab", - "tokio 0.2.25", - "tokio-util 0.3.1", - "tracing", - "tracing-futures", -] - [[package]] name = "h2" version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ca32592cf21ac7ccab1825cd87f6c9b3d9022c44d086172ed0966bec8af30be" dependencies = [ - "bytes 1.2.1", + "bytes", "fnv", "futures-core", "futures-sink", @@ -1241,8 +1228,8 @@ dependencies = [ "http", "indexmap", "slab", - "tokio 1.21.2", - "tokio-util 0.7.4", + "tokio", + "tokio-util", "tracing", ] @@ -1285,10 +1272,10 @@ checksum = "f3e372db8e5c0d213e0cd0b9be18be2aca3d44cf2fe30a9d46a65581cd454584" dependencies = [ "base64", "bitflags", - "bytes 1.2.1", + "bytes", "headers-core", "http", - "httpdate 1.0.2", + "httpdate", "mime", "sha1", ] @@ -1332,17 +1319,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" dependencies = [ - "hmac 0.12.1", -] - -[[package]] -name = "hmac" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dcb5e64cda4c23119ab41ba960d1e170a774c8e4b9d9e6a9bc18aabf5e59695" -dependencies = [ - "crypto-mac", - "digest 0.8.1", + "hmac", ] [[package]] @@ -1360,19 +1337,9 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" dependencies = [ - "bytes 1.2.1", + "bytes", "fnv", - "itoa 1.0.3", -] - -[[package]] -name = "http-body" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" -dependencies = [ - "bytes 0.5.6", - "http", + "itoa", ] [[package]] @@ -1381,9 +1348,9 @@ version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ - "bytes 1.2.1", + "bytes", "http", - "pin-project-lite 0.2.9", + "pin-project-lite", ] [[package]] @@ -1398,12 +1365,6 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" -[[package]] -name = "httpdate" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" - [[package]] name = "httpdate" version = "1.0.2" @@ -1416,49 +1377,25 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" -[[package]] -name = "hyper" -version = "0.13.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a6f157065790a3ed2f88679250419b5cdd96e714a0d65f7797fd337186e96bb" -dependencies = [ - "bytes 0.5.6", - "futures-channel", - "futures-core", - "futures-util", - "h2 0.2.7", - "http", - "http-body 0.3.1", - "httparse", - "httpdate 0.3.2", - "itoa 0.4.8", - "pin-project", - "socket2 0.3.19", - "tokio 0.2.25", - "tower-service", - "tracing", - "want", -] - [[package]] name = "hyper" version = "0.14.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02c929dc5c39e335a03c405292728118860721b10190d98c2a0f0efd5baafbac" dependencies = [ - "bytes 1.2.1", + "bytes", "futures-channel", "futures-core", "futures-util", - "h2 0.3.14", + "h2", "http", - "http-body 0.4.5", + "http-body", "httparse", - "httpdate 1.0.2", - "itoa 1.0.3", - "pin-project-lite 0.2.9", - "socket2 0.4.7", - "tokio 1.21.2", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", "tower-service", "tracing", "want", @@ -1470,49 +1407,47 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" dependencies = [ - "hyper 0.14.20", - "pin-project-lite 0.2.9", - "tokio 1.21.2", + "hyper", + "pin-project-lite", + "tokio", "tokio-io-timeout", ] -[[package]] -name = "hyper-tls" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d979acc56dcb5b8dddba3917601745e877576475aa046df3226eabdecef78eed" -dependencies = [ - "bytes 0.5.6", - "hyper 0.13.10", - "native-tls", - "tokio 0.2.25", - "tokio-tls", -] - [[package]] name = "hyper-tls" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ - "bytes 1.2.1", - "hyper 0.14.20", + "bytes", + "hyper", "native-tls", - "tokio 1.21.2", + "tokio", "tokio-native-tls", ] [[package]] name = "iana-time-zone" -version = "0.1.50" +version = "0.1.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd911b35d940d2bd0bea0f9100068e5b97b51a1cbe13d13382f132e0365257a0" +checksum = "f5a6ef98976b22b3b7f2f3a806f858cb862044cfa66805aa3ad84cb3d3b785ed" dependencies = [ "android_system_properties", "core-foundation-sys", + "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "winapi 0.3.9", + "winapi", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fde6edd6cef363e9359ed3c98ba64590ba9eecba2293eb5a723ab32aee8926aa" +dependencies = [ + "cxx", + "cxx-build", ] [[package]] @@ -1564,16 +1499,7 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "iovec" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" -dependencies = [ - "libc", + "cfg-if", ] [[package]] @@ -1615,15 +1541,9 @@ dependencies = [ [[package]] name = "itoa" -version = "0.4.8" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" - -[[package]] -name = "itoa" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" +checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" [[package]] name = "js-sys" @@ -1643,16 +1563,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "kernel32-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - [[package]] name = "lalrpop" version = "0.17.2" @@ -1703,7 +1613,7 @@ dependencies = [ "fastrand", "futures-io", "futures-util", - "httpdate 1.0.2", + "httpdate", "idna 0.2.3", "mime", "nom", @@ -1711,8 +1621,8 @@ dependencies = [ "quoted_printable", "rustls", "rustls-pemfile", - "socket2 0.4.7", - "tokio 1.21.2", + "socket2", + "tokio", "tokio-rustls", "webpki-roots", ] @@ -1792,9 +1702,18 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.134" +version = "0.2.135" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "329c933548736bc49fd575ee68c89e8be4d260064184389a5b77517cddd99ffb" +checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c" + +[[package]] +name = "link-cplusplus" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369" +dependencies = [ + "cc", +] [[package]] name = "lock_api" @@ -1812,7 +1731,7 @@ version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1910,25 +1829,6 @@ dependencies = [ "adler", ] -[[package]] -name = "mio" -version = "0.6.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" -dependencies = [ - "cfg-if 0.1.10", - "fuchsia-zircon", - "fuchsia-zircon-sys", - "iovec", - "kernel32-sys", - "libc", - "log", - "miow", - "net2", - "slab", - "winapi 0.2.8", -] - [[package]] name = "mio" version = "0.8.4" @@ -1941,18 +1841,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "miow" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" -dependencies = [ - "kernel32-sys", - "net2", - "winapi 0.2.8", - "ws2_32-sys", -] - [[package]] name = "native-tls" version = "0.2.10" @@ -1971,17 +1859,6 @@ dependencies = [ "tempfile", ] -[[package]] -name = "net2" -version = "0.2.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "391630d12b68002ae1e25e8f974306474966550ad82dac6886fb8910c19568ae" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "winapi 0.3.9", -] - [[package]] name = "new_debug_unreachable" version = "1.0.4" @@ -1998,6 +1875,16 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + [[package]] name = "num-bigint" version = "0.2.6" @@ -2084,7 +1971,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12fc0523e3bd51a692c8850d075d74dc062ccf251c0110668cbd921917118a13" dependencies = [ "bitflags", - "cfg-if 1.0.0", + "cfg-if", "foreign-types", "libc", "once_cell", @@ -2128,6 +2015,12 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a86ed3f5f244b372d6b1a00b72ef7f8876d0bc6a78a4c9985c53614041512063" +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + [[package]] name = "parking_lot" version = "0.11.2" @@ -2155,12 +2048,12 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "instant", "libc", "redox_syscall 0.2.16", "smallvec", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2169,7 +2062,7 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall 0.2.16", "smallvec", @@ -2184,7 +2077,7 @@ checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" dependencies = [ "base64ct", "rand_core 0.6.4", - "subtle 2.4.1", + "subtle", ] [[package]] @@ -2309,12 +2202,6 @@ dependencies = [ "syn", ] -[[package]] -name = "pin-project-lite" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" - [[package]] name = "pin-project-lite" version = "0.2.9" @@ -2388,7 +2275,7 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45c8babc29389186697fe5a2a4859d697825496b83db5d0b65271cdc0488e88c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "fnv", "lazy_static", "memchr", @@ -2402,7 +2289,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "399c3c31cdec40583bb68f0b18403400d01ec4289c383aa047560439952c4dd7" dependencies = [ - "bytes 1.2.1", + "bytes", "prost-derive", ] @@ -2425,7 +2312,7 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dfaa718ad76a44b3415e6c4d53b17c8f99160dcb3a99b10470fce8ad43f6e3e" dependencies = [ - "bytes 1.2.1", + "bytes", "prost", ] @@ -2460,7 +2347,7 @@ dependencies = [ "rand_os", "rand_pcg", "rand_xorshift", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2544,7 +2431,7 @@ checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" dependencies = [ "libc", "rand_core 0.4.2", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2558,7 +2445,7 @@ dependencies = [ "libc", "rand_core 0.4.2", "rdrand", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2658,42 +2545,7 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" dependencies = [ - "winapi 0.3.9", -] - -[[package]] -name = "reqwest" -version = "0.10.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0718f81a8e14c4dbb3b34cf23dc6aaf9ab8a0dfec160c534b3dbca1aaa21f47c" -dependencies = [ - "base64", - "bytes 0.5.6", - "encoding_rs", - "futures-core", - "futures-util", - "http", - "http-body 0.3.1", - "hyper 0.13.10", - "hyper-tls 0.4.3", - "ipnet", - "js-sys", - "lazy_static", - "log", - "mime", - "mime_guess", - "native-tls", - "percent-encoding", - "pin-project-lite 0.2.9", - "serde", - "serde_urlencoded", - "tokio 0.2.25", - "tokio-tls", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "winreg 0.7.0", + "winapi", ] [[package]] @@ -2703,15 +2555,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "431949c384f4e2ae07605ccaa56d1d9d2ecdb5cadd4f9577ccfab29f2e5149fc" dependencies = [ "base64", - "bytes 1.2.1", + "bytes", "encoding_rs", "futures-core", "futures-util", - "h2 0.3.14", + "h2", "http", - "http-body 0.4.5", - "hyper 0.14.20", - "hyper-tls 0.5.0", + "http-body", + "hyper", + "hyper-tls", "ipnet", "js-sys", "log", @@ -2719,18 +2571,18 @@ dependencies = [ "native-tls", "once_cell", "percent-encoding", - "pin-project-lite 0.2.9", + "pin-project-lite", "serde", "serde_json", "serde_urlencoded", - "tokio 1.21.2", + "tokio", "tokio-native-tls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "winreg 0.10.1", + "winreg", ] [[package]] @@ -2757,7 +2609,7 @@ dependencies = [ "spin", "untrusted", "web-sys", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2904,6 +2756,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +[[package]] +name = "scratch" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" + [[package]] name = "sct" version = "0.7.0" @@ -3005,7 +2863,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41feea4228a6f1cd09ec7a3593a682276702cd67b5273544757dae23c096f074" dependencies = [ "indexmap", - "itoa 1.0.3", + "itoa", "ryu", "serde", ] @@ -3017,7 +2875,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", - "itoa 1.0.3", + "itoa", "ryu", "serde", ] @@ -3028,7 +2886,7 @@ version = "0.65.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79914ff59fe9f3b58e68da7017b6869d1c951d4c826ad457d4975b292451798c" dependencies = [ - "bytes 1.2.1", + "bytes", "derive_more", "serde", "serde_bytes", @@ -3042,7 +2900,7 @@ version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.10.5", ] @@ -3066,7 +2924,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ "block-buffer 0.9.0", - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.9.0", "opaque-debug 0.3.0", @@ -3078,7 +2936,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.10.5", ] @@ -3122,37 +2980,12 @@ dependencies = [ "autocfg 1.1.0", ] -[[package]] -name = "slack-http-verifier" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2848741518fc1c58c7c28b0c4136e62a523438b3700311f7a1faffd37e756f8" -dependencies = [ - "crypto-mac", - "hex", - "hmac 0.7.1", - "http", - "reqwest 0.10.10", - "sha2 0.8.2", -] - [[package]] name = "smallvec" version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" -[[package]] -name = "socket2" -version = "0.3.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "winapi 0.3.9", -] - [[package]] name = "socket2" version = "0.4.7" @@ -3160,7 +2993,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" dependencies = [ "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -3227,7 +3060,7 @@ dependencies = [ "base64", "bitflags", "byteorder", - "bytes 1.2.1", + "bytes", "chrono", "crc", "crossbeam-queue", @@ -3242,9 +3075,9 @@ dependencies = [ "hashlink", "hex", "hkdf", - "hmac 0.12.1", + "hmac", "indexmap", - "itoa 1.0.3", + "itoa", "libc", "log", "md-5 0.10.5", @@ -3300,7 +3133,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24c5b2d25fa654cc5f841750b8e1cdedbe21189bf9a9382ee90bfa9dd3562396" dependencies = [ "once_cell", - "tokio 1.21.2", + "tokio", "tokio-rustls", ] @@ -3405,12 +3238,6 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" -[[package]] -name = "subtle" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" - [[package]] name = "subtle" version = "2.4.1" @@ -3440,7 +3267,7 @@ dependencies = [ "ahash", "ast_node", "better_scoped_tls", - "cfg-if 1.0.0", + "cfg-if", "debug_unreachable", "either", "from_variant", @@ -3544,9 +3371,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.101" +version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e90cde112c4b9690b8cbe810cba9ddd8bc1d7472e2cae317b69e9438c1cba7d2" +checksum = "3fcd952facd492f9be3ef0d0b7032a6e442ee9b361d4acc2b1d0c4aaa5f613a1" dependencies = [ "proc-macro2", "quote", @@ -3565,12 +3392,12 @@ version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "fastrand", "libc", "redox_syscall 0.2.16", "remove_dir_all", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -3581,7 +3408,16 @@ checksum = "edd106a334b7657c10b7c540a0106114feadeb4dc314513e97df481d5d966f42" dependencies = [ "byteorder", "dirs 1.0.5", - "winapi 0.3.9", + "winapi", +] + +[[package]] +name = "termcolor" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +dependencies = [ + "winapi-util", ] [[package]] @@ -3632,7 +3468,7 @@ checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" dependencies = [ "libc", "wasi 0.10.0+wasi-snapshot-preview1", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -3641,7 +3477,7 @@ version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d634a985c4d4238ec39cacaed2e7ae552fbd3c476b552c1deac3021b7d7eaf0c" dependencies = [ - "itoa 1.0.3", + "itoa", "libc", "num_threads", "time-macros", @@ -3668,24 +3504,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" -[[package]] -name = "tokio" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6703a273949a90131b290be1fe7b039d0fc884aa1935860dfcbe056f28cd8092" -dependencies = [ - "bytes 0.5.6", - "fnv", - "futures-core", - "iovec", - "lazy_static", - "memchr", - "mio 0.6.23", - "num_cpus", - "pin-project-lite 0.1.12", - "slab", -] - [[package]] name = "tokio" version = "1.21.2" @@ -3693,18 +3511,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" dependencies = [ "autocfg 1.1.0", - "bytes 1.2.1", + "bytes", "libc", "memchr", - "mio 0.8.4", + "mio", "num_cpus", "parking_lot 0.12.1", - "pin-project-lite 0.2.9", + "pin-project-lite", "signal-hook-registry", - "socket2 0.4.7", + "socket2", "tokio-macros", "tracing", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -3713,8 +3531,8 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" dependencies = [ - "pin-project-lite 0.2.9", - "tokio 1.21.2", + "pin-project-lite", + "tokio", ] [[package]] @@ -3735,7 +3553,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" dependencies = [ "native-tls", - "tokio 1.21.2", + "tokio", ] [[package]] @@ -3745,7 +3563,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ "rustls", - "tokio 1.21.2", + "tokio", "webpki", ] @@ -3756,8 +3574,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6edf2d6bc038a43d31353570e27270603f4648d18f5ed10c0e179abe43255af" dependencies = [ "futures-core", - "pin-project-lite 0.2.9", - "tokio 1.21.2", + "pin-project-lite", + "tokio", ] [[package]] @@ -3770,46 +3588,22 @@ dependencies = [ "futures-core", "libc", "redox_syscall 0.2.16", - "tokio 1.21.2", + "tokio", "tokio-stream", "xattr", ] -[[package]] -name = "tokio-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a70f4fcd7b3b24fb194f837560168208f669ca8cb70d0c4b862944452396343" -dependencies = [ - "native-tls", - "tokio 0.2.25", -] - -[[package]] -name = "tokio-util" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" -dependencies = [ - "bytes 0.5.6", - "futures-core", - "futures-sink", - "log", - "pin-project-lite 0.1.12", - "tokio 0.2.25", -] - [[package]] name = "tokio-util" version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" dependencies = [ - "bytes 1.2.1", + "bytes", "futures-core", "futures-sink", - "pin-project-lite 0.2.9", - "tokio 1.21.2", + "pin-project-lite", + "tokio", "tracing", ] @@ -3832,21 +3626,21 @@ dependencies = [ "async-trait", "axum", "base64", - "bytes 1.2.1", + "bytes", "futures-core", "futures-util", - "h2 0.3.14", + "h2", "http", - "http-body 0.4.5", - "hyper 0.14.20", + "http-body", + "hyper", "hyper-timeout", "percent-encoding", "pin-project", "prost", "prost-derive", - "tokio 1.21.2", + "tokio", "tokio-stream", - "tokio-util 0.7.4", + "tokio-util", "tower", "tower-layer", "tower-service", @@ -3864,11 +3658,11 @@ dependencies = [ "futures-util", "indexmap", "pin-project", - "pin-project-lite 0.2.9", + "pin-project-lite", "rand 0.8.5", "slab", - "tokio 1.21.2", - "tokio-util 0.7.4", + "tokio", + "tokio-util", "tower-layer", "tower-service", "tracing", @@ -3886,7 +3680,7 @@ dependencies = [ "futures-util", "http", "parking_lot 0.12.1", - "pin-project-lite 0.2.9", + "pin-project-lite", "tower-layer", "tower-service", ] @@ -3898,13 +3692,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c530c8675c1dbf98facee631536fa116b5fb6382d7dd6dc1b118d970eafe3ba" dependencies = [ "bitflags", - "bytes 1.2.1", + "bytes", "futures-core", "futures-util", "http", - "http-body 0.4.5", + "http-body", "http-range-header", - "pin-project-lite 0.2.9", + "pin-project-lite", "tower", "tower-layer", "tower-service", @@ -3913,9 +3707,9 @@ dependencies = [ [[package]] name = "tower-layer" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "343bc9466d3fe6b0f960ef45960509f84480bf4fd96f92901afe7ff3df9d3a62" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" [[package]] name = "tower-service" @@ -3929,9 +3723,9 @@ version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "log", - "pin-project-lite 0.2.9", + "pin-project-lite", "tracing-attributes", "tracing-core", ] @@ -3990,12 +3784,12 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.15" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60db860322da191b40952ad9affe65ea23e7dd6a5c442c2c42865810c6ab8e6b" +checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70" dependencies = [ - "ansi_term", "matchers", + "nu-ansi-term", "once_cell", "regex", "serde", @@ -4128,9 +3922,9 @@ checksum = "d70b6494226b36008c8366c288d77190b3fad2eb4c10533139c1c1f461127f1a" [[package]] name = "unicode-ident" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcc811dc4066ac62f84f11307873c4850cb653bfa9b1719cee2bd2204a4bc5dd" +checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" [[package]] name = "unicode-normalization" @@ -4258,7 +4052,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" dependencies = [ "same-file", - "winapi 0.3.9", + "winapi", "winapi-util", ] @@ -4296,9 +4090,7 @@ version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" dependencies = [ - "cfg-if 1.0.0", - "serde", - "serde_json", + "cfg-if", "wasm-bindgen-macro", ] @@ -4323,7 +4115,7 @@ version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -4409,12 +4201,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" - [[package]] name = "winapi" version = "0.3.9" @@ -4425,12 +4211,6 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu", ] -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" - [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" @@ -4443,7 +4223,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -4471,7 +4251,8 @@ dependencies = [ "git-version", "headers", "hex", - "hyper 0.14.20", + "hmac", + "hyper", "itertools 0.10.5", "json-pointer", "lettre", @@ -4482,14 +4263,14 @@ dependencies = [ "rand 0.8.5", "rand_core 0.6.4", "regex", - "reqwest 0.11.12", + "reqwest", "retainer", "rust-embed", "rustpython-parser", "serde", "serde_json", "serde_urlencoded", - "slack-http-verifier", + "sha2 0.10.6", "sql-builder", "sqlx", "swc_common", @@ -4498,9 +4279,9 @@ dependencies = [ "tempfile", "thiserror", "time 0.3.15", - "tokio 1.21.2", + "tokio", "tokio-tar", - "tokio-util 0.7.4", + "tokio-util", "tower", "tower-cookies", "tower-http", @@ -4556,32 +4337,13 @@ version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" -[[package]] -name = "winreg" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" -dependencies = [ - "winapi 0.3.9", -] - [[package]] name = "winreg" version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" dependencies = [ - "winapi 0.3.9", -] - -[[package]] -name = "ws2_32-sys" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" -dependencies = [ - "winapi 0.2.8", - "winapi-build", + "winapi", ] [[package]] diff --git a/backend/Cargo.toml b/backend/Cargo.toml index 7c95ade8c5..457eee188d 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -45,7 +45,6 @@ url = "^2" async-oauth2 = "^0" reqwest = { version = "^0", features = ["json"] } time = "^0" -slack-http-verifier = "^0" serde_urlencoded = "^0" tokio-tar = "^0" tempfile = "^3" @@ -60,6 +59,8 @@ swc_ecma_parser = "^0" swc_ecma_ast = "^0" base64 = "^0" unicode-general-category = "^0" +hmac = "^0" +sha2 = "^0" sqlx = { version = "^0", features = ["offline", "macros", "migrate", "uuid", "json", "chrono", "postgres", "runtime-tokio-rustls"]} dotenv = "^0" diff --git a/backend/openapi.yaml b/backend/openapi.yaml index cbce6b31ec..729d67b235 100644 --- a/backend/openapi.yaml +++ b/backend/openapi.yaml @@ -2551,7 +2551,7 @@ paths: schema: type: string - /w/{workspace}/jobs/resume/{id}: + /w/{workspace}/jobs/resume/{job_id}/{resume_id}/{signature}: get: summary: resume a job for a suspended flow operationId: resumeSuspendedJob @@ -2560,6 +2560,16 @@ paths: parameters: - $ref: "#/components/parameters/WorkspaceId" - $ref: "#/components/parameters/JobId" + - name: resume_id + in: path + required: true + schema: + type: integer + - name: signature + in: path + required: true + schema: + type: string - name: payload in: query schema: @@ -2593,7 +2603,7 @@ paths: schema: type: string - /w/{workspace}/jobs/cancel/{id}: + /w/{workspace}/jobs/cancel/{job_id}/{resume_id}/{signature}: get: summary: cancel a job for a suspended flow operationId: cancelSuspendedJob @@ -2602,6 +2612,16 @@ paths: parameters: - $ref: "#/components/parameters/WorkspaceId" - $ref: "#/components/parameters/JobId" + - name: resume_id + in: path + required: true + schema: + type: integer + - name: signature + in: path + required: true + schema: + type: string - name: payload in: query schema: diff --git a/backend/sqlx-data.json b/backend/sqlx-data.json index dfddd71bba..3d67549022 100644 --- a/backend/sqlx-data.json +++ b/backend/sqlx-data.json @@ -1178,38 +1178,6 @@ }, "query": "SELECT * from resource_type WHERE name = $1 AND (workspace_id = $2 OR workspace_id = 'starter')" }, - "5a8eeff8ac0f52408720f8204bae085045cc4313bb31ab57442b093182633101": { - "describe": { - "columns": [ - { - "name": "id", - "ordinal": 0, - "type_info": "Uuid" - }, - { - "name": "flow_status", - "ordinal": 1, - "type_info": "Jsonb" - }, - { - "name": "suspend", - "ordinal": 2, - "type_info": "Int4" - } - ], - "nullable": [ - false, - true, - false - ], - "parameters": { - "Left": [ - "Uuid" - ] - } - }, - "query": "\n SELECT id, flow_status, suspend\n FROM queue\n WHERE id = ( SELECT parent_job FROM queue WHERE id = $1\n UNION\n SELECT parent_job from completed_job WHERE id = $1 )\n FOR UPDATE\n " - }, "5b7a1d16d8109a65479ab33d411c60d14ea91d870fdff8606d7aa4ad39f0ba00": { "describe": { "columns": [ @@ -1887,6 +1855,38 @@ }, "query": "INSERT INTO completed_job AS cj\n ( workspace_id\n , id\n , parent_job\n , created_by\n , created_at\n , started_at\n , duration_ms\n , success\n , script_hash\n , script_path\n , args\n , result\n , logs\n , raw_code\n , canceled\n , canceled_by\n , canceled_reason\n , job_kind\n , schedule_path\n , permissioned_as\n , flow_status\n , raw_flow\n , is_flow_step\n , is_skipped\n , language )\n VALUES ($1, $2, $3, $4, $5, $6, EXTRACT(milliseconds FROM (now() - $6)), $7, $8, $9,$10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24)\n ON CONFLICT (id) DO UPDATE SET success = $7, result = $11, logs = concat(cj.logs, $12)" }, + "853788436dbe987853433e8dc83665f68bd127de31d4c807abafeead896f6ac4": { + "describe": { + "columns": [ + { + "name": "id", + "ordinal": 0, + "type_info": "Uuid" + }, + { + "name": "flow_status", + "ordinal": 1, + "type_info": "Jsonb" + }, + { + "name": "suspend", + "ordinal": 2, + "type_info": "Int4" + } + ], + "nullable": [ + false, + true, + false + ], + "parameters": { + "Left": [ + "Uuid" + ] + } + }, + "query": "\n SELECT id, flow_status, suspend\n FROM queue\n WHERE id = ( SELECT parent_job FROM queue WHERE id = $1 UNION ALL SELECT parent_job FROM completed_job WHERE id = $1)\n FOR UPDATE\n " + }, "88a3f58a1a315200fdd2e4bb8638246ee21818f8aaaf56f6e9d7ddce1490d886": { "describe": { "columns": [ diff --git a/backend/src/email.rs b/backend/src/email.rs deleted file mode 100644 index b0d7d9c526..0000000000 --- a/backend/src/email.rs +++ /dev/null @@ -1,31 +0,0 @@ -use lettre::{ - transport::smtp::authentication::Credentials, AsyncSmtpTransport, AsyncTransport, Message, - Tokio1Executor, -}; - -use crate::error::{Error, Result}; - -pub struct EmailSender { - pub from: String, - pub server: String, - pub password: String, -} - -impl EmailSender { - pub async fn send_email(&self, email: Message) -> Result<()> { - let creds = Credentials::new(self.from.to_string(), self.password.to_string()); - - // Open a remote connection to gmail - let mailer: AsyncSmtpTransport = - AsyncSmtpTransport::::relay(&self.server) - .unwrap() - .credentials(creds) - .build(); - - mailer - .send(email) - .await - .map_err(|x| Error::InternalErr(format!("Impossible to send email {x}")))?; - Ok(()) - } -} diff --git a/backend/src/fixtures/base.sql b/backend/src/fixtures/base.sql index 4c3d64b535..9f1546a858 100644 --- a/backend/src/fixtures/base.sql +++ b/backend/src/fixtures/base.sql @@ -5,6 +5,14 @@ INSERT INTO workspace (id, name, owner, domain) VALUES ('test-workspace', 'test-workspace', 'test-user', null); +INSERT INTO usr(workspace_id, email, username, is_admin, role) VALUES + ('test-workspace', 'test@windmill.dev', 'test-user', true, 'Admin'); + +INSERT INTO workspace_key(workspace_id, kind, key) VALUES + ('test-workspace', 'cloud', 'test-key'); + +GRANT ALL PRIVILEGES ON TABLE workspace_key TO windmill_admin; +GRANT ALL PRIVILEGES ON TABLE workspace_key TO windmill_user; CREATE FUNCTION "notify_insert_on_completed_job" () RETURNS TRIGGER AS $$ diff --git a/backend/src/flows.rs b/backend/src/flows.rs index 7c2f0ff998..3aeca225d0 100644 --- a/backend/src/flows.rs +++ b/backend/src/flows.rs @@ -151,6 +151,14 @@ impl Default for ExponentialDelay { } } +#[derive(Deserialize, Serialize, Debug, Clone)] +pub struct Suspend { + #[serde(skip_serializing_if = "Option::is_none")] + pub required_events: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub timeout: Option, +} + #[derive(Deserialize, Serialize, Debug, Clone)] pub struct FlowModule { #[serde(default)] @@ -159,9 +167,8 @@ pub struct FlowModule { pub value: FlowModuleValue, pub stop_after_if: Option, pub summary: Option, - #[serde(default)] - #[serde(skip_serializing_if = "is_default")] - pub suspend: u16, + #[serde(skip_serializing_if = "Option::is_none")] + pub suspend: Option, #[serde(skip_serializing_if = "Option::is_none")] pub retry: Option, #[serde(skip_serializing_if = "Option::is_none")] diff --git a/backend/src/jobs.rs b/backend/src/jobs.rs index 0046965788..95bb7ad8e6 100644 --- a/backend/src/jobs.rs +++ b/backend/src/jobs.rs @@ -9,6 +9,7 @@ use axum::extract::Host; use anyhow::Context; +use hmac::Mac; use sql_builder::prelude::*; use sqlx::{query_scalar, Postgres, Transaction}; use std::collections::HashMap; @@ -17,12 +18,14 @@ use tracing::instrument; use crate::{ audit::{audit_log, ActionKind}, db::{UserDB, DB}, - error::{self, to_anyhow, Error, OrElseNotFound}, + error::{self, to_anyhow, Error}, flows::FlowValue, + oauth2::HmacSha256, schedule::get_schedule_opt, scripts::{get_hub_script_by_path, ScriptHash, ScriptLang}, users::{owner_to_token_owner, Authed}, utils::{now_from_db, require_admin, Pagination, StripPath}, + variables::get_workspace_key, worker, worker_flow::{ init_flow_status, FlowStatus, FlowStatusModule, MAX_RETRY_ATTEMPTS, MAX_RETRY_INTERVAL, @@ -69,14 +72,30 @@ pub fn workspaced_service() -> Router { .route("/completed/delete/:id", post(delete_completed_job)) .route("/get/:id", get(get_job)) .route("/getupdate/:id", get(get_job_update)) + .route( + "/job_signature/:job_id/:resume_id", + get(create_job_signature), + ) } pub fn global_service() -> Router { Router::new() - .route("/resume/:id", get(resume_suspended_job)) - .route("/resume/:id", post(resume_suspended_job)) - .route("/cancel/:id", get(cancel_suspended_job)) - .route("/cancel/:id", post(cancel_suspended_job)) + .route( + "/resume/:job_id/:resume_id/:secret", + get(resume_suspended_job), + ) + .route( + "/resume/:job_id/:resume_id/:secret", + post(resume_suspended_job), + ) + .route( + "/cancel/:job_id/:resume_id/:secret", + get(cancel_suspended_job), + ) + .route( + "/cancel/:job_id/:resume_id/:secret", + post(cancel_suspended_job), + ) } #[derive(Debug, sqlx::FromRow, Serialize, Clone)] @@ -118,7 +137,7 @@ impl QueuedJob { } #[derive(Debug, sqlx::FromRow, Serialize)] -struct CompletedJob { +pub struct CompletedJob { workspace_id: String, id: Uuid, parent_job: Option, @@ -925,7 +944,7 @@ async fn get_job( Ok(Json(job)) } -async fn get_job_by_id<'c>( +pub async fn get_job_by_id<'c>( mut tx: Transaction<'c, Postgres>, w_id: &str, id: Uuid, @@ -963,58 +982,65 @@ pub async fn get_queued_job<'c>( pub async fn resume_suspended_job( /* unauthed */ Extension(db): Extension, - Path((_, job)): Path<(String, Uuid)>, + Path((w_id, job, resume_id, secret)): Path<(String, Uuid, u32, String)>, QueryOrBody(value): QueryOrBody, ) -> error::Result { let value = value.unwrap_or(serde_json::Value::Null); - NewResumeJob { job, value, is_cancel: false } - .insert(&db) - .await?; + insert_resume_job(&db, &w_id, job, resume_id, secret, false, value).await?; Ok(StatusCode::CREATED) } pub async fn cancel_suspended_job( /* unauthed */ Extension(db): Extension, - Path((_, job)): Path<(String, Uuid)>, + Path((w_id, job, resume_id, secret)): Path<(String, Uuid, u32, String)>, QueryOrBody(value): QueryOrBody, ) -> error::Result { let value = value.unwrap_or(serde_json::Value::Null); - NewResumeJob { job, value, is_cancel: true } - .insert(&db) - .await?; + insert_resume_job(&db, &w_id, job, resume_id, secret, true, value).await?; Ok(StatusCode::CREATED) } -struct NewResumeJob { - pub job: Uuid, - pub value: Value, - pub is_cancel: bool, +pub async fn create_job_signature( + authed: Authed, + Extension(user_db): Extension, + Path((w_id, job_id, resume_id)): Path<(String, Uuid, u32)>, +) -> error::Result { + let key = get_workspace_key(&w_id, &mut user_db.begin(&authed).await?).await?; + let mut mac = HmacSha256::new_from_slice(key.as_bytes()).map_err(to_anyhow)?; + mac.update(job_id.as_bytes()); + mac.update(resume_id.to_be_bytes().as_ref()); + Ok(hex::encode(mac.finalize().into_bytes())) } -impl NewResumeJob { - async fn insert(self, db: &DB) -> error::Result<()> { - insert_resume_job(db, self).await - } -} - -async fn insert_resume_job(db: &DB, new: NewResumeJob) -> error::Result<()> { +async fn insert_resume_job( + db: &DB, + w_id: &str, + job_id: Uuid, + resume_id: u32, + secret: String, + is_cancel: bool, + value: serde_json::Value, +) -> error::Result<()> { let mut tx = db.begin().await?; - + let key = get_workspace_key(&w_id, &mut tx).await?; + let mut mac = HmacSha256::new_from_slice(key.as_bytes()).map_err(to_anyhow)?; + mac.update(job_id.as_bytes()); + mac.update(resume_id.to_be_bytes().as_ref()); + mac.verify_slice(hex::decode(secret)?.as_ref()) + .map_err(|_| anyhow::anyhow!("Invalid signature"))?; let flow = sqlx::query!( r#" SELECT id, flow_status, suspend - FROM queue - WHERE id = ( SELECT parent_job FROM queue WHERE id = $1 - UNION - SELECT parent_job from completed_job WHERE id = $1 ) - FOR UPDATE + FROM queue + WHERE id = ( SELECT parent_job FROM queue WHERE id = $1 UNION ALL SELECT parent_job FROM completed_job WHERE id = $1) + FOR UPDATE "#, - new.job, + job_id, ) .fetch_optional(&mut tx) .await? - .or_else_not_found(new.job)?; + .ok_or_else(|| anyhow::anyhow!("parent flow job not found"))?; sqlx::query!( r#" @@ -1022,11 +1048,11 @@ async fn insert_resume_job(db: &DB, new: NewResumeJob) -> error::Result<()> { (id, job, flow, value, is_cancel) VALUES ($1, $2, $3, $4, $5) "#, - Uuid::from(Ulid::new()), - new.job, + Uuid::from_u128(job_id.as_u128() ^ resume_id as u128), + job_id, flow.id, - new.value, - new.is_cancel, + value, + is_cancel, ) .execute(&mut tx) .await?; @@ -1044,11 +1070,11 @@ async fn insert_resume_job(db: &DB, new: NewResumeJob) -> error::Result<()> { let status = serde_json::from_value::(flow.flow_status.context("no flow status")?) .context("deserialize flow status")?; - if matches!(status.current_step(), Some(FlowStatusModule::WaitingForEvents { job, .. }) if job == &new.job) + if matches!(status.current_step(), Some(FlowStatusModule::WaitingForEvents { job, .. }) if job == &job_id) { sqlx::query!( "UPDATE queue SET suspend = $1 WHERE id = $2", - if new.is_cancel { 0 } else { suspend }, + if is_cancel { 0 } else { suspend }, flow.id, ) .execute(&mut tx) @@ -1060,9 +1086,9 @@ async fn insert_resume_job(db: &DB, new: NewResumeJob) -> error::Result<()> { Ok(()) } -#[derive(Serialize)] +#[derive(Serialize, Debug)] #[serde(tag = "type")] -enum Job { +pub enum Job { QueuedJob(QueuedJob), CompletedJob(CompletedJob), } diff --git a/backend/src/lib.rs b/backend/src/lib.rs index e51107325e..12678c32e2 100644 --- a/backend/src/lib.rs +++ b/backend/src/lib.rs @@ -12,7 +12,6 @@ use axum::{handler::Handler, middleware::from_extractor, routing::get, Extension use db::DB; use futures::FutureExt; use git_version::git_version; -use slack_http_verifier::SlackVerifier; use std::{net::SocketAddr, sync::Arc}; use tower::ServiceBuilder; use tower_cookies::CookieManagerLayer; @@ -25,7 +24,6 @@ extern crate dotenv; mod audit; mod client; mod db; -mod email; mod error; mod external_ip; mod flows; @@ -57,11 +55,10 @@ mod workspaces; use error::Error; -pub use crate::email::EmailSender; use crate::{ db::UserDB, error::to_anyhow, - oauth2::build_oauth_clients, + oauth2::{build_oauth_clients, SlackVerifier}, tracing_init::{MyMakeSpan, MyOnResponse}, utils::rd_string, }; @@ -99,16 +96,14 @@ struct CloudHosted(bool); pub async fn run_server( db: DB, addr: SocketAddr, - base_url: &str, - es: EmailSender, + base_url: String, mut rx: tokio::sync::broadcast::Receiver<()>, ) -> anyhow::Result<()> { let user_db = UserDB::new(db.clone()); let auth_cache = Arc::new(users::AuthCache::new(db.clone())); let argon2 = Arc::new(Argon2::default()); - let email_sender = Arc::new(es); - let basic_clients = Arc::new(build_oauth_clients(base_url).await?); + let basic_clients = Arc::new(build_oauth_clients(&base_url).await?); let slack_verifier = Arc::new( std::env::var("SLACK_SIGNING_SECRET") .ok() @@ -150,9 +145,7 @@ pub async fn run_server( .nest("/jobs", jobs::workspaced_service()) .nest( "/users", - users::workspaced_service() - .layer(Extension(argon2.clone())) - .layer(Extension(email_sender)), + users::workspaced_service().layer(Extension(argon2.clone())), ) .nest("/variables", variables::workspaced_service()) .nest("/oauth", oauth2::workspaced_service()) diff --git a/backend/src/main.rs b/backend/src/main.rs index 714f7899d0..854e73c5e6 100644 --- a/backend/src/main.rs +++ b/backend/src/main.rs @@ -59,18 +59,7 @@ async fn main() -> anyhow::Result<()> { let base_url_2 = base_url.clone(); let server_f = async { if server_mode { - windmill::run_server( - db.clone(), - addr, - &base_url_2, - windmill::EmailSender { - from: "bot@windmill.dev".to_string(), - server: "smtp.gmail.com".to_string(), - password: std::env::var("SMTP_PASSWORD").unwrap_or("NOPASS".to_string()), - }, - rx.resubscribe(), - ) - .await?; + windmill::run_server(db.clone(), addr, base_url_2, rx.resubscribe()).await?; } Ok(()) as anyhow::Result<()> }; diff --git a/backend/src/oauth2.rs b/backend/src/oauth2.rs index af07dff5c9..e2e2d00322 100644 --- a/backend/src/oauth2.rs +++ b/backend/src/oauth2.rs @@ -16,7 +16,6 @@ use itertools::Itertools; use oauth2::{Client as OClient, *}; use reqwest::Client; use serde::{de::DeserializeOwned, Deserialize, Serialize}; -use slack_http_verifier::SlackVerifier; use sqlx::{Postgres, Transaction}; use tokio::{fs::File, io::AsyncReadExt}; use tower_cookies::{Cookie, Cookies}; @@ -36,6 +35,13 @@ use crate::{ BaseUrl, }; +use std::str; + +use hmac::{Hmac, Mac}; +use sha2::Sha256; + +pub type HmacSha256 = Hmac; + pub fn global_service() -> Router { Router::new() .route("/login/:client", get(login)) @@ -959,3 +965,28 @@ fn set_cookie(state: &State, cookies: Cookies) { cookie.set_path("/"); cookies.add(cookie); } + +#[derive(Clone, Debug)] +pub struct SlackVerifier { + mac: HmacSha256, +} + +impl SlackVerifier { + pub fn new>(secret: S) -> anyhow::Result { + HmacSha256::new_from_slice(secret.as_ref()) + .map(|mac| SlackVerifier { mac }) + .map_err(|_| anyhow::anyhow!("invalid secret")) + } + + pub fn verify(&self, ts: &str, body: &str, exp_sig: &str) -> anyhow::Result<()> { + let basestring = format!("v0:{}:{}", ts, body); + let mut mac = self.mac.clone(); + + mac.update(basestring.as_bytes()); + let sig = format!("v0={}", hex::encode(mac.finalize().into_bytes())); + if sig != exp_sig { + Err(anyhow::anyhow!("signature mismatch"))?; + } + Ok(()) + } +} diff --git a/backend/src/variables.rs b/backend/src/variables.rs index eb5544e4ac..8c11ac583a 100644 --- a/backend/src/variables.rs +++ b/backend/src/variables.rs @@ -453,15 +453,22 @@ pub async fn build_crypt<'c>( db: &mut Transaction<'c, Postgres>, w_id: &str, ) -> Result { + let key = get_workspace_key(w_id, db).await?; + Ok(magic_crypt::new_magic_crypt!(key, 256)) +} + +pub async fn get_workspace_key<'c>( + w_id: &str, + db: &mut Transaction<'c, Postgres>, +) -> Result { let key = sqlx::query_scalar!( "SELECT key FROM workspace_key WHERE workspace_id = $1 AND kind = 'cloud'", w_id ) .fetch_one(db) .await - .map_err(|e| Error::InternalErr(format!("fetching crypt key: {e}")))?; - - Ok(magic_crypt::new_magic_crypt!(key, 256)) + .map_err(|e| Error::InternalErr(format!("fetching workspace key: {e}")))?; + Ok(key) } pub fn encrypt(mc: &MagicCrypt256, value: &str) -> String { diff --git a/backend/src/worker.rs b/backend/src/worker.rs index 06510edb23..91827c592a 100644 --- a/backend/src/worker.rs +++ b/backend/src/worker.rs @@ -2623,46 +2623,42 @@ def main(): } mod suspend_resume { + + use crate::jobs::get_job_by_id; + use super::*; use futures::{Stream, StreamExt}; struct ApiServer { addr: std::net::SocketAddr, - tx: tokio::sync::oneshot::Sender<()>, - task: tokio::task::JoinHandle>, + tx: tokio::sync::broadcast::Sender<()>, + task: tokio::task::JoinHandle>, } impl ApiServer { async fn start(db: DB) -> Self { - let (tx, rx) = tokio::sync::oneshot::channel::<()>(); + let (tx, rx) = tokio::sync::broadcast::channel::<()>(1); let sock = tokio::net::TcpListener::bind("127.0.0.1:0").await.unwrap(); let addr = sock.local_addr().unwrap(); + drop(sock); - use crate::jobs::{cancel_suspended_job, resume_suspended_job}; - use axum::routing::{get, post}; - - let router = axum::Router::new() - .route("/w/:workspace/jobs/resume/:id", get(resume_suspended_job)) - .route("/w/:workspace/jobs/resume/:id", post(resume_suspended_job)) - .route("/w/:workspace/jobs/cancel/:id", get(cancel_suspended_job)) - .route("/w/:workspace/jobs/cancel/:id", post(cancel_suspended_job)) - .layer(axum::extract::Extension(db)); - - let serve = axum::Server::from_tcp(sock.into_std().unwrap()) - .unwrap() - .serve(router.into_make_service()) - .with_graceful_shutdown(async { drop(rx.await) }); - - let task = tokio::task::spawn(serve); + let task = tokio::task::spawn({ + crate::run_server( + db.clone(), + addr, + format!("http://localhost:{}", addr.port()), + rx, + ) + }); return Self { addr, tx, task }; } - async fn close(self) -> hyper::Result<()> { - let Self { task, tx, .. } = self; + async fn close(self) -> anyhow::Result<()> { + let Self { tx, task, .. } = self; drop(tx); task.await.unwrap() } @@ -2686,6 +2682,16 @@ def main(): } } + async fn print_job(id: Uuid, db: &DB) -> Result<(), anyhow::Error> { + tracing::info!( + "{:#?}", + get_job_by_id(db.begin().await?, "test-workspace", id) + .await? + .0 + ); + Ok(()) + } + fn flow() -> FlowValue { serde_json::from_value(serde_json::json!({ "modules": [{ @@ -2700,19 +2706,32 @@ def main(): "content": "\ export async function main(n, port, op) {\ const job = Deno.env.get('WM_JOB_ID'); + const token = Deno.env.get('WM_TOKEN'); const r = await fetch( - `http://localhost:${port}/w/test-workspace/jobs/${op}/${job}`,\ + `http://localhost:${port}/api/w/test-workspace/jobs/job_signature/${job}/0?token=${token}`,\ + {\ + method: 'GET',\ + headers: { 'Authorization': `Bearer ${token}` }\ + }\ + );\ + console.log(r);\ + const secret = await r.text();\ + console.log('Secret: ' + secret + ' ' + job + ' ' + token);\ + const r2 = await fetch( + `http://localhost:${port}/api/w/test-workspace/jobs/${op}/${job}/0/${secret}`,\ {\ method: 'POST',\ body: JSON.stringify('from job'),\ headers: { 'content-type': 'application/json' }\ }\ );\ - console.log(r); + console.log(await r2.text());\ return n + 1;\ }", }, - "suspend": 1, + "suspend": { + "required_events": 1 + }, }, { "input_transform": { "n": { "type": "javascript", "expr": "previous_result", }, @@ -2724,7 +2743,9 @@ def main(): "language": "deno", "content": "export function main(n, resume, resumes) { return { n: n + 1, resume, resumes } }" }, - "suspend": 1, + "suspend": { + "required_events": 1 + }, }, { "input_transform": { "last": { "type": "javascript", "expr": "previous_result", }, @@ -2762,19 +2783,34 @@ def main(): let db = db_; wait_until_flow_suspends(flow, queue, &db).await; + // print_job(flow, &db).await; /* The first job resumes itself. */ let _first = completed.next().await.unwrap(); + // print_job(_first, &db).await; + /* ... and send a request resume it. */ let second = completed.next().await.unwrap(); + // print_job(second, &db).await; + + let token = create_token_for_owner(&db, "test-workspace", "u/test-user", "", 100, "").await.unwrap(); + let secret = reqwest::get(format!( + "http://localhost:{port}/api/w/test-workspace/jobs/job_signature/{second}/0?token={token}" + )) + .await + .unwrap() + .error_for_status() + .unwrap() + .text().await.unwrap(); + println!("{}", secret); /* ImZyb20gdGVzdCIK = base64 "from test" */ reqwest::get(format!( - "http://localhost:{port}/w/test-workspace/jobs/resume/{second}?payload=ImZyb20gdGVzdCIK" - )) - .await - .unwrap() - .error_for_status() - .unwrap(); + "http://localhost:{port}/api/w/test-workspace/jobs/resume/{second}/0/{secret}?payload=ImZyb20gdGVzdCIK" + )) + .await + .unwrap() + .error_for_status() + .unwrap(); completed.find(&flow).await.unwrap(); }) @@ -2852,13 +2888,25 @@ def main(): /* ... and send a request resume it. */ let second = completed.next().await.unwrap(); + let token = create_token_for_owner(&db, "test-workspace", "u/test-user", "", 100, "").await.unwrap(); + let secret = reqwest::get(format!( + "http://localhost:{port}/api/w/test-workspace/jobs/job_signature/{second}/0?token={token}" + )) + .await + .unwrap() + .error_for_status() + .unwrap() + .text().await.unwrap(); + println!("{}", secret); + + /* ImZyb20gdGVzdCIK = base64 "from test" */ reqwest::get(format!( - "http://localhost:{port}/w/test-workspace/jobs/cancel/{second}?payload=ImZyb20gdGVzdCIK" - )) - .await - .unwrap() - .error_for_status() - .unwrap(); + "http://localhost:{port}/api/w/test-workspace/jobs/cancel/{second}/0/{secret}?payload=ImZyb20gdGVzdCIK" + )) + .await + .unwrap() + .error_for_status() + .unwrap(); completed.find(&flow).await.unwrap(); }) @@ -3213,7 +3261,7 @@ def main(error, port): payload, Some(args), /* user */ "test-user", - /* permissioned_as */ Default::default(), + /* permissioned_as */ "u/admin".to_string(), /* scheduled_for_o */ None, /* schedule_path */ None, /* parent_job */ None, diff --git a/backend/src/worker_flow.rs b/backend/src/worker_flow.rs index f8e9bcb778..b71d169a61 100644 --- a/backend/src/worker_flow.rs +++ b/backend/src/worker_flow.rs @@ -4,7 +4,7 @@ use std::time::Duration; use crate::{ db::DB, error::{self, Error}, - flows::{FlowModule, FlowModuleValue, FlowValue, InputTransform, Retry}, + flows::{FlowModule, FlowModuleValue, FlowValue, InputTransform, Retry, Suspend}, jobs::{ add_completed_job, add_completed_job_error, get_queued_job, postprocess_queued_job, push, script_path_to_payload, JobPayload, QueuedJob, @@ -623,7 +623,7 @@ async fn push_next_flow_job( &status_module, FlowStatusModule::WaitingForPriorSteps | FlowStatusModule::WaitingForEvents { .. } ) { - if let Some((count, last)) = needs_resume(&flow, &status) { + if let Some((suspend, last)) = needs_resume(&flow, &status) { let mut tx = db.begin().await?; /* Lock this row to prevent the suspend column getting out out of sync @@ -652,7 +652,8 @@ async fn push_next_flow_job( resume_messages.extend(resumes.into_iter().map(|r| r.value)); - if is_cancelled.is_none() && resume_messages.len() >= count as usize { + let required_events = suspend.required_events.unwrap() as u16; + if is_cancelled.is_none() && resume_messages.len() >= required_events as usize { /* If we are woken up after suspending, last_result will be the flow args, but we * should use the result from the last job */ if let FlowStatusModule::WaitingForEvents { .. } = &status_module { @@ -663,10 +664,6 @@ async fn push_next_flow_job( .context("previous job result")?; } - sqlx::query!("DELETE FROM resume_job WHERE job = $1", last) - .execute(&mut tx) - .await?; - /* continue on and run this job! */ tx.commit().await?; @@ -683,9 +680,9 @@ async fn push_next_flow_job( WHERE id = $4 ", ) - .bind(json!(FlowStatusModule::WaitingForEvents { count, job: last })) - .bind((count - resume_messages.len() as u16) as i32) - .bind(30 * MINUTES) + .bind(json!(FlowStatusModule::WaitingForEvents { count: required_events, job: last })) + .bind((required_events - resume_messages.len() as u16) as i32) + .bind(suspend.timeout.map(|t| Duration::from_secs(t.into())).unwrap_or_else(|| 30 * MINUTES)) .bind(flow_job.id) .execute(&mut tx) .await?; @@ -1333,18 +1330,23 @@ fn from_now(duration: Duration) -> chrono::DateTime { } /// returns previous module non-zero suspend count and job -fn needs_resume(flow: &FlowValue, status: &FlowStatus) -> Option<(u16, Uuid)> { +fn needs_resume(flow: &FlowValue, status: &FlowStatus) -> Option<(Suspend, Uuid)> { let prev = usize::try_from(status.step) .ok() .and_then(|s| s.checked_sub(1))?; - let suspend = flow.modules.get(prev)?.suspend; - if suspend == 0 { + let suspend = flow.modules.get(prev)?.suspend.clone(); + if suspend + .as_ref() + .and_then(|s| s.required_events) + .unwrap_or(0) + == 0 + { return None; } if let &FlowStatusModule::Success { job, .. } = status.modules.get(prev)? { - Some((suspend, job)) + Some((suspend.unwrap(), job)) } else { None } diff --git a/frontend/src/lib/components/flows/content/FlowModuleSuspend.svelte b/frontend/src/lib/components/flows/content/FlowModuleSuspend.svelte index d0ba96095f..ed62e71db9 100644 --- a/frontend/src/lib/components/flows/content/FlowModuleSuspend.svelte +++ b/frontend/src/lib/components/flows/content/FlowModuleSuspend.svelte @@ -37,7 +37,10 @@ if (isSuspendEnabled && flowModule.suspend != undefined) { flowModule.suspend = undefined } else { - flowModule.suspend = 1 + flowModule.suspend = { + required_events: 1, + timeout: 1800 + } } }} options={{ @@ -48,7 +51,15 @@ Number of events to wait for {#if flowModule.suspend} - + + {:else} + + {/if} + + Timeout (in seconds) + + {#if flowModule.suspend} + {:else} {/if} diff --git a/openflow.openapi.yaml b/openflow.openapi.yaml index 24dc48794b..c5e59e8445 100644 --- a/openflow.openapi.yaml +++ b/openflow.openapi.yaml @@ -91,7 +91,12 @@ components: summary: type: string suspend: - type: integer + type: object + properties: + required_events: + type: integer + timeout: + type: integer retry: $ref: "#/components/schemas/Retry" required: