diff --git a/.github/actions/spelling/allow.txt b/.github/actions/spelling/allow.txt index e94aea740924b..aa1068f502bac 100644 --- a/.github/actions/spelling/allow.txt +++ b/.github/actions/spelling/allow.txt @@ -425,6 +425,8 @@ userguide webhdfs winapi workarounds +XCHACHA +XSALSA yandex zeek zookeeper diff --git a/Cargo.lock b/Cargo.lock index a01609b042117..6530e45d539d8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -39,6 +39,16 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" +[[package]] +name = "aead" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" +dependencies = [ + "crypto-common", + "generic-array", +] + [[package]] name = "aes" version = "0.8.2" @@ -160,6 +170,21 @@ dependencies = [ "winapi", ] +[[package]] +name = "anstream" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +dependencies = [ + "anstyle 1.0.0", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is-terminal", + "utf8parse", +] + [[package]] name = "anstyle" version = "0.3.1" @@ -172,6 +197,34 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" +[[package]] +name = "anstyle-parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "anstyle-wincon" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +dependencies = [ + "anstyle 1.0.0", + "windows-sys 0.48.0", +] + [[package]] name = "anyhow" version = "1.0.72" @@ -1829,6 +1882,30 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "chacha20" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7fc89c7c5b9e7a02dfe45cd2367bae382f9ed31c61ca8debe5f827c420a2f08" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "chacha20poly1305" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" +dependencies = [ + "aead", + "chacha20", + "cipher", + "poly1305", + "zeroize", +] + [[package]] name = "charset" version = "0.1.3" @@ -1924,6 +2001,7 @@ checksum = "d1873270f8f7942c191139cb8a40fd228da6c3fd2fc376d7e92d47aa14aeb59e" dependencies = [ "crypto-common", "inout", + "zeroize", ] [[package]] @@ -1943,9 +2021,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.1.14" +version = "4.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "906f7fe1da4185b7a282b2bc90172a496f9def1aca4545fe7526810741591e14" +checksum = "5fd304a20bff958a57f04c4e96a2e7594cc4490a0e809cbd48bb6437edaa452d" dependencies = [ "clap_builder", "clap_derive", @@ -1958,21 +2036,20 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1eef05769009513df2eb1c3b4613e7fad873a14c600ff025b08f250f59fee7de" dependencies = [ - "clap 4.1.14", + "clap 4.3.19", "log", ] [[package]] name = "clap_builder" -version = "4.1.14" +version = "4.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "351f9ad9688141ed83dfd8f5fb998a06225ef444b48ff4dc43de6d409b7fd10b" +checksum = "01c6a3f08f1fe5662a35cfe393aec09c4df95f60ee93b7556505260f75eee9e1" dependencies = [ - "bitflags 1.3.2", + "anstream", + "anstyle 1.0.0", "clap_lex", - "is-terminal", "strsim 0.10.0", - "termcolor", "terminal_size 0.2.2", ] @@ -1982,14 +2059,14 @@ version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5fc443334c81a804575546c5a8a79b4913b50e28d69232903604cada1de817ce" dependencies = [ - "clap 4.1.14", + "clap 4.3.19", ] [[package]] name = "clap_derive" -version = "4.1.14" +version = "4.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81d7dc0031c3a59a04fc2ba395c8e2dd463cba1859275f065d225f6122221b45" +checksum = "54a9bb5758fc5dfe728d1019941681eccaf0cf8a4189b692a0ee2f2ecf90a050" dependencies = [ "heck 0.4.1", "proc-macro2 1.0.66", @@ -1999,9 +2076,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1" +checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" [[package]] name = "clipboard-win" @@ -2046,7 +2123,7 @@ dependencies = [ "similar-asserts", "smallvec", "snafu", - "syslog_loose 0.19.0", + "syslog_loose", "tokio", "tokio-util", "tracing 0.1.37", @@ -2069,6 +2146,12 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + [[package]] name = "colored" version = "2.0.4" @@ -2281,7 +2364,7 @@ dependencies = [ "anes", "cast", "ciborium", - "clap 4.1.14", + "clap 4.3.19", "criterion-plot", "futures 0.3.28", "is-terminal", @@ -2418,9 +2501,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array", + "rand_core 0.6.4", "typenum", ] +[[package]] +name = "crypto_secretbox" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d6cf87adf719ddf43a805e92c6870a531aedda35ff640442cbaf8674e141e1" +dependencies = [ + "aead", + "cipher", + "generic-array", + "poly1305", + "salsa20", + "subtle", + "zeroize", +] + [[package]] name = "csv" version = "1.2.2" @@ -3473,12 +3572,13 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.6" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] @@ -5962,9 +6062,9 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pest" -version = "2.5.6" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cbd939b234e95d72bc393d51788aec68aeeb5d51e748ca08ff3aad58cb722f7" +checksum = "1acb4a4365a13f749a93f1a094a7805e5cfa0955373a9de860d962eaa3a5fe5a" dependencies = [ "thiserror", "ucd-trie", @@ -5972,9 +6072,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.5.6" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a81186863f3d0a27340815be8f2078dd8050b14cd71913db9fbda795e5f707d7" +checksum = "666d00490d4ac815001da55838c500eafb0320019bbaa44444137c48b443a853" dependencies = [ "pest", "pest_generator", @@ -5982,22 +6082,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.5.6" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75a1ef20bf3193c15ac345acb32e26b3dc3223aff4d77ae4fc5359567683796b" +checksum = "68ca01446f50dbda87c1786af8770d535423fa8a53aec03b8f4e3d7eb10e0929" dependencies = [ "pest", "pest_meta", "proc-macro2 1.0.66", "quote 1.0.32", - "syn 1.0.109", + "syn 2.0.28", ] [[package]] name = "pest_meta" -version = "2.5.6" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e3b284b1f13a20dc5ebc90aff59a51b8d7137c221131b52a7260c08cbc1cc80" +checksum = "56af0a30af74d0445c0bf6d9d051c979b516a1a5af790d251daee76005420a48" dependencies = [ "once_cell", "pest", @@ -6171,6 +6271,17 @@ dependencies = [ "windows-sys 0.42.0", ] +[[package]] +name = "poly1305" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" +dependencies = [ + "cpufeatures", + "opaque-debug", + "universal-hash", +] + [[package]] name = "portable-atomic" version = "1.3.1" @@ -7326,6 +7437,15 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +[[package]] +name = "salsa20" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213" +dependencies = [ + "cipher", +] + [[package]] name = "same-file" version = "1.0.6" @@ -8201,16 +8321,6 @@ dependencies = [ "time", ] -[[package]] -name = "syslog_loose" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fb75f176928530867b2a659e470f9c9ff71904695bab6556f7ad30f9039efd" -dependencies = [ - "chrono", - "nom", -] - [[package]] name = "syslog_loose" version = "0.19.0" @@ -9147,9 +9257,9 @@ dependencies = [ [[package]] name = "uaparser" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d705ae455d32248d299de9af5316a79ce9dc502c0b533aaeaf5f1c2fc02cc5" +checksum = "cf694e7b0434d4fad6c879e984e8fdc3a62f5533c3d421762244f9e9d03f6927" dependencies = [ "derive_more", "lazy_static", @@ -9225,6 +9335,16 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +[[package]] +name = "universal-hash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" +dependencies = [ + "crypto-common", + "subtle", +] + [[package]] name = "unreachable" version = "1.0.0" @@ -9289,9 +9409,9 @@ checksum = "5190c9442dcdaf0ddd50f37420417d219ae5261bbf5db120d0f9bab996c9cba1" [[package]] name = "utf8parse" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936e4b492acfd135421d8dca4b1aa80a7bfc26e702ef3af710e0752684df5372" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" @@ -9325,7 +9445,7 @@ dependencies = [ "atty", "cached", "chrono", - "clap 4.1.14", + "clap 4.3.19", "clap-verbosity-flag", "clap_complete", "confy", @@ -9400,7 +9520,7 @@ dependencies = [ "bytesize", "chrono", "cidr-utils", - "clap 4.1.14", + "clap 4.3.19", "codecs", "colored", "console-subscriber", @@ -9560,7 +9680,7 @@ dependencies = [ "anyhow", "async-trait", "chrono", - "clap 4.1.14", + "clap 4.3.19", "futures 0.3.28", "graphql_client", "indoc", @@ -9583,7 +9703,7 @@ dependencies = [ "async-trait", "bytecheck", "bytes 1.4.0", - "clap 4.1.14", + "clap 4.3.19", "crc32fast", "criterion", "crossbeam-queue", @@ -9801,7 +9921,7 @@ dependencies = [ name = "vector-vrl-cli" version = "0.1.0" dependencies = [ - "clap 4.1.14", + "clap 4.3.19", "vector-vrl-functions", "vrl", ] @@ -9820,7 +9940,7 @@ dependencies = [ "ansi_term", "chrono", "chrono-tz", - "clap 4.1.14", + "clap 4.3.19", "enrichment", "glob", "prettydiff", @@ -9861,9 +9981,9 @@ checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" [[package]] name = "vrl" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee149a42aa313d18cf7a7e6b54e06df03b4a0e6e5dd42a2b8b6d5eeb98d582c1" +checksum = "bf1c43c0a6834959dd38eb762b462d156df043f3dfd86550ff62a96bd572466c" dependencies = [ "aes", "ansi_term", @@ -9875,12 +9995,14 @@ dependencies = [ "cbc", "cfb-mode", "cfg-if", + "chacha20poly1305", "charset", "chrono", "chrono-tz", "cidr-utils", - "clap 4.1.14", + "clap 4.3.19", "codespan-reporting", + "crypto_secretbox", "csv", "ctr", "data-encoding", @@ -9926,7 +10048,7 @@ dependencies = [ "sha3", "snafu", "strip-ansi-escapes", - "syslog_loose 0.18.0", + "syslog_loose", "termcolor", "thiserror", "tracing 0.1.37", diff --git a/Cargo.toml b/Cargo.toml index a0a130b577334..4a048caef7d94 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -118,7 +118,7 @@ members = [ ] [workspace.dependencies] -vrl = { version = "0.5.0", features = ["cli", "test", "test_framework", "arbitrary"] } +vrl = { version = "0.6.0", features = ["cli", "test", "test_framework", "arbitrary"] } [dependencies] vrl.workspace = true diff --git a/LICENSE-3rdparty.csv b/LICENSE-3rdparty.csv index 7489d175b1fca..8c11eae6a04f2 100644 --- a/LICENSE-3rdparty.csv +++ b/LICENSE-3rdparty.csv @@ -4,6 +4,7 @@ RustyXML,https://github.com/Florob/RustyXML,MIT OR Apache-2.0,Florian Zeitz adler32,https://github.com/remram44/adler32-rs,Zlib,Remi Rampin +aead,https://github.com/RustCrypto/traits,MIT OR Apache-2.0,RustCrypto Developers aes,https://github.com/RustCrypto/block-ciphers,MIT OR Apache-2.0,RustCrypto Developers ahash,https://github.com/tkaitchuck/ahash,MIT OR Apache-2.0,Tom Kaitchuck aho-corasick,https://github.com/BurntSushi/aho-corasick,Unlicense OR MIT,Andrew Gallant @@ -11,6 +12,11 @@ amq-protocol,https://github.com/amqp-rs/amq-protocol,BSD-2-Clause,Marc-Antoine P android-tzdata,https://github.com/RumovZ/android-tzdata,MIT OR Apache-2.0,RumovZ android_system_properties,https://github.com/nical/android_system_properties,MIT OR Apache-2.0,Nicolas Silva ansi_term,https://github.com/ogham/rust-ansi-term,MIT,"ogham@bsago.me, Ryan Scheel (Havvy) , Josh Triplett " +anstream,https://github.com/rust-cli/anstyle,MIT OR Apache-2.0,The anstream Authors +anstyle,https://github.com/rust-cli/anstyle,MIT OR Apache-2.0,The anstyle Authors +anstyle-parse,https://github.com/rust-cli/anstyle,MIT OR Apache-2.0,The anstyle-parse Authors +anstyle-query,https://github.com/rust-cli/anstyle,MIT OR Apache-2.0,The anstyle-query Authors +anstyle-wincon,https://github.com/rust-cli/anstyle,MIT OR Apache-2.0,The anstyle-wincon Authors anyhow,https://github.com/dtolnay/anyhow,MIT OR Apache-2.0,David Tolnay anymap,https://github.com/chris-morgan/anymap,BlueOak-1.0.0 OR MIT OR Apache-2.0,Chris Morgan apache-avro,https://github.com/apache/avro,Apache-2.0,Apache Avro team @@ -108,6 +114,8 @@ cbc,https://github.com/RustCrypto/block-modes,MIT OR Apache-2.0,RustCrypto Devel cesu8,https://github.com/emk/cesu8-rs,Apache-2.0 OR MIT,Eric Kidd cfb-mode,https://github.com/RustCrypto/block-modes,MIT OR Apache-2.0,RustCrypto Developers cfg-if,https://github.com/alexcrichton/cfg-if,MIT OR Apache-2.0,Alex Crichton +chacha20,https://github.com/RustCrypto/stream-ciphers,Apache-2.0 OR MIT,RustCrypto Developers +chacha20poly1305,https://github.com/RustCrypto/AEADs/tree/master/chacha20poly1305,Apache-2.0 OR MIT,RustCrypto Developers charset,https://github.com/hsivonen/charset,MIT OR Apache-2.0,Henri Sivonen chrono,https://github.com/chronotope/chrono,MIT OR Apache-2.0,The chrono Authors chrono-tz,https://github.com/chronotope/chrono-tz,MIT OR Apache-2.0,The chrono-tz Authors @@ -120,6 +128,7 @@ clap_derive,https://github.com/clap-rs/clap/tree/master/clap_derive,MIT OR Apach clap_lex,https://github.com/clap-rs/clap/tree/master/clap_lex,MIT OR Apache-2.0,The clap_lex Authors clipboard-win,https://github.com/DoumanAsh/clipboard-win,BSL-1.0,Douman codespan-reporting,https://github.com/brendanzab/codespan,Apache-2.0,Brendan Zabarauskas +colorchoice,https://github.com/rust-cli/anstyle,MIT OR Apache-2.0,The colorchoice Authors colored,https://github.com/mackwic/colored,MPL-2.0,Thomas Wickham combine,https://github.com/Marwes/combine,MIT,Markus Westerlind concurrent-queue,https://github.com/smol-rs/concurrent-queue,Apache-2.0 OR MIT,Stjepan Glavina @@ -141,6 +150,7 @@ crossbeam-utils,https://github.com/crossbeam-rs/crossbeam,MIT OR Apache-2.0,The crossterm,https://github.com/crossterm-rs/crossterm,MIT,T. Post crossterm_winapi,https://github.com/crossterm-rs/crossterm-winapi,MIT,T. Post crypto-common,https://github.com/RustCrypto/traits,MIT OR Apache-2.0,RustCrypto Developers +crypto_secretbox,https://github.com/RustCrypto/nacl-compat/tree/master/crypto_secretbox,Apache-2.0 OR MIT,RustCrypto Developers csv,https://github.com/BurntSushi/rust-csv,Unlicense OR MIT,Andrew Gallant ctor,https://github.com/mmastrac/rust-ctor,Apache-2.0 OR MIT,Matt Mastracci ctr,https://github.com/RustCrypto/block-modes,MIT OR Apache-2.0,RustCrypto Developers @@ -383,6 +393,7 @@ pinky-swear,https://github.com/amqp-rs/pinky-swear,BSD-2-Clause,Marc-Antoine Per pkcs8,https://github.com/RustCrypto/formats/tree/master/pkcs8,Apache-2.0 OR MIT,RustCrypto Developers platforms,https://github.com/RustSec/platforms-crate,Apache-2.0 OR MIT,Tony Arcieri polling,https://github.com/smol-rs/polling,Apache-2.0 OR MIT,Stjepan Glavina +poly1305,https://github.com/RustCrypto/universal-hashes,Apache-2.0 OR MIT,RustCrypto Developers portable-atomic,https://github.com/taiki-e/portable-atomic,Apache-2.0 OR MIT,The portable-atomic Authors postgres-openssl,https://github.com/sfackler/rust-postgres,MIT OR Apache-2.0,Steven Fackler postgres-protocol,https://github.com/sfackler/rust-postgres,MIT OR Apache-2.0,Steven Fackler @@ -455,6 +466,7 @@ rustversion,https://github.com/dtolnay/rustversion,MIT OR Apache-2.0,David Tolna rusty-fork,https://github.com/altsysrq/rusty-fork,MIT OR Apache-2.0,Jason Lingle rustyline,https://github.com/kkawakam/rustyline,MIT,Katsu Kawakami ryu,https://github.com/dtolnay/ryu,Apache-2.0 OR BSL-1.0,David Tolnay +salsa20,https://github.com/RustCrypto/stream-ciphers,MIT OR Apache-2.0,RustCrypto Developers same-file,https://github.com/BurntSushi/same-file,Unlicense OR MIT,Andrew Gallant sasl2-sys,https://github.com/MaterializeInc/rust-sasl,Apache-2.0,"Materialize, Inc." scan_fmt,https://github.com/wlentz/scan_fmt,MIT,wlentz @@ -579,6 +591,7 @@ unicode-normalization,https://github.com/unicode-rs/unicode-normalization,MIT OR unicode-segmentation,https://github.com/unicode-rs/unicode-segmentation,MIT OR Apache-2.0,"kwantam , Manish Goregaokar " unicode-width,https://github.com/unicode-rs/unicode-width,MIT OR Apache-2.0,"kwantam , Manish Goregaokar " unicode-xid,https://github.com/unicode-rs/unicode-xid,MIT OR Apache-2.0,"erick.tryzelaar , kwantam , Manish Goregaokar " +universal-hash,https://github.com/RustCrypto/traits,MIT OR Apache-2.0,RustCrypto Developers unreachable,https://github.com/reem/rust-unreachable,MIT OR Apache-2.0,Jonathan Reem unsafe-libyaml,https://github.com/dtolnay/unsafe-libyaml,MIT,David Tolnay untrusted,https://github.com/briansmith/untrusted,ISC,Brian Smith @@ -587,7 +600,6 @@ url,https://github.com/servo/rust-url,MIT OR Apache-2.0,The rust-url developers urlencoding,https://github.com/kornelski/rust_urlencoding,MIT,"Kornel , Bertram Truong " utf-8,https://github.com/SimonSapin/rust-utf8,MIT OR Apache-2.0,Simon Sapin utf8-width,https://github.com/magiclen/utf8-width,MIT,Magic Len -utf8parse,https://github.com/jwilm/vte,Apache-2.0 OR MIT,"Joe Wilm , Christian Duerr " uuid,https://github.com/uuid-rs/uuid,Apache-2.0 OR MIT,"Ashley Mannix, Christopher Armstrong, Dylan DPC, Hunar Roop Kahlon" valuable,https://github.com/tokio-rs/valuable,MIT,The valuable Authors vec_map,https://github.com/contain-rs/vec-map,MIT OR Apache-2.0,"Alex Crichton , Jorge Aparicio , Alexis Beingessner , Brian Anderson <>, tbu- <>, Manish Goregaokar <>, Aaron Turon , Adolfo Ochagavía <>, Niko Matsakis <>, Steven Fackler <>, Chase Southwood , Eduard Burtescu <>, Florian Wilkens <>, Félix Raimundo <>, Tibor Benke <>, Markus Siemens , Josh Branchaud , Huon Wilson , Corey Farwell , Aaron Liblong <>, Nick Cameron , Patrick Walton , Felix S Klock II <>, Andrew Paseltiner , Sean McArthur , Vadim Petrochenkov <>" diff --git a/lib/codecs/tests/data/native_encoding/schema.cue b/lib/codecs/tests/data/native_encoding/schema.cue index 34c1bec6adc3d..91ddb069b885b 100644 --- a/lib/codecs/tests/data/native_encoding/schema.cue +++ b/lib/codecs/tests/data/native_encoding/schema.cue @@ -5,8 +5,8 @@ #Trace: {...} #Metric: { - name: string - namespace?: string + name: string + namespace?: string tags?: {[string]: #TagValueSet} timestamp?: #Timestamp interval_ms?: int @@ -40,11 +40,11 @@ sum: number avg: number } - } +} } -#TagValueSet: { #TagValue | [...#TagValue] } +#TagValueSet: {#TagValue | [...#TagValue]} -#TagValue: { string | null } +#TagValue: {string | null} #Timestamp: =~"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(.\\d+)?Z" diff --git a/lib/enrichment/src/find_enrichment_table_records.rs b/lib/enrichment/src/find_enrichment_table_records.rs index 3ade47b7c55a6..7086709cd208a 100644 --- a/lib/enrichment/src/find_enrichment_table_records.rs +++ b/lib/enrichment/src/find_enrichment_table_records.rs @@ -1,6 +1,7 @@ use std::collections::BTreeMap; use vrl::prelude::*; +use crate::vrl_util::is_case_sensitive; use crate::{ vrl_util::{self, add_index, evaluate_condition}, Case, Condition, IndexHandle, TableRegistry, TableSearch, @@ -87,7 +88,7 @@ impl Function for FindEnrichmentTableRecords { fn compile( &self, - _state: &TypeState, + state: &TypeState, ctx: &mut FunctionCompileContext, arguments: ArgumentList, ) -> Compiled { @@ -102,7 +103,7 @@ impl Function for FindEnrichmentTableRecords { .collect::>(); let table = arguments - .required_enum("table", &tables)? + .required_enum("table", &tables, state)? .try_bytes_utf8_lossy() .expect("table is not valid utf8") .into_owned(); @@ -110,21 +111,7 @@ impl Function for FindEnrichmentTableRecords { let select = arguments.optional("select"); - let case_sensitive = arguments - .optional_literal("case_sensitive")? - .and_then(|literal| literal.resolve_constant()) - .map(|value| value.try_boolean()) - .transpose() - .expect("case_sensitive should be boolean") // This will have been caught by the type checker. - .map(|case_sensitive| { - if case_sensitive { - Case::Sensitive - } else { - Case::Insensitive - } - }) - .unwrap_or(Case::Sensitive); - + let case_sensitive = is_case_sensitive(&arguments, state)?; let index = Some( add_index(registry, &table, case_sensitive, &condition) .map_err(|err| Box::new(err) as Box<_>)?, diff --git a/lib/enrichment/src/get_enrichment_table_record.rs b/lib/enrichment/src/get_enrichment_table_record.rs index 3678d85e4fea0..a028894d89373 100644 --- a/lib/enrichment/src/get_enrichment_table_record.rs +++ b/lib/enrichment/src/get_enrichment_table_record.rs @@ -1,6 +1,7 @@ use std::collections::BTreeMap; use vrl::prelude::*; +use crate::vrl_util::is_case_sensitive; use crate::{ vrl_util::{self, add_index, evaluate_condition}, Case, Condition, IndexHandle, TableRegistry, TableSearch, @@ -79,7 +80,7 @@ impl Function for GetEnrichmentTableRecord { fn compile( &self, - _state: &TypeState, + state: &TypeState, ctx: &mut FunctionCompileContext, arguments: ArgumentList, ) -> Compiled { @@ -94,7 +95,7 @@ impl Function for GetEnrichmentTableRecord { .collect::>(); let table = arguments - .required_enum("table", &tables)? + .required_enum("table", &tables, state)? .try_bytes_utf8_lossy() .expect("table is not valid utf8") .into_owned(); @@ -102,21 +103,7 @@ impl Function for GetEnrichmentTableRecord { let select = arguments.optional("select"); - let case_sensitive = arguments - .optional_literal("case_sensitive")? - .and_then(|literal| literal.resolve_constant()) - .map(|value| value.try_boolean()) - .transpose() - .expect("case_sensitive should be boolean") // This will have been caught by the type checker. - .map(|case_sensitive| { - if case_sensitive { - Case::Sensitive - } else { - Case::Insensitive - } - }) - .unwrap_or(Case::Sensitive); - + let case_sensitive = is_case_sensitive(&arguments, state)?; let index = Some( add_index(registry, &table, case_sensitive, &condition) .map_err(|err| Box::new(err) as Box<_>)?, diff --git a/lib/enrichment/src/vrl_util.rs b/lib/enrichment/src/vrl_util.rs index f6aaa4dac02ce..ccdebd3cdfbb1 100644 --- a/lib/enrichment/src/vrl_util.rs +++ b/lib/enrichment/src/vrl_util.rs @@ -80,6 +80,26 @@ pub(crate) fn add_index( Ok(index) } +pub(crate) fn is_case_sensitive( + arguments: &ArgumentList, + state: &TypeState, +) -> Result { + Ok(arguments + .optional_literal("case_sensitive", state)? + .map(|value| { + let case_sensitive = value + .as_boolean() + .expect("case_sensitive should be boolean"); // This will have been caught by the type checker. + + if case_sensitive { + Case::Sensitive + } else { + Case::Insensitive + } + }) + .unwrap_or(Case::Sensitive)) +} + #[cfg(test)] mod tests { use std::sync::{Arc, Mutex}; diff --git a/lib/vector-vrl/functions/src/set_semantic_meaning.rs b/lib/vector-vrl/functions/src/set_semantic_meaning.rs index 26e61c1671f59..f1b53065d96ed 100644 --- a/lib/vector-vrl/functions/src/set_semantic_meaning.rs +++ b/lib/vector-vrl/functions/src/set_semantic_meaning.rs @@ -62,8 +62,7 @@ impl Function for SetSemanticMeaning { let query = arguments.required_query("target")?; let meaning = arguments - .required_literal("meaning")? - .to_value() + .required_literal("meaning", state)? .try_bytes_utf8_lossy() .expect("meaning not bytes") .into_owned(); diff --git a/website/cue/reference/remap/concepts/function.cue b/website/cue/reference/remap/concepts/function.cue index 60f026bb336e3..5885b48a2a857 100644 --- a/website/cue/reference/remap/concepts/function.cue +++ b/website/cue/reference/remap/concepts/function.cue @@ -19,5 +19,14 @@ remap: concepts: function: { is a defining characteristic of VRL and a primary source of its safety guarantees. """ } + deprecation: { + title: "Deprecation" + description: """ + VRL functions can be marked as "deprecated". When a function + is deprecated, a warning will be shown at runtime. + + Suggestions on how to update the VRL program can usually be found in the actual warning and the function documentation. + """ + } } } diff --git a/website/cue/reference/remap/expressions/function_call.cue b/website/cue/reference/remap/expressions/function_call.cue index a86a3fcff4e22..2226dd23652f9 100644 --- a/website/cue/reference/remap/expressions/function_call.cue +++ b/website/cue/reference/remap/expressions/function_call.cue @@ -134,6 +134,15 @@ remap: expressions: function_call: { failures. """ } + deprecation: { + title: "Deprecation" + description: """ + VRL functions can be marked as "deprecated". When a function + is deprecated, a warning will be shown at runtime. + + Suggestions on how to update the VRL program can usually be found in the actual warning and the function documentation. + """ + } } examples: [ diff --git a/website/cue/reference/remap/functions.cue b/website/cue/reference/remap/functions.cue index f8fc7df8b4292..151a61e5faabf 100644 --- a/website/cue/reference/remap/functions.cue +++ b/website/cue/reference/remap/functions.cue @@ -24,6 +24,7 @@ remap: { } internal_failure_reasons: [...string] examples?: [remap.#Example, ...remap.#Example] + deprecated: bool | *false } #FunctionCategory: "Array" | "Codec" | "Coerce" | "Convert" | "Debug" | "Enrichment" | "Enumerate" | "Event" | "Path" | "Cryptography" | "IP" | "Number" | "Object" | "Parse" | "Random" | "String" | "System" | "Timestamp" | "Type" diff --git a/website/cue/reference/remap/functions/encrypt.cue b/website/cue/reference/remap/functions/encrypt.cue index c37e68dfd45fc..4d91f4efeb372 100644 --- a/website/cue/reference/remap/functions/encrypt.cue +++ b/website/cue/reference/remap/functions/encrypt.cue @@ -13,9 +13,15 @@ remap: functions: encrypt: { * AES-256-OFB (key = 32 bytes, iv = 16 bytes) * AES-192-OFB (key = 24 bytes, iv = 16 bytes) * AES-128-OFB (key = 16 bytes, iv = 16 bytes) - * AES-256-CTR (key = 32 bytes, iv = 16 bytes) - * AES-192-CTR (key = 24 bytes, iv = 16 bytes) - * AES-128-CTR (key = 16 bytes, iv = 16 bytes) + * Deprecated - AES-256-CTR (key = 32 bytes, iv = 16 bytes) + * Deprecated - AES-192-CTR (key = 24 bytes, iv = 16 bytes) + * Deprecated - AES-128-CTR (key = 16 bytes, iv = 16 bytes) + * AES-256-CTR-LE (key = 32 bytes, iv = 16 bytes) + * AES-192-CTR-LE (key = 24 bytes, iv = 16 bytes) + * AES-128-CTR-LE (key = 16 bytes, iv = 16 bytes) + * AES-256-CTR-BE (key = 32 bytes, iv = 16 bytes) + * AES-192-CTR-BE (key = 24 bytes, iv = 16 bytes) + * AES-128-CTR-BE (key = 16 bytes, iv = 16 bytes) * AES-256-CBC-PKCS7 (key = 32 bytes, iv = 16 bytes) * AES-192-CBC-PKCS7 (key = 24 bytes, iv = 16 bytes) * AES-128-CBC-PKCS7 (key = 16 bytes, iv = 16 bytes) @@ -28,6 +34,9 @@ remap: functions: encrypt: { * AES-256-CBC-ISO10126 (key = 32 bytes, iv = 16 bytes) * AES-192-CBC-ISO10126 (key = 24 bytes, iv = 16 bytes) * AES-128-CBC-ISO10126 (key = 16 bytes, iv = 16 bytes) + * CHACHA20-POLY1305 (key = 32 bytes, iv = 12 bytes) + * XCHACHA20-POLY1305 (key = 32 bytes, iv = 24 bytes) + * XSALSA20-POLY1305 (key = 32 bytes, iv = 24 bytes) """ arguments: [ diff --git a/website/cue/reference/remap/functions/parse_nginx_log.cue b/website/cue/reference/remap/functions/parse_nginx_log.cue index 99f48be898b4d..0fd6c04f1a6f1 100644 --- a/website/cue/reference/remap/functions/parse_nginx_log.cue +++ b/website/cue/reference/remap/functions/parse_nginx_log.cue @@ -60,18 +60,15 @@ remap: functions: parse_nginx_log: { ) """# return: { + agent: "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36" client: "172.17.0.1" - user: "alice" - timestamp: "2021-04-01T12:02:31Z" + compression: "2.75" + referer: "http://localhost/somewhere" request: "POST /not-found HTTP/1.1" - method: "POST" - path: "/not-found" - protocol: "HTTP/1.1" - status: 404 size: 153 - referer: "http://localhost/somewhere" - agent: "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36" - compression: "2.75" + status: 404 + timestamp: "2021-04-01T12:02:31Z" + user: "alice" } }, { diff --git a/website/cue/reference/remap/functions/to_timestamp.cue b/website/cue/reference/remap/functions/to_timestamp.cue index e7329f19a8206..f46e3a37d23b1 100644 --- a/website/cue/reference/remap/functions/to_timestamp.cue +++ b/website/cue/reference/remap/functions/to_timestamp.cue @@ -3,10 +3,14 @@ package metadata remap: functions: to_timestamp: { category: "Coerce" description: """ + This function is deprecated. + For integer values, use `from_unix_timestamp`, otherwise use `parse_timestamp`. Coerces the `value` into a timestamp. """ notices: ["There is the possibility of precision loss due to float arithmetic when coercing floats."] + deprecated: true + arguments: [ { name: "value" @@ -47,35 +51,40 @@ remap: functions: to_timestamp: { source: """ to_timestamp!("2020-10-21T16:00:00Z") """ - return: "2020-10-21T16:00:00Z" + return: "2020-10-21T16:00:00Z" + skip_test: true }, { title: "Coerce a unix timestamp (integer) to a timestamp" source: """ to_timestamp!(1675968923) """ - return: "2023-02-09T18:55:23Z" + return: "2023-02-09T18:55:23Z" + skip_test: true }, { title: "Coerce a unix timestamp (float) to a timestamp" source: """ to_timestamp!(1675968923.567) """ - return: "2023-02-09T18:55:23.566999912Z" + return: "2023-02-09T18:55:23.566999912Z" + skip_test: true }, { title: "Coerce a unix timestamp, in milliseconds, to a timestamp" source: """ to_timestamp!(1676478566639, unit: "milliseconds") """ - return: "2023-02-15T16:29:26.639Z" + return: "2023-02-15T16:29:26.639Z" + skip_test: true }, { title: "Coerce a unix timestamp, in nanoseconds, to a timestamp" source: """ to_timestamp!(1675968923012312311, unit: "nanoseconds") """ - return: "2023-02-09T18:55:23.012312311Z" + return: "2023-02-09T18:55:23.012312311Z" + skip_test: true }, ] } diff --git a/website/layouts/partials/data.html b/website/layouts/partials/data.html index 3feefe90cd353..55f14ab1c44a5 100644 --- a/website/layouts/partials/data.html +++ b/website/layouts/partials/data.html @@ -688,6 +688,10 @@

{{ else }} {{ partial "badge.html" (dict "word" "fallible" "color" "yellow" "inline" true "href" $href) }} {{ end }} + {{/* Deprecation Badge */}} + {{ if $func.deprecated }} + {{ partial "badge.html" (dict "word" "deprecated" "color" "red" "inline" true "href" $href) }} + {{ end }}