diff --git a/Cargo.lock b/Cargo.lock index dc1e54c..bddbfbb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,12 +1,12 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] @@ -28,15 +28,15 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.89" +version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" +checksum = "37bf3594c4c988a53154954629820791dde498571819ae4ca50ca811e060cc95" [[package]] name = "async-stream" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" dependencies = [ "async-stream-impl", "futures-core", @@ -45,9 +45,9 @@ dependencies = [ [[package]] name = "async-stream-impl" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", @@ -56,9 +56,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.82" +version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", @@ -73,15 +73,15 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "axum" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f43644eed690f5374f1af436ecd6aea01cd201f6fbdf0178adaf6907afb2cec" +checksum = "504e3947307ac8326a5437504c517c4b56716c9d98fac0028c2acc7ca47d70ae" dependencies = [ "async-trait", "axum-core", @@ -106,9 +106,9 @@ dependencies = [ [[package]] name = "axum-core" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6b8ba012a258d63c9adfa28b9ddcf66149da6f986c5b5452e629d5ee64bf00" +checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" dependencies = [ "async-trait", "bytes", @@ -183,9 +183,9 @@ checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" [[package]] name = "cc" -version = "1.1.21" +version = "1.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" +checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" dependencies = [ "shlex", ] @@ -196,6 +196,22 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + [[package]] name = "ctrlc-async" version = "3.2.2" @@ -253,18 +269,18 @@ dependencies = [ [[package]] name = "derive_builder" -version = "0.20.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd33f37ee6a119146a1781d3356a7c26028f83d779b2e04ecd45fdc75c76877b" +checksum = "507dfb09ea8b7fa618fcf76e953f4f5e192547945816d5358edffe39f6f94947" dependencies = [ "derive_builder_macro", ] [[package]] name = "derive_builder_core" -version = "0.20.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7431fa049613920234f22c47fdc33e6cf3ee83067091ea4277a3f8c4587aae38" +checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8" dependencies = [ "darling", "proc-macro2", @@ -274,14 +290,20 @@ dependencies = [ [[package]] name = "derive_builder_macro" -version = "0.20.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4abae7035bf79b9877b779505d8cf3749285b80c43941eda66604841889451dc" +checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" dependencies = [ "derive_builder_core", "syn", ] +[[package]] +name = "dotenv" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" + [[package]] name = "either" version = "1.13.0" @@ -333,24 +355,24 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", ] [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", @@ -359,21 +381,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-core", "futures-macro", @@ -398,9 +420,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.31.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "h2" @@ -414,7 +436,7 @@ dependencies = [ "futures-core", "futures-sink", "http", - "indexmap 2.5.0", + "indexmap 2.6.0", "slab", "tokio", "tokio-util", @@ -429,9 +451,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" [[package]] name = "hatchet-sdk" @@ -440,6 +462,7 @@ dependencies = [ "anyhow", "ctrlc-async", "derive_builder", + "dotenv", "envy", "futures-util", "jsonwebtoken", @@ -504,9 +527,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.4" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" @@ -516,9 +539,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" dependencies = [ "bytes", "futures-channel", @@ -550,9 +573,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da62f120a8a37763efb0cf8fdf264b884c7b8b9ac8660b900c8661030c00e6ba" +checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" dependencies = [ "bytes", "futures-channel", @@ -563,7 +586,6 @@ dependencies = [ "pin-project-lite", "socket2", "tokio", - "tower 0.4.13", "tower-service", "tracing", ] @@ -586,12 +608,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.14.5", + "hashbrown 0.15.0", ] [[package]] @@ -611,9 +633,9 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] @@ -635,9 +657,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.158" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "linux-raw-sys" @@ -754,18 +776,24 @@ dependencies = [ [[package]] name = "object" -version = "0.36.4" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "pem" @@ -790,23 +818,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.5.0", + "indexmap 2.6.0", ] [[package]] name = "pin-project" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "baf123a161dde1e524adf36f90bc5d8d3462824a9c43553ad07a8183161189ec" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" dependencies = [ "proc-macro2", "quote", @@ -852,18 +880,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "7c3a7fc5db1e57d5a779a352c8cdb57b29aa4c40cc69c3a68a7fedc815fbf2f9" dependencies = [ "unicode-ident", ] [[package]] name = "prost" -version = "0.13.2" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2ecbe40f08db5c006b5764a2645f7f3f141ce756412ac9e1dd6087e6d32995" +checksum = "7b0487d90e047de87f984913713b85c601c05609aad5b0df4b4573fbf69aa13f" dependencies = [ "bytes", "prost-derive", @@ -871,9 +899,9 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.13.2" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8650aabb6c35b860610e9cff5dc1af886c9e25073b7b1712a68972af4281302" +checksum = "0c1318b19085f08681016926435853bbf7858f9c082d0999b80550ff5d9abe15" dependencies = [ "bytes", "heck", @@ -892,9 +920,9 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.13.2" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acf0c195eebb4af52c752bec4f52f645da98b6e92077a04110c7f349477ae5ac" +checksum = "e9552f850d5f0964a4e4d0bf306459ac29323ddfbae05e35a7c0d35cb0803cc5" dependencies = [ "anyhow", "itertools", @@ -905,9 +933,9 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.13.2" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60caa6738c7369b940c3d49246a8d1749323674c65cb13010134f5c9bad5b519" +checksum = "4759aa0d3a6232fb8dbdb97b61de2c20047c68aca932c7ed76da9d788508d670" dependencies = [ "prost", ] @@ -953,9 +981,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.6" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" dependencies = [ "aho-corasick", "memchr", @@ -965,9 +993,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ "aho-corasick", "memchr", @@ -976,9 +1004,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "ring" @@ -1016,9 +1044,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.13" +version = "0.23.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" +checksum = "5fbb44d7acc4e873d613422379f69f237a1b141928c02f6bc6ccfddddc2d7993" dependencies = [ "log", "once_cell", @@ -1029,21 +1057,33 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rustls-native-certs" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcaf18a4f2be7326cd874a5fa579fae794320a0f388d365dca7e480e55f83f8a" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "rustls-pki-types", + "schannel", + "security-framework", +] + [[package]] name = "rustls-pemfile" -version = "2.1.3" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" dependencies = [ - "base64 0.22.1", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" +checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" [[package]] name = "rustls-webpki" @@ -1058,9 +1098,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" [[package]] name = "ryu" @@ -1068,16 +1108,48 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +[[package]] +name = "schannel" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" +dependencies = [ + "windows-sys 0.59.0", +] + [[package]] name = "secrecy" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba079fa568d52545cd70b334b2ce6f88f62b8fc2bda9290f48a0578388a49331" +checksum = "e891af845473308773346dc847b2c23ee78fe442e0472ac50e22a18a93d3ae5a" dependencies = [ "serde", "zeroize", ] +[[package]] +name = "security-framework" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +dependencies = [ + "bitflags 2.6.0", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "serde" version = "1.0.210" @@ -1100,9 +1172,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.131" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "67d42a0bd4ac281beff598909bb56a86acaf979b84483e1c79c10dcaf98f8cf3" dependencies = [ "itoa", "memchr", @@ -1173,9 +1245,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" -version = "2.0.77" +version = "2.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" dependencies = [ "proc-macro2", "quote", @@ -1196,9 +1268,9 @@ checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" [[package]] name = "tempfile" -version = "3.12.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" +checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" dependencies = [ "cfg-if", "fastrand", @@ -1209,18 +1281,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", @@ -1322,9 +1394,9 @@ dependencies = [ [[package]] name = "tonic" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6f6ba989e4b2c58ae83d862d3a3e27690b6e3ae630d0deb59f3697f32aa88ad" +checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" dependencies = [ "async-stream", "async-trait", @@ -1341,6 +1413,7 @@ dependencies = [ "percent-encoding", "pin-project", "prost", + "rustls-native-certs", "rustls-pemfile", "socket2", "tokio", @@ -1354,13 +1427,14 @@ dependencies = [ [[package]] name = "tonic-build" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe4ee8877250136bd7e3d2331632810a4df4ea5e004656990d8d66d2f5ee8a67" +checksum = "9557ce109ea773b399c9b9e5dca39294110b74f1f342cb347a80d1fce8c26a11" dependencies = [ "prettyplease", "proc-macro2", "prost-build", + "prost-types", "quote", "syn", ] @@ -1477,9 +1551,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", "once_cell", @@ -1488,9 +1562,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", @@ -1503,9 +1577,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1513,9 +1587,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", @@ -1526,9 +1600,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "winapi" diff --git a/Cargo.toml b/Cargo.toml index b0cf240..a2eb93c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,9 +17,12 @@ serde = { version = "1", features = ["derive"] } serde_json = "1" thiserror = "1" tokio = { version = "1", features = ["fs", "macros", "rt-multi-thread", "sync"] } -tonic = { version = "0.12", features = ["tls"] } +tonic = { version = "0.12", features = ["tls", "tls-native-roots"] } tracing = "0.1" [build-dependencies] tonic-build = "0.12" tempfile = "3" + +[dev-dependencies] +dotenv = "0.15" diff --git a/build.rs b/build.rs index 7b16cb0..df53724 100644 --- a/build.rs +++ b/build.rs @@ -14,7 +14,12 @@ fn prepend_package_name_and_build( writeln!(temp_file, "package {package_name};")?; let target_path = temp_file.into_temp_path(); - tonic_build::compile_protos(target_path)?; + tonic_build::configure() + .disable_package_emission() + .compile_protos( + &[&target_path], + &[target_path.parent().expect("must succeed")], + )?; Ok(()) } diff --git a/examples/fibonacci.rs b/examples/fibonacci.rs new file mode 100644 index 0000000..40f3bab --- /dev/null +++ b/examples/fibonacci.rs @@ -0,0 +1,34 @@ +use hatchet_sdk::{Client, StepBuilder, WorkflowBuilder}; + +pub async fn execute(n: std::num::NonZero) -> anyhow::Result { + let mut sum = 0; + let mut last = 0; + let mut current = 1; + for _i in 1..=n.get() { + sum = last + current; + last = current; + current = sum; + } + Ok(sum) +} + +#[tokio::main] +async fn main() -> anyhow::Result<()> { + dotenv::dotenv().ok(); + + let client = Client::new()?; + let mut worker = client.worker("example").build(); + worker.register_workflow( + WorkflowBuilder::default() + .name("fibonacci") + .step( + StepBuilder::default() + .name("compute") + .function(&execute) + .build()?, + ) + .build()?, + ); + worker.start().await?; + Ok(()) +} diff --git a/hatchet b/hatchet index 67df70d..7b701ed 160000 --- a/hatchet +++ b/hatchet @@ -1 +1 @@ -Subproject commit 67df70db1a12be6fc842ecc46100fa717bfdd7a4 +Subproject commit 7b701ed2094d3e72edc48b81f998ff23491fdcc6 diff --git a/src/client.rs b/src/client.rs index 792687a..05d4d3d 100644 --- a/src/client.rs +++ b/src/client.rs @@ -6,8 +6,7 @@ use crate::worker::WorkerBuilder; pub(crate) struct Environment { pub(crate) token: SecretString, pub(crate) host_port: Option, - #[serde(default)] - pub(crate) listener_v2_timeout: u64, + pub(crate) listener_v2_timeout: Option, #[serde(default)] pub(crate) tls_strategy: crate::ClientTlStrategy, pub(crate) tls_cert_file: Option, diff --git a/src/error.rs b/src/error.rs index 757c17b..70dace0 100644 --- a/src/error.rs +++ b/src/error.rs @@ -2,17 +2,27 @@ pub enum Error { #[error("failed to load configuration from the environment: {0}")] Environment(#[from] envy::Error), - #[error("transport error: {0}")] - TonicTransport(#[from] tonic::transport::Error), - #[error("status: {0}")] - TonicStatus(#[from] tonic::Status), + #[error("worker registration request: {0}")] + CouldNotRegisterWorker(tonic::Status), + #[error("workflow registration request:: {0}")] + CouldNotPutWorkflow(tonic::Status), + #[error("dispatcher listen error: {0}")] + CouldNotListenToDispatcher(tonic::Status), + #[error("step status send error: {0}")] + CouldNotSendStepStatus(tonic::Status), + #[error("heartbeat error: {0}")] + CouldNotSendHeartbeat(tonic::Status), + #[error("dispatcher connection error: {0}")] + CouldNotConnectToDispatcher(tonic::transport::Error), + #[error("workflow service connection error: {0:?}")] + CouldNotConnectToWorkflowService(tonic::transport::Error), #[error("could not read file under `{1}`: {0}")] CouldNotReadFile(std::io::Error, String), #[error("environment variables {0} and {1} cannot be set simultaneously")] CantSetBothEnvironmentVariables(&'static str, &'static str), #[error("could not subscribe to actions after {0} retries")] CouldNotSubscribeToActions(usize), - #[error("could not decode the provided token to retrieve the host/port pair")] + #[error("could not decode the provided token to retrieve the host/port pair: {0}")] CouldNotDecodeToken(jsonwebtoken::errors::Error), #[error("could not decode action payload: {0}")] CouldNotDecodeActionPayload(serde_json::Error), diff --git a/src/worker/heartbeat.rs b/src/worker/heartbeat.rs index 02381b5..0fc5562 100644 --- a/src/worker/heartbeat.rs +++ b/src/worker/heartbeat.rs @@ -23,7 +23,8 @@ where heartbeat_at: Some(std::time::SystemTime::now().into()), worker_id: worker_id.clone(), }) - .await?; + .await + .map_err(crate::Error::CouldNotSendHeartbeat)?; tokio::select! { _ = interval.tick() => { diff --git a/src/worker/listener.rs b/src/worker/listener.rs index f9520d3..5a4f38a 100644 --- a/src/worker/listener.rs +++ b/src/worker/listener.rs @@ -66,7 +66,8 @@ where StepActionEventType::StepEventTypeStarted, Default::default(), )) - .await? + .await + .map_err(crate::Error::CouldNotSendStepStatus)? .into_inner(); let input = serde_json::from_str(&action.action_payload) @@ -97,7 +98,8 @@ where dispatcher .send_step_action_event(action_event) - .await? + .await + .map_err(crate::Error::CouldNotSendStepStatus)? .into_inner(); Ok(()) @@ -110,7 +112,7 @@ pub(crate) async fn run( namespace: &str, worker_id: &str, workflows: Vec, - listener_v2_timeout: u64, + listener_v2_timeout: Option, mut interrupt_receiver: tokio::sync::mpsc::Receiver<()>, _heartbeat_interrupt_sender: tokio::sync::mpsc::Sender<()>, ) -> crate::Result<()> @@ -141,15 +143,25 @@ where } .into_request(); request.set_timeout(DEFAULT_ACTION_TIMEOUT); - dispatcher.listen(request).await?.into_inner() + dispatcher + .listen(request) + .await + .map_err(crate::Error::CouldNotListenToDispatcher)? + .into_inner() } ListenStrategy::V2 => { let mut request = WorkerListenRequest { worker_id: worker_id.to_owned(), } .into_request(); - request.set_timeout(std::time::Duration::from_millis(listener_v2_timeout)); - dispatcher.listen_v2(request).await?.into_inner() + if let Some(listener_v2_timeout) = listener_v2_timeout { + request.set_timeout(std::time::Duration::from_millis(listener_v2_timeout)); + } + dispatcher + .listen_v2(request) + .await + .map_err(crate::Error::CouldNotListenToDispatcher)? + .into_inner() } }; diff --git a/src/worker/mod.rs b/src/worker/mod.rs index 683205e..b929649 100644 --- a/src/worker/mod.rs +++ b/src/worker/mod.rs @@ -13,7 +13,9 @@ use crate::{client::Environment, ClientTlStrategy, Workflow}; #[derive(derive_builder::Builder)] #[builder(pattern = "owned", build_fn(private, name = "build_private"))] pub struct Worker<'a> { + #[builder(default, setter(into))] name: String, + #[builder(default, setter(into))] max_runs: Option, #[builder(vis = "pub(crate)")] environment: &'a super::client::Environment, @@ -47,18 +49,26 @@ struct TokenClaims { } fn construct_endpoint_url<'a>( + tls_strategy: ClientTlStrategy, host_port_in_environment: Option<&'a str>, token: &SecretString, ) -> crate::Result { use secrecy::ExposeSecret; + + let protocol = match tls_strategy { + ClientTlStrategy::None => "http", + ClientTlStrategy::Tls | ClientTlStrategy::MTls => "https", + }; + Ok(format!( - "https://{}", + "{protocol}://{}", host_port_in_environment .map(|value| crate::Result::Ok(std::borrow::Cow::Borrowed(value))) .unwrap_or_else(|| { let key = jsonwebtoken::DecodingKey::from_secret(&[]); - let mut validation = jsonwebtoken::Validation::new(jsonwebtoken::Algorithm::HS256); + let mut validation = jsonwebtoken::Validation::new(jsonwebtoken::Algorithm::ES256); validation.insecure_disable_signature_validation(); + validation.validate_aud = false; let data: jsonwebtoken::TokenData = jsonwebtoken::decode(token.expose_secret(), &key, &validation) .map_err(crate::Error::CouldNotDecodeToken)?; @@ -75,11 +85,14 @@ async fn construct_endpoint( host_port: Option<&str>, token: &SecretString, ) -> crate::Result { - let mut endpoint = tonic::transport::Endpoint::new(construct_endpoint_url(host_port, token)?)?; + let mut endpoint = + tonic::transport::Endpoint::new(construct_endpoint_url(tls_strategy, host_port, token)?) + .expect("endpoint must be valid"); endpoint = match tls_strategy { - crate::ClientTlStrategy::None => todo!(), + crate::ClientTlStrategy::None => endpoint, crate::ClientTlStrategy::Tls | crate::ClientTlStrategy::MTls => { - let mut tls_config = tonic::transport::channel::ClientTlsConfig::new(); + let mut tls_config = + tonic::transport::channel::ClientTlsConfig::new().with_enabled_roots(); if let Some(domain_name) = tls_server_name { tls_config = tls_config.domain_name(domain_name); }; @@ -104,7 +117,9 @@ async fn construct_endpoint( tls_config = tls_config.ca_certificate(Certificate::from_pem(extra_root_certificate)); } - endpoint.tls_config(tls_config)? + endpoint + .tls_config(tls_config) + .expect("TLS config must be valid") } }; Ok(endpoint) @@ -155,6 +170,8 @@ impl<'a> Worker<'a> { ) .await?; + println!("{}", endpoint.uri()); + let authorization_header: tonic::metadata::MetadataValue = format!("Bearer {token}", token = token.expose_secret()) .parse() @@ -163,7 +180,10 @@ impl<'a> Worker<'a> { let mut workflow_service_client = grpc::workflow_service_client::WorkflowServiceClient::with_interceptor( - endpoint.connect().await?, + endpoint + .connect() + .await + .map_err(crate::Error::CouldNotConnectToWorkflowService)?, move |mut request: tonic::Request<()>| { request .metadata_mut() @@ -199,7 +219,7 @@ impl<'a> Worker<'a> { "{namespaced_workflow_name}:{name}", name = step.name ), - timeout: step.timeout.as_secs().to_string(), + timeout: format!("{}s", step.timeout.as_secs()), inputs: "{}".to_owned(), parents: step.parents.clone(), user_data: Default::default(), @@ -211,20 +231,25 @@ impl<'a> Worker<'a> { }], name: namespaced_workflow_name, concurrency: None, // FIXME: Implement. - schedule_timeout: Some(workflow.schedule_timeout.as_secs().to_string()), - cron_input: None, // FIXME: Implement. - on_failure_job: None, // FIXME: Implement. - sticky: None, // FIXME: Implement. + schedule_timeout: Some(format!("{}s", workflow.schedule_timeout.as_secs())), + cron_input: None, // FIXME: Implement. + on_failure_job: None, // FIXME: Implement. + sticky: None, // FIXME: Implement. + default_priority: None, // FIXME: Implement. kind: None, }), }) - .await?; + .await + .map_err(crate::Error::CouldNotPutWorkflow)?; } // FIXME: Account for all the settings from `self.environment`. let mut dispatcher = { grpc::dispatcher_client::DispatcherClient::with_interceptor( - endpoint.connect().await?, + endpoint + .connect() + .await + .map_err(crate::Error::CouldNotConnectToDispatcher)?, move |mut request: tonic::Request<()>| { request .metadata_mut() @@ -246,8 +271,11 @@ impl<'a> Worker<'a> { request }; - let WorkerRegisterResponse { worker_id, .. } = - dispatcher.register(request).await?.into_inner(); + let WorkerRegisterResponse { worker_id, .. } = dispatcher + .register(request) + .await + .map_err(crate::Error::CouldNotRegisterWorker)? + .into_inner(); futures_util::try_join! { heartbeat::run(dispatcher.clone(), &worker_id, heartbeat_interrupt_receiver), diff --git a/src/workflow.rs b/src/workflow.rs index daea3a8..f43301d 100644 --- a/src/workflow.rs +++ b/src/workflow.rs @@ -42,7 +42,7 @@ impl StepBuilder { pub struct Workflow { #[builder(setter(into))] pub(crate) name: String, - #[builder(setter(into))] + #[builder(default, setter(into))] pub(crate) description: String, #[builder(default, setter(into))] pub(crate) version: String,