diff --git a/Cargo.lock b/Cargo.lock index 816ff5929e..dbf2fe2728 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -94,9 +94,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.7" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd2405b3ac1faab2990b74d728624cd9fd115651fcecc7c2d8daf01376275ba" +checksum = "3fde6067df7359f2d6335ec1a50c1f8f825801687d10da0cc4c6b08e3f6afd15" dependencies = [ "anstyle", "anstyle-parse", @@ -160,9 +160,9 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "async-compression" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc2d0cfb2a7388d34f590e76686704c494ed7aaceed62ee1ba35cbf363abc2a5" +checksum = "a116f46a969224200a0a97f29cfd4c50e7534e4b4826bd23ea2c3c533039c82c" dependencies = [ "brotli", "flate2", @@ -189,10 +189,10 @@ dependencies = [ "rand 0.8.5", "regex", "ring", - "rustls", + "rustls 0.21.10", "rustls-native-certs", "rustls-pemfile 1.0.4", - "rustls-webpki", + "rustls-webpki 0.101.7", "serde", "serde_json", "serde_nanos", @@ -201,7 +201,7 @@ dependencies = [ "time", "tokio", "tokio-retry", - "tokio-rustls", + "tokio-rustls 0.24.1", "tracing", "url", ] @@ -296,7 +296,7 @@ checksum = "0f77d243921b0979fbbd728dd2d5162e68ac8252976797c24eb5b3a6af9090dc" dependencies = [ "http", "log", - "rustls", + "rustls 0.21.10", "serde", "serde_json", "url", @@ -454,6 +454,16 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +[[package]] +name = "bcder" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c627747a6774aab38beb35990d88309481378558875a41da1a4b2e373c906ef0" +dependencies = [ + "bytes 1.5.0", + "smallvec", +] + [[package]] name = "bigdecimal" version = "0.3.1" @@ -479,9 +489,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" dependencies = [ "serde", ] @@ -761,9 +771,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.16" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58e54881c004cec7895b0068a0a954cd5d62da01aef83fa35b1e594497bf5445" +checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" dependencies = [ "clap_builder", "clap_derive", @@ -771,9 +781,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.16" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59cb82d7f531603d2fd1f507441cdd35184fa81beff7bd489570de7f773460bb" +checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" dependencies = [ "anstream", "anstyle", @@ -1151,7 +1161,7 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "crossterm_winapi", "libc", "parking_lot", @@ -2194,9 +2204,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b553656127a00601c8ae5590fcfdc118e4083a7924b6cf4ffc1ea4b99dc429d7" +checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" dependencies = [ "bytes 1.5.0", "fnv", @@ -2262,9 +2272,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" [[package]] name = "hex" @@ -2405,9 +2415,9 @@ dependencies = [ "futures-util", "http", "hyper", - "rustls", + "rustls 0.21.10", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", ] [[package]] @@ -2638,9 +2648,9 @@ checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "js-sys" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" dependencies = [ "wasm-bindgen", ] @@ -2712,7 +2722,7 @@ version = "0.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "libc", "redox_syscall", ] @@ -2748,9 +2758,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" @@ -2982,6 +2992,7 @@ dependencies = [ "serde_json", "si-data-nats", "telemetry", + "telemetry-nats", "thiserror", "tokio", ] @@ -3013,7 +3024,7 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "cfg-if", "libc", ] @@ -3451,6 +3462,16 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" +[[package]] +name = "pem" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b8fcc794035347fb64beda2d3b462595dd2753e3f268d89c5aae77e8cf2c310" +dependencies = [ + "base64 0.21.7", + "serde", +] + [[package]] name = "pem-rfc7468" version = "0.7.0" @@ -3608,9 +3629,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69d3587f8a9e599cc7ec2c00e331f71c4e69a5f9a4b8a6efd5b07466b9736f9a" +checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" [[package]] name = "platforms" @@ -3748,9 +3769,9 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "3.0.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b2685dd208a3771337d8d386a89840f0f43cd68be8dae90a5f8c2384effc9cd" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" dependencies = [ "toml_edit 0.21.0", ] @@ -4093,14 +4114,14 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls", + "rustls 0.21.10", "rustls-pemfile 1.0.4", "serde", "serde_json", "serde_urlencoded", "system-configuration", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", "tower-service", "url", "wasm-bindgen", @@ -4216,7 +4237,7 @@ dependencies = [ "md5", "percent-encoding", "quick-xml", - "rustls", + "rustls 0.21.10", "rustls-native-certs", "serde", "serde_derive", @@ -4225,7 +4246,7 @@ dependencies = [ "thiserror", "time", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", "tokio-stream", "url", ] @@ -4263,11 +4284,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.28" +version = "0.38.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" +checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "errno", "libc", "linux-raw-sys", @@ -4282,10 +4303,24 @@ checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", "ring", - "rustls-webpki", + "rustls-webpki 0.101.7", "sct", ] +[[package]] +name = "rustls" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e87c9956bd9807afa1f77e0f7594af32566e830e088a5576d27c5b6f30f49d41" +dependencies = [ + "log", + "ring", + "rustls-pki-types", + "rustls-webpki 0.102.1", + "subtle", + "zeroize", +] + [[package]] name = "rustls-native-certs" version = "0.6.3" @@ -4333,6 +4368,17 @@ dependencies = [ "untrusted", ] +[[package]] +name = "rustls-webpki" +version = "0.102.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef4ca26037c909dedb327b48c3327d0ba91d3dd3c4e05dad328f210ffb68e95b" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + [[package]] name = "rustversion" version = "1.0.14" @@ -4458,9 +4504,9 @@ dependencies = [ [[package]] name = "sea-orm" -version = "0.12.10" +version = "0.12.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9195a2b2a182cbee3f76cf2a97c20204022f91259bdf8a48b537788202775b" +checksum = "59f66e2129991acd51fcad7b59da1edd862edca69773cc9a19cb17b967fae2fb" dependencies = [ "async-stream", "async-trait", @@ -4486,9 +4532,9 @@ dependencies = [ [[package]] name = "sea-orm-macros" -version = "0.12.10" +version = "0.12.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66c6acfe3d49625c679955c7e7e7cd2d72b512a5c77bcd535a74aa41590b9f28" +checksum = "b03da1864306242678ac3b6567e69f70dd1252a72742baa23a4d92d2d45da3fc" dependencies = [ "heck", "proc-macro2", @@ -4500,9 +4546,9 @@ dependencies = [ [[package]] name = "sea-query" -version = "0.30.6" +version = "0.30.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a1feb0a26c02efedb049b22d3884e66f15a40c42b33dcbe49b46abc484c2bd" +checksum = "4166a1e072292d46dc91f31617c2a1cdaf55a8be4b5c9f4bf2ba248e3ac4999b" dependencies = [ "bigdecimal", "chrono", @@ -4602,9 +4648,9 @@ dependencies = [ [[package]] name = "serde-aux" -version = "4.3.1" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "184eba62ebddb71658697c8b08822edee89970bf318c5362189f0de27f85b498" +checksum = "a86348501c129f3ad50c2f4635a01971f76974cd8a3f335988a0f1581c082765" dependencies = [ "chrono", "serde", @@ -4896,7 +4942,7 @@ dependencies = [ "ouroboros 0.18.2", "refinery", "remain", - "rustls", + "rustls 0.22.2", "rustls-pemfile 2.0.0", "serde", "si-std", @@ -5079,9 +5125,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.2" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" +checksum = "2593d31f82ead8df961d8bd23a64c2ccf2eb5dd34b0a34bfb4dd54011c72009e" [[package]] name = "socket2" @@ -5185,7 +5231,7 @@ dependencies = [ "paste", "percent-encoding", "rust_decimal", - "rustls", + "rustls 0.21.10", "rustls-pemfile 1.0.4", "serde", "serde_json", @@ -5251,7 +5297,7 @@ dependencies = [ "atoi", "base64 0.21.7", "bigdecimal", - "bitflags 2.4.1", + "bitflags 2.4.2", "byteorder", "bytes 1.5.0", "chrono", @@ -5298,7 +5344,7 @@ dependencies = [ "atoi", "base64 0.21.7", "bigdecimal", - "bitflags 2.4.1", + "bitflags 2.4.2", "byteorder", "chrono", "crc", @@ -5568,6 +5614,15 @@ dependencies = [ "tracing-opentelemetry", ] +[[package]] +name = "telemetry-nats" +version = "0.1.0" +dependencies = [ + "si-data-nats", + "telemetry", + "tracing-opentelemetry", +] + [[package]] name = "tempfile" version = "3.9.0" @@ -5763,15 +5818,16 @@ dependencies = [ [[package]] name = "tokio-postgres-rustls" -version = "0.10.0" -source = "git+https://github.com/fnichol/tokio-postgres-rustls.git?branch=ring-0.17#531c8af4420fcd1b551ffe9eb5e9f3c714812333" +version = "0.11.0" +source = "git+https://github.com/jbg/tokio-postgres-rustls.git?branch=master#f210aa24c4788e7f3bd9af52c4f7014c5561ac70" dependencies = [ "futures", "ring", - "rustls", + "rustls 0.22.2", "tokio", "tokio-postgres", - "tokio-rustls", + "tokio-rustls 0.25.0", + "x509-certificate", ] [[package]] @@ -5791,7 +5847,18 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls", + "rustls 0.21.10", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +dependencies = [ + "rustls 0.22.2", + "rustls-pki-types", "tokio", ] @@ -5996,7 +6063,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" dependencies = [ "async-compression", - "bitflags 2.4.1", + "bitflags 2.4.2", "bytes 1.5.0", "futures-core", "futures-util", @@ -6165,9 +6232,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.14" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" @@ -6406,9 +6473,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -6416,9 +6483,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" dependencies = [ "bumpalo", "log", @@ -6431,9 +6498,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.39" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" +checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" dependencies = [ "cfg-if", "js-sys", @@ -6443,9 +6510,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -6453,9 +6520,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" dependencies = [ "proc-macro2", "quote", @@ -6466,15 +6533,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" [[package]] name = "web-sys" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" dependencies = [ "js-sys", "wasm-bindgen", @@ -6706,11 +6773,30 @@ dependencies = [ "tap", ] +[[package]] +name = "x509-certificate" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66534846dec7a11d7c50a74b7cdb208b9a581cad890b7866430d438455847c85" +dependencies = [ + "bcder", + "bytes 1.5.0", + "chrono", + "der", + "hex", + "pem", + "ring", + "signature 2.2.0", + "spki", + "thiserror", + "zeroize", +] + [[package]] name = "xattr" -version = "1.2.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "914566e6413e7fa959cc394fb30e563ba80f3541fbd40816d4c05a0fc3f2a0f1" +checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" dependencies = [ "libc", "linux-raw-sys", @@ -6790,3 +6876,17 @@ name = "zeroize" version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] diff --git a/Cargo.toml b/Cargo.toml index b38844e9f9..75e8b1879c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,10 +15,10 @@ members = [ "lib/buck2-resources", "lib/bytes-lines-codec", "lib/config-file", + "lib/council-server", "lib/cyclone-client", "lib/cyclone-core", "lib/cyclone-server", - "lib/council-server", "lib/dal", "lib/dal-test", "lib/deadpool-cyclone", @@ -33,12 +33,13 @@ members = [ "lib/si-data-pg", "lib/si-hash", "lib/si-pkg", + "lib/si-posthog-rs", "lib/si-settings", "lib/si-std", "lib/si-test-macros", - "lib/si-posthog-rs", "lib/telemetry-application-rs", "lib/telemetry-http-rs", + "lib/telemetry-nats-rs", "lib/telemetry-rs", "lib/veritech-client", "lib/veritech-core", @@ -112,7 +113,7 @@ regex = "1.8.1" remain = "0.2.8" reqwest = { version = "0.11.17", default-features = false, features = ["rustls-tls", "json", "multipart"] } ring = "=0.17.5" # Upgrading this is possible, but a pain, so we don't want to pick up every new minor version (see: https://github.com/facebook/buck2/commit/91af40b66960d003067c3d241595fb53d1e636c8) -rustls = { version = "0.21.1" } # pinned because ring above depends on it +rustls = { version = "0.22.2" } rustls-pemfile = { version = "2.0.0" } rust-s3 = { version = "0.34.0-rc4", default-features = false, features = ["tokio-rustls-tls"] } sea-orm = { version = "0.12.0", features = ["sqlx-postgres", "runtime-tokio-rustls", "macros", "with-chrono", "debug-print"] } @@ -133,7 +134,7 @@ test-log = { version = "0.2.11", default-features = false, features = ["trace"] thiserror = "1.0.40" tokio = { version = "1.28.0", features = ["full"] } tokio-postgres = { version = "0.7.8", features = ["runtime", "with-chrono-0_4", "with-serde_json-1"] } -tokio-postgres-rustls = { version = "0.10.0" } +tokio-postgres-rustls = { version = "0.11.0" } tokio-serde = { version = "0.8.0", features = ["json"] } tokio-stream = "0.1.14" tokio-test = "0.4.2" @@ -168,5 +169,5 @@ docker-api = { git = "https://github.com/vv9k/docker-api-rs.git", branch = "mast # Note that this helps us to narrow down the number of `ring`/`rustls` versions to 1 each rust-s3 = { git = "https://github.com/ScuffleTV/rust-s3.git", branch = "troy/rustls" } # pending a potential merge and release of -# https://github.com/jbg/tokio-postgres-rustls/pull/17 -tokio-postgres-rustls = { git = "https://github.com/fnichol/tokio-postgres-rustls.git", branch = "ring-0.17" } +# https://github.com/jbg/tokio-postgres-rustls/pull/18 +tokio-postgres-rustls = { git = "https://github.com/jbg/tokio-postgres-rustls.git", branch = "master" } diff --git a/lib/council-server/src/server.rs b/lib/council-server/src/server.rs index 47abca03b4..ca40ef9f9c 100644 --- a/lib/council-server/src/server.rs +++ b/lib/council-server/src/server.rs @@ -2,7 +2,7 @@ use crate::{Graph, Id, Request, Response}; use std::time::Duration; use futures::StreamExt; -use si_data_nats::NatsClient; +use si_data_nats::{NatsClient, Subject}; use telemetry::prelude::*; use tokio::{signal, sync::watch}; @@ -213,7 +213,7 @@ pub enum Error { #[instrument(level = "info")] pub async fn register_graph_from_job( complete_graph: &mut ChangeSetGraph, - reply_channel: String, + reply_channel: Subject, change_set_id: Id, new_dependency_data: Graph, ) -> Result<(), Error> { @@ -225,7 +225,7 @@ pub async fn register_graph_from_job( pub async fn job_processed_a_value( nats: &NatsClient, complete_graph: &mut ChangeSetGraph, - reply_channel: String, + reply_channel: Subject, change_set_id: Id, node_id: Id, ) -> Result<(), Error> { @@ -251,7 +251,7 @@ pub async fn job_processed_a_value( pub async fn job_failed_processing_a_value( nats: &NatsClient, complete_graph: &mut ChangeSetGraph, - reply_channel: String, + reply_channel: Subject, change_set_id: Id, node_id: Id, ) -> Result<(), Error> { @@ -278,7 +278,7 @@ pub async fn job_failed_processing_a_value( #[instrument(level = "info")] pub async fn job_is_going_away( complete_graph: &mut ChangeSetGraph, - reply_channel: String, + reply_channel: Subject, change_set_id: Id, ) -> Result<(), Error> { debug!(%reply_channel, %change_set_id, ?complete_graph, "Job is going away"); diff --git a/lib/council-server/src/server/graph.rs b/lib/council-server/src/server/graph.rs index e8341baa39..98fb7c0423 100644 --- a/lib/council-server/src/server/graph.rs +++ b/lib/council-server/src/server/graph.rs @@ -4,6 +4,7 @@ use std::collections::{HashMap, HashSet, VecDeque}; mod node_metadata; use node_metadata::NodeMetadata; +use si_data_nats::Subject; #[derive(Default, Debug)] pub struct ChangeSetGraph { @@ -20,7 +21,10 @@ impl ChangeSetGraph { for graph in self.dependency_data.values_mut() { for (id, metadata) in graph.iter_mut() { if let Some(reply_channel) = metadata.next_to_process() { - result.entry(reply_channel.clone()).or_default().push(*id); + result + .entry(reply_channel.to_string()) + .or_default() + .push(*id); } } } @@ -29,7 +33,7 @@ impl ChangeSetGraph { pub fn merge_dependency_graph( &mut self, - reply_channel: String, + reply_channel: Subject, new_dependency_data: Graph, change_set_id: Id, ) -> Result<(), Error> { @@ -68,7 +72,7 @@ impl ChangeSetGraph { pub fn mark_node_as_processed( &mut self, - reply_channel: &str, + reply_channel: &Subject, change_set_id: Id, node_id: Id, ) -> Result, Error> { @@ -96,7 +100,7 @@ impl ChangeSetGraph { Ok(wanted_by_reply_channels) } - pub fn remove_channel(&mut self, change_set_id: Id, reply_channel: &str) { + pub fn remove_channel(&mut self, change_set_id: Id, reply_channel: &Subject) { if let Some(graph) = self.dependency_data.get_mut(&change_set_id) { let mut to_remove = Vec::new(); for (id, metadata) in graph.iter_mut() { @@ -118,10 +122,10 @@ impl ChangeSetGraph { /// for the nodes that are being removed. pub fn remove_node_and_dependents( &mut self, - reply_channel: String, + reply_channel: Subject, change_set_id: Id, node_id: Id, - ) -> Result, Error> { + ) -> Result, Error> { let mut failure_notifications = Vec::new(); let change_set_graph_data = self.dependency_data.get_mut(&change_set_id).unwrap(); diff --git a/lib/council-server/src/server/graph/node_metadata.rs b/lib/council-server/src/server/graph/node_metadata.rs index 1050b7540f..7e710a9ef1 100644 --- a/lib/council-server/src/server/graph/node_metadata.rs +++ b/lib/council-server/src/server/graph/node_metadata.rs @@ -3,14 +3,16 @@ use std::{ time::Instant, }; +use si_data_nats::Subject; + use crate::{server::Error, Id}; #[derive(Debug)] pub struct NodeMetadata { // This should really be an ordered set, to remove duplicates, but we'll deal with // that later. - wanted_by_reply_channels: VecDeque, - processing_reply_channel: Option, + wanted_by_reply_channels: VecDeque, + processing_reply_channel: Option, depends_on_node_ids: HashSet, processing_started_at: Option, last_updated_at: Instant, @@ -29,7 +31,7 @@ impl Default for NodeMetadata { } impl NodeMetadata { - pub fn add_wanted_by_reply_channel(&mut self, reply_channel: &str) { + pub fn add_wanted_by_reply_channel(&mut self, reply_channel: &Subject) { self.wanted_by_reply_channels .push_back(reply_channel.to_owned()); self.last_updated_at = Instant::now(); @@ -62,7 +64,7 @@ impl NodeMetadata { pub fn mark_as_processed( &mut self, - reply_channel: &str, + reply_channel: &Subject, ) -> Result<(bool, HashSet), Error> { if self.processing_reply_channel().map(|p| &**p) != Some(reply_channel) { return Err(Error::ShouldNotBeProcessingByJob); @@ -79,7 +81,7 @@ impl NodeMetadata { if self.dependencies_satisfied() { let mut wanted_by_reply_channels = self.wanted_by_reply_channels(); if let Some(processed_by_reply_channel) = processing_reply_channel { - wanted_by_reply_channels.insert(processed_by_reply_channel); + wanted_by_reply_channels.insert(processed_by_reply_channel.to_string()); } Ok((true, wanted_by_reply_channels)) @@ -88,7 +90,7 @@ impl NodeMetadata { } } - pub fn merge_metadata(&mut self, reply_channel: String, dependencies: &Vec) { + pub fn merge_metadata(&mut self, reply_channel: Subject, dependencies: &Vec) { self.last_updated_at = Instant::now(); if !self.wanted_by_reply_channels.contains(&reply_channel) { @@ -97,7 +99,7 @@ impl NodeMetadata { self.depends_on_node_ids.extend(dependencies); } - pub fn next_to_process(&mut self) -> Option { + pub fn next_to_process(&mut self) -> Option { if self.depends_on_node_ids.is_empty() && self.processing_reply_channel.is_none() { self.last_updated_at = Instant::now(); @@ -112,11 +114,11 @@ impl NodeMetadata { None } - pub fn processing_reply_channel(&self) -> Option<&String> { + pub fn processing_reply_channel(&self) -> Option<&Subject> { self.processing_reply_channel.as_ref() } - pub fn remove_channel(&mut self, reply_channel: &str) { + pub fn remove_channel(&mut self, reply_channel: &Subject) { self.last_updated_at = Instant::now(); self.wanted_by_reply_channels @@ -134,10 +136,10 @@ impl NodeMetadata { } pub fn wanted_by_reply_channels(&self) -> HashSet { - HashSet::from_iter(self.wanted_by_reply_channels.iter().cloned()) + HashSet::from_iter(self.wanted_by_reply_channels.iter().map(|s| s.to_string())) } - pub fn wanted_by_reply_channels_iter(&self) -> Iter<'_, String> { + pub fn wanted_by_reply_channels_iter(&self) -> Iter<'_, Subject> { self.wanted_by_reply_channels.iter() } } diff --git a/lib/dal/src/job/definition/dependent_values_update.rs b/lib/dal/src/job/definition/dependent_values_update.rs index dc852025f5..0b976991eb 100644 --- a/lib/dal/src/job/definition/dependent_values_update.rs +++ b/lib/dal/src/job/definition/dependent_values_update.rs @@ -213,6 +213,7 @@ impl DependentValuesUpdate { task_ctx, attribute_value, pub_council.clone(), + Span::current(), )); } } @@ -317,6 +318,7 @@ impl DependentValuesUpdate { /// play more nicely with being spawned into a `JoinSet`. #[instrument( name = "dependent_values_update.update_value", + parent = &parent_span, skip_all, level = "info", fields( @@ -327,6 +329,7 @@ async fn update_value( ctx: DalContext, mut attribute_value: AttributeValue, council: council_server::PubClient, + parent_span: Span, ) -> JobConsumerResult<()> { let update_result = attribute_value.update_from_prototype_function(&ctx).await; // We don't propagate the error up, because we want the rest of the nodes in the graph to make progress diff --git a/lib/dal/src/job/definition/fix.rs b/lib/dal/src/job/definition/fix.rs index d1af68cdda..d0a06d2ed8 100644 --- a/lib/dal/src/job/definition/fix.rs +++ b/lib/dal/src/job/definition/fix.rs @@ -115,6 +115,14 @@ impl JobConsumerMetadata for FixesJob { #[async_trait] impl JobConsumer for FixesJob { + #[instrument( + name = "fixes_job.run", + skip_all, + level = "info", + fields( + // TODO(fnichol): add some? + ) + )] async fn run(&self, ctx: &mut DalContext) -> JobConsumerResult<()> { let mut fixes = self.fixes.clone(); @@ -150,7 +158,13 @@ impl JobConsumer for FixesJob { .await?; handles.push(async move { let id = fix_item.id; - let res = tokio::task::spawn(fix_task(task_ctx, self.batch_id, fix_item)).await; + let res = tokio::task::spawn(fix_task( + task_ctx, + self.batch_id, + fix_item, + Span::current(), + )) + .await; (id, res) }); } @@ -309,10 +323,20 @@ async fn finish_batch(ctx: &DalContext, id: FixBatchId) -> JobConsumerResult<()> Ok(()) } +#[instrument( + name = "fixes_job.fix_task", + parent = &parent_span, + skip_all, + level = "info", + fields( + // TODO(fnichol): add some? + ) +)] async fn fix_task( ctx: DalContext, batch_id: FixBatchId, fix_item: FixItem, + parent_span: Span, ) -> JobConsumerResult<(Fix, Vec)> { let deleted_ctx = &ctx.clone_with_delete_visibility(); // Get the workflow for the action we need to run. diff --git a/lib/nats-subscriber/BUCK b/lib/nats-subscriber/BUCK index 45ce4a17ea..2193d1125d 100644 --- a/lib/nats-subscriber/BUCK +++ b/lib/nats-subscriber/BUCK @@ -5,6 +5,7 @@ rust_library( deps = [ "//lib/si-data-nats:si-data-nats", "//lib/telemetry-rs:telemetry", + "//lib/telemetry-nats-rs:telemetry-nats", "//third-party/rust:futures", "//third-party/rust:futures-lite", "//third-party/rust:pin-project-lite", diff --git a/lib/nats-subscriber/Cargo.toml b/lib/nats-subscriber/Cargo.toml index 3ecbfbb649..0f0c740154 100644 --- a/lib/nats-subscriber/Cargo.toml +++ b/lib/nats-subscriber/Cargo.toml @@ -13,5 +13,6 @@ serde = { workspace = true } serde_json = { workspace = true } si-data-nats = { path = "../../lib/si-data-nats" } telemetry = { path = "../../lib/telemetry-rs" } +telemetry-nats = { path = "../../lib/telemetry-nats-rs" } thiserror = { workspace = true } tokio = { workspace = true } diff --git a/lib/nats-subscriber/src/builder.rs b/lib/nats-subscriber/src/builder.rs index 5d052e1173..ec08b55514 100644 --- a/lib/nats-subscriber/src/builder.rs +++ b/lib/nats-subscriber/src/builder.rs @@ -3,14 +3,16 @@ use std::marker::PhantomData; -use si_data_nats::NatsClient; +use si_data_nats::{subject::ToSubject, NatsClient, Subject}; +use telemetry::prelude::*; +use telemetry_nats::NatsMakeSpan; use crate::{Subscriber, SubscriberError, SubscriberResult}; /// The [`builder`](Self) used for creating a [`Subscriber`]. pub struct SubscriberBuilder { /// The [NATS](https://nats.io) subject used. - pub subject: String, + pub subject: Subject, /// Indicates the final type of the [`Request`](crate::Request). _phantom: PhantomData, @@ -24,17 +26,21 @@ pub struct SubscriberBuilder { /// [`Request`](crate::Request). /// Otherwise, it will not perform the check. pub check_for_reply_mailbox: bool, + + /// The logging level of the message processing spans + span_level: Level, } impl SubscriberBuilder { /// Create a new [`builder`](SubscriberBuilder) for building a [`Subscriber`]. - pub fn new(subject: impl Into) -> Self { + pub fn new(subject: impl ToSubject) -> Self { Self { - subject: subject.into(), + subject: subject.to_subject(), _phantom: PhantomData::, queue_name: None, final_message_header_key: None, check_for_reply_mailbox: false, + span_level: Level::INFO, } } @@ -55,12 +61,15 @@ impl SubscriberBuilder { .map_err(SubscriberError::NatsSubscribe)? }; + let make_span = NatsMakeSpan::new().level(self.span_level); + Ok(Subscriber { inner, _phantom: PhantomData::, subject: self.subject, final_message_header_key: self.final_message_header_key, check_for_reply_mailbox: self.check_for_reply_mailbox, + make_span, }) } @@ -81,4 +90,10 @@ impl SubscriberBuilder { self.check_for_reply_mailbox = true; self } + + /// Sets the logging level for the message processing spans. + pub fn span_level(mut self, level: Level) -> Self { + self.span_level = level; + self + } } diff --git a/lib/nats-subscriber/src/lib.rs b/lib/nats-subscriber/src/lib.rs index 19a2bc0dc0..66be3183d6 100644 --- a/lib/nats-subscriber/src/lib.rs +++ b/lib/nats-subscriber/src/lib.rs @@ -15,8 +15,9 @@ use futures::{Stream, StreamExt}; use futures_lite::future::FutureExt; use pin_project_lite::pin_project; use serde::de::DeserializeOwned; -use si_data_nats::{NatsError, Subject}; +use si_data_nats::{status::StatusCode, subject::ToSubject, HeaderMap, NatsError, Subject}; use telemetry::prelude::*; +use telemetry_nats::NatsMakeSpan; use thiserror::Error; pub use crate::builder::SubscriberBuilder; @@ -46,17 +47,28 @@ type SubscriberResult = Result; /// Contains the Rust type expected in the subscriber stream. #[derive(Debug)] pub struct Request { - /// The Rust type expected in the subscriber stream. + /// Subject to which this request is published to. + pub subject: Subject, + + /// A deserialized `T` from the message payload bytes in the subscriber stream. pub payload: T, - /// An optional reply mailbox. - pub reply_mailbox: Option, -} -impl Request { - /// Split the [`request`](Self)'s fields into individual values. - pub fn into_parts(self) -> (T, Option) { - (self.payload, self.reply_mailbox) - } + /// Optional reply subject to which response can be published by [crate::Subscriber]. + /// + /// Used for request-response pattern with [crate::Client::request]. + pub reply: Option, + + /// Optional headers. + pub headers: Option, + + /// Optional Status of the message. Used mostly for internal handling. + pub status: Option, + + /// Optional [status][crate::Message::status] description. + pub description: Option, + + /// Parent [`Span`] for processing the underlying request message. + pub process_span: Span, } pin_project! { @@ -66,15 +78,16 @@ pin_project! { #[pin] inner: si_data_nats::Subscriber, _phantom: PhantomData, - subject: String, + subject: Subject, final_message_header_key: Option, check_for_reply_mailbox: bool, + make_span: NatsMakeSpan, } } impl Subscriber { /// Provides the [`builder`](SubscriberBuilder) for creating a [`Subscriber`]. - pub fn create(subject: impl Into) -> SubscriberBuilder { + pub fn create(subject: impl ToSubject) -> SubscriberBuilder { SubscriberBuilder::new(subject) } @@ -102,8 +115,8 @@ impl Subscriber { .map_err(SubscriberError::NatsUnsubscribe) } - /// Returns the NATS subject to which this subscriber is subscribed. - pub fn subject(&self) -> &str { + /// Returns a reference to the [`Subject`] to which this subscriber is subscribed. + pub fn subject(&self) -> &Subject { &self.subject } } @@ -121,13 +134,13 @@ where // Convert this NATS message into the request type `T` and return any errors // for the caller to decide how to proceed (i.e. does the caller fail on first error, // ignore error items, etc.) - Poll::Ready(Some(nats_msg)) => { + Poll::Ready(Some(msg)) => { // Only check if the message has a final message header if our subscriber config // specified one (or used the default). if let Some(final_message_header_key) = this.final_message_header_key { // If the NATS message has a final message header, then treat this as an // end-of-stream marker and close our stream. - if let Some(headers) = nats_msg.headers() { + if let Some(headers) = msg.headers() { if headers .iter() .any(|(key, _)| AsRef::::as_ref(key) == final_message_header_key) @@ -141,16 +154,15 @@ where } } - let (data, reply) = nats_msg.into_parts(); - let reply_mailbox = reply; - // Always provide the reply_mailbox if there is one, but only make it an error if // we were told to explicitly check for one. - if *this.check_for_reply_mailbox && reply_mailbox.is_none() { - return Poll::Ready(Some(Err(SubscriberError::NoReplyMailbox(data)))); + if *this.check_for_reply_mailbox && msg.reply().is_none() { + return Poll::Ready(Some(Err(SubscriberError::NoReplyMailbox( + msg.into_parts().0.payload.into(), + )))); } - let payload: T = match serde_json::from_slice(&data) { + let payload: T = match serde_json::from_slice(msg.payload()) { // Deserializing from JSON into a formal request type was successful Ok(request) => request, // Deserializing failed @@ -159,10 +171,19 @@ where } }; + let process_span = this.make_span.make_span(&msg, this.subject); + + let (msg, _metadata) = msg.into_parts(); + // Return the request type Poll::Ready(Some(Ok(Request { + reply: msg.reply, + subject: msg.subject, payload, - reply_mailbox, + headers: msg.headers, + status: msg.status, + description: msg.description, + process_span, }))) } // We see no more messages on the subject, so let's decide what to do diff --git a/lib/pinga-server/src/server.rs b/lib/pinga-server/src/server.rs index f12f5997fb..27871f3979 100644 --- a/lib/pinga-server/src/server.rs +++ b/lib/pinga-server/src/server.rs @@ -127,7 +127,6 @@ impl Server { ) } - #[allow(clippy::too_many_arguments)] #[instrument(name = "pinga.init.from_services", skip_all)] pub fn from_services( instance_id: impl Into, @@ -267,7 +266,6 @@ impl Default for ShutdownSource { pub struct JobItem { metadata: Arc, - messaging_destination: Arc, ctx_builder: DalContextBuilder, request: Result>, } @@ -283,7 +281,7 @@ impl Subscriber { let subject = nats_jobs_subject(nats.metadata().subject_prefix()); debug!( - messaging.destination = &subject.as_str(), + messaging.destination.name = subject.as_str(), "subscribing for job requests" ); @@ -291,15 +289,12 @@ impl Subscriber { // Since the any blocking job should block on its child jobs let ctx_builder = DalContext::builder(services_context, false); - let messaging_destination = Arc::new(subject.clone()); - Ok(nats_subscriber::Subscriber::create(subject) .queue_name(NATS_JOBS_DEFAULT_QUEUE) .start(&nats) .await? .map(move |request| JobItem { metadata: metadata.clone(), - messaging_destination: messaging_destination.clone(), ctx_builder: ctx_builder.clone(), request: request.map_err(Into::into), })) @@ -348,12 +343,8 @@ async fn process_job_requests_task(rx: UnboundedReceiver, concurrency_l match job.request { Ok(request) => { // Spawn a task and process the request - let join_handle = task::spawn(execute_job_task( - job.metadata, - job.messaging_destination, - job.ctx_builder, - request, - )); + let join_handle = + task::spawn(execute_job_task(job.metadata, job.ctx_builder, request)); if let Err(err) = join_handle.await { // NOTE(fnichol): This likely happens when there is contention or // an error in the Tokio runtime so we will be loud and log an @@ -376,6 +367,7 @@ async fn process_job_requests_task(rx: UnboundedReceiver, concurrency_l #[instrument( name = "execute_job_task", + parent = &request.process_span, skip_all, fields( job.id = request.payload.id, @@ -395,7 +387,6 @@ async fn process_job_requests_task(rx: UnboundedReceiver, concurrency_l )] async fn execute_job_task( metadata: Arc, - messaging_destination: Arc, ctx_builder: DalContextBuilder, request: Request, ) { @@ -405,6 +396,8 @@ async fn execute_job_task( let arg_str = serde_json::to_string(&request.payload.arg) .unwrap_or_else(|_| "arg failed to serialize".to_string()); + let messaging_destination = request.subject; + span.record("job.invoked_arg", arg_str); span.record("messaging.destination", messaging_destination.as_str()); span.record( @@ -412,15 +405,25 @@ async fn execute_job_task( format!("{} process", &messaging_destination).as_str(), ); - let maybe_reply_channel = request.reply_mailbox.clone(); - let reply_message = match execute_job( - &metadata, - messaging_destination, - ctx_builder.clone(), - request, - ) - .await { + let job_info = &request.payload; + + span.record("job_info.id", &job_info.id); + span.record("job_info.kind", &job_info.kind); + if let Ok(arg_str) = serde_json::to_string(&job_info.arg) { + span.record("job_info.arg", arg_str); + } + if let Ok(access_builder) = serde_json::to_string(&job_info.access_builder) { + span.record("job_info.access_builder", access_builder); + } + if let Ok(visibility) = serde_json::to_string(&job_info.visibility) { + span.record("job_info.visibility", visibility); + } + span.record("job_info.blocking", job_info.blocking); + } + + let maybe_reply_channel = request.reply.clone(); + let reply_message = match execute_job(ctx_builder.clone(), request.payload).await { Ok(_) => { span.record_ok(); Ok(()) @@ -452,34 +455,11 @@ async fn execute_job_task( } } -async fn execute_job( - _metadata: &Arc, - _messaging_destination: Arc, - mut ctx_builder: DalContextBuilder, - request: Request, -) -> Result<()> { - let (job_info, _) = request.into_parts(); +async fn execute_job(mut ctx_builder: DalContextBuilder, job_info: JobInfo) -> Result<()> { if job_info.blocking { ctx_builder.set_blocking(); } - let current_span = tracing::Span::current(); - if !current_span.is_disabled() { - tracing::Span::current().record("job_info.id", &job_info.id); - tracing::Span::current().record("job_info.kind", &job_info.kind); - let arg_str = serde_json::to_string(&job_info.arg)?; - tracing::Span::current().record("job_info.arg", arg_str); - tracing::Span::current().record( - "job_info.access_builder", - serde_json::to_string(&job_info.access_builder)?, - ); - tracing::Span::current().record( - "job_info.visibility", - serde_json::to_string(&job_info.visibility)?, - ); - tracing::Span::current().record("job_info.blocking", job_info.blocking); - } - let job = match job_info.kind.as_str() { stringify!(DependentValuesUpdate) => { diff --git a/lib/sdf-server/src/server/service/ws/crdt.rs b/lib/sdf-server/src/server/service/ws/crdt.rs index 923d575168..754125e246 100644 --- a/lib/sdf-server/src/server/service/ws/crdt.rs +++ b/lib/sdf-server/src/server/service/ws/crdt.rs @@ -108,8 +108,8 @@ pub async fn crdt_handle( tasks.spawn(async move { while let Some(message) = ws_subscription.next().await { - sink.send(Message::Binary(message.payload().to_owned())) - .await?; + let (inner, _) = message.into_parts(); + sink.send(Message::Binary(inner.payload.into())).await?; } let result: CrdtResult<()> = Ok(()); diff --git a/lib/sdf-server/src/server/service/ws/crdt/y.rs b/lib/sdf-server/src/server/service/ws/crdt/y.rs index a196e45f62..7c280f4edb 100644 --- a/lib/sdf-server/src/server/service/ws/crdt/y.rs +++ b/lib/sdf-server/src/server/service/ws/crdt/y.rs @@ -76,7 +76,9 @@ impl Stream for YStream { match Pin::new(&mut self.0).poll_next(cx) { Poll::Pending => Poll::Pending, Poll::Ready(None) => Poll::Ready(None), - Poll::Ready(Some(message)) => Poll::Ready(Some(Ok(message.payload().to_owned()))), + Poll::Ready(Some(message)) => { + Poll::Ready(Some(Ok(message.into_parts().0.payload.into()))) + } } } } diff --git a/lib/si-data-nats/BUCK b/lib/si-data-nats/BUCK index e03f7e180b..713c795f5e 100644 --- a/lib/si-data-nats/BUCK +++ b/lib/si-data-nats/BUCK @@ -4,10 +4,10 @@ rust_library( name = "si-data-nats", deps = [ "//lib/telemetry-rs:telemetry", + "//third-party/rust:async-nats", "//third-party/rust:bytes", "//third-party/rust:crossbeam-channel", "//third-party/rust:futures", - "//third-party/rust:async-nats", "//third-party/rust:remain", "//third-party/rust:serde", "//third-party/rust:serde_json", diff --git a/lib/si-data-nats/examples/nats-subscribe/main.rs b/lib/si-data-nats/examples/nats-subscribe/main.rs index 48af2630c7..b44ce87a30 100644 --- a/lib/si-data-nats/examples/nats-subscribe/main.rs +++ b/lib/si-data-nats/examples/nats-subscribe/main.rs @@ -72,22 +72,40 @@ async fn run() -> Result<(), Box<(dyn std::error::Error + 'static)>> { skip_all, level = "debug", fields( - messaging.destination = sub.metadata().messaging_destination(), - messaging.destination_kind = sub.metadata().messaging_destination_kind(), - messaging.operation = sub.metadata().messaging_operation(), - messaging.protocol = sub.metadata().messaging_protocol(), + messaging.client_id = sub.metadata().messaging_client_id(), + messaging.destination.name = sub.metadata().messaging_destination_name(), + messaging.message.body.size = message.payload().len(), + messaging.nats.server.id = sub.metadata().messaging_nats_server_id(), + messaging.nats.server.name = sub.metadata().messaging_nats_server_name(), + messaging.nats.server.version = sub.metadata().messaging_nats_server_version(), + messaging.operation = MessagingOperation::Receive.as_str(), messaging.system = sub.metadata().messaging_system(), messaging.url = sub.metadata().messaging_url(), - messaging.subject = sub.metadata().messaging_subject(), - net.transport = sub.metadata().net_transport(), - otel.kind = sub.metadata().process_otel_kind(), - otel.name = sub.metadata().process_otel_name(), + network.peer.address = sub.metadata().network_peer_address(), + network.protocol.name = sub.metadata().network_protocol_name(), + network.protocol.version = sub.metadata().network_protocol_version(), + network.transport = sub.metadata().network_transport(), + otel.kind = SpanKind::Consumer.as_str(), // similar to an RPC operation + otel.name = Empty, otel.status_code = Empty, otel.status_message = Empty, + server.address = sub.metadata().server_address(), + server.port = sub.metadata().server_port(), ) )] fn process_message(message: Message, count: u32, sub: &Subscriber) { - Span::current().follows_from(sub.span()); + let span = Span::current(); + span.follows_from(sub.span()); + + span.record( + "otel.name", + format!( + "{} {}", + message.subject(), + MessagingOperation::Receive.as_str() + ) + .as_str(), + ); let data = String::from_utf8_lossy(message.payload()); info!(message = ?message, data = data.as_ref(), count); diff --git a/lib/si-data-nats/src/lib.rs b/lib/si-data-nats/src/lib.rs index 7e201aa661..e6b0de2239 100644 --- a/lib/si-data-nats/src/lib.rs +++ b/lib/si-data-nats/src/lib.rs @@ -7,7 +7,7 @@ )] #![allow(clippy::missing_errors_doc)] -use std::{fmt::Debug, io, sync::Arc}; +use std::{fmt::Debug, io, sync::Arc, time::Duration}; use async_nats::{subject::ToSubject, ToServerAddrs}; use bytes::Bytes; @@ -24,10 +24,10 @@ mod subscriber; pub use async_nats::{ connection::State, header, header::HeaderMap, rustls, status, subject, Auth, AuthError, - Request, ServerAddr, ServerInfo, Subject, + HeaderName, HeaderValue, ServerAddr, ServerInfo, Subject, }; pub use connect_options::ConnectOptions; -pub use message::Message; +pub use message::{InnerMessage, Message}; pub use subscriber::Subscriber; pub type NatsError = Error; @@ -164,12 +164,43 @@ impl Client { /// # Ok(()) /// # } /// ``` + #[instrument( + name = "client.publish", + skip_all, + level = "debug", + fields( + messaging.client_id = self.metadata.messaging_client_id(), + messaging.destination.name = Empty, + messaging.message.body.size = Empty, + // messaging.message.conversation_id = Empty, + messaging.nats.server.id = self.metadata.messaging_nats_server_id(), + messaging.nats.server.name = self.metadata.messaging_nats_server_name(), + messaging.nats.server.version = self.metadata.messaging_nats_server_version(), + messaging.operation = MessagingOperation::Publish.as_str(), + messaging.system = self.metadata.messaging_system(), + messaging.url = self.metadata.messaging_url(), + network.peer.address = self.metadata.network_peer_address(), + network.protocol.name = self.metadata.network_protocol_name(), + network.protocol.version = self.metadata.network_protocol_version(), + network.transport = self.metadata.network_transport(), + otel.kind = SpanKind::Producer.as_str(), + otel.name = Empty, + otel.status_code = Empty, + otel.status_message = Empty, + server.address = self.metadata.server_address(), + server.port = self.metadata.server_port(), + ) + )] pub async fn publish(&self, subject: impl ToSubject, payload: Bytes) -> Result<()> { let span = Span::current(); let subject = subject.to_subject(); - span.record("messaging.destination", subject.as_str()); - span.record("otel.name", format!("{} send", &subject).as_str()); + span.record("messaging.destination.name", subject.as_str()); + span.record("messaging.message.body.size", payload.len()); + span.record( + "otel.name", + format!("{} {}", &subject, MessagingOperation::Publish.as_str()).as_str(), + ); self.inner .publish(subject, payload) .await @@ -203,17 +234,26 @@ impl Client { skip_all, level = "debug", fields( - messaging.destination = Empty, - messaging.destination_kind = "topic", - messaging.operation = "send", - messaging.protocol = %self.metadata.messaging_protocol, - messaging.system = %self.metadata.messaging_system, - messaging.url = %self.metadata.messaging_url, - net.transport = %self.metadata.net_transport, + messaging.client_id = self.metadata.messaging_client_id(), + messaging.destination.name = Empty, + messaging.message.body.size = Empty, + // messaging.message.conversation_id = Empty, + messaging.nats.server.id = self.metadata.messaging_nats_server_id(), + messaging.nats.server.name = self.metadata.messaging_nats_server_name(), + messaging.nats.server.version = self.metadata.messaging_nats_server_version(), + messaging.operation = MessagingOperation::Publish.as_str(), + messaging.system = self.metadata.messaging_system(), + messaging.url = self.metadata.messaging_url(), + network.peer.address = self.metadata.network_peer_address(), + network.protocol.name = self.metadata.network_protocol_name(), + network.protocol.version = self.metadata.network_protocol_version(), + network.transport = self.metadata.network_transport(), otel.kind = SpanKind::Producer.as_str(), otel.name = Empty, otel.status_code = Empty, otel.status_message = Empty, + server.address = self.metadata.server_address(), + server.port = self.metadata.server_port(), ) )] pub async fn publish_with_headers( @@ -225,8 +265,12 @@ impl Client { let span = Span::current(); let subject = subject.to_subject(); - span.record("messaging.destination", subject.as_str()); - span.record("otel.name", format!("{} send", &subject).as_str()); + span.record("messaging.destination.name", subject.as_str()); + span.record("messaging.message.body.size", payload.len()); + span.record( + "otel.name", + format!("{} {}", &subject, MessagingOperation::Publish.as_str()).as_str(), + ); self.inner .publish_with_headers(subject, headers, payload) .await @@ -260,17 +304,26 @@ impl Client { skip_all, level = "debug", fields( - messaging.destination = Empty, - messaging.destination_kind = "topic", - messaging.operation = "send", - messaging.protocol = %self.metadata.messaging_protocol, - messaging.system = %self.metadata.messaging_system, - messaging.url = %self.metadata.messaging_url, - net.transport = %self.metadata.net_transport, + messaging.client_id = self.metadata.messaging_client_id(), + messaging.destination.name = Empty, + messaging.message.body.size = Empty, + // messaging.message.conversation_id = Empty, + messaging.nats.server.id = self.metadata.messaging_nats_server_id(), + messaging.nats.server.name = self.metadata.messaging_nats_server_name(), + messaging.nats.server.version = self.metadata.messaging_nats_server_version(), + messaging.operation = MessagingOperation::Publish.as_str(), + messaging.system = self.metadata.messaging_system(), + messaging.url = self.metadata.messaging_url(), + network.peer.address = self.metadata.network_peer_address(), + network.protocol.name = self.metadata.network_protocol_name(), + network.protocol.version = self.metadata.network_protocol_version(), + network.transport = self.metadata.network_transport(), otel.kind = SpanKind::Producer.as_str(), otel.name = Empty, otel.status_code = Empty, otel.status_message = Empty, + server.address = self.metadata.server_address(), + server.port = self.metadata.server_port(), ) )] pub async fn publish_with_reply( @@ -282,8 +335,12 @@ impl Client { let span = Span::current(); let subject = subject.to_subject(); - span.record("messaging.destination", subject.as_str()); - span.record("otel.name", format!("{} send", &subject).as_str()); + span.record("messaging.destination.name", subject.as_str()); + span.record("messaging.message.body.size", payload.len()); + span.record( + "otel.name", + format!("{} {}", &subject, MessagingOperation::Publish.as_str()).as_str(), + ); self.inner .publish_with_reply(subject, reply, payload) .await @@ -320,17 +377,26 @@ impl Client { skip_all, level = "debug", fields( - messaging.destination = Empty, - messaging.destination_kind = "topic", - messaging.operation = "send", - messaging.protocol = %self.metadata.messaging_protocol, - messaging.system = %self.metadata.messaging_system, - messaging.url = %self.metadata.messaging_url, - net.transport = %self.metadata.net_transport, + messaging.client_id = self.metadata.messaging_client_id(), + messaging.destination.name = Empty, + messaging.message.body.size = Empty, + // messaging.message.conversation_id = Empty, + messaging.nats.server.id = self.metadata.messaging_nats_server_id(), + messaging.nats.server.name = self.metadata.messaging_nats_server_name(), + messaging.nats.server.version = self.metadata.messaging_nats_server_version(), + messaging.operation = MessagingOperation::Publish.as_str(), + messaging.system = self.metadata.messaging_system(), + messaging.url = self.metadata.messaging_url(), + network.peer.address = self.metadata.network_peer_address(), + network.protocol.name = self.metadata.network_protocol_name(), + network.protocol.version = self.metadata.network_protocol_version(), + network.transport = self.metadata.network_transport(), otel.kind = SpanKind::Producer.as_str(), otel.name = Empty, otel.status_code = Empty, otel.status_message = Empty, + server.address = self.metadata.server_address(), + server.port = self.metadata.server_port(), ) )] pub async fn publish_with_reply_and_headers( @@ -343,8 +409,12 @@ impl Client { let span = Span::current(); let subject = subject.to_subject(); - span.record("messaging.destination", subject.as_str()); - span.record("otel.name", format!("{} send", &subject).as_str()); + span.record("messaging.destination.name", subject.as_str()); + span.record("messaging.message.body.size", payload.len()); + span.record( + "otel.name", + format!("{} {}", &subject, MessagingOperation::Publish.as_str()).as_str(), + ); self.inner .publish_with_reply_and_headers(subject, reply, headers, payload) .await @@ -370,25 +440,39 @@ impl Client { skip_all, level = "debug", fields( - messaging.destination = Empty, - messaging.destination_kind = "topic", - messaging.operation = "send", - messaging.protocol = %self.metadata.messaging_protocol, - messaging.system = %self.metadata.messaging_system, - messaging.url = %self.metadata.messaging_url, - net.transport = %self.metadata.net_transport, - otel.kind = SpanKind::Client.as_str(), + messaging.client_id = self.metadata.messaging_client_id(), + messaging.destination.name = Empty, + messaging.message.body.size = Empty, + // TODO: maybe use this and inject in headers? + // messaging.message.conversation_id = Empty, + messaging.nats.server.id = self.metadata.messaging_nats_server_id(), + messaging.nats.server.name = self.metadata.messaging_nats_server_name(), + messaging.nats.server.version = self.metadata.messaging_nats_server_version(), + messaging.operation = MessagingOperation::Publish.as_str(), + messaging.system = self.metadata.messaging_system(), + messaging.url = self.metadata.messaging_url(), + network.peer.address = self.metadata.network_peer_address(), + network.protocol.name = self.metadata.network_protocol_name(), + network.protocol.version = self.metadata.network_protocol_version(), + network.transport = self.metadata.network_transport(), + otel.kind = SpanKind::Client.as_str(), // similar to an RPC operation otel.name = Empty, otel.status_code = Empty, otel.status_message = Empty, + server.address = self.metadata.server_address(), + server.port = self.metadata.server_port(), ) )] pub async fn request(&self, subject: impl ToSubject, payload: Bytes) -> Result { let span = Span::current(); let subject = subject.to_subject(); - span.record("messaging.destination", subject.as_str()); - span.record("otel.name", format!("{} send", &subject).as_str()); + span.record("messaging.destination.name", subject.as_str()); + span.record("messaging.message.body.size", payload.len()); + span.record( + "otel.name", + format!("{} {}", &subject, MessagingOperation::Publish.as_str()).as_str(), + ); let msg = self .inner .request(subject, payload) @@ -419,17 +503,27 @@ impl Client { skip_all, level = "debug", fields( - messaging.destination = Empty, - messaging.destination_kind = "topic", - messaging.operation = "send", - messaging.protocol = %self.metadata.messaging_protocol, - messaging.system = %self.metadata.messaging_system, - messaging.url = %self.metadata.messaging_url, - net.transport = %self.metadata.net_transport, - otel.kind = SpanKind::Client.as_str(), + messaging.client_id = self.metadata.messaging_client_id(), + messaging.destination.name = Empty, + messaging.message.body.size = Empty, + // TODO: maybe use this and inject in headers? + // messaging.message.conversation_id = Empty, + messaging.nats.server.id = self.metadata.messaging_nats_server_id(), + messaging.nats.server.name = self.metadata.messaging_nats_server_name(), + messaging.nats.server.version = self.metadata.messaging_nats_server_version(), + messaging.operation = MessagingOperation::Publish.as_str(), + messaging.system = self.metadata.messaging_system(), + messaging.url = self.metadata.messaging_url(), + network.peer.address = self.metadata.network_peer_address(), + network.protocol.name = self.metadata.network_protocol_name(), + network.protocol.version = self.metadata.network_protocol_version(), + network.transport = self.metadata.network_transport(), + otel.kind = SpanKind::Client.as_str(), // similar to an RPC operation otel.name = Empty, otel.status_code = Empty, otel.status_message = Empty, + server.address = self.metadata.server_address(), + server.port = self.metadata.server_port(), ) )] pub async fn request_with_headers( @@ -441,8 +535,12 @@ impl Client { let span = Span::current(); let subject = subject.to_subject(); - span.record("messaging.destination", subject.as_str()); - span.record("otel.name", format!("{} send", &subject).as_str()); + span.record("messaging.destination.name", subject.as_str()); + span.record("messaging.message.body.size", payload.len()); + span.record( + "otel.name", + format!("{} {}", &subject, MessagingOperation::Publish.as_str()).as_str(), + ); let msg = self .inner .request_with_headers(subject, headers, payload) @@ -471,28 +569,44 @@ impl Client { skip_all, level = "debug", fields( - messaging.destination = Empty, - messaging.destination_kind = "topic", - messaging.operation = "send", - messaging.protocol = %self.metadata.messaging_protocol, - messaging.system = %self.metadata.messaging_system, - messaging.url = %self.metadata.messaging_url, - net.transport = %self.metadata.net_transport, - otel.kind = SpanKind::Client.as_str(), + messaging.client_id = self.metadata.messaging_client_id(), + messaging.destination.name = Empty, + messaging.message.body.size = Empty, + // TODO: maybe use this and inject in headers? + // messaging.message.conversation_id = Empty, + messaging.nats.server.id = self.metadata.messaging_nats_server_id(), + messaging.nats.server.name = self.metadata.messaging_nats_server_name(), + messaging.nats.server.version = self.metadata.messaging_nats_server_version(), + messaging.operation = MessagingOperation::Publish.as_str(), + messaging.system = self.metadata.messaging_system(), + messaging.url = self.metadata.messaging_url(), + network.peer.address = self.metadata.network_peer_address(), + network.protocol.name = self.metadata.network_protocol_name(), + network.protocol.version = self.metadata.network_protocol_version(), + network.transport = self.metadata.network_transport(), + otel.kind = SpanKind::Client.as_str(), // similar to an RPC operation otel.name = Empty, otel.status_code = Empty, otel.status_message = Empty, + server.address = self.metadata.server_address(), + server.port = self.metadata.server_port(), ) )] pub async fn send_request(&self, subject: impl ToSubject, request: Request) -> Result { let span = Span::current(); let subject = subject.to_subject(); - span.record("messaging.destination", subject.as_str()); - span.record("otel.name", format!("{} send", &subject).as_str()); + span.record("messaging.destination.name", subject.as_str()); + if let Some(ref payload) = request.payload { + span.record("messaging.message.body.size", payload.len()); + } + span.record( + "otel.name", + format!("{} {}", &subject, MessagingOperation::Publish.as_str()).as_str(), + ); let msg = self .inner - .send_request(subject, request) + .send_request(subject, request.into()) .await .map_err(|err| span.record_err(Error::NatsRequest(err)))?; @@ -539,26 +653,35 @@ impl Client { skip_all, level = "debug", fields( - messaging.destination = Empty, - messaging.destination_kind = "topic", - messaging.operation = "receive", - messaging.protocol = %self.metadata.messaging_protocol, - messaging.system = %self.metadata.messaging_system, - messaging.url = %self.metadata.messaging_url, - messaging.subject = Empty, - net.transport = %self.metadata.net_transport, - otel.kind = SpanKind::Client.as_str(), + messaging.client_id = self.metadata.messaging_client_id(), + messaging.destination.name = Empty, + messaging.nats.server.id = self.metadata.messaging_nats_server_id(), + messaging.nats.server.name = self.metadata.messaging_nats_server_name(), + messaging.nats.server.version = self.metadata.messaging_nats_server_version(), + messaging.operation = MessagingOperation::Receive.as_str(), + messaging.system = self.metadata.messaging_system(), + messaging.url = self.metadata.messaging_url(), + network.peer.address = self.metadata.network_peer_address(), + network.protocol.name = self.metadata.network_protocol_name(), + network.protocol.version = self.metadata.network_protocol_version(), + network.transport = self.metadata.network_transport(), + otel.kind = SpanKind::Consumer.as_str(), otel.name = Empty, otel.status_code = Empty, otel.status_message = Empty, + server.address = self.metadata.server_address(), + server.port = self.metadata.server_port(), ) )] pub async fn subscribe(&self, subject: impl ToSubject) -> Result { let span = Span::current(); let subject = subject.to_subject(); - span.record("messaging.destination", subject.as_str()); - span.record("otel.name", format!("{} receive", &subject).as_str()); + span.record("messaging.destination.name", subject.as_str()); + span.record( + "otel.name", + format!("{} {}", &subject, MessagingOperation::Receive.as_str()).as_str(), + ); let sub_subject = subject.clone(); let sub = self .inner @@ -597,18 +720,25 @@ impl Client { skip_all, level = "debug", fields( - messaging.destination = Empty, - messaging.destination_kind = "topic", - messaging.operation = "receive", - messaging.protocol = %self.metadata.messaging_protocol, - messaging.subscriber.queue = Empty, - messaging.system = %self.metadata.messaging_system, - messaging.url = %self.metadata.messaging_url, - net.transport = %self.metadata.net_transport, - otel.kind = SpanKind::Client.as_str(), + messaging.client_id = self.metadata.messaging_client_id(), + messaging.destination.name = Empty, + messaging.nats.server.id = self.metadata.messaging_nats_server_id(), + messaging.nats.server.name = self.metadata.messaging_nats_server_name(), + messaging.nats.server.version = self.metadata.messaging_nats_server_version(), + messaging.nats.queue_group = Empty, + messaging.operation = MessagingOperation::Receive.as_str(), + messaging.system = self.metadata.messaging_system(), + messaging.url = self.metadata.messaging_url(), + network.peer.address = self.metadata.network_peer_address(), + network.protocol.name = self.metadata.network_protocol_name(), + network.protocol.version = self.metadata.network_protocol_version(), + network.transport = self.metadata.network_transport(), + otel.kind = SpanKind::Consumer.as_str(), otel.name = Empty, otel.status_code = Empty, otel.status_message = Empty, + server.address = self.metadata.server_address(), + server.port = self.metadata.server_port(), ) )] pub async fn queue_subscribe( @@ -619,9 +749,12 @@ impl Client { let span = Span::current(); let subject = subject.to_subject(); - span.record("messaging.destination", subject.as_str()); - span.record("messaging.subscriber.queue", queue_group.as_str()); - span.record("otel.name", format!("{} receive", &subject).as_str()); + span.record("messaging.destination.name", subject.as_str()); + span.record( + "otel.name", + format!("{} {}", &subject, MessagingOperation::Receive.as_str()).as_str(), + ); + span.record("messaging.nats.queue_group", queue_group.as_str()); let sub_subject = subject.clone(); let sub = self .inner @@ -654,13 +787,21 @@ impl Client { skip_all, level = "debug", fields( - messaging.protocol = %self.metadata.messaging_protocol, - messaging.system = %self.metadata.messaging_system, - messaging.url = %self.metadata.messaging_url, - net.transport = %self.metadata.net_transport, - otel.kind = SpanKind::Client.as_str(), + messaging.client_id = self.metadata.messaging_client_id(), + messaging.nats.server.id = self.metadata.messaging_nats_server_id(), + messaging.nats.server.name = self.metadata.messaging_nats_server_name(), + messaging.nats.server.version = self.metadata.messaging_nats_server_version(), + messaging.system = self.metadata.messaging_system(), + messaging.url = self.metadata.messaging_url(), + network.peer.address = self.metadata.network_peer_address(), + network.protocol.name = self.metadata.network_protocol_name(), + network.protocol.version = self.metadata.network_protocol_version(), + network.transport = self.metadata.network_transport(), + otel.kind = SpanKind::Client.as_str(), // similar to an RPC operation otel.status_code = Empty, otel.status_message = Empty, + server.address = self.metadata.server_address(), + server.port = self.metadata.server_port(), ) )] pub async fn flush(&self) -> Result<()> { @@ -699,11 +840,22 @@ impl Client { skip_all, level = "debug", fields( - messaging.protocol = %self.metadata.messaging_protocol, - messaging.system = %self.metadata.messaging_system, - messaging.transaction = Empty, - messaging.url = %self.metadata.messaging_url, - net.transport = %self.metadata.net_transport, + messaging.client_id = self.metadata.messaging_client_id(), + messaging.nats.server.id = self.metadata.messaging_nats_server_id(), + messaging.nats.server.name = self.metadata.messaging_nats_server_name(), + messaging.nats.server.version = self.metadata.messaging_nats_server_version(), + messaging.system = self.metadata.messaging_system(), + messaging.url = self.metadata.messaging_url(), + messaging.x.transaction = Empty, + network.peer.address = self.metadata.network_peer_address(), + network.protocol.name = self.metadata.network_protocol_name(), + network.protocol.version = self.metadata.network_protocol_version(), + network.transport = self.metadata.network_transport(), + otel.kind = SpanKind::Internal.as_str(), + otel.status_code = Empty, + otel.status_message = Empty, + server.address = self.metadata.server_address(), + server.port = self.metadata.server_port(), ) )] pub fn transaction(&self) -> NatsTxn { @@ -755,13 +907,21 @@ impl Client { skip_all, level = "debug", fields( - messaging.protocol = Empty, + messaging.client_id = Empty, + messaging.nats.server.id = Empty, + messaging.nats.server.name = Empty, + messaging.nats.server.version = Empty, messaging.system = Empty, messaging.url = Empty, - net.transport = Empty, + network.peer.address = Empty, + network.protocol.name = Empty, + network.protocol.version = Empty, + network.transport = Empty, otel.kind = SpanKind::Client.as_str(), otel.status_code = Empty, otel.status_message = Empty, + server.address = Empty, + server.port = Empty, ) )] pub async fn connect_with_options( @@ -771,24 +931,21 @@ impl Client { ) -> Result { let addrs = addrs.to_server_addrs()?.collect::>(); - let metadata = ConnectionMetadata { - messaging_protocol: "nats", - messaging_system: "nats", - messaging_url: addrs - .clone() - .into_iter() - .map(|a| a.into_inner().into()) - .collect::>() - .join(","), - net_transport: "ip_tcp", - subject_prefix, - }; + let messaging_system = "nats"; + let messaging_url = addrs + .clone() + .into_iter() + .map(|a| a.into_inner().into()) + .collect::>() + .join(","); + let network_protocol_name = "nats"; + let network_transport = "ip_tcp"; let span = Span::current(); - span.record("messaging.protocol", metadata.messaging_protocol); - span.record("messaging.system", metadata.messaging_system); - span.record("messaging.url", metadata.messaging_url.as_str()); - span.record("net.transport", metadata.net_transport); + span.record("messaging.system", messaging_system); + span.record("messaging.url", messaging_url.as_str()); + span.record("network.protocol.name", network_protocol_name); + span.record("network.transport", network_transport); let inner = options .inner @@ -797,6 +954,48 @@ impl Client { .map_err(|err| span.record_err(Error::NatsConnect(err)))?; debug!("successfully connected to nats"); + let server_info = inner.server_info(); + + let metadata = ConnectionMetadata { + messaging_client_id: server_info.client_id.to_string(), + messaging_system, + messaging_url, + messaging_nats_server_id: server_info.server_id, + messaging_nats_server_name: server_info.server_name, + messaging_nats_server_version: server_info.version, + network_peer_address: server_info.client_ip, + network_transport, + network_protocol_name, + network_protocol_version: server_info.proto.to_string(), + server_address: server_info.host, + server_port: server_info.port, + subject_prefix, + }; + + span.record("messaging.client_id", metadata.messaging_client_id.as_str()); + span.record( + "messaging.nats.server.id", + metadata.messaging_nats_server_id.as_str(), + ); + span.record( + "messaging.nats.server.name", + metadata.messaging_nats_server_name.as_str(), + ); + span.record( + "messaging.nats.server.version", + metadata.messaging_nats_server_version.as_str(), + ); + span.record( + "network.peer.address", + metadata.network_peer_address.as_str(), + ); + span.record( + "network.protocol.version", + metadata.network_protocol_version.as_str(), + ); + span.record("server.address", metadata.server_address.as_str()); + span.record("server.port", metadata.server_port); + span.record_ok(); Ok(Self { inner, @@ -812,17 +1011,40 @@ impl Client { #[derive(Clone, Debug)] pub struct ConnectionMetadata { - messaging_protocol: &'static str, + messaging_client_id: String, + messaging_nats_server_id: String, + messaging_nats_server_name: String, + messaging_nats_server_version: String, messaging_system: &'static str, messaging_url: String, + network_peer_address: String, + network_protocol_name: &'static str, + network_protocol_version: String, + network_transport: &'static str, + server_address: String, + server_port: u16, subject_prefix: Option, - net_transport: &'static str, } impl ConnectionMetadata { - /// Gets a reference to the connection metadata's messaging protocol. - pub fn messaging_protocol(&self) -> &str { - self.messaging_protocol + /// Gets a reference to the connection metadata's messaging client id. + pub fn messaging_client_id(&self) -> &str { + self.messaging_client_id.as_ref() + } + + /// Gets a reference to the connection metadata's messaging nats server id. + pub fn messaging_nats_server_id(&self) -> &str { + self.messaging_nats_server_id.as_ref() + } + + /// Gets a reference to the connection metadata's messaging nats server name. + pub fn messaging_nats_server_name(&self) -> &str { + self.messaging_nats_server_name.as_ref() + } + + /// Gets a reference to the connection metadata's messaging nats server version. + pub fn messaging_nats_server_version(&self) -> &str { + self.messaging_nats_server_version.as_ref() } /// Gets a reference to the connection metadata's messaging system. @@ -835,9 +1057,34 @@ impl ConnectionMetadata { self.messaging_url.as_ref() } - /// Gets a reference to the connection metadata's net transport. - pub fn net_transport(&self) -> &str { - self.net_transport + /// Gets a reference to the connection metadata's network peer address. + pub fn network_peer_address(&self) -> &str { + self.network_peer_address.as_ref() + } + + /// Gets a reference to the connection metadata's network protocol name. + pub fn network_protocol_name(&self) -> &str { + self.network_protocol_name + } + + /// Gets a reference to the connection metadata's network protocol version. + pub fn network_protocol_version(&self) -> &str { + self.network_protocol_version.as_ref() + } + + /// Gets a reference to the connection metadata's network transport. + pub fn network_transport(&self) -> &str { + self.network_transport + } + + /// Gets a reference to the connection metadata's server address. + pub fn server_address(&self) -> &str { + self.server_address.as_ref() + } + + /// Gets a reference to the connection metadata's server port. + pub fn server_port(&self) -> u16 { + self.server_port } /// Gets the common prefix for use on all subjects. @@ -869,10 +1116,10 @@ impl NatsTxn { skip_all, level = "debug", fields( - messaging.protocol = %self.metadata.messaging_protocol, - messaging.system = %self.metadata.messaging_system, - messaging.url = %self.metadata.messaging_url, - net.transport = %self.metadata.net_transport, + messaging.destination.name = Empty, + otel.kind = SpanKind::Internal.as_str(), + otel.status_code = Empty, + otel.status_message = Empty, ) )] pub async fn publish(&self, subject: impl ToSubject, object: &T) -> Result<()> @@ -883,6 +1130,7 @@ impl NatsTxn { span.follows_from(&self.tx_span); let subject = subject.to_subject(); + span.record("messaging.destination.name", subject.as_str()); let json: serde_json::Value = serde_json::to_value(object) .map_err(|err| span.record_err(self.tx_span.record_err(Error::Serialize(err))))?; let mut pending_publish = self.pending_publish.lock().await; @@ -896,10 +1144,9 @@ impl NatsTxn { skip_all, level = "debug", fields( - messaging.protocol = %self.metadata.messaging_protocol, - messaging.system = %self.metadata.messaging_system, - messaging.url = %self.metadata.messaging_url, - net.transport = %self.metadata.net_transport, + otel.kind = SpanKind::Internal.as_str(), + otel.status_code = Empty, + otel.status_message = Empty, ) )] pub async fn commit_into_conn(self) -> Result { @@ -917,7 +1164,7 @@ impl NatsTxn { } self.tx_span.record_ok(); - self.tx_span.record("messaging.transaction", "commit"); + self.tx_span.record("messaging.x.transaction", "commit"); span.record_ok(); Ok(self.client) @@ -928,10 +1175,7 @@ impl NatsTxn { skip_all, level = "debug", fields( - messaging.protocol = %self.metadata.messaging_protocol, - messaging.system = %self.metadata.messaging_system, - messaging.url = %self.metadata.messaging_url, - net.transport = %self.metadata.net_transport, + otel.kind = SpanKind::Internal.as_str(), ) )] pub async fn commit(self) -> Result<()> { @@ -940,14 +1184,13 @@ impl NatsTxn { } #[instrument( - name = "transaction.rollback", + name = "transaction.rollback_into_conn", skip_all, level = "debug", fields( - messaging.protocol = %self.metadata.messaging_protocol, - messaging.system = %self.metadata.messaging_system, - messaging.url = %self.metadata.messaging_url, - net.transport = %self.metadata.net_transport, + otel.kind = SpanKind::Internal.as_str(), + otel.status_code = Empty, + otel.status_message = Empty, ) )] pub async fn rollback_into_conn(self) -> Result { @@ -958,7 +1201,7 @@ impl NatsTxn { // function returns (i.e. it consumes `self`). self.tx_span.record_ok(); - self.tx_span.record("messaging.transaction", "rollback"); + self.tx_span.record("messaging.x.transaction", "rollback"); span.record_ok(); Ok(self.client) @@ -969,10 +1212,7 @@ impl NatsTxn { skip_all, level = "debug", fields( - messaging.protocol = %self.metadata.messaging_protocol, - messaging.system = %self.metadata.messaging_system, - messaging.url = %self.metadata.messaging_url, - net.transport = %self.metadata.net_transport, + otel.kind = SpanKind::Internal.as_str(), ) )] pub async fn rollback(self) -> Result<()> { @@ -985,3 +1225,122 @@ impl NatsTxn { self.metadata.as_ref() } } + +/// Used for building customized requests. +/// +/// Note: this type is wrapped in order to expose the inner fields this wrapping module. +#[derive(Default)] +pub struct Request { + payload: Option, + headers: Option, + timeout: Option>, + inbox: Option, +} + +impl Request { + pub fn new() -> Request { + Default::default() + } + + /// Sets the payload of the request. If not used, empty payload will be sent. + /// + /// # Examples + /// ```no_run + /// # #[tokio::main] + /// # async fn main() -> Result<(), si_data_nats::Error> { + /// let client = si_data_nats::connect("demo.nats.io").await?; + /// let request = si_data_nats::Request::new().payload("data".into()); + /// client.send_request("service", request).await?; + /// # Ok(()) + /// # } + /// ``` + pub fn payload(mut self, payload: Bytes) -> Request { + self.payload = Some(payload); + self + } + + /// Sets the headers of the requests. + /// + /// # Examples + /// ```no_run + /// # #[tokio::main] + /// # async fn main() -> Result<(), si_data_nats::Error> { + /// use std::str::FromStr; + /// let client = si_data_nats::connect("demo.nats.io").await?; + /// let mut headers = si_data_nats::HeaderMap::new(); + /// headers.insert( + /// "X-Example", + /// si_data_nats::HeaderValue::from_str("Value").unwrap(), + /// ); + /// let request = si_data_nats::Request::new() + /// .headers(headers) + /// .payload("data".into()); + /// client.send_request("service", request).await?; + /// # Ok(()) + /// # } + /// ``` + pub fn headers(mut self, headers: HeaderMap) -> Request { + self.headers = Some(headers); + self + } + + /// Sets the custom timeout of the request. Overrides default [Client] timeout. + /// Setting it to [Option::None] disables the timeout entirely which might result in deadlock. + /// To use default timeout, simply do not call this function. + /// + /// # Examples + /// ```no_run + /// # #[tokio::main] + /// # async fn main() -> Result<(), si_data_nats::Error> { + /// let client = si_data_nats::connect("demo.nats.io").await?; + /// let request = si_data_nats::Request::new() + /// .timeout(Some(std::time::Duration::from_secs(15))) + /// .payload("data".into()); + /// client.send_request("service", request).await?; + /// # Ok(()) + /// # } + /// ``` + pub fn timeout(mut self, timeout: Option) -> Request { + self.timeout = Some(timeout); + self + } + + /// Sets custom inbox for this request. Overrides both customized and default [Client] Inbox. + /// + /// # Examples + /// ```no_run + /// # #[tokio::main] + /// # async fn main() -> Result<(), si_data_nats::Error> { + /// use std::str::FromStr; + /// let client = si_data_nats::connect("demo.nats.io").await?; + /// let request = si_data_nats::Request::new() + /// .inbox("custom_inbox".into()) + /// .payload("data".into()); + /// client.send_request("service", request).await?; + /// # Ok(()) + /// # } + /// ``` + pub fn inbox(mut self, inbox: String) -> Request { + self.inbox = Some(inbox); + self + } +} + +impl From for async_nats::Request { + fn from(value: Request) -> Self { + let mut r = Self::new(); + if let Some(payload) = value.payload { + r = r.payload(payload); + } + if let Some(headers) = value.headers { + r = r.headers(headers); + } + if let Some(timeout) = value.timeout { + r = r.timeout(timeout); + } + if let Some(inbox) = value.inbox { + r = r.inbox(inbox); + } + r + } +} diff --git a/lib/si-data-nats/src/message.rs b/lib/si-data-nats/src/message.rs index 8ab595aeb5..b7906fef9d 100644 --- a/lib/si-data-nats/src/message.rs +++ b/lib/si-data-nats/src/message.rs @@ -1,11 +1,14 @@ -use async_nats::Subject; +use async_nats::{StatusCode, Subject}; +use bytes::Bytes; use super::{ConnectionMetadata, HeaderMap}; use std::{fmt, sync::Arc}; +pub use async_nats::Message as InnerMessage; + #[derive(Clone)] pub struct Message { - inner: async_nats::Message, + inner: InnerMessage, metadata: Arc, } @@ -14,36 +17,59 @@ impl Message { Self { inner, metadata } } - /// Gets a reference to the subject of this message. - #[must_use] + /// Gets a reference to the [`Subject`] to which this message is published to. pub fn subject(&self) -> &Subject { &self.inner.subject } - /// Gets a reference to the reply of this message. - #[must_use] - pub fn reply(&self) -> Option<&str> { - self.inner.reply.as_deref() - } - - /// Consumes the message and returns the inner data and reply subject. - #[must_use] - pub fn into_parts(self) -> (Vec, Option) { - (self.inner.payload.into(), self.inner.reply) + /// Gets a reference to the optional reply [`Subject`] to which responses can be published by + /// [crate::Subscriber]. + /// + /// Used for request-response pattern with [crate::Client::request]. + pub fn reply(&self) -> Option<&Subject> { + self.inner.reply.as_ref() } - /// Gets a reference to the message contents. - #[must_use] - pub fn payload(&self) -> &[u8] { + /// Gets a reference to the payload of the message. + /// + /// Can be any arbitrary format. + pub fn payload(&self) -> &Bytes { &self.inner.payload } - /// Gets a reference to the headers of this message. - #[must_use] + /// Gets a reference to the optional headers. pub fn headers(&self) -> Option<&HeaderMap> { self.inner.headers.as_ref() } + /// Gets optional [`StatusCode`] of the message. + /// + /// Used mostly for internal handling. + pub fn status(&self) -> Option { + self.inner.status + } + + /// Gets a referrence to optional [`StatusCode`] description. + pub fn description(&self) -> Option<&str> { + self.inner.description.as_deref() + } + + /// Gets length. + // + // NOTE(fnichol): there are no docs upstream, so this appears to be the length of the payload, + // although maybe it's the entire message? + pub fn length(&self) -> usize { + self.inner.length + } +} + +impl Message { + /// Consumes the message and returns the inner message and connection metadata. + #[must_use] + pub fn into_parts(self) -> (InnerMessage, Arc) { + (self.inner, self.metadata) + } + /// Get a reference to the connection metadata. pub fn metadata(&self) -> Arc { self.metadata.clone() diff --git a/lib/si-data-nats/src/subscriber.rs b/lib/si-data-nats/src/subscriber.rs index fc6f7001ae..f150c5d4a9 100644 --- a/lib/si-data-nats/src/subscriber.rs +++ b/lib/si-data-nats/src/subscriber.rs @@ -40,12 +40,7 @@ impl Subscriber { ) -> Self { let metadata = SubscriberMessageMetadata { connection_metadata, - messaging_destination: subject.to_string(), - messaging_destination_kind: "topic", - messaging_operation: "process", - messaging_subject: subject.to_string(), - process_otel_kind: SpanKind::Consumer.to_string(), - process_otel_name: format!("{subject} process"), + messaging_destination_name: subject.to_string(), }; Self { @@ -75,13 +70,22 @@ impl Subscriber { skip_all, level = "debug", fields( - messaging.protocol = %self.metadata.messaging_protocol(), - messaging.system = %self.metadata.messaging_system(), - messaging.url = %self.metadata.messaging_url(), - net.transport = %self.metadata.net_transport(), - otel.kind = SpanKind::Client.as_str(), + messaging.client_id = self.metadata.messaging_client_id(), + messaging.destination.name = self.metadata.messaging_destination_name.as_str(), + messaging.nats.server.id = self.metadata.messaging_nats_server_id(), + messaging.nats.server.name = self.metadata.messaging_nats_server_name(), + messaging.nats.server.version = self.metadata.messaging_nats_server_version(), + messaging.system = self.metadata.messaging_system(), + messaging.url = self.metadata.messaging_url(), + network.peer.address = self.metadata.network_peer_address(), + network.protocol.name = self.metadata.network_protocol_name(), + network.protocol.version = self.metadata.network_protocol_version(), + network.transport = self.metadata.network_transport(), + otel.kind = SpanKind::Client.as_str(), // similar to an RPC operation otel.status_code = Empty, otel.status_message = Empty, + server.address = self.metadata.server_address(), + server.port = self.metadata.server_port(), ) )] pub async fn unsubscribe(mut self) -> Result<()> { @@ -125,18 +129,26 @@ impl Subscriber { /// # } /// ``` #[instrument( - name = "subscriber.unsubscribe", + name = "subscriber.unsubscribe_after", skip_all, level = "debug", fields( - subscriber.unsub_after = %unsub_after, - messaging.protocol = %self.metadata.messaging_protocol(), - messaging.system = %self.metadata.messaging_system(), - messaging.url = %self.metadata.messaging_url(), - net.transport = %self.metadata.net_transport(), - otel.kind = SpanKind::Client.as_str(), + messaging.client_id = self.metadata.messaging_client_id(), + messaging.destination.name = self.metadata.messaging_destination_name.as_str(), + messaging.nats.server.id = self.metadata.messaging_nats_server_id(), + messaging.nats.server.name = self.metadata.messaging_nats_server_name(), + messaging.nats.server.version = self.metadata.messaging_nats_server_version(), + messaging.system = self.metadata.messaging_system(), + messaging.url = self.metadata.messaging_url(), + network.peer.address = self.metadata.network_peer_address(), + network.protocol.name = self.metadata.network_protocol_name(), + network.protocol.version = self.metadata.network_protocol_version(), + network.transport = self.metadata.network_transport(), + otel.kind = SpanKind::Client.as_str(), // similar to an RPC operation otel.status_code = Empty, otel.status_message = Empty, + server.address = self.metadata.server_address(), + server.port = self.metadata.server_port(), ) )] pub async fn unsubscribe_after(mut self, unsub_after: u64) -> Result<()> { @@ -184,64 +196,80 @@ impl Stream for Subscriber { #[derive(Clone, Debug)] pub struct SubscriberMessageMetadata { connection_metadata: Arc, - messaging_destination: String, - messaging_destination_kind: &'static str, - messaging_operation: &'static str, - messaging_subject: String, - - process_otel_kind: String, - process_otel_name: String, + messaging_destination_name: String, } impl SubscriberMessageMetadata { - /// Gets a reference to the subscriber message metadata's messaging destination. - pub fn messaging_destination(&self) -> &str { - self.messaging_destination.as_ref() + /// Gets a reference to the subscriber metadata's messaging destination name. + pub fn messaging_destination_name(&self) -> &str { + self.messaging_destination_name.as_str() } - /// Gets a reference to the subscriber message metadata's messaging destination kind. - pub fn messaging_destination_kind(&self) -> &str { - self.messaging_destination_kind + /// Gets a reference to the subscriber metadata's messaging client id. + pub fn messaging_client_id(&self) -> &str { + self.connection_metadata.messaging_client_id.as_ref() } - /// Gets a reference to the subscriber message metadata's messaging operation. - pub fn messaging_operation(&self) -> &str { - self.messaging_operation + /// Gets a reference to the subscriber metadata's messaging nats server id. + pub fn messaging_nats_server_id(&self) -> &str { + self.connection_metadata.messaging_nats_server_id.as_ref() } - /// Gets a reference to the subscriber message metadata's messaging protocol. - pub fn messaging_protocol(&self) -> &str { - self.connection_metadata.messaging_protocol() + /// Gets a reference to the subscriber metadata's messaging nats server name. + pub fn messaging_nats_server_name(&self) -> &str { + self.connection_metadata.messaging_nats_server_name.as_ref() } - /// Gets a reference to the subscriber message metadata's messaging system. + /// Gets a reference to the subscriber metadata's messaging nats server version. + pub fn messaging_nats_server_version(&self) -> &str { + self.connection_metadata + .messaging_nats_server_version + .as_ref() + } + + /// Gets a reference to the subscriber metadata's messaging system. pub fn messaging_system(&self) -> &str { - self.connection_metadata.messaging_system() + self.connection_metadata.messaging_system } - /// Gets a reference to the subscriber message metadata's messaging url. + /// Gets a reference to the subscriber metadata's messaging url. pub fn messaging_url(&self) -> &str { - self.connection_metadata.messaging_url() + self.connection_metadata.messaging_url.as_ref() + } + + /// Gets a reference to the subscriber metadata's network peer address. + pub fn network_peer_address(&self) -> &str { + self.connection_metadata.network_peer_address.as_ref() + } + + /// Gets a reference to the subscriber metadata's network protocol name. + pub fn network_protocol_name(&self) -> &str { + self.connection_metadata.network_protocol_name + } + + /// Gets a reference to the subscriber metadata's network protocol version. + pub fn network_protocol_version(&self) -> &str { + self.connection_metadata.network_protocol_version.as_ref() } - /// Gets a reference to the subscriber message metadata's messaging subject. - pub fn messaging_subject(&self) -> &str { - self.messaging_subject.as_ref() + /// Gets a reference to the subscriber metadata's network transport. + pub fn network_transport(&self) -> &str { + self.connection_metadata.network_transport } - /// Get a reference to the subscriber message metadata's net transport. - pub fn net_transport(&self) -> &str { - self.connection_metadata.net_transport() + /// Gets a reference to the subscriber metadata's server address. + pub fn server_address(&self) -> &str { + self.connection_metadata.server_address.as_ref() } - /// Gets a reference to the subscriber message metadata's process otel kind. - pub fn process_otel_kind(&self) -> &str { - &self.process_otel_kind + /// Gets a reference to the subscriber metadata's server port. + pub fn server_port(&self) -> u16 { + self.connection_metadata.server_port } - /// Gets a reference to the subscriber message metadata's process otel name. - pub fn process_otel_name(&self) -> &str { - self.process_otel_name.as_ref() + /// Gets the common prefix for use on all subjects. + pub fn subject_prefix(&self) -> Option<&str> { + self.connection_metadata.subject_prefix.as_deref() } /// Get a reference to the subscriber message metadata's connection metadata. diff --git a/lib/si-data-pg/src/lib.rs b/lib/si-data-pg/src/lib.rs index ad5f80b841..4ca0c891b7 100644 --- a/lib/si-data-pg/src/lib.rs +++ b/lib/si-data-pg/src/lib.rs @@ -7,7 +7,10 @@ )] #![allow(clippy::missing_errors_doc)] -use rustls::{Certificate, RootCertStore}; +use rustls::{ + pki_types::{CertificateDer, TrustAnchor}, + RootCertStore, +}; use tokio_postgres_rustls::MakeRustlsConnect; use base64::{engine::general_purpose, Engine}; @@ -266,24 +269,20 @@ impl PgPool { // Creates a tls_config for connecting to postgres securely async fn tls_config(settings: &PgPoolConfig) -> PgPoolResult { let mut root_cert_store = RootCertStore::empty(); - root_cert_store.add_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.iter().map(|ta| { - rustls::OwnedTrustAnchor::from_subject_spki_name_constraints( - ta.subject, - ta.spki, - ta.name_constraints, - ) + root_cert_store.extend(webpki_roots::TLS_SERVER_ROOTS.iter().map(|ta| TrustAnchor { + subject: ta.subject.into(), + subject_public_key_info: ta.spki.into(), + name_constraints: ta.name_constraints.map(Into::into), })); if let Some(cert) = &settings.certificate_path { - root_cert_store - .add_parsable_certificates(&Self::get_certificate_from_path(cert).await?); + root_cert_store.add_parsable_certificates(Self::get_certificate_from_path(cert).await?); } if let Some(cert) = &settings.certificate_base64 { root_cert_store.add_parsable_certificates( - &Self::get_certificate_from_base64(cert.to_string()).await?, + Self::get_certificate_from_base64(cert.to_string()).await?, ); } let config = rustls::ClientConfig::builder() - .with_safe_defaults() .with_root_certificates(root_cert_store) .with_no_client_auth(); @@ -291,23 +290,22 @@ impl PgPool { } // Creates a certificate object from bytes - async fn get_certificate_from_bytes(bytes: &[u8]) -> PgPoolResult> { + async fn get_certificate_from_bytes( + bytes: &[u8], + ) -> PgPoolResult>> { let mut reader = std::io::BufReader::new(bytes); Ok(rustls_pemfile::certs(&mut reader) .map(|c| { - Certificate( - c.map_err(PgPoolError::CreateCertificate) - .expect( - "errror unpacking root cert, this should have been caught by map_err", - ) - .to_vec(), - ) + c.map_err(PgPoolError::CreateCertificate) + .expect("errror unpacking root cert, this should have been caught by map_err") }) - .collect::>()) + .collect::>()) } // Creates a Certificate object from a base64 encoded certificate - async fn get_certificate_from_base64(key_string: String) -> PgPoolResult> { + async fn get_certificate_from_base64( + key_string: String, + ) -> PgPoolResult>> { let buf = general_purpose::STANDARD .decode(key_string) .map_err(PgPoolError::Base64Decode)?; @@ -315,7 +313,9 @@ impl PgPool { } // Creates a Certificate object from a certificate file - async fn get_certificate_from_path(path: impl AsRef) -> PgPoolResult> { + async fn get_certificate_from_path( + path: impl AsRef, + ) -> PgPoolResult>> { let buf = std::fs::read(path).map_err(PgPoolError::ReadPem)?; Self::get_certificate_from_bytes(&buf).await } diff --git a/lib/telemetry-nats-rs/BUCK b/lib/telemetry-nats-rs/BUCK new file mode 100644 index 0000000000..d5183aac90 --- /dev/null +++ b/lib/telemetry-nats-rs/BUCK @@ -0,0 +1,11 @@ +load("@prelude-si//:macros.bzl", "rust_library") + +rust_library( + name = "telemetry-nats", + deps = [ + "//lib/si-data-nats:si-data-nats", + "//lib/telemetry-rs:telemetry", + "//third-party/rust:tracing-opentelemetry", + ], + srcs = glob(["src/**/*.rs"]), +) diff --git a/lib/telemetry-nats-rs/Cargo.toml b/lib/telemetry-nats-rs/Cargo.toml new file mode 100644 index 0000000000..863bfb867e --- /dev/null +++ b/lib/telemetry-nats-rs/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "telemetry-nats" +version = "0.1.0" +edition = "2021" +rust-version = "1.64" +publish = false + +[dependencies] +si-data-nats = { path = "../../lib/si-data-nats" } +telemetry = { path = "../../lib/telemetry-rs" } +tracing-opentelemetry = { workspace = true } diff --git a/lib/telemetry-nats-rs/src/headers.rs b/lib/telemetry-nats-rs/src/headers.rs new file mode 100644 index 0000000000..56deda1d45 --- /dev/null +++ b/lib/telemetry-nats-rs/src/headers.rs @@ -0,0 +1,9 @@ +//! NATS header names. + +use si_data_nats::HeaderName; + +/// A correlation ID. +/// +/// The conversation ID identifying the conversation to which the message belongs, represented as a +/// string. Sometimes called “Correlation ID”. +pub static CORRELATION_ID: HeaderName = HeaderName::from_static("X-Correlation-ID"); diff --git a/lib/telemetry-nats-rs/src/lib.rs b/lib/telemetry-nats-rs/src/lib.rs new file mode 100644 index 0000000000..099021e504 --- /dev/null +++ b/lib/telemetry-nats-rs/src/lib.rs @@ -0,0 +1,19 @@ +//! Telemetry support for running NATS-related services. + +#![warn( + clippy::unwrap_in_result, + clippy::indexing_slicing, + clippy::arithmetic_side_effects, + clippy::unwrap_used, + clippy::panic, + clippy::missing_panics_doc, + clippy::panic_in_result_fn, + missing_docs +)] + +pub mod headers; +mod make_span; +mod propagation; + +pub use make_span::NatsMakeSpan; +pub use propagation::{extract_opentelemetry_context, inject_opentelemetry_context}; diff --git a/lib/telemetry-nats-rs/src/make_span.rs b/lib/telemetry-nats-rs/src/make_span.rs new file mode 100644 index 0000000000..65b2e3f923 --- /dev/null +++ b/lib/telemetry-nats-rs/src/make_span.rs @@ -0,0 +1,133 @@ +use si_data_nats::{header, Message, Subject}; +use telemetry::prelude::*; +use tracing_opentelemetry::OpenTelemetrySpanExt; + +use crate::{headers::CORRELATION_ID, propagation::extract_opentelemetry_context}; + +/// Generates [`Span`]s from incoming NATS messages on a subscription. +#[derive(Clone, Debug)] +pub struct NatsMakeSpan { + level: Level, +} + +impl Default for NatsMakeSpan { + #[inline] + fn default() -> Self { + Self { level: Level::INFO } + } +} + +impl NatsMakeSpan { + /// Creates a new `NatsMakeSpan`. + pub fn new() -> Self { + Self::default() + } + + /// Sets the [`Level`] used for the tracing [`Span`]. + pub fn level(mut self, level: Level) -> Self { + self.level = level; + self + } + + /// Generate a [`Span`] from a message. + pub fn make_span(&mut self, message: &Message, sub_subject: &Subject) -> Span { + enum InnerLevel { + Error, + Warn, + Info, + Debug, + Trace, + } + impl From for InnerLevel { + fn from(value: Level) -> Self { + match value { + Level::ERROR => InnerLevel::Error, + Level::WARN => InnerLevel::Warn, + Level::INFO => InnerLevel::Info, + Level::DEBUG => InnerLevel::Debug, + _ => InnerLevel::Trace, + } + } + } + + let metadata = message.metadata(); + + // This ugly macro is needed, unfortunately, because `tracing::span!` required the level + // argument to be static. Meaning we can't just pass `self.level` and a dynamic name. + macro_rules! inner { + ($level:expr, $name:expr) => { + ::telemetry::tracing::span!( + $level, + $name, + + // Messaging attributes + // + // See: https://opentelemetry.io/docs/specs/semconv/messaging/messaging-spans/#messaging-attributes + + messaging.client_id = metadata.messaging_client_id(), + messaging.destination.name = sub_subject.as_str(), + messaging.message.body.size = message.payload().len(), + messaging.message.conversation_id = Empty, + messaging.message.envelope.size = message.length(), + messaging.nats.server.id = metadata.messaging_nats_server_id(), + messaging.nats.server.name = metadata.messaging_nats_server_name(), + messaging.nats.server.version = metadata.messaging_nats_server_version(), + messaging.operation = MessagingOperation::Receive.as_str(), + messaging.system = metadata.messaging_system(), + messaging.url = metadata.messaging_url(), + network.peer.address = metadata.network_peer_address(), + network.protocol.name = metadata.network_protocol_name(), + network.protocol.version = metadata.network_protocol_version(), + network.transport = metadata.network_transport(), + server.address = metadata.server_address(), + server.port = metadata.server_port(), + + // Set special `otel.*` fields which tracing-opentelemetry will use when + // transmitting traces via OpenTelemetry protocol + // + // See: + // https://docs.rs/tracing-opentelemetry/0.22.0/tracing_opentelemetry/#special-fields + // + + otel.kind = SpanKind::Consumer.as_str(), + otel.name = Empty, + // Default for OpenTelemetry status is `Unset` which should map to an empty/unset + // tracing value. + // + // See: https://docs.rs/opentelemetry/0.21.0/opentelemetry/trace/enum.Status.html + otel.status_code = Empty, + // Only set if status_code == Error + otel.status_message = Empty, + ) + }; + } + + let span = match InnerLevel::from(self.level) { + InnerLevel::Error => inner!(Level::ERROR, MessagingOperation::RECEIVE_STR), + InnerLevel::Warn => inner!(Level::ERROR, MessagingOperation::RECEIVE_STR), + InnerLevel::Info => inner!(Level::ERROR, MessagingOperation::RECEIVE_STR), + InnerLevel::Debug => inner!(Level::ERROR, MessagingOperation::RECEIVE_STR), + InnerLevel::Trace => inner!(Level::ERROR, MessagingOperation::RECEIVE_STR), + }; + + span.record( + "otel.name", + format!("{} {}", sub_subject, MessagingOperation::Receive.as_str()), + ); + if let Some(headers) = message.headers() { + if let Some(message_id) = headers.get(header::NATS_MESSAGE_ID) { + span.record("messaging.message.id", message_id.as_str()); + } + + if let Some(correlation_id) = headers.get(CORRELATION_ID.as_ref()) { + span.record("messaging.message.correlation.id", correlation_id.as_str()); + } + + // Extract OpenTelemetry parent span metadata from the request headers (if it exists) and + // associate it with this request span + span.set_parent(extract_opentelemetry_context(headers)); + } + + span + } +} diff --git a/lib/telemetry-nats-rs/src/propagation.rs b/lib/telemetry-nats-rs/src/propagation.rs new file mode 100644 index 0000000000..f7953e651c --- /dev/null +++ b/lib/telemetry-nats-rs/src/propagation.rs @@ -0,0 +1,51 @@ +use si_data_nats::HeaderMap; +use telemetry::opentelemetry::{global, Context}; + +/// Extracts an OpenTelemetry [`Context`] from a [`HeaderMap`]. +pub fn extract_opentelemetry_context(headers: &HeaderMap) -> Context { + let extractor = self::headers::HeaderExtractor(headers); + global::get_text_map_propagator(|propagator| propagator.extract(&extractor)) +} + +/// Injects an OpenTelemetry [`Context`] into a [`HeaderMap`]. +pub fn inject_opentelemetry_context(ctx: &Context, headers: &mut HeaderMap) { + let mut injector = self::headers::HeaderInjector(headers); + global::get_text_map_propagator(|propagator| propagator.inject_context(ctx, &mut injector)); +} + +mod headers { + use std::str::FromStr; + + use si_data_nats::{HeaderMap, HeaderName, HeaderValue}; + use telemetry::opentelemetry::propagation::{Extractor, Injector}; + + pub struct HeaderInjector<'a>(pub &'a mut HeaderMap); + + impl<'a> Injector for HeaderInjector<'a> { + /// Set a key and value in the HeaderMap. Does nothing if the key or value are not valid inputs. + fn set(&mut self, key: &str, value: String) { + if let Ok(name) = HeaderName::from_str(key) { + if let Ok(val) = HeaderValue::from_str(&value) { + self.0.insert(name, val); + } + } + } + } + + pub struct HeaderExtractor<'a>(pub &'a HeaderMap); + + impl<'a> Extractor for HeaderExtractor<'a> { + /// Get a value for a key from the HeaderMap. If the value is not valid ASCII, returns None. + fn get(&self, key: &str) -> Option<&str> { + self.0.get(key).map(>::as_ref) + } + + /// Collect all the keys from the HeaderMap. + fn keys(&self) -> Vec<&str> { + self.0 + .iter() + .map(|(name, _values)| >::as_ref(name)) + .collect::>() + } + } +} diff --git a/lib/telemetry-rs/src/lib.rs b/lib/telemetry-rs/src/lib.rs index ce966faab3..50b1802313 100644 --- a/lib/telemetry-rs/src/lib.rs +++ b/lib/telemetry-rs/src/lib.rs @@ -23,7 +23,7 @@ pub use opentelemetry::{self, trace::SpanKind}; pub use tracing; pub mod prelude { - pub use super::{SpanExt, SpanKind, SpanKindExt}; + pub use super::{MessagingOperation, SpanExt, SpanKind, SpanKindExt}; pub use tracing::{ self, debug, debug_span, enabled, error, event, event_enabled, field::Empty, info, info_span, instrument, span, span_enabled, trace, trace_span, warn, Instrument, Level, @@ -51,6 +51,46 @@ impl OtelStatusCode { } } +/// Represents valied states for OpenTelemetry's `messaging.operation` field. +/// +/// `messaging.operation` has the following list of well-known values. If one of them applies, then +/// the respective value MUST be used, otherwise a custom value MAY be used. +/// +/// See: +#[remain::sorted] +#[derive(Clone, Copy, Debug)] +pub enum MessagingOperation { + /// A message is created. “Create” spans always refer to a single message and are used to + /// provide a unique creation context for messages in batch publishing scenarios. + Create, + /// One or more messages are passed to a consumer. This operation refers to push-based + /// scenarios, where consumer register callbacks which get called by messaging SDKs. + Deliver, + /// One or more messages are provided for publishing to an intermediary. If a single message is + /// published, the context of the “Publish” span can be used as the creation context and no + /// “Create” span needs to be created. + Publish, + /// One or more messages are requested by a consumer. This operation refers to pull-based + /// scenarios, where consumers explicitly call methods of messaging SDKs to receive messages. + Receive, +} + +impl MessagingOperation { + pub const CREATE_STR: &'static str = "create"; + pub const DELIVER_STR: &'static str = "deliver"; + pub const PUBLISH_STR: &'static str = "publish"; + pub const RECEIVE_STR: &'static str = "receive"; + + pub fn as_str(&self) -> &'static str { + match self { + Self::Create => Self::CREATE_STR, + Self::Deliver => Self::DELIVER_STR, + Self::Publish => Self::PUBLISH_STR, + Self::Receive => Self::RECEIVE_STR, + } + } +} + /// An extention trait for [`SpanKind`] providing string representations. pub trait SpanKindExt { /// Returns a static str representation. diff --git a/lib/veritech-server/src/server.rs b/lib/veritech-server/src/server.rs index 557e1d92cd..99c52c9671 100644 --- a/lib/veritech-server/src/server.rs +++ b/lib/veritech-server/src/server.rs @@ -276,9 +276,10 @@ async fn resolver_function_request_task( cyclone_pool: Pool, request: Request, ) { - let (cyclone_request, reply_mailbox) = request.into_parts(); - let reply_mailbox = match reply_mailbox { - Some(reply_mailbox) => reply_mailbox, + let cyclone_request = request.payload; + + let reply_mailbox = match request.reply { + Some(reply) => reply, None => { error!("no reply mailbox found"); return; @@ -441,8 +442,9 @@ async fn validation_request( cyclone_pool: Pool, request: Request, ) -> ServerResult<()> { - let (cyclone_request, reply_mailbox) = request.into_parts(); - let reply_mailbox = reply_mailbox.ok_or(ServerError::NoReplyMailboxFound)?; + let cyclone_request = request.payload; + + let reply_mailbox = request.reply.ok_or(ServerError::NoReplyMailboxFound)?; let publisher = Publisher::new(&nats, &reply_mailbox); let mut client = cyclone_pool @@ -560,8 +562,8 @@ async fn schema_variant_definition_request( cyclone_pool: Pool, request: Request, ) -> ServerResult<()> { - let (cyclone_request, reply_mailbox) = request.into_parts(); - let reply_mailbox = reply_mailbox.ok_or(ServerError::NoReplyMailboxFound)?; + let cyclone_request = request.payload; + let reply_mailbox = request.reply.ok_or(ServerError::NoReplyMailboxFound)?; let publisher = Publisher::new(&nats, &reply_mailbox); let mut client = cyclone_pool @@ -674,8 +676,8 @@ async fn action_run_request( cyclone_pool: Pool, request: Request, ) -> ServerResult<()> { - let (cyclone_request, reply_mailbox) = request.into_parts(); - let reply_mailbox = reply_mailbox.ok_or(ServerError::NoReplyMailboxFound)?; + let cyclone_request = request.payload; + let reply_mailbox = request.reply.ok_or(ServerError::NoReplyMailboxFound)?; let publisher = Publisher::new(&nats, &reply_mailbox); let mut client = cyclone_pool @@ -789,8 +791,8 @@ async fn reconciliation_request( cyclone_pool: Pool, request: Request, ) -> ServerResult<()> { - let (cyclone_request, reply_mailbox) = request.into_parts(); - let reply_mailbox = reply_mailbox.ok_or(ServerError::NoReplyMailboxFound)?; + let cyclone_request = request.payload; + let reply_mailbox = request.reply.ok_or(ServerError::NoReplyMailboxFound)?; let publisher = Publisher::new(&nats, &reply_mailbox); let mut client = cyclone_pool diff --git a/third-party/rust/BUCK b/third-party/rust/BUCK index 72f0bd8b76..5c105c27d2 100644 --- a/third-party/rust/BUCK +++ b/third-party/rust/BUCK @@ -32,9 +32,9 @@ git_fetch( ) git_fetch( - name = "tokio-postgres-rustls-00062377dd266360.git", - repo = "https://github.com/fnichol/tokio-postgres-rustls.git", - rev = "531c8af4420fcd1b551ffe9eb5e9f3c714812333", + name = "tokio-postgres-rustls-855e14009fe3bebe.git", + repo = "https://github.com/jbg/tokio-postgres-rustls.git", + rev = "f210aa24c4788e7f3bd9af52c4f7014c5561ac70", visibility = [], ) @@ -276,18 +276,18 @@ cargo.rust_library( ) http_archive( - name = "anstream-0.6.7.crate", - sha256 = "4cd2405b3ac1faab2990b74d728624cd9fd115651fcecc7c2d8daf01376275ba", - strip_prefix = "anstream-0.6.7", - urls = ["https://crates.io/api/v1/crates/anstream/0.6.7/download"], + name = "anstream-0.6.9.crate", + sha256 = "3fde6067df7359f2d6335ec1a50c1f8f825801687d10da0cc4c6b08e3f6afd15", + strip_prefix = "anstream-0.6.9", + urls = ["https://crates.io/api/v1/crates/anstream/0.6.9/download"], visibility = [], ) cargo.rust_library( - name = "anstream-0.6.7", - srcs = [":anstream-0.6.7.crate"], + name = "anstream-0.6.9", + srcs = [":anstream-0.6.9.crate"], crate = "anstream", - crate_root = "anstream-0.6.7.crate/src/lib.rs", + crate_root = "anstream-0.6.9.crate/src/lib.rs", edition = "2021", features = [ "auto", @@ -463,18 +463,18 @@ cargo.rust_library( ) http_archive( - name = "async-compression-0.4.5.crate", - sha256 = "bc2d0cfb2a7388d34f590e76686704c494ed7aaceed62ee1ba35cbf363abc2a5", - strip_prefix = "async-compression-0.4.5", - urls = ["https://crates.io/api/v1/crates/async-compression/0.4.5/download"], + name = "async-compression-0.4.6.crate", + sha256 = "a116f46a969224200a0a97f29cfd4c50e7534e4b4826bd23ea2c3c533039c82c", + strip_prefix = "async-compression-0.4.6", + urls = ["https://crates.io/api/v1/crates/async-compression/0.4.6/download"], visibility = [], ) cargo.rust_library( - name = "async-compression-0.4.5", - srcs = [":async-compression-0.4.5.crate"], + name = "async-compression-0.4.6", + srcs = [":async-compression-0.4.6.crate"], crate = "async_compression", - crate_root = "async-compression-0.4.5.crate/src/lib.rs", + crate_root = "async-compression-0.4.6.crate/src/lib.rs", edition = "2018", features = [ "brotli", @@ -1103,6 +1103,27 @@ cargo.rust_library( visibility = [], ) +http_archive( + name = "bcder-0.7.4.crate", + sha256 = "c627747a6774aab38beb35990d88309481378558875a41da1a4b2e373c906ef0", + strip_prefix = "bcder-0.7.4", + urls = ["https://crates.io/api/v1/crates/bcder/0.7.4/download"], + visibility = [], +) + +cargo.rust_library( + name = "bcder-0.7.4", + srcs = [":bcder-0.7.4.crate"], + crate = "bcder", + crate_root = "bcder-0.7.4.crate/src/lib.rs", + edition = "2018", + visibility = [], + deps = [ + ":bytes-1.5.0", + ":smallvec-1.12.0", + ], +) + http_archive( name = "bigdecimal-0.3.1.crate", sha256 = "a6773ddc0eafc0e509fb60e48dff7f450f8e674a0686ae8605e8d9901bd5eefa", @@ -1161,18 +1182,18 @@ cargo.rust_library( ) http_archive( - name = "bitflags-2.4.1.crate", - sha256 = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07", - strip_prefix = "bitflags-2.4.1", - urls = ["https://crates.io/api/v1/crates/bitflags/2.4.1/download"], + name = "bitflags-2.4.2.crate", + sha256 = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf", + strip_prefix = "bitflags-2.4.2", + urls = ["https://crates.io/api/v1/crates/bitflags/2.4.2/download"], visibility = [], ) cargo.rust_library( - name = "bitflags-2.4.1", - srcs = [":bitflags-2.4.1.crate"], + name = "bitflags-2.4.2", + srcs = [":bitflags-2.4.2.crate"], crate = "bitflags", - crate_root = "bitflags-2.4.1.crate/src/lib.rs", + crate_root = "bitflags-2.4.2.crate/src/lib.rs", edition = "2021", features = [ "serde", @@ -1841,23 +1862,23 @@ cargo.rust_library( alias( name = "clap", - actual = ":clap-4.4.16", + actual = ":clap-4.4.18", visibility = ["PUBLIC"], ) http_archive( - name = "clap-4.4.16.crate", - sha256 = "58e54881c004cec7895b0068a0a954cd5d62da01aef83fa35b1e594497bf5445", - strip_prefix = "clap-4.4.16", - urls = ["https://crates.io/api/v1/crates/clap/4.4.16/download"], + name = "clap-4.4.18.crate", + sha256 = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c", + strip_prefix = "clap-4.4.18", + urls = ["https://crates.io/api/v1/crates/clap/4.4.18/download"], visibility = [], ) cargo.rust_library( - name = "clap-4.4.16", - srcs = [":clap-4.4.16.crate"], + name = "clap-4.4.18", + srcs = [":clap-4.4.18.crate"], crate = "clap", - crate_root = "clap-4.4.16.crate/src/lib.rs", + crate_root = "clap-4.4.18.crate/src/lib.rs", edition = "2021", features = [ "color", @@ -1873,24 +1894,24 @@ cargo.rust_library( ], visibility = [], deps = [ - ":clap_builder-4.4.16", + ":clap_builder-4.4.18", ":clap_derive-4.4.7", ], ) http_archive( - name = "clap_builder-4.4.16.crate", - sha256 = "59cb82d7f531603d2fd1f507441cdd35184fa81beff7bd489570de7f773460bb", - strip_prefix = "clap_builder-4.4.16", - urls = ["https://crates.io/api/v1/crates/clap_builder/4.4.16/download"], + name = "clap_builder-4.4.18.crate", + sha256 = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7", + strip_prefix = "clap_builder-4.4.18", + urls = ["https://crates.io/api/v1/crates/clap_builder/4.4.18/download"], visibility = [], ) cargo.rust_library( - name = "clap_builder-4.4.16", - srcs = [":clap_builder-4.4.16.crate"], + name = "clap_builder-4.4.18", + srcs = [":clap_builder-4.4.18.crate"], crate = "clap_builder", - crate_root = "clap_builder-4.4.16.crate/src/lib.rs", + crate_root = "clap_builder-4.4.18.crate/src/lib.rs", edition = "2021", features = [ "color", @@ -1904,7 +1925,7 @@ cargo.rust_library( ], visibility = [], deps = [ - ":anstream-0.6.7", + ":anstream-0.6.9", ":anstyle-1.0.4", ":clap_lex-0.6.0", ":strsim-0.10.0", @@ -2827,7 +2848,7 @@ cargo.rust_library( }, visibility = [], deps = [ - ":bitflags-2.4.1", + ":bitflags-2.4.2", ":parking_lot-0.12.1", ], ) @@ -5053,18 +5074,18 @@ cargo.rust_library( ) http_archive( - name = "h2-0.3.23.crate", - sha256 = "b553656127a00601c8ae5590fcfdc118e4083a7924b6cf4ffc1ea4b99dc429d7", - strip_prefix = "h2-0.3.23", - urls = ["https://crates.io/api/v1/crates/h2/0.3.23/download"], + name = "h2-0.3.24.crate", + sha256 = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9", + strip_prefix = "h2-0.3.24", + urls = ["https://crates.io/api/v1/crates/h2/0.3.24/download"], visibility = [], ) cargo.rust_library( - name = "h2-0.3.23", - srcs = [":h2-0.3.23.crate"], + name = "h2-0.3.24", + srcs = [":h2-0.3.24.crate"], crate = "h2", - crate_root = "h2-0.3.23.crate/src/lib.rs", + crate_root = "h2-0.3.24.crate/src/lib.rs", edition = "2018", visibility = [], deps = [ @@ -5534,7 +5555,7 @@ cargo.rust_library( ":futures-channel-0.3.30", ":futures-core-0.3.30", ":futures-util-0.3.30", - ":h2-0.3.23", + ":h2-0.3.24", ":http-0.2.11", ":http-body-0.4.6", ":httparse-1.8.0", @@ -5694,7 +5715,7 @@ cargo.rust_library( ], visibility = [], deps = [ - ":unicode-bidi-0.3.14", + ":unicode-bidi-0.3.15", ":unicode-normalization-0.1.22", ], ) @@ -6796,18 +6817,18 @@ cxx_library( ) http_archive( - name = "linux-raw-sys-0.4.12.crate", - sha256 = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456", - strip_prefix = "linux-raw-sys-0.4.12", - urls = ["https://crates.io/api/v1/crates/linux-raw-sys/0.4.12/download"], + name = "linux-raw-sys-0.4.13.crate", + sha256 = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c", + strip_prefix = "linux-raw-sys-0.4.13", + urls = ["https://crates.io/api/v1/crates/linux-raw-sys/0.4.13/download"], visibility = [], ) cargo.rust_library( - name = "linux-raw-sys-0.4.12", - srcs = [":linux-raw-sys-0.4.12.crate"], + name = "linux-raw-sys-0.4.13", + srcs = [":linux-raw-sys-0.4.13.crate"], crate = "linux_raw_sys", - crate_root = "linux-raw-sys-0.4.12.crate/src/lib.rs", + crate_root = "linux-raw-sys-0.4.13.crate/src/lib.rs", edition = "2021", features = [ "elf", @@ -7399,7 +7420,7 @@ cargo.rust_library( ], visibility = [], deps = [ - ":bitflags-2.4.1", + ":bitflags-2.4.2", ":cfg-if-1.0.0", ":libc-0.2.152", ], @@ -7618,7 +7639,7 @@ cargo.rust_library( ":num-iter-0.1.43", ":num-traits-0.2.17", ":rand-0.8.5", - ":smallvec-1.11.2", + ":smallvec-1.12.0", ":zeroize-1.7.0", ], ) @@ -8587,7 +8608,7 @@ cargo.rust_library( visibility = [], deps = [ ":cfg-if-1.0.0", - ":smallvec-1.11.2", + ":smallvec-1.12.0", ], ) @@ -8638,6 +8659,31 @@ cargo.rust_library( visibility = [], ) +http_archive( + name = "pem-3.0.3.crate", + sha256 = "1b8fcc794035347fb64beda2d3b462595dd2753e3f268d89c5aae77e8cf2c310", + strip_prefix = "pem-3.0.3", + urls = ["https://crates.io/api/v1/crates/pem/3.0.3/download"], + visibility = [], +) + +cargo.rust_library( + name = "pem-3.0.3", + srcs = [":pem-3.0.3.crate"], + crate = "pem", + crate_root = "pem-3.0.3.crate/src/lib.rs", + edition = "2021", + features = [ + "default", + "std", + ], + visibility = [], + deps = [ + ":base64-0.21.7", + ":serde-1.0.195", + ], +) + http_archive( name = "pem-rfc7468-0.7.0.crate", sha256 = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412", @@ -8936,18 +8982,18 @@ cargo.rust_library( ) http_archive( - name = "pkg-config-0.3.28.crate", - sha256 = "69d3587f8a9e599cc7ec2c00e331f71c4e69a5f9a4b8a6efd5b07466b9736f9a", - strip_prefix = "pkg-config-0.3.28", - urls = ["https://crates.io/api/v1/crates/pkg-config/0.3.28/download"], + name = "pkg-config-0.3.29.crate", + sha256 = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb", + strip_prefix = "pkg-config-0.3.29", + urls = ["https://crates.io/api/v1/crates/pkg-config/0.3.29/download"], visibility = [], ) cargo.rust_library( - name = "pkg-config-0.3.28", - srcs = [":pkg-config-0.3.28.crate"], + name = "pkg-config-0.3.29", + srcs = [":pkg-config-0.3.29.crate"], crate = "pkg_config", - crate_root = "pkg-config-0.3.28.crate/src/lib.rs", + crate_root = "pkg-config-0.3.29.crate/src/lib.rs", edition = "2015", visibility = [], ) @@ -10119,7 +10165,7 @@ cargo.rust_library( "linux-arm64": dict( deps = [ ":encoding_rs-0.8.33", - ":h2-0.3.23", + ":h2-0.3.24", ":http-body-0.4.6", ":hyper-0.14.28", ":hyper-rustls-0.24.2", @@ -10139,7 +10185,7 @@ cargo.rust_library( "linux-x86_64": dict( deps = [ ":encoding_rs-0.8.33", - ":h2-0.3.23", + ":h2-0.3.24", ":http-body-0.4.6", ":hyper-0.14.28", ":hyper-rustls-0.24.2", @@ -10159,7 +10205,7 @@ cargo.rust_library( "macos-arm64": dict( deps = [ ":encoding_rs-0.8.33", - ":h2-0.3.23", + ":h2-0.3.24", ":http-body-0.4.6", ":hyper-0.14.28", ":hyper-rustls-0.24.2", @@ -10180,7 +10226,7 @@ cargo.rust_library( "macos-x86_64": dict( deps = [ ":encoding_rs-0.8.33", - ":h2-0.3.23", + ":h2-0.3.24", ":http-body-0.4.6", ":hyper-0.14.28", ":hyper-rustls-0.24.2", @@ -10201,7 +10247,7 @@ cargo.rust_library( "windows-gnu": dict( deps = [ ":encoding_rs-0.8.33", - ":h2-0.3.23", + ":h2-0.3.24", ":http-body-0.4.6", ":hyper-0.14.28", ":hyper-rustls-0.24.2", @@ -10222,7 +10268,7 @@ cargo.rust_library( "windows-msvc": dict( deps = [ ":encoding_rs-0.8.33", - ":h2-0.3.23", + ":h2-0.3.24", ":http-body-0.4.6", ":hyper-0.14.28", ":hyper-rustls-0.24.2", @@ -11214,18 +11260,18 @@ cargo.rust_library( ) http_archive( - name = "rustix-0.38.28.crate", - sha256 = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316", - strip_prefix = "rustix-0.38.28", - urls = ["https://crates.io/api/v1/crates/rustix/0.38.28/download"], + name = "rustix-0.38.30.crate", + sha256 = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca", + strip_prefix = "rustix-0.38.30", + urls = ["https://crates.io/api/v1/crates/rustix/0.38.30/download"], visibility = [], ) cargo.rust_library( - name = "rustix-0.38.28", - srcs = [":rustix-0.38.28.crate"], + name = "rustix-0.38.30", + srcs = [":rustix-0.38.30.crate"], crate = "rustix", - crate_root = "rustix-0.38.28.crate/src/lib.rs", + crate_root = "rustix-0.38.30.crate/src/lib.rs", edition = "2021", features = [ "alloc", @@ -11242,7 +11288,7 @@ cargo.rust_library( }, deps = [ ":libc-0.2.152", - ":linux-raw-sys-0.4.12", + ":linux-raw-sys-0.4.13", ], ), "linux-x86_64": dict( @@ -11251,7 +11297,7 @@ cargo.rust_library( }, deps = [ ":libc-0.2.152", - ":linux-raw-sys-0.4.12", + ":linux-raw-sys-0.4.13", ], ), "macos-arm64": dict( @@ -11279,16 +11325,16 @@ cargo.rust_library( deps = [":windows-sys-0.52.0"], ), }, - rustc_flags = ["@$(location :rustix-0.38.28-build-script-run[rustc_flags])"], + rustc_flags = ["@$(location :rustix-0.38.30-build-script-run[rustc_flags])"], visibility = [], - deps = [":bitflags-2.4.1"], + deps = [":bitflags-2.4.2"], ) cargo.rust_binary( - name = "rustix-0.38.28-build-script-build", - srcs = [":rustix-0.38.28.crate"], + name = "rustix-0.38.30-build-script-build", + srcs = [":rustix-0.38.30.crate"], crate = "build_script_build", - crate_root = "rustix-0.38.28.crate/build.rs", + crate_root = "rustix-0.38.30.crate/build.rs", edition = "2021", features = [ "alloc", @@ -11302,9 +11348,9 @@ cargo.rust_binary( ) buildscript_run( - name = "rustix-0.38.28-build-script-run", + name = "rustix-0.38.30-build-script-run", package_name = "rustix", - buildscript_rule = ":rustix-0.38.28-build-script-build", + buildscript_rule = ":rustix-0.38.30-build-script-build", features = [ "alloc", "default", @@ -11313,13 +11359,7 @@ buildscript_run( "termios", "use-libc-auxv", ], - version = "0.38.28", -) - -alias( - name = "rustls", - actual = ":rustls-0.21.10", - visibility = ["PUBLIC"], + version = "0.38.30", ) http_archive( @@ -11352,6 +11392,46 @@ cargo.rust_library( ], ) +alias( + name = "rustls", + actual = ":rustls-0.22.2", + visibility = ["PUBLIC"], +) + +http_archive( + name = "rustls-0.22.2.crate", + sha256 = "e87c9956bd9807afa1f77e0f7594af32566e830e088a5576d27c5b6f30f49d41", + strip_prefix = "rustls-0.22.2", + urls = ["https://crates.io/api/v1/crates/rustls/0.22.2/download"], + visibility = [], +) + +cargo.rust_library( + name = "rustls-0.22.2", + srcs = [":rustls-0.22.2.crate"], + crate = "rustls", + crate_root = "rustls-0.22.2.crate/src/lib.rs", + edition = "2021", + features = [ + "default", + "log", + "logging", + "ring", + "tls12", + ], + named_deps = { + "pki_types": ":rustls-pki-types-1.1.0", + }, + visibility = [], + deps = [ + ":log-0.4.20", + ":ring-0.17.5", + ":rustls-webpki-0.102.1", + ":subtle-2.5.0", + ":zeroize-1.7.0", + ], +) + http_archive( name = "rustls-native-certs-0.6.3.crate", sha256 = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00", @@ -11456,6 +11536,7 @@ cargo.rust_library( features = [ "alloc", "default", + "std", ], visibility = [], ) @@ -11486,6 +11567,35 @@ cargo.rust_library( ], ) +http_archive( + name = "rustls-webpki-0.102.1.crate", + sha256 = "ef4ca26037c909dedb327b48c3327d0ba91d3dd3c4e05dad328f210ffb68e95b", + strip_prefix = "rustls-webpki-0.102.1", + urls = ["https://crates.io/api/v1/crates/rustls-webpki/0.102.1/download"], + visibility = [], +) + +cargo.rust_library( + name = "rustls-webpki-0.102.1", + srcs = [":rustls-webpki-0.102.1.crate"], + crate = "webpki", + crate_root = "rustls-webpki-0.102.1.crate/src/lib.rs", + edition = "2021", + features = [ + "alloc", + "ring", + "std", + ], + named_deps = { + "pki_types": ":rustls-pki-types-1.1.0", + }, + visibility = [], + deps = [ + ":ring-0.17.5", + ":untrusted-0.9.0", + ], +) + http_archive( name = "rustversion-1.0.14.crate", sha256 = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4", @@ -11648,23 +11758,23 @@ cargo.rust_library( alias( name = "sea-orm", - actual = ":sea-orm-0.12.10", + actual = ":sea-orm-0.12.11", visibility = ["PUBLIC"], ) http_archive( - name = "sea-orm-0.12.10.crate", - sha256 = "cf9195a2b2a182cbee3f76cf2a97c20204022f91259bdf8a48b537788202775b", - strip_prefix = "sea-orm-0.12.10", - urls = ["https://crates.io/api/v1/crates/sea-orm/0.12.10/download"], + name = "sea-orm-0.12.11.crate", + sha256 = "59f66e2129991acd51fcad7b59da1edd862edca69773cc9a19cb17b967fae2fb", + strip_prefix = "sea-orm-0.12.11", + urls = ["https://crates.io/api/v1/crates/sea-orm/0.12.11/download"], visibility = [], ) cargo.rust_library( - name = "sea-orm-0.12.10", - srcs = [":sea-orm-0.12.10.crate"], + name = "sea-orm-0.12.11", + srcs = [":sea-orm-0.12.11.crate"], crate = "sea_orm", - crate_root = "sea-orm-0.12.10.crate/src/lib.rs", + crate_root = "sea-orm-0.12.11.crate/src/lib.rs", edition = "2021", features = [ "bigdecimal", @@ -11700,8 +11810,8 @@ cargo.rust_library( ":log-0.4.20", ":ouroboros-0.17.2", ":rust_decimal-1.33.1", - ":sea-orm-macros-0.12.10", - ":sea-query-0.30.6", + ":sea-orm-macros-0.12.11", + ":sea-query-0.30.7", ":sea-query-binder-0.5.0", ":serde-1.0.195", ":serde_json-1.0.111", @@ -11716,18 +11826,18 @@ cargo.rust_library( ) http_archive( - name = "sea-orm-macros-0.12.10.crate", - sha256 = "66c6acfe3d49625c679955c7e7e7cd2d72b512a5c77bcd535a74aa41590b9f28", - strip_prefix = "sea-orm-macros-0.12.10", - urls = ["https://crates.io/api/v1/crates/sea-orm-macros/0.12.10/download"], + name = "sea-orm-macros-0.12.11.crate", + sha256 = "b03da1864306242678ac3b6567e69f70dd1252a72742baa23a4d92d2d45da3fc", + strip_prefix = "sea-orm-macros-0.12.11", + urls = ["https://crates.io/api/v1/crates/sea-orm-macros/0.12.11/download"], visibility = [], ) cargo.rust_library( - name = "sea-orm-macros-0.12.10", - srcs = [":sea-orm-macros-0.12.10.crate"], + name = "sea-orm-macros-0.12.11", + srcs = [":sea-orm-macros-0.12.11.crate"], crate = "sea_orm_macros", - crate_root = "sea-orm-macros-0.12.10.crate/src/lib.rs", + crate_root = "sea-orm-macros-0.12.11.crate/src/lib.rs", edition = "2021", features = [ "bae", @@ -11750,18 +11860,18 @@ cargo.rust_library( ) http_archive( - name = "sea-query-0.30.6.crate", - sha256 = "a4a1feb0a26c02efedb049b22d3884e66f15a40c42b33dcbe49b46abc484c2bd", - strip_prefix = "sea-query-0.30.6", - urls = ["https://crates.io/api/v1/crates/sea-query/0.30.6/download"], + name = "sea-query-0.30.7.crate", + sha256 = "4166a1e072292d46dc91f31617c2a1cdaf55a8be4b5c9f4bf2ba248e3ac4999b", + strip_prefix = "sea-query-0.30.7", + urls = ["https://crates.io/api/v1/crates/sea-query/0.30.7/download"], visibility = [], ) cargo.rust_library( - name = "sea-query-0.30.6", - srcs = [":sea-query-0.30.6.crate"], + name = "sea-query-0.30.7", + srcs = [":sea-query-0.30.7.crate"], crate = "sea_query", - crate_root = "sea-query-0.30.6.crate/src/lib.rs", + crate_root = "sea-query-0.30.7.crate/src/lib.rs", edition = "2021", features = [ "backend-mysql", @@ -11836,7 +11946,7 @@ cargo.rust_library( ":bigdecimal-0.3.1", ":chrono-0.4.31", ":rust_decimal-1.33.1", - ":sea-query-0.30.6", + ":sea-query-0.30.7", ":serde_json-1.0.111", ":sqlx-0.7.3", ":time-0.3.31", @@ -12023,23 +12133,23 @@ cargo.rust_library( alias( name = "serde-aux", - actual = ":serde-aux-4.3.1", + actual = ":serde-aux-4.4.0", visibility = ["PUBLIC"], ) http_archive( - name = "serde-aux-4.3.1.crate", - sha256 = "184eba62ebddb71658697c8b08822edee89970bf318c5362189f0de27f85b498", - strip_prefix = "serde-aux-4.3.1", - urls = ["https://crates.io/api/v1/crates/serde-aux/4.3.1/download"], + name = "serde-aux-4.4.0.crate", + sha256 = "a86348501c129f3ad50c2f4635a01971f76974cd8a3f335988a0f1581c082765", + strip_prefix = "serde-aux-4.4.0", + urls = ["https://crates.io/api/v1/crates/serde-aux/4.4.0/download"], visibility = [], ) cargo.rust_library( - name = "serde-aux-4.3.1", - srcs = [":serde-aux-4.3.1.crate"], + name = "serde-aux-4.4.0", + srcs = [":serde-aux-4.4.0.crate"], crate = "serde_aux", - crate_root = "serde-aux-4.3.1.crate/src/lib.rs", + crate_root = "serde-aux-4.4.0.crate/src/lib.rs", edition = "2021", features = [ "chrono", @@ -12731,22 +12841,22 @@ cargo.rust_library( edition = "2018", features = ["union"], visibility = [], - deps = [":smallvec-1.11.2"], + deps = [":smallvec-1.12.0"], ) http_archive( - name = "smallvec-1.11.2.crate", - sha256 = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970", - strip_prefix = "smallvec-1.11.2", - urls = ["https://crates.io/api/v1/crates/smallvec/1.11.2/download"], + name = "smallvec-1.12.0.crate", + sha256 = "2593d31f82ead8df961d8bd23a64c2ccf2eb5dd34b0a34bfb4dd54011c72009e", + strip_prefix = "smallvec-1.12.0", + urls = ["https://crates.io/api/v1/crates/smallvec/1.12.0/download"], visibility = [], ) cargo.rust_library( - name = "smallvec-1.11.2", - srcs = [":smallvec-1.11.2.crate"], + name = "smallvec-1.12.0", + srcs = [":smallvec-1.12.0.crate"], crate = "smallvec", - crate_root = "smallvec-1.11.2.crate/src/lib.rs", + crate_root = "smallvec-1.12.0.crate/src/lib.rs", edition = "2018", features = [ "const_generics", @@ -13028,7 +13138,7 @@ cargo.rust_library( ":serde-1.0.195", ":serde_json-1.0.111", ":sha2-0.10.8", - ":smallvec-1.11.2", + ":smallvec-1.12.0", ":sqlformat-0.2.3", ":thiserror-1.0.56", ":time-0.3.31", @@ -13078,7 +13188,7 @@ cargo.rust_library( ":atoi-2.0.0", ":base64-0.21.7", ":bigdecimal-0.3.1", - ":bitflags-2.4.1", + ":bitflags-2.4.2", ":byteorder-1.5.0", ":chrono-0.4.31", ":crc-3.0.1", @@ -13103,7 +13213,7 @@ cargo.rust_library( ":serde_json-1.0.111", ":sha1-0.10.6", ":sha2-0.10.8", - ":smallvec-1.11.2", + ":smallvec-1.12.0", ":sqlx-core-0.7.3", ":stringprep-0.1.4", ":thiserror-1.0.56", @@ -13198,7 +13308,7 @@ cargo.rust_library( visibility = [], deps = [ ":finl_unicode-1.2.0", - ":unicode-bidi-0.3.14", + ":unicode-bidi-0.3.15", ":unicode-normalization-0.1.22", ], ) @@ -13491,25 +13601,25 @@ cargo.rust_library( "linux-arm64": dict( deps = [ ":libc-0.2.152", - ":xattr-1.2.0", + ":xattr-1.3.1", ], ), "linux-x86_64": dict( deps = [ ":libc-0.2.152", - ":xattr-1.2.0", + ":xattr-1.3.1", ], ), "macos-arm64": dict( deps = [ ":libc-0.2.152", - ":xattr-1.2.0", + ":xattr-1.3.1", ], ), "macos-x86_64": dict( deps = [ ":libc-0.2.152", - ":xattr-1.2.0", + ":xattr-1.3.1", ], ), }, @@ -13557,16 +13667,16 @@ cargo.rust_library( edition = "2018", platform = { "linux-arm64": dict( - deps = [":rustix-0.38.28"], + deps = [":rustix-0.38.30"], ), "linux-x86_64": dict( - deps = [":rustix-0.38.28"], + deps = [":rustix-0.38.30"], ), "macos-arm64": dict( - deps = [":rustix-0.38.28"], + deps = [":rustix-0.38.30"], ), "macos-x86_64": dict( - deps = [":rustix-0.38.28"], + deps = [":rustix-0.38.30"], ), "windows-gnu": dict( deps = [":windows-sys-0.52.0"], @@ -13598,16 +13708,16 @@ cargo.rust_library( edition = "2021", platform = { "linux-arm64": dict( - deps = [":rustix-0.38.28"], + deps = [":rustix-0.38.30"], ), "linux-x86_64": dict( - deps = [":rustix-0.38.28"], + deps = [":rustix-0.38.30"], ), "macos-arm64": dict( - deps = [":rustix-0.38.28"], + deps = [":rustix-0.38.30"], ), "macos-x86_64": dict( - deps = [":rustix-0.38.28"], + deps = [":rustix-0.38.30"], ), "windows-gnu": dict( deps = [":windows-sys-0.48.0"], @@ -13692,7 +13802,7 @@ cargo.rust_binary( ":bytes-1.5.0", ":chrono-0.4.31", ":ciborium-0.2.1", - ":clap-4.4.16", + ":clap-4.4.18", ":color-eyre-0.6.2", ":colored-2.1.0", ":comfy-table-7.1.0", @@ -13749,12 +13859,12 @@ cargo.rust_binary( ":reqwest-0.11.23", ":ring-0.17.5", ":rust-s3-0.34.0-rc4", - ":rustls-0.21.10", + ":rustls-0.22.2", ":rustls-pemfile-2.0.0", - ":sea-orm-0.12.10", + ":sea-orm-0.12.11", ":self-replace-1.3.7", ":serde-1.0.195", - ":serde-aux-4.3.1", + ":serde-aux-4.4.0", ":serde_json-1.0.111", ":serde_url_params-0.2.1", ":serde_with-3.4.0", @@ -13769,7 +13879,7 @@ cargo.rust_binary( ":thiserror-1.0.56", ":tokio-1.35.1", ":tokio-postgres-0.7.10", - ":tokio-postgres-rustls-0.10.0", + ":tokio-postgres-rustls-0.11.0", ":tokio-serde-0.8.0", ":tokio-stream-0.1.14", ":tokio-test-0.4.3", @@ -14217,24 +14327,25 @@ cargo.rust_library( alias( name = "tokio-postgres-rustls", - actual = ":tokio-postgres-rustls-0.10.0", + actual = ":tokio-postgres-rustls-0.11.0", visibility = ["PUBLIC"], ) cargo.rust_library( - name = "tokio-postgres-rustls-0.10.0", - srcs = [":tokio-postgres-rustls-00062377dd266360.git"], + name = "tokio-postgres-rustls-0.11.0", + srcs = [":tokio-postgres-rustls-855e14009fe3bebe.git"], crate = "tokio_postgres_rustls", - crate_root = "tokio-postgres-rustls-00062377dd266360/src/lib.rs", + crate_root = "tokio-postgres-rustls-855e14009fe3bebe/src/lib.rs", edition = "2018", visibility = [], deps = [ ":futures-0.3.30", ":ring-0.17.5", - ":rustls-0.21.10", + ":rustls-0.22.2", ":tokio-1.35.1", ":tokio-postgres-0.7.10", - ":tokio-rustls-0.24.1", + ":tokio-rustls-0.25.0", + ":x509-certificate-0.23.1", ], ) @@ -14286,6 +14397,30 @@ cargo.rust_library( ], ) +http_archive( + name = "tokio-rustls-0.25.0.crate", + sha256 = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f", + strip_prefix = "tokio-rustls-0.25.0", + urls = ["https://crates.io/api/v1/crates/tokio-rustls/0.25.0/download"], + visibility = [], +) + +cargo.rust_library( + name = "tokio-rustls-0.25.0", + srcs = [":tokio-rustls-0.25.0.crate"], + crate = "tokio_rustls", + crate_root = "tokio-rustls-0.25.0.crate/src/lib.rs", + edition = "2021", + named_deps = { + "pki_types": ":rustls-pki-types-1.1.0", + }, + visibility = [], + deps = [ + ":rustls-0.22.2", + ":tokio-1.35.1", + ], +) + alias( name = "tokio-serde", actual = ":tokio-serde-0.8.0", @@ -14687,7 +14822,7 @@ cargo.rust_library( ":bytes-1.5.0", ":futures-core-0.3.30", ":futures-util-0.3.30", - ":h2-0.3.23", + ":h2-0.3.24", ":http-0.2.11", ":http-body-0.4.6", ":hyper-0.14.28", @@ -14799,8 +14934,8 @@ cargo.rust_library( ], visibility = [], deps = [ - ":async-compression-0.4.5", - ":bitflags-2.4.1", + ":async-compression-0.4.6", + ":bitflags-2.4.2", ":bytes-1.5.0", ":futures-core-0.3.30", ":futures-util-0.3.30", @@ -15026,7 +15161,7 @@ cargo.rust_library( ":once_cell-1.19.0", ":opentelemetry-0.21.0", ":opentelemetry_sdk-0.21.2", - ":smallvec-1.11.2", + ":smallvec-1.12.0", ":tracing-0.1.40", ":tracing-core-0.1.32", ":tracing-log-0.2.0", @@ -15079,7 +15214,7 @@ cargo.rust_library( ":once_cell-1.19.0", ":regex-1.10.2", ":sharded-slab-0.1.7", - ":smallvec-1.11.2", + ":smallvec-1.12.0", ":thread_local-1.1.7", ":tracing-0.1.40", ":tracing-core-0.1.32", @@ -15251,18 +15386,18 @@ buildscript_run( ) http_archive( - name = "unicode-bidi-0.3.14.crate", - sha256 = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416", - strip_prefix = "unicode-bidi-0.3.14", - urls = ["https://crates.io/api/v1/crates/unicode-bidi/0.3.14/download"], + name = "unicode-bidi-0.3.15.crate", + sha256 = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75", + strip_prefix = "unicode-bidi-0.3.15", + urls = ["https://crates.io/api/v1/crates/unicode-bidi/0.3.15/download"], visibility = [], ) cargo.rust_library( - name = "unicode-bidi-0.3.14", - srcs = [":unicode-bidi-0.3.14.crate"], + name = "unicode-bidi-0.3.15", + srcs = [":unicode-bidi-0.3.15.crate"], crate = "unicode_bidi", - crate_root = "unicode-bidi-0.3.14.crate/src/lib.rs", + crate_root = "unicode-bidi-0.3.15.crate/src/lib.rs", edition = "2018", features = [ "default", @@ -16180,18 +16315,48 @@ cargo.rust_library( ) http_archive( - name = "xattr-1.2.0.crate", - sha256 = "914566e6413e7fa959cc394fb30e563ba80f3541fbd40816d4c05a0fc3f2a0f1", - strip_prefix = "xattr-1.2.0", - urls = ["https://crates.io/api/v1/crates/xattr/1.2.0/download"], + name = "x509-certificate-0.23.1.crate", + sha256 = "66534846dec7a11d7c50a74b7cdb208b9a581cad890b7866430d438455847c85", + strip_prefix = "x509-certificate-0.23.1", + urls = ["https://crates.io/api/v1/crates/x509-certificate/0.23.1/download"], visibility = [], ) cargo.rust_library( - name = "xattr-1.2.0", - srcs = [":xattr-1.2.0.crate"], + name = "x509-certificate-0.23.1", + srcs = [":x509-certificate-0.23.1.crate"], + crate = "x509_certificate", + crate_root = "x509-certificate-0.23.1.crate/src/lib.rs", + edition = "2021", + visibility = [], + deps = [ + ":bcder-0.7.4", + ":bytes-1.5.0", + ":chrono-0.4.31", + ":der-0.7.8", + ":hex-0.4.3", + ":pem-3.0.3", + ":ring-0.17.5", + ":signature-2.2.0", + ":spki-0.7.3", + ":thiserror-1.0.56", + ":zeroize-1.7.0", + ], +) + +http_archive( + name = "xattr-1.3.1.crate", + sha256 = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f", + strip_prefix = "xattr-1.3.1", + urls = ["https://crates.io/api/v1/crates/xattr/1.3.1/download"], + visibility = [], +) + +cargo.rust_library( + name = "xattr-1.3.1", + srcs = [":xattr-1.3.1.crate"], crate = "xattr", - crate_root = "xattr-1.2.0.crate/src/lib.rs", + crate_root = "xattr-1.3.1.crate/src/lib.rs", edition = "2021", features = [ "default", @@ -16199,20 +16364,14 @@ cargo.rust_library( ], platform = { "linux-arm64": dict( - deps = [":linux-raw-sys-0.4.12"], + deps = [":linux-raw-sys-0.4.13"], ), "linux-x86_64": dict( - deps = [":linux-raw-sys-0.4.12"], - ), - "macos-arm64": dict( - deps = [":libc-0.2.152"], - ), - "macos-x86_64": dict( - deps = [":libc-0.2.152"], + deps = [":linux-raw-sys-0.4.13"], ), }, visibility = [], - deps = [":rustix-0.38.28"], + deps = [":rustix-0.38.30"], ) alias( @@ -16311,7 +16470,7 @@ cargo.rust_library( ":serde-1.0.195", ":serde_json-1.0.111", ":smallstr-0.3.0", - ":smallvec-1.11.2", + ":smallvec-1.12.0", ":thiserror-1.0.56", ], ) @@ -16362,6 +16521,32 @@ cargo.rust_library( features = [ "alloc", "default", + "derive", + "zeroize_derive", ], visibility = [], + deps = [":zeroize_derive-1.4.2"], +) + +http_archive( + name = "zeroize_derive-1.4.2.crate", + sha256 = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69", + strip_prefix = "zeroize_derive-1.4.2", + urls = ["https://crates.io/api/v1/crates/zeroize_derive/1.4.2/download"], + visibility = [], +) + +cargo.rust_library( + name = "zeroize_derive-1.4.2", + srcs = [":zeroize_derive-1.4.2.crate"], + crate = "zeroize_derive", + crate_root = "zeroize_derive-1.4.2.crate/src/lib.rs", + edition = "2021", + proc_macro = True, + visibility = [], + deps = [ + ":proc-macro2-1.0.76", + ":quote-1.0.35", + ":syn-2.0.48", + ], ) diff --git a/third-party/rust/Cargo.lock b/third-party/rust/Cargo.lock index 60add10c90..7b6212c06b 100644 --- a/third-party/rust/Cargo.lock +++ b/third-party/rust/Cargo.lock @@ -94,9 +94,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.7" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd2405b3ac1faab2990b74d728624cd9fd115651fcecc7c2d8daf01376275ba" +checksum = "3fde6067df7359f2d6335ec1a50c1f8f825801687d10da0cc4c6b08e3f6afd15" dependencies = [ "anstyle", "anstyle-parse", @@ -160,9 +160,9 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "async-compression" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc2d0cfb2a7388d34f590e76686704c494ed7aaceed62ee1ba35cbf363abc2a5" +checksum = "a116f46a969224200a0a97f29cfd4c50e7534e4b4826bd23ea2c3c533039c82c" dependencies = [ "brotli", "flate2", @@ -189,10 +189,10 @@ dependencies = [ "rand 0.8.5", "regex", "ring", - "rustls", + "rustls 0.21.10", "rustls-native-certs", "rustls-pemfile 1.0.4", - "rustls-webpki", + "rustls-webpki 0.101.7", "serde", "serde_json", "serde_nanos", @@ -201,7 +201,7 @@ dependencies = [ "time", "tokio", "tokio-retry", - "tokio-rustls", + "tokio-rustls 0.24.1", "tracing", "url", ] @@ -296,7 +296,7 @@ checksum = "0f77d243921b0979fbbd728dd2d5162e68ac8252976797c24eb5b3a6af9090dc" dependencies = [ "http", "log", - "rustls", + "rustls 0.21.10", "serde", "serde_json", "url", @@ -438,6 +438,16 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +[[package]] +name = "bcder" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c627747a6774aab38beb35990d88309481378558875a41da1a4b2e373c906ef0" +dependencies = [ + "bytes 1.5.0", + "smallvec", +] + [[package]] name = "bigdecimal" version = "0.3.1" @@ -463,9 +473,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" dependencies = [ "serde", ] @@ -724,9 +734,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.16" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58e54881c004cec7895b0068a0a954cd5d62da01aef83fa35b1e594497bf5445" +checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" dependencies = [ "clap_builder", "clap_derive", @@ -734,9 +744,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.16" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59cb82d7f531603d2fd1f507441cdd35184fa81beff7bd489570de7f773460bb" +checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" dependencies = [ "anstream", "anstyle", @@ -1067,7 +1077,7 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "crossterm_winapi", "libc", "parking_lot", @@ -1907,9 +1917,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b553656127a00601c8ae5590fcfdc118e4083a7924b6cf4ffc1ea4b99dc429d7" +checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" dependencies = [ "bytes 1.5.0", "fnv", @@ -1975,9 +1985,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" [[package]] name = "hex" @@ -2118,9 +2128,9 @@ dependencies = [ "futures-util", "http", "hyper", - "rustls", + "rustls 0.21.10", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", ] [[package]] @@ -2351,9 +2361,9 @@ checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "js-sys" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" dependencies = [ "wasm-bindgen", ] @@ -2425,7 +2435,7 @@ version = "0.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "libc", "redox_syscall", ] @@ -2455,9 +2465,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" @@ -2639,7 +2649,7 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "cfg-if", "libc", ] @@ -3059,6 +3069,16 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" +[[package]] +name = "pem" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b8fcc794035347fb64beda2d3b462595dd2753e3f268d89c5aae77e8cf2c310" +dependencies = [ + "base64 0.21.7", + "serde", +] + [[package]] name = "pem-rfc7468" version = "0.7.0" @@ -3179,9 +3199,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69d3587f8a9e599cc7ec2c00e331f71c4e69a5f9a4b8a6efd5b07466b9736f9a" +checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" [[package]] name = "platforms" @@ -3319,9 +3339,9 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "3.0.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b2685dd208a3771337d8d386a89840f0f43cd68be8dae90a5f8c2384effc9cd" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" dependencies = [ "toml_edit 0.21.0", ] @@ -3664,14 +3684,14 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls", + "rustls 0.21.10", "rustls-pemfile 1.0.4", "serde", "serde_json", "serde_urlencoded", "system-configuration", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", "tower-service", "url", "wasm-bindgen", @@ -3787,7 +3807,7 @@ dependencies = [ "md5", "percent-encoding", "quick-xml", - "rustls", + "rustls 0.21.10", "rustls-native-certs", "serde", "serde_derive", @@ -3796,7 +3816,7 @@ dependencies = [ "thiserror", "time", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", "tokio-stream", "url", ] @@ -3834,11 +3854,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.28" +version = "0.38.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" +checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "errno", "libc", "linux-raw-sys", @@ -3853,10 +3873,24 @@ checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", "ring", - "rustls-webpki", + "rustls-webpki 0.101.7", "sct", ] +[[package]] +name = "rustls" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e87c9956bd9807afa1f77e0f7594af32566e830e088a5576d27c5b6f30f49d41" +dependencies = [ + "log", + "ring", + "rustls-pki-types", + "rustls-webpki 0.102.1", + "subtle", + "zeroize", +] + [[package]] name = "rustls-native-certs" version = "0.6.3" @@ -3904,6 +3938,17 @@ dependencies = [ "untrusted", ] +[[package]] +name = "rustls-webpki" +version = "0.102.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef4ca26037c909dedb327b48c3327d0ba91d3dd3c4e05dad328f210ffb68e95b" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + [[package]] name = "rustversion" version = "1.0.14" @@ -3965,9 +4010,9 @@ dependencies = [ [[package]] name = "sea-orm" -version = "0.12.10" +version = "0.12.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9195a2b2a182cbee3f76cf2a97c20204022f91259bdf8a48b537788202775b" +checksum = "59f66e2129991acd51fcad7b59da1edd862edca69773cc9a19cb17b967fae2fb" dependencies = [ "async-stream", "async-trait", @@ -3993,9 +4038,9 @@ dependencies = [ [[package]] name = "sea-orm-macros" -version = "0.12.10" +version = "0.12.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66c6acfe3d49625c679955c7e7e7cd2d72b512a5c77bcd535a74aa41590b9f28" +checksum = "b03da1864306242678ac3b6567e69f70dd1252a72742baa23a4d92d2d45da3fc" dependencies = [ "heck", "proc-macro2", @@ -4007,9 +4052,9 @@ dependencies = [ [[package]] name = "sea-query" -version = "0.30.6" +version = "0.30.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a1feb0a26c02efedb049b22d3884e66f15a40c42b33dcbe49b46abc484c2bd" +checksum = "4166a1e072292d46dc91f31617c2a1cdaf55a8be4b5c9f4bf2ba248e3ac4999b" dependencies = [ "bigdecimal", "chrono", @@ -4109,9 +4154,9 @@ dependencies = [ [[package]] name = "serde-aux" -version = "4.3.1" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "184eba62ebddb71658697c8b08822edee89970bf318c5362189f0de27f85b498" +checksum = "a86348501c129f3ad50c2f4635a01971f76974cd8a3f335988a0f1581c082765" dependencies = [ "chrono", "serde", @@ -4399,9 +4444,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.2" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" +checksum = "2593d31f82ead8df961d8bd23a64c2ccf2eb5dd34b0a34bfb4dd54011c72009e" [[package]] name = "socket2" @@ -4505,7 +4550,7 @@ dependencies = [ "paste", "percent-encoding", "rust_decimal", - "rustls", + "rustls 0.21.10", "rustls-pemfile 1.0.4", "serde", "serde_json", @@ -4571,7 +4616,7 @@ dependencies = [ "atoi", "base64 0.21.7", "bigdecimal", - "bitflags 2.4.1", + "bitflags 2.4.2", "byteorder", "bytes 1.5.0", "chrono", @@ -4618,7 +4663,7 @@ dependencies = [ "atoi", "base64 0.21.7", "bigdecimal", - "bitflags 2.4.1", + "bitflags 2.4.2", "byteorder", "chrono", "crc", @@ -4963,7 +5008,7 @@ dependencies = [ "reqwest", "ring", "rust-s3", - "rustls", + "rustls 0.22.2", "rustls-pemfile 2.0.0", "sea-orm", "self-replace", @@ -5157,15 +5202,16 @@ dependencies = [ [[package]] name = "tokio-postgres-rustls" -version = "0.10.0" -source = "git+https://github.com/fnichol/tokio-postgres-rustls.git?branch=ring-0.17#531c8af4420fcd1b551ffe9eb5e9f3c714812333" +version = "0.11.0" +source = "git+https://github.com/jbg/tokio-postgres-rustls.git?branch=master#f210aa24c4788e7f3bd9af52c4f7014c5561ac70" dependencies = [ "futures", "ring", - "rustls", + "rustls 0.22.2", "tokio", "tokio-postgres", - "tokio-rustls", + "tokio-rustls 0.25.0", + "x509-certificate", ] [[package]] @@ -5185,7 +5231,18 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls", + "rustls 0.21.10", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +dependencies = [ + "rustls 0.22.2", + "rustls-pki-types", "tokio", ] @@ -5390,7 +5447,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" dependencies = [ "async-compression", - "bitflags 2.4.1", + "bitflags 2.4.2", "bytes 1.5.0", "futures-core", "futures-util", @@ -5559,9 +5616,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.14" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" @@ -5739,9 +5796,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -5749,9 +5806,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" dependencies = [ "bumpalo", "log", @@ -5764,9 +5821,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.39" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" +checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" dependencies = [ "cfg-if", "js-sys", @@ -5776,9 +5833,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -5786,9 +5843,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" dependencies = [ "proc-macro2", "quote", @@ -5799,15 +5856,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" [[package]] name = "web-sys" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" dependencies = [ "js-sys", "wasm-bindgen", @@ -6039,11 +6096,30 @@ dependencies = [ "tap", ] +[[package]] +name = "x509-certificate" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66534846dec7a11d7c50a74b7cdb208b9a581cad890b7866430d438455847c85" +dependencies = [ + "bcder", + "bytes 1.5.0", + "chrono", + "der", + "hex", + "pem", + "ring", + "signature 2.2.0", + "spki", + "thiserror", + "zeroize", +] + [[package]] name = "xattr" -version = "1.2.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "914566e6413e7fa959cc394fb30e563ba80f3541fbd40816d4c05a0fc3f2a0f1" +checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" dependencies = [ "libc", "linux-raw-sys", @@ -6114,3 +6190,17 @@ name = "zeroize" version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] diff --git a/third-party/rust/Cargo.toml b/third-party/rust/Cargo.toml index 60b436285b..e950e2e28e 100644 --- a/third-party/rust/Cargo.toml +++ b/third-party/rust/Cargo.toml @@ -85,7 +85,7 @@ regex = "1.8.1" remain = "0.2.8" reqwest = { version = "0.11.17", default-features = false, features = ["rustls-tls", "json", "multipart"] } ring = "=0.17.5" # Upgrading this is possible, but a pain, so we don't want to pick up every new minor version (see: https://github.com/facebook/buck2/commit/91af40b66960d003067c3d241595fb53d1e636c8) -rustls = { version = "0.21.1" } # pinned because ring above depends on it +rustls = { version = "0.22.2" } rustls-pemfile = { version = "2.0.0" } rust-s3 = { version = "0.34.0-rc4", default-features = false, features = ["tokio-rustls-tls"] } sea-orm = { version = "0.12.0", features = ["sqlx-postgres", "runtime-tokio-rustls", "macros", "with-chrono", "debug-print"] } @@ -106,7 +106,7 @@ test-log = { version = "0.2.11", default-features = false, features = ["trace"] thiserror = "1.0.40" tokio = { version = "1.28.0", features = ["full"] } tokio-postgres = { version = "0.7.8", features = ["runtime", "with-chrono-0_4", "with-serde_json-1"] } -tokio-postgres-rustls = { version = "0.10.0" } +tokio-postgres-rustls = { version = "0.11.0" } tokio-serde = { version = "0.8.0", features = ["json"] } tokio-stream = "0.1.14" tokio-test = "0.4.2" @@ -141,7 +141,7 @@ docker-api = { git = "https://github.com/vv9k/docker-api-rs.git", branch = "mast # Note that this helps us to narrow down the number of `ring`/`rustls` versions to 1 each rust-s3 = { git = "https://github.com/ScuffleTV/rust-s3.git", branch = "troy/rustls" } # pending a potential merge and release of -# https://github.com/jbg/tokio-postgres-rustls/pull/17 -tokio-postgres-rustls = { git = "https://github.com/fnichol/tokio-postgres-rustls.git", branch = "ring-0.17" } +# https://github.com/jbg/tokio-postgres-rustls/pull/18 +tokio-postgres-rustls = { git = "https://github.com/jbg/tokio-postgres-rustls.git", branch = "master" } # END: DEPENDENCIES