diff --git a/Cargo.lock b/Cargo.lock index 3b60529e4be982..cc01521b4d87ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -217,9 +217,9 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +checksum = "c677ab05e09154296dd37acecd46420c17b9713e8366facafa8fc0885167cf4c" dependencies = [ "anstyle 1.0.0", "windows-sys 0.48.0", @@ -244,7 +244,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c0fdddc3fdac97394ffcc5c89c634faa9c1c166ced54189af34e407c97b6ee7" dependencies = [ "byteorder", - "digest", + "digest 0.10.7", "lazy_static", "libflate", "log", @@ -304,7 +304,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c6368f9ae5c6ec403ca910327ae0c9437b0a85255b6950c90d497e6177f6e5e" dependencies = [ "proc-macro-hack", - "quote 1.0.33", + "quote 1.0.32", "syn 1.0.109", ] @@ -534,7 +534,7 @@ dependencies = [ "darling 0.14.2", "proc-macro-crate 1.2.1", "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "syn 1.0.109", "thiserror", ] @@ -550,9 +550,9 @@ dependencies = [ "darling 0.20.3", "proc-macro-crate 1.2.1", "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "strum", - "syn 2.0.29", + "syn 2.0.28", "thiserror", ] @@ -729,8 +729,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.33", - "syn 2.0.29", + "quote 1.0.32", + "syn 2.0.28", ] [[package]] @@ -751,8 +751,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.33", - "syn 2.0.29", + "quote 1.0.32", + "syn 2.0.28", ] [[package]] @@ -768,8 +768,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.33", - "syn 2.0.29", + "quote 1.0.32", + "syn 2.0.28", ] [[package]] @@ -1143,7 +1143,7 @@ dependencies = [ "once_cell", "percent-encoding", "regex", - "sha2", + "sha2 0.10.7", "time", "tracing 0.1.37", ] @@ -1175,7 +1175,7 @@ dependencies = [ "md-5", "pin-project-lite", "sha1", - "sha2", + "sha2 0.10.7", "tracing 0.1.37", ] @@ -1426,7 +1426,7 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "sha2", + "sha2 0.10.7", "time", "url", "uuid", @@ -1562,8 +1562,8 @@ version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49fb8528abca6895a5ada33d62aedd538a5c33e77068256483b44a3230270163" dependencies = [ - "quote 1.0.33", - "syn 2.0.29", + "quote 1.0.32", + "syn 2.0.28", ] [[package]] @@ -1578,6 +1578,15 @@ dependencies = [ "wyz", ] +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + [[package]] name = "block-buffer" version = "0.10.3" @@ -1697,7 +1706,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61820b4c5693eafb998b1e67485423c923db4a75f72585c247bdee32bad81e7b" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "syn 1.0.109", ] @@ -1708,7 +1717,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c76cdbfa13def20d1f8af3ae7b3c6771f06352a74221d8851262ac384c122b8e" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "syn 1.0.109", ] @@ -1778,7 +1787,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13e576ebe98e605500b3c8041bb888e966653577172df6dd97398714eb30b9bf" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "syn 1.0.109", ] @@ -1861,7 +1870,7 @@ dependencies = [ "cached_proc_macro_types", "darling 0.14.2", "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "syn 1.0.109", ] @@ -2111,8 +2120,8 @@ checksum = "54a9bb5758fc5dfe728d1019941681eccaf0cf8a4189b692a0ee2f2ecf90a050" dependencies = [ "heck 0.4.1", "proc-macro2 1.0.66", - "quote 1.0.33", - "syn 2.0.29", + "quote 1.0.32", + "syn 2.0.28", ] [[package]] @@ -2313,9 +2322,9 @@ dependencies = [ [[package]] name = "const-oid" -version = "0.9.5" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" +checksum = "9d6f2aa4d0537bcc1c74df8755072bd31c1ef1a3a1b85a68e8404a8c353b7b8b" [[package]] name = "convert_case" @@ -2356,9 +2365,9 @@ checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" dependencies = [ "libc", ] @@ -2572,7 +2581,7 @@ version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" dependencies = [ - "quote 1.0.33", + "quote 1.0.32", "syn 1.0.109", ] @@ -2593,29 +2602,15 @@ checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" [[package]] name = "curve25519-dalek" -version = "4.0.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f711ade317dd348950a9910f81c5947e3d8907ebd2b83f76203ff1807e6a2bc2" +checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" dependencies = [ - "cfg-if", - "cpufeatures", - "curve25519-dalek-derive", - "digest", - "fiat-crypto", - "platforms 3.0.2", - "rustc_version 0.4.0", + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", "subtle", -] - -[[package]] -name = "curve25519-dalek-derive" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" -dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.33", - "syn 2.0.29", + "zeroize", ] [[package]] @@ -2640,7 +2635,7 @@ dependencies = [ "codespan-reporting", "once_cell", "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "scratch", "syn 1.0.109", ] @@ -2658,7 +2653,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a08a6e2fcc370a089ad3b4aaf54db3b1b4cee38ddabce5896b33eb693275f470" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "syn 1.0.109", ] @@ -2701,7 +2696,7 @@ dependencies = [ "fnv", "ident_case", "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "strsim 0.10.0", "syn 1.0.109", ] @@ -2715,7 +2710,7 @@ dependencies = [ "fnv", "ident_case", "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "strsim 0.10.0", "syn 1.0.109", ] @@ -2729,9 +2724,9 @@ dependencies = [ "fnv", "ident_case", "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "strsim 0.10.0", - "syn 2.0.29", + "syn 2.0.28", ] [[package]] @@ -2741,7 +2736,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" dependencies = [ "darling_core 0.13.4", - "quote 1.0.33", + "quote 1.0.32", "syn 1.0.109", ] @@ -2752,7 +2747,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" dependencies = [ "darling_core 0.14.2", - "quote 1.0.33", + "quote 1.0.32", "syn 1.0.109", ] @@ -2763,8 +2758,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core 0.20.3", - "quote 1.0.33", - "syn 2.0.29", + "quote 1.0.32", + "syn 2.0.28", ] [[package]] @@ -2825,13 +2820,20 @@ checksum = "f578e8e2c440e7297e008bb5486a3a8a194775224bbc23729b0dbdfaeebf162e" [[package]] name = "der" -version = "0.7.8" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +checksum = "79b71cca7d95d7681a4b3b9cdf63c8dbc3730d0584c2c74e31416d64a90493f4" dependencies = [ "const-oid", - "pem-rfc7468", - "zeroize", +] + +[[package]] +name = "deranged" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7684a49fb1af197853ef7b2ee694bc1f5b4179556f1e5710e1760c5db6f5e929" +dependencies = [ + "serde", ] [[package]] @@ -2841,7 +2843,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "syn 1.0.109", ] @@ -2852,8 +2854,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53e0efad4403bfc52dc201159c4b842a246a14b98c64b55dfd0f2d89729dfeb8" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.33", - "syn 2.0.29", + "quote 1.0.32", + "syn 2.0.28", ] [[package]] @@ -2864,7 +2866,7 @@ checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ "convert_case 0.4.0", "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "rustc_version 0.4.0", "syn 1.0.109", ] @@ -2881,13 +2883,22 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + [[package]] name = "digest" version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer", + "block-buffer 0.10.3", "crypto-common", "subtle", ] @@ -3031,23 +3042,23 @@ checksum = "bbfc4744c1b8f2a09adc0e55242f60b1af195d88596bd8700be74418c056c555" [[package]] name = "ed25519" -version = "2.2.2" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60f6d271ca33075c88028be6f04d502853d63a5ece419d269c15315d4fc1cf1d" +checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" dependencies = [ "signature", ] [[package]] name = "ed25519-dalek" -version = "2.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980" +checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" dependencies = [ "curve25519-dalek", "ed25519", - "sha2", - "signature", + "sha2 0.9.9", + "zeroize", ] [[package]] @@ -3111,7 +3122,7 @@ checksum = "21cdad81446a7f7dc43f6a77409efeb9733d2fa65553efef6018ef257c959b73" dependencies = [ "heck 0.4.1", "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "syn 1.0.109", ] @@ -3123,7 +3134,7 @@ checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116" dependencies = [ "heck 0.4.1", "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "syn 1.0.109", ] @@ -3135,8 +3146,8 @@ checksum = "8f33313078bb8d4d05a2733a94ac4c2d8a0df9a2b84424ebf4f33bfc224a890e" dependencies = [ "once_cell", "proc-macro2 1.0.66", - "quote 1.0.33", - "syn 2.0.29", + "quote 1.0.32", + "syn 2.0.28", ] [[package]] @@ -3155,8 +3166,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.33", - "syn 2.0.29", + "quote 1.0.32", + "syn 2.0.28", ] [[package]] @@ -3283,7 +3294,7 @@ checksum = "f47da3a72ec598d9c8937a7ebca8962a5c7a1f28444e38c2b33c771ba3f55f05" dependencies = [ "proc-macro-error", "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "syn 1.0.109", ] @@ -3322,12 +3333,6 @@ dependencies = [ "instant", ] -[[package]] -name = "fiat-crypto" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e825f6987101665dea6ec934c09ec6d721de7bc1bf92248e1d5810c8cd636b77" - [[package]] name = "file-source" version = "0.1.0" @@ -3385,7 +3390,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4c81935e123ab0741c4c4f0d9b8377e5fb21d3de7e062fa4b1263b1fbcba1ea" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "syn 1.0.109", ] @@ -3566,8 +3571,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.33", - "syn 2.0.29", + "quote 1.0.32", + "syn 2.0.28", ] [[package]] @@ -3745,7 +3750,7 @@ dependencies = [ "heck 0.4.1", "lazy_static", "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "serde", "serde_json", "syn 1.0.109", @@ -3996,7 +4001,7 @@ dependencies = [ "log", "mach", "ntapi", - "platforms 1.1.0", + "platforms", "winapi", ] @@ -4068,7 +4073,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest", + "digest 0.10.7", ] [[package]] @@ -5105,7 +5110,7 @@ version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" dependencies = [ - "digest", + "digest 0.10.7", ] [[package]] @@ -5159,8 +5164,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ddece26afd34c31585c74a4db0630c376df271c285d682d1e55012197830b6df" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.33", - "syn 2.0.29", + "quote 1.0.32", + "syn 2.0.28", ] [[package]] @@ -5303,7 +5308,7 @@ dependencies = [ "serde_bytes", "serde_with 1.14.0", "sha-1", - "sha2", + "sha2 0.10.7", "socket2 0.4.9", "stringprep", "strsim 0.10.0", @@ -5437,9 +5442,9 @@ dependencies = [ [[package]] name = "nkeys" -version = "0.3.2" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aad178aad32087b19042ee36dfd450b73f5f934fbfb058b59b198684dfec4c47" +checksum = "3e9261eb915c785ea65708bc45ef43507ea46914e1a73f1412d1a38aba967c8e" dependencies = [ "byteorder", "data-encoding", @@ -5636,7 +5641,7 @@ checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" dependencies = [ "proc-macro-crate 1.2.1", "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "syn 1.0.109", ] @@ -5648,8 +5653,8 @@ checksum = "56ea360eafe1022f7cc56cd7b869ed57330fb2453d0c7831d99b74c65d2f5597" dependencies = [ "proc-macro-crate 1.2.1", "proc-macro2 1.0.66", - "quote 1.0.33", - "syn 2.0.29", + "quote 1.0.32", + "syn 2.0.28", ] [[package]] @@ -5682,7 +5687,7 @@ dependencies = [ "serde", "serde_json", "serde_path_to_error", - "sha2", + "sha2 0.10.7", "thiserror", "url", ] @@ -5831,7 +5836,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "syn 1.0.109", ] @@ -6011,7 +6016,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ - "digest", + "digest 0.10.7", ] [[package]] @@ -6031,9 +6036,9 @@ dependencies = [ [[package]] name = "pem-rfc7468" -version = "0.7.0" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +checksum = "8f22eb0e3c593294a99e9ff4b24cf6b752d43f193aa4415fe5077c159996d497" dependencies = [ "base64ct", ] @@ -6073,8 +6078,8 @@ dependencies = [ "pest", "pest_meta", "proc-macro2 1.0.66", - "quote 1.0.33", - "syn 2.0.29", + "quote 1.0.32", + "syn 2.0.28", ] [[package]] @@ -6085,7 +6090,7 @@ checksum = "56af0a30af74d0445c0bf6d9d051c979b516a1a5af790d251daee76005420a48" dependencies = [ "once_cell", "pest", - "sha2", + "sha2 0.10.7", ] [[package]] @@ -6161,8 +6166,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.33", - "syn 2.0.29", + "quote 1.0.32", + "syn 2.0.28", ] [[package]] @@ -6191,12 +6196,14 @@ dependencies = [ [[package]] name = "pkcs8" -version = "0.10.2" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +checksum = "ee3ef9b64d26bad0536099c816c6734379e45bbd5f14798def6809e5cc350447" dependencies = [ "der", + "pem-rfc7468", "spki", + "zeroize", ] [[package]] @@ -6211,12 +6218,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "989d43012e2ca1c4a02507c67282691a0a3207f9dc67cec596b43fe925b3d325" -[[package]] -name = "platforms" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d7ddaed09e0eb771a79ab0fd64609ba0afb0a8366421957936ad14cbd13630" - [[package]] name = "plotters" version = "0.3.4" @@ -6310,7 +6311,7 @@ dependencies = [ "md-5", "memchr", "rand 0.8.5", - "sha2", + "sha2 0.10.7", "stringprep", ] @@ -6442,7 +6443,7 @@ checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "syn 1.0.109", "version_check", ] @@ -6454,7 +6455,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "version_check", ] @@ -6563,7 +6564,7 @@ dependencies = [ "anyhow", "itertools 0.10.5", "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "syn 1.0.109", ] @@ -6606,7 +6607,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "syn 1.0.109", ] @@ -6715,7 +6716,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b22a693222d716a9587786f37ac3f6b4faedb5b80c23914e7303ff5a1d8016e9" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "syn 1.0.109", ] @@ -6730,9 +6731,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" dependencies = [ "proc-macro2 1.0.66", ] @@ -7158,7 +7159,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff26ed6c7c4dfc2aa9480b86a60e3c7233543a270a680e10758a507c5a4ce476" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "syn 1.0.109", ] @@ -7364,9 +7365,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.101.2" +version = "0.101.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "513722fd73ad80a71f72b61009ea1b584bcfa1483ca93949c8f290298837fa59" +checksum = "261e9e0888cba427c3316e6322805653c9425240b6fd96cee7cb671ab70ab8d0" dependencies = [ "ring", "untrusted", @@ -7611,8 +7612,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc59dfdcbad1437773485e0367fea4b090a2e0a16d9ffc46af47764536a298ec" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.33", - "syn 2.0.29", + "quote 1.0.32", + "syn 2.0.28", ] [[package]] @@ -7622,8 +7623,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e578a843d40b4189a4d66bba51d7684f57da5bd7c304c64e14bd63efbef49509" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.33", - "syn 2.0.29", + "quote 1.0.32", + "syn 2.0.28", ] [[package]] @@ -7674,8 +7675,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.33", - "syn 2.0.29", + "quote 1.0.32", + "syn 2.0.28", ] [[package]] @@ -7749,7 +7750,7 @@ checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" dependencies = [ "darling 0.13.4", "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "syn 1.0.109", ] @@ -7761,8 +7762,8 @@ checksum = "2e6be15c453eb305019bfa438b1593c731f36a289a7853f7707ee29e870b3b3c" dependencies = [ "darling 0.20.3", "proc-macro2 1.0.66", - "quote 1.0.33", - "syn 2.0.29", + "quote 1.0.32", + "syn 2.0.28", ] [[package]] @@ -7798,7 +7799,7 @@ checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c" dependencies = [ "cfg-if", "cpufeatures", - "digest", + "digest 0.10.7", ] [[package]] @@ -7809,7 +7810,20 @@ checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" dependencies = [ "cfg-if", "cpufeatures", - "digest", + "digest 0.10.7", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", ] [[package]] @@ -7820,7 +7834,7 @@ checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" dependencies = [ "cfg-if", "cpufeatures", - "digest", + "digest 0.10.7", ] [[package]] @@ -7829,7 +7843,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bdf0c33fae925bdc080598b84bc15c55e7b9a4a43b3c704da051f977469691c9" dependencies = [ - "digest", + "digest 0.10.7", "keccak", ] @@ -7884,9 +7898,9 @@ dependencies = [ [[package]] name = "signatory" -version = "0.27.1" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e303f8205714074f6068773f0e29527e0453937fe837c9717d066635b65f31" +checksum = "5dfecc059e81632eef1dd9b79e22fc28b8fe69b30d3357512a77a0ad8ee3c782" dependencies = [ "pkcs8", "rand_core 0.6.4", @@ -7896,12 +7910,9 @@ dependencies = [ [[package]] name = "signature" -version = "2.0.0" +version = "1.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fe458c98333f9c8152221191a77e2a44e8325d0193484af2e9421a53019e57d" -dependencies = [ - "digest", -] +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" [[package]] name = "simd-abstraction" @@ -8022,7 +8033,7 @@ checksum = "990079665f075b699031e9c08fd3ab99be5029b96f3b78dc0709e8f77e4efebf" dependencies = [ "heck 0.4.1", "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "syn 1.0.109", ] @@ -8069,11 +8080,10 @@ dependencies = [ [[package]] name = "spki" -version = "0.7.2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" +checksum = "5c01a0c15da1b0b0e1494112e7af814a678fec9bd157881b49beac661e9b6f32" dependencies = [ - "base64ct", "der", ] @@ -8173,7 +8183,7 @@ dependencies = [ "heck 0.3.3", "proc-macro-error", "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "syn 1.0.109", ] @@ -8194,9 +8204,9 @@ checksum = "6069ca09d878a33f883cc06aaa9718ede171841d3832450354410b718b097232" dependencies = [ "heck 0.4.1", "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "rustversion", - "syn 2.0.29", + "syn 2.0.28", ] [[package]] @@ -8233,18 +8243,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "unicode-ident", ] [[package]] name = "syn" -version = "2.0.29" +version = "2.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" +checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "unicode-ident", ] @@ -8254,6 +8264,18 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20518fe4a4c9acf048008599e464deb21beeae3d3578418951a189c235a7a9a8" +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.32", + "syn 1.0.109", + "unicode-xid 0.2.4", +] + [[package]] name = "syslog" version = "6.1.0" @@ -8389,22 +8411,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.47" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97a802ec30afc17eee47b2855fc72e0c4cd62be9b4efe6591edde0ec5bd68d8f" +checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.47" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bb623b56e39ab7dcd4b1b98bb6c8f8d907ed255b18de254088016b27a8ee19b" +checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.33", - "syn 2.0.29", + "quote 1.0.32", + "syn 2.0.28", ] [[package]] @@ -8439,10 +8461,11 @@ dependencies = [ [[package]] name = "time" -version = "0.3.23" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59e399c068f43a5d116fedaf73b203fa4f9c519f17e2b34f63221d3792f81446" +checksum = "b0fdd63d58b18d663fbdf70e049f00a22c8e42be082203be7f26589213cd75ea" dependencies = [ + "deranged", "itoa", "libc", "num_threads", @@ -8459,9 +8482,9 @@ checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "time-macros" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96ba15a897f3c86766b757e5ac7221554c6750054d74d5b28844fce5fb36a6c4" +checksum = "eb71511c991639bb078fd5bf97757e03914361c48100d52878b8e52b46fb92cd" dependencies = [ "time-core", ] @@ -8548,8 +8571,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.33", - "syn 2.0.29", + "quote 1.0.32", + "syn 2.0.28", ] [[package]] @@ -8782,7 +8805,7 @@ dependencies = [ "prettyplease", "proc-macro2 1.0.66", "prost-build", - "quote 1.0.33", + "quote 1.0.32", "syn 1.0.109", ] @@ -8886,7 +8909,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "syn 1.0.109", ] @@ -9144,7 +9167,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89851716b67b937e393b3daa8423e67ddfc4bbbf1654bcf05488e95e0828db0c" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "syn 1.0.109", ] @@ -9155,7 +9178,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64cba322cb9b7bc6ca048de49e83918223f35e7a86311267013afff257004870" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "syn 1.0.109", ] @@ -9185,8 +9208,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfc13d450dc4a695200da3074dacf43d449b968baee95e341920e47f61a3b40f" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.33", - "syn 2.0.29", + "quote 1.0.32", + "syn 2.0.28", ] [[package]] @@ -9400,7 +9423,7 @@ dependencies = [ "serde", "serde_json", "serde_yaml 0.9.25", - "sha2", + "sha2 0.10.7", "tempfile", "toml 0.7.6", ] @@ -9557,7 +9580,7 @@ dependencies = [ "serde_json", "serde_with 3.3.0", "serde_yaml 0.9.25", - "sha2", + "sha2 0.10.7", "similar-asserts", "smallvec", "smpl_jwt", @@ -9741,10 +9764,10 @@ dependencies = [ "darling 0.20.3", "once_cell", "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "serde", "serde_json", - "syn 2.0.29", + "syn 2.0.28", "tracing 0.1.37", ] @@ -9754,10 +9777,10 @@ version = "0.1.0" dependencies = [ "darling 0.20.3", "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "serde", "serde_derive_internals", - "syn 2.0.29", + "syn 2.0.28", "vector-config", "vector-config-common", ] @@ -9982,7 +10005,7 @@ dependencies = [ "serde", "serde_json", "sha-1", - "sha2", + "sha2 0.10.7", "sha3", "snafu", "strip-ansi-escapes 0.1.1", @@ -10027,7 +10050,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d257817081c7dffcdbab24b9e62d2def62e2ff7d00b1c20062551e6cccc145ff" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", ] [[package]] @@ -10128,8 +10151,8 @@ dependencies = [ "log", "once_cell", "proc-macro2 1.0.66", - "quote 1.0.33", - "syn 2.0.29", + "quote 1.0.32", + "syn 2.0.28", "wasm-bindgen-shared", ] @@ -10151,7 +10174,7 @@ version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ - "quote 1.0.33", + "quote 1.0.32", "wasm-bindgen-macro-support", ] @@ -10162,8 +10185,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.33", - "syn 2.0.29", + "quote 1.0.32", + "syn 2.0.28", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -10567,7 +10590,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6505e6815af7de1746a08f69c69606bb45695a17149517680f3b2149713b19a3" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.33", + "quote 1.0.32", "syn 1.0.109", ] @@ -10576,6 +10599,21 @@ name = "zeroize" version = "1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.32", + "syn 1.0.109", + "synstructure", +] [[package]] name = "zstd" diff --git a/Cargo.toml b/Cargo.toml index 17a62c31a20d42..564c90120b87bf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,6 +35,11 @@ path = "src/config/loading/secret_backend_example.rs" test = false bench = false +# Debug symbols end up chewing up several GB of disk space, so better to just +# disable them. +[profile.dev] +debug = false + # CI-based builds use full release optimization. See scripts/environment/release-flags.sh. # This results in roughly a 5% reduction in performance when compiling locally vs when # compiled via the CI pipeline. @@ -696,7 +701,7 @@ sinks-datadog_events = [] sinks-datadog_logs = [] sinks-datadog_metrics = ["protobuf-build", "dep:prost-reflect"] sinks-datadog_traces = ["protobuf-build", "dep:rmpv", "dep:rmp-serde", "dep:serde_bytes"] -sinks-elasticsearch = ["aws-core", "transforms-metric_to_log"] +sinks-elasticsearch = ["transforms-metric_to_log"] sinks-file = ["dep:async-compression"] sinks-gcp = ["dep:base64", "gcp"] sinks-greptimedb = ["dep:greptimedb-client"] @@ -711,7 +716,7 @@ sinks-nats = ["dep:async-nats", "dep:nkeys"] sinks-new_relic_logs = ["sinks-http"] sinks-new_relic = [] sinks-papertrail = ["dep:syslog"] -sinks-prometheus = ["aws-core", "dep:base64", "dep:prometheus-parser", "dep:snap"] +sinks-prometheus = ["dep:base64", "dep:prometheus-parser", "dep:snap"] sinks-pulsar = ["dep:apache-avro", "dep:pulsar", "dep:lru"] sinks-redis = ["dep:redis"] sinks-sematext = ["sinks-elasticsearch", "sinks-influxdb"] @@ -818,7 +823,7 @@ datadog-logs-integration-tests = ["sinks-datadog_logs"] datadog-metrics-integration-tests = ["sinks-datadog_metrics"] datadog-traces-integration-tests = ["sources-datadog_agent", "sinks-datadog_traces", "axum/tokio"] docker-logs-integration-tests = ["sources-docker_logs", "unix"] -es-integration-tests = ["sinks-elasticsearch"] +es-integration-tests = ["sinks-elasticsearch", "aws-core"] eventstoredb_metrics-integration-tests = ["sources-eventstoredb_metrics"] fluent-integration-tests = ["docker", "sources-fluent"] gcp-cloud-storage-integration-tests = ["sinks-gcp"] diff --git a/src/sinks/axiom.rs b/src/sinks/axiom.rs index 54fa54025430a5..e3213f3ea04edc 100644 --- a/src/sinks/axiom.rs +++ b/src/sinks/axiom.rs @@ -6,7 +6,7 @@ use vector_config::configurable_component; use crate::{ config::{AcknowledgementsConfig, DataType, GenerateConfig, Input, SinkConfig, SinkContext}, sinks::{ - elasticsearch::{ElasticsearchApiVersion, ElasticsearchAuth, ElasticsearchConfig}, + elasticsearch::{ElasticsearchApiVersion, ElasticsearchAuthConfig, ElasticsearchConfig}, util::{http::RequestConfig, Compression}, Healthcheck, VectorSink, }, @@ -95,7 +95,7 @@ impl SinkConfig for AxiomConfig { let elasticsearch_config = ElasticsearchConfig { endpoints: vec![self.build_endpoint()], compression: self.compression, - auth: Some(ElasticsearchAuth::Basic { + auth: Some(ElasticsearchAuthConfig::Basic { user: "axiom".to_string(), password: self.token.clone(), }), diff --git a/src/sinks/elasticsearch/common.rs b/src/sinks/elasticsearch/common.rs index d6bd3881e01d26..c03bcd49dfc662 100644 --- a/src/sinks/elasticsearch/common.rs +++ b/src/sinks/elasticsearch/common.rs @@ -1,6 +1,8 @@ use std::collections::HashMap; +#[cfg(feature = "aws-core")] use aws_credential_types::provider::SharedCredentialsProvider; +#[cfg(feature = "aws-core")] use aws_types::region::Region; use bytes::{Buf, Bytes}; use http::{Response, StatusCode, Uri}; @@ -15,11 +17,12 @@ use super::{ InvalidHostSnafu, Request, }; use crate::{ - http::{Auth, HttpClient, MaybeAuth}, + http::{HttpClient, MaybeAuth}, sinks::{ elasticsearch::{ - ElasticsearchAuth, ElasticsearchCommonMode, ElasticsearchConfig, ParseError, + ElasticsearchAuthConfig, ElasticsearchCommonMode, ElasticsearchConfig, ParseError, }, + util::auth::Auth, util::{http::RequestConfig, TowerRequestConfig, UriSerde}, HealthcheckError, }, @@ -31,12 +34,10 @@ use crate::{ pub struct ElasticsearchCommon { pub base_url: String, pub bulk_uri: Uri, - pub http_auth: Option, - pub aws_auth: Option, + pub auth: Option, pub mode: ElasticsearchCommonMode, pub request_builder: ElasticsearchRequestBuilder, pub tls_settings: TlsSettings, - pub region: Option, pub request: RequestConfig, pub query_params: HashMap, pub metric_to_log: MetricToLog, @@ -61,31 +62,35 @@ impl ElasticsearchCommon { .into()); } - let authorization = match &config.auth { - Some(ElasticsearchAuth::Basic { user, password }) => Some(Auth::Basic { - user: user.clone(), - password: password.clone(), - }), - _ => None, - }; let uri = endpoint.parse::()?; - let http_auth = authorization.choose_one(&uri.auth)?; - let base_url = uri.uri.to_string().trim_end_matches('/').to_owned(); - - let aws_auth = match &config.auth { - Some(ElasticsearchAuth::Basic { .. }) | None => None, - Some(ElasticsearchAuth::Aws(aws)) => { + let auth = match &config.auth { + Some(ElasticsearchAuthConfig::Basic { user, password }) => { + let auth = Some(crate::http::Auth::Basic { + user: user.clone(), + password: password.clone(), + }); + // basic auth must be some for now + let auth = auth.choose_one(&uri.auth)?.unwrap(); + Some(Auth::Basic(auth)) + } + #[cfg(feature = "aws-core")] + Some(ElasticsearchAuthConfig::Aws(aws)) => { let region = config .aws .as_ref() .map(|config| config.region()) .ok_or(ParseError::RegionRequired)? .ok_or(ParseError::RegionRequired)?; - - Some(aws.credentials_provider(region).await?) + Some(Auth::Aws { + provider: aws.credentials_provider(region.clone()).await?, + region, + }) } + None => None, }; + let base_url = uri.uri.to_string().trim_end_matches('/').to_owned(); + let mode = config.common_mode()?; let tower_request = config @@ -126,8 +131,6 @@ impl ElasticsearchCommon { metric_config.metric_tag_values, ); - let region = config.aws.as_ref().and_then(|config| config.region()); - let version = if let Some(version) = *version { version } else { @@ -136,16 +139,7 @@ impl ElasticsearchCommon { ElasticsearchApiVersion::V7 => 7, ElasticsearchApiVersion::V8 => 8, ElasticsearchApiVersion::Auto => { - match get_version( - &base_url, - &http_auth, - &aws_auth, - ®ion, - &request, - &tls_settings, - proxy_config, - ) - .await + match get_version(&base_url, &auth, &request, &tls_settings, proxy_config).await { Ok(version) => { debug!(message = "Auto-detected Elasticsearch API version.", %version); @@ -195,15 +189,13 @@ impl ElasticsearchCommon { }; Ok(Self { - http_auth, + auth, base_url, bulk_uri, - aws_auth, mode, request_builder, query_params, request, - region, tls_settings, metric_to_log, }) @@ -248,9 +240,7 @@ impl ElasticsearchCommon { pub async fn healthcheck(self, client: HttpClient) -> crate::Result<()> { match get( &self.base_url, - &self.http_auth, - &self.aws_auth, - &self.region, + &self.auth, &self.request, client, "/_cluster/health", @@ -264,6 +254,7 @@ impl ElasticsearchCommon { } } +#[cfg(feature = "aws-core")] pub async fn sign_request( request: &mut http::Request, credentials_provider: &SharedCredentialsProvider, @@ -274,9 +265,7 @@ pub async fn sign_request( async fn get_version( base_url: &str, - http_auth: &Option, - aws_auth: &Option, - region: &Option, + auth: &Option, request: &RequestConfig, tls_settings: &TlsSettings, proxy_config: &ProxyConfig, @@ -291,7 +280,7 @@ async fn get_version( } let client = HttpClient::new(tls_settings.clone(), proxy_config)?; - let response = get(base_url, http_auth, aws_auth, region, request, client, "/") + let response = get(base_url, auth, request, client, "/") .await .map_err(|error| format!("Failed to get Elasticsearch API version: {}", error))?; @@ -314,28 +303,31 @@ async fn get_version( async fn get( base_url: &str, - http_auth: &Option, - aws_auth: &Option, - region: &Option, + auth: &Option, request: &RequestConfig, client: HttpClient, path: &str, ) -> crate::Result> { let mut builder = Request::get(format!("{}{}", base_url, path)); - if let Some(authorization) = &http_auth { - builder = authorization.apply_builder(builder); - } - for (header, value) in &request.headers { builder = builder.header(&header[..], &value[..]); } - let mut request = builder.body(Bytes::new())?; - if let Some(credentials_provider) = aws_auth { - sign_request(&mut request, credentials_provider, region).await?; + if let Some(auth) = auth { + match auth { + Auth::Basic(http_auth) => { + http_auth.apply(&mut request); + } + #[cfg(feature = "aws-core")] + Auth::Aws { provider, region } => { + let region = region.clone(); + sign_request(&mut request, provider, &Some(region)).await?; + } + } } + client .send(request.map(hyper::Body::from)) .await diff --git a/src/sinks/elasticsearch/config.rs b/src/sinks/elasticsearch/config.rs index 2295555dc8c728..c50d7702d0b2b9 100644 --- a/src/sinks/elasticsearch/config.rs +++ b/src/sinks/elasticsearch/config.rs @@ -6,8 +6,9 @@ use std::{ use futures::{FutureExt, TryFutureExt}; use vector_config::configurable_component; +#[cfg(feature = "aws-core")] +use crate::aws::RegionOrEndpoint; use crate::{ - aws::RegionOrEndpoint, codecs::Transformer, config::{AcknowledgementsConfig, DataType, Input, SinkConfig, SinkContext}, event::{EventRef, LogEvent, Value}, @@ -19,7 +20,7 @@ use crate::{ retry::ElasticsearchRetryLogic, service::{ElasticsearchService, HttpRequestBuilder}, sink::ElasticsearchSink, - ElasticsearchApiVersion, ElasticsearchAuth, ElasticsearchCommon, + ElasticsearchApiVersion, ElasticsearchAuthConfig, ElasticsearchCommon, ElasticsearchCommonMode, ElasticsearchMode, }, util::{ @@ -142,7 +143,7 @@ pub struct ElasticsearchConfig { pub request: RequestConfig, #[configurable(derived)] - pub auth: Option, + pub auth: Option, /// Custom parameters to add to the query string for each HTTP request sent to Elasticsearch. #[serde(default)] @@ -153,6 +154,7 @@ pub struct ElasticsearchConfig { #[serde(default)] #[configurable(derived)] + #[cfg(feature = "aws-core")] pub aws: Option, #[serde(default)] @@ -215,6 +217,7 @@ impl Default for ElasticsearchConfig { request: Default::default(), auth: None, query: None, + #[cfg(feature = "aws-core")] aws: None, tls: None, endpoint_health: None, diff --git a/src/sinks/elasticsearch/mod.rs b/src/sinks/elasticsearch/mod.rs index 47e0f8869e807f..d44435fb318ec5 100644 --- a/src/sinks/elasticsearch/mod.rs +++ b/src/sinks/elasticsearch/mod.rs @@ -24,6 +24,7 @@ use snafu::Snafu; use vector_common::sensitive_string::SensitiveString; use vector_config::configurable_component; +#[cfg(feature = "aws-core")] use crate::aws::AwsAuthentication; use crate::{ event::{EventRef, LogEvent}, @@ -36,7 +37,7 @@ use crate::{ #[derive(Clone, Debug)] #[serde(deny_unknown_fields, rename_all = "snake_case", tag = "strategy")] #[configurable(metadata(docs::enum_tag_description = "The authentication strategy to use."))] -pub enum ElasticsearchAuth { +pub enum ElasticsearchAuthConfig { /// HTTP Basic Authentication. Basic { /// Basic authentication username. @@ -50,6 +51,7 @@ pub enum ElasticsearchAuth { password: SensitiveString, }, + #[cfg(feature = "aws-core")] /// Amazon OpenSearch Service-specific authentication. Aws(AwsAuthentication), } @@ -210,6 +212,7 @@ pub enum ParseError { IndexTemplate { source: TemplateParseError }, #[snafu(display("Batch action template parse error: {}", source))] BatchActionTemplate { source: TemplateParseError }, + #[cfg(feature = "aws-core")] #[snafu(display("aws.region required when AWS authentication is in use"))] RegionRequired, #[snafu(display("Endpoints option must be specified"))] diff --git a/src/sinks/elasticsearch/service.rs b/src/sinks/elasticsearch/service.rs index 4e68218cc95bca..04e5260d5ba31e 100644 --- a/src/sinks/elasticsearch/service.rs +++ b/src/sinks/elasticsearch/service.rs @@ -4,8 +4,6 @@ use std::{ task::{Context, Poll}, }; -use aws_credential_types::provider::SharedCredentialsProvider; -use aws_types::region::Region; use bytes::Bytes; use futures::future::BoxFuture; use http::{Response, Uri}; @@ -17,11 +15,13 @@ use vector_common::{ }; use vector_core::{stream::DriverResponse, ByteSizeOf}; +#[cfg(feature = "aws-core")] use crate::sinks::elasticsearch::sign_request; use crate::{ event::{EventFinalizers, EventStatus, Finalizable}, - http::{Auth, HttpClient}, + http::HttpClient, sinks::util::{ + auth::Auth, http::{HttpBatchService, RequestConfig}, Compression, ElementCount, }, @@ -96,11 +96,9 @@ impl ElasticsearchService { pub struct HttpRequestBuilder { pub bulk_uri: Uri, pub query_params: HashMap, - pub region: Option, + pub auth: Option, pub compression: Compression, pub http_request_config: RequestConfig, - pub http_auth: Option, - pub credentials_provider: Option, } impl HttpRequestBuilder { @@ -108,11 +106,9 @@ impl HttpRequestBuilder { HttpRequestBuilder { bulk_uri: common.bulk_uri.clone(), http_request_config: config.request.clone(), - http_auth: common.http_auth.clone(), + auth: common.auth.clone(), query_params: common.query_params.clone(), - region: common.region.clone(), compression: config.compression, - credentials_provider: common.aws_auth.clone(), } } @@ -136,16 +132,19 @@ impl HttpRequestBuilder { builder = builder.header(&header[..], &value[..]); } - if let Some(auth) = &self.http_auth { - builder = auth.apply_builder(builder); - } - let mut request = builder .body(es_req.payload) .expect("Invalid http request value used"); - if let Some(credentials_provider) = &self.credentials_provider { - sign_request(&mut request, credentials_provider, &self.region).await?; + if let Some(auth) = &self.auth { + match auth { + Auth::Basic(auth) => { + auth.apply(&mut request); + } + Auth::Aws { provider, region } => { + sign_request(&mut request, provider, &Some(region.clone())).await?; + } + } } Ok(request) diff --git a/src/sinks/prometheus/mod.rs b/src/sinks/prometheus/mod.rs index dd0033c46c1b68..c092732b46d538 100644 --- a/src/sinks/prometheus/mod.rs +++ b/src/sinks/prometheus/mod.rs @@ -8,6 +8,7 @@ pub(crate) mod remote_write; use vector_config::configurable_component; +#[cfg(feature = "aws-core")] use crate::aws::AwsAuthentication; /// Authentication strategies. @@ -33,6 +34,7 @@ pub enum PrometheusRemoteWriteAuth { token: SensitiveString, }, + #[cfg(feature = "aws-core")] /// Amazon Prometheus Service-specific authentication. Aws(AwsAuthentication), } diff --git a/src/sinks/prometheus/remote_write.rs b/src/sinks/prometheus/remote_write.rs index a1e9b792fed4de..da86e714262a63 100644 --- a/src/sinks/prometheus/remote_write.rs +++ b/src/sinks/prometheus/remote_write.rs @@ -14,16 +14,18 @@ use vector_config::configurable_component; use vector_core::{ByteSizeOf, EstimatedJsonEncodedSizeOf}; use super::collector::{self, MetricCollector as _}; +#[cfg(feature = "aws-core")] +use crate::aws::RegionOrEndpoint; use crate::{ - aws::RegionOrEndpoint, config::{self, AcknowledgementsConfig, Input, SinkConfig}, event::{Event, Metric}, - http::{Auth, HttpClient}, + http::HttpClient, internal_events::{EndpointBytesSent, TemplateRenderingError}, sinks::{ self, prometheus::PrometheusRemoteWriteAuth, util::{ + auth::Auth, batch::BatchConfig, buffer::metrics::{MetricNormalize, MetricNormalizer, MetricSet, MetricsBuffer}, http::HttpRetryLogic, @@ -48,6 +50,7 @@ impl SinkBatchSettings for PrometheusRemoteWriteDefaultBatchSettings { enum Errors { #[snafu(display(r#"Prometheus remote_write sink cannot accept "set" metrics"#))] SetMetricInvalid, + #[cfg(feature = "aws-core")] #[snafu(display("aws.region required when AWS authentication is in use"))] AwsRegionRequired, } @@ -116,6 +119,7 @@ pub struct RemoteWriteConfig { #[configurable(derived)] pub auth: Option, + #[cfg(feature = "aws-core")] #[configurable(derived)] #[configurable(metadata(docs::advanced))] pub aws: Option, @@ -178,22 +182,19 @@ impl SinkConfig for RemoteWriteConfig { let client = HttpClient::new(tls_settings, cx.proxy())?; let tenant_id = self.tenant_id.clone(); - let (http_auth, credentials_provider, aws_region) = match &self.auth { - Some(PrometheusRemoteWriteAuth::Basic { user, password }) => ( - Some(Auth::Basic { + let auth = match &self.auth { + Some(PrometheusRemoteWriteAuth::Basic { user, password }) => { + Some(Auth::Basic(crate::http::Auth::Basic { user: user.clone(), password: password.clone().into(), - }), - None, - None, - ), - Some(PrometheusRemoteWriteAuth::Bearer { token }) => ( - Some(Auth::Bearer { + })) + } + Some(PrometheusRemoteWriteAuth::Bearer { token }) => { + Some(Auth::Basic(crate::http::Auth::Bearer { token: token.clone(), - }), - None, - None, - ), + })) + } + #[cfg(feature = "aws-core")] Some(PrometheusRemoteWriteAuth::Aws(aws_auth)) => { let region = self .aws @@ -201,21 +202,17 @@ impl SinkConfig for RemoteWriteConfig { .map(|config| config.region()) .ok_or(Errors::AwsRegionRequired)? .ok_or(Errors::AwsRegionRequired)?; - - ( - None, - Some(aws_auth.credentials_provider(region.clone()).await?), - Some(region), - ) + Some(Auth::Aws { + provider: aws_auth.credentials_provider(region.clone()).await?, + region, + }) } - None => (None, None, None), + None => None, }; let http_request_builder = Arc::new(HttpRequestBuilder { endpoint: endpoint.clone(), - aws_region, - credentials_provider, - http_auth, + auth, compression: self.compression, }); @@ -380,9 +377,7 @@ impl Service, PartitionKey>> for RemoteWriteSer pub struct HttpRequestBuilder { pub endpoint: Uri, - pub aws_region: Option, - pub http_auth: Option, - pub credentials_provider: Option, + pub auth: Option, pub compression: Compression, } @@ -407,12 +402,14 @@ impl HttpRequestBuilder { } let mut request = builder.body(body.into()).unwrap(); - if let Some(http_auth) = &self.http_auth { - http_auth.apply(&mut request); - } - - if let Some(credentials_provider) = &self.credentials_provider { - sign_request(&mut request, credentials_provider, &self.aws_region).await?; + if let Some(auth) = &self.auth { + match auth { + Auth::Basic(http_auth) => http_auth.apply(&mut request), + #[cfg(feature = "aws-core")] + Auth::Aws { provider, region } => { + sign_request(&mut request, provider, &Some(region.clone())).await? + } + } } let (parts, body) = request.into_parts(); @@ -440,6 +437,7 @@ fn compress_block(compression: Compression, data: Bytes) -> Vec { } } +#[cfg(feature = "aws-core")] async fn sign_request( request: &mut http::Request, credentials_provider: &SharedCredentialsProvider, diff --git a/src/sinks/util/auth.rs b/src/sinks/util/auth.rs new file mode 100644 index 00000000000000..b10fcd3501ce1e --- /dev/null +++ b/src/sinks/util/auth.rs @@ -0,0 +1,14 @@ +#[cfg(feature = "aws-core")] +use aws_credential_types::provider::SharedCredentialsProvider; +#[cfg(feature = "aws-core")] +use aws_types::region::Region; + +#[derive(Debug, Clone)] +pub enum Auth { + Basic(crate::http::Auth), + #[cfg(feature = "aws-core")] + Aws { + provider: SharedCredentialsProvider, + region: Region, + }, +} diff --git a/src/sinks/util/mod.rs b/src/sinks/util/mod.rs index 4f222063312fd2..33171bfb910602 100644 --- a/src/sinks/util/mod.rs +++ b/src/sinks/util/mod.rs @@ -23,6 +23,7 @@ pub mod udp; pub mod unix; pub mod uri; pub mod zstd; +pub mod auth; use std::borrow::Cow;