diff --git a/Cargo.lock b/Cargo.lock index dea8b8d87f6..1ce9a33ca69 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,22 +1,16 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" -version = "0.21.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - [[package]] name = "adler2" version = "2.0.0" @@ -25,9 +19,9 @@ checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "ahash" -version = "0.8.7" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "getrandom", @@ -38,18 +32,18 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "ammonia" -version = "3.3.0" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e6d1c7838db705c9b756557ee27c384ce695a1c51a6fe528784cb1c6840170" +checksum = "1ab99eae5ee58501ab236beb6f20f6ca39be615267b014899c89b2f0bc18a459" dependencies = [ "html5ever", "maplit", @@ -81,9 +75,9 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstream" -version = "0.6.14" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" dependencies = [ "anstyle", "anstyle-parse", @@ -96,43 +90,43 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.4" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anyhow" -version = "1.0.79" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" [[package]] name = "appendlist" @@ -170,18 +164,18 @@ dependencies = [ [[package]] name = "askama_derive" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ccf09143e56923c12e027b83a9553210a3c58322ed8419a53461b14a4dccd85" +checksum = "19fe8d6cb13c4714962c072ea496f3392015f0989b1a2847bb4b2d9effd71d83" dependencies = [ "askama_parser", "basic-toml", "mime", "mime_guess", - "proc-macro2 1.0.89", - "quote 1.0.35", + "proc-macro2 1.0.92", + "quote 1.0.37", "serde", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -192,9 +186,9 @@ checksum = "619743e34b5ba4e9703bba34deac3427c72507c7159f5fd030aea8cac0cfe341" [[package]] name = "askama_parser" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "262eb9cf7be51269c5f2951eeda9ccd14d6934e437457f47b4f066bf55a6770d" +checksum = "acb1161c6b64d1c3d83108213c2a2533a342ac225aabd0bda218278c2ddb00c0" dependencies = [ "nom", ] @@ -211,13 +205,14 @@ dependencies = [ [[package]] name = "assert_cmd" -version = "2.0.12" +version = "2.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88903cb14723e4d4003335bb7f8a14f27691649105346a0f0957466c096adfe6" +checksum = "dc1835b7f27878de8525dc71410b5a31cdcc5f230aed5ba5df968e09c201b23d" dependencies = [ "anstyle", "bstr", "doc-comment", + "libc", "predicates", "predicates-core", "predicates-tree", @@ -226,23 +221,23 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.1.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", - "miniz_oxide 0.7.1", + "miniz_oxide", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -253,9 +248,9 @@ checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64" -version = "0.21.6" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c79fed4cdb43e993fcdadc7e58a09fd0e3e649c4436fa11da71c9f1f3ee7feb9" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64" @@ -265,9 +260,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "basic-toml" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2db21524cad41c5591204d22d75e1970a2d1f71060214ca931dc7d5afe2c14e5" +checksum = "823388e228f614e9558c6804262db37960ec8821856535f5c3f59913140558f8" dependencies = [ "serde", ] @@ -278,7 +273,16 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" dependencies = [ - "bit-vec", + "bit-vec 0.6.3", +] + +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec 0.8.0", ] [[package]] @@ -287,6 +291,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + [[package]] name = "bitflags" version = "1.3.2" @@ -316,13 +326,13 @@ checksum = "9672cb0edeadf721484e298c0ed4dd70b0eaa3acaed5b4fd0bd73ca32e51d814" dependencies = [ "ahash", "appendlist", - "base64 0.21.6", + "base64 0.21.7", "fluent-uri", - "idna", + "idna 0.5.0", "once_cell", "percent-encoding", "regex", - "regex-syntax 0.8.2", + "regex-syntax 0.8.5", "serde", "serde_json", "url", @@ -330,12 +340,12 @@ dependencies = [ [[package]] name = "bstr" -version = "1.9.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c48f0051a4b4c5e0b6d365cd04af53aeaa209e3cc15ec2cdb69e73cc87fbd0dc" +checksum = "1a68f1f47cdf0ec8ee4b941b2eee2a80cb796db73118c0dd09ac63fbe405be22" dependencies = [ "memchr", - "regex-automata 0.4.7", + "regex-automata 0.4.9", "serde", ] @@ -353,9 +363,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" [[package]] name = "cast" @@ -378,6 +388,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "chrono" version = "0.4.38" @@ -395,9 +411,9 @@ dependencies = [ [[package]] name = "ciborium" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "effd91f6c78e5a4ace8a5d3c0b6bfaec9e2baaef55f3efc00e45fb2e477ee926" +checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" dependencies = [ "ciborium-io", "ciborium-ll", @@ -406,15 +422,15 @@ dependencies = [ [[package]] name = "ciborium-io" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf919175532b369853f5d5e20b26b43112613fd6fe7aee757e35f7a44642656" +checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" [[package]] name = "ciborium-ll" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defaa24ecc093c77630e6c15e17c51f5e187bf35ee514f4e2d67baaa96dae22b" +checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" dependencies = [ "ciborium-io", "half", @@ -422,9 +438,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.11" +version = "4.5.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35723e6a11662c2afb578bcf0b88bf6ea8e21282a953428f240574fcc3a2b5b3" +checksum = "fb3b4b9e5a7c7514dfa52869339ee98b3156b0bfb4e8a77c4ff4babb64b1604f" dependencies = [ "clap_builder", "clap_derive", @@ -432,49 +448,49 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.11" +version = "4.5.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49eb96cbfa7cfa35017b7cd548c75b14c3118c98b423041d70562665e07fb0fa" +checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec" dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.11.0", - "terminal_size", + "strsim", + "terminal_size 0.4.0", ] [[package]] name = "clap_complete" -version = "4.5.10" +version = "4.5.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbeb5ae3a578b7f639911ed31e98a48e16ef6f44e62d275184bb755a093fea55" +checksum = "d9647a559c112175f17cf724dc72d3645680a883c58481332779192b0d8e7a01" dependencies = [ "clap", ] [[package]] name = "clap_derive" -version = "4.5.11" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d029b67f89d30bbb547c89fd5161293c0aec155fc691d7924b64550662db93e" +checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ "heck 0.5.0", - "proc-macro2 1.0.89", - "quote 1.0.35", - "syn 2.0.85", + "proc-macro2 1.0.92", + "quote 1.0.37", + "syn 2.0.89", ] [[package]] name = "clap_lex" -version = "0.7.1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" +checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7" [[package]] name = "cli-table" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adfbb116d9e2c4be7011360d0c0bee565712c11e969c9609b25b619366dc379d" +checksum = "b53f9241f288a7b12c56565f04aaeaeeab6b8923d42d99255d4ca428b4d97f89" dependencies = [ "cli-table-derive", "csv", @@ -484,12 +500,12 @@ dependencies = [ [[package]] name = "cli-table-derive" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2af3bfb9da627b0a6c467624fb7963921433774ed435493b5c08a3053e829ad4" +checksum = "3e83a93253aaae7c74eb7428ce4faa6e219ba94886908048888701819f82fb94" dependencies = [ - "proc-macro2 1.0.89", - "quote 1.0.35", + "proc-macro2 1.0.92", + "quote 1.0.37", "syn 1.0.109", ] @@ -505,9 +521,9 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "colored" @@ -531,24 +547,24 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" dependencies = [ "libc", ] [[package]] name = "crc" -version = "3.0.1" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" +checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" dependencies = [ "crc-catalog", ] @@ -606,9 +622,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.12" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ "crossbeam-utils", ] @@ -638,6 +654,12 @@ version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + [[package]] name = "crypto-common" version = "0.1.6" @@ -650,9 +672,9 @@ dependencies = [ [[package]] name = "csv" -version = "1.3.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac574ff4d437a7b5ad237ef331c17ccca63c46479e5b5453eb8e10bb99a759fe" +checksum = "acdc4883a9c96732e4733212c01447ebd805833b7275a73ca3ee080fd77afdaf" dependencies = [ "csv-core", "itoa", @@ -671,53 +693,54 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.130" +version = "1.0.131" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23c042a0ba58aaff55299632834d1ea53ceff73d62373f62c9ae60890ad1b942" +checksum = "2568d7d2cfc051e43414fe1ef80c712cbcd60c3624d1ad1cb4b2572324d0a5d9" dependencies = [ "cc", "cxxbridge-flags", "cxxbridge-macro", + "foldhash", "link-cplusplus", ] [[package]] name = "cxx-build" -version = "1.0.130" +version = "1.0.131" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45dc1c88d0fdac57518a9b1f6c4f4fb2aca8f3c30c0d03d7d8518b47ca0bcea6" +checksum = "1674a8b80cdcce32512a75975d85d569b160f612ee1d31645bc46771f7c220a1" dependencies = [ "cc", "codespan-reporting", - "proc-macro2 1.0.89", - "quote 1.0.35", + "proc-macro2 1.0.92", + "quote 1.0.37", "scratch", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] name = "cxxbridge-flags" -version = "1.0.130" +version = "1.0.131" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa7ed7d30b289e2592cc55bc2ccd89803a63c913e008e6eb59f06cddf45bb52f" +checksum = "0c710c27f23b7fa00c23aaee9e6fd3e79a6dffc5f5c6217487ec5213f51296b7" [[package]] name = "cxxbridge-macro" -version = "1.0.130" +version = "1.0.131" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b8c465d22de46b851c04630a5fc749a26005b263632ed2e0d9cc81518ead78d" +checksum = "0aa53ef9fc54b986272efe83e257bbb417d1c3ceab1b732411d8c634fda572be" dependencies = [ - "proc-macro2 1.0.89", - "quote 1.0.35", + "proc-macro2 1.0.92", + "quote 1.0.37", "rustversion", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] name = "darling" -version = "0.20.8" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ "darling_core", "darling_macro", @@ -725,27 +748,38 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.8" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" dependencies = [ "fnv", "ident_case", - "proc-macro2 1.0.89", - "quote 1.0.35", - "strsim 0.10.0", - "syn 2.0.85", + "proc-macro2 1.0.92", + "quote 1.0.37", + "strsim", + "syn 2.0.89", ] [[package]] name = "darling_macro" -version = "0.20.8" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", - "quote 1.0.35", - "syn 2.0.85", + "quote 1.0.37", + "syn 2.0.89", +] + +[[package]] +name = "dbus" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bb21987b9fb1613058ba3843121dd18b163b254d8a6e797e144cbac14d96d1b" +dependencies = [ + "libc", + "libdbus-sys", + "winapi", ] [[package]] @@ -763,16 +797,16 @@ version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" dependencies = [ - "proc-macro2 1.0.89", - "quote 1.0.35", - "syn 2.0.85", + "proc-macro2 1.0.92", + "quote 1.0.37", + "syn 2.0.89", ] [[package]] name = "diesel" -version = "2.2.4" +version = "2.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "158fe8e2e68695bd615d7e4f3227c0727b151330d3e253b525086c348d055d5e" +checksum = "cbf9649c05e0a9dbd6d0b0b8301db5182b972d0fd02f0a7c6736cf632d7c0fd5" dependencies = [ "bitflags 2.6.0", "byteorder", @@ -791,9 +825,9 @@ checksum = "e7f2c3de51e2ba6bf2a648285696137aaf0f5f487bcbea93972fe8a364e131a4" dependencies = [ "diesel_table_macro_syntax", "dsl_auto_type", - "proc-macro2 1.0.89", - "quote 1.0.35", - "syn 2.0.85", + "proc-macro2 1.0.92", + "quote 1.0.37", + "syn 2.0.89", ] [[package]] @@ -802,7 +836,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "209c735641a413bc68c4923a9d6ad4bcb3ca306b794edaa7eb0b3228a99ffb25" dependencies = [ - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -842,9 +876,9 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ - "proc-macro2 1.0.89", - "quote 1.0.35", - "syn 2.0.85", + "proc-macro2 1.0.92", + "quote 1.0.37", + "syn 2.0.89", ] [[package]] @@ -862,16 +896,16 @@ dependencies = [ "darling", "either", "heck 0.5.0", - "proc-macro2 1.0.89", - "quote 1.0.35", - "syn 2.0.85", + "proc-macro2 1.0.92", + "quote 1.0.37", + "syn 2.0.89", ] [[package]] name = "either" -version = "1.9.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "elasticlunr-rs" @@ -887,24 +921,34 @@ dependencies = [ [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ "cfg-if", ] +[[package]] +name = "env_filter" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f2c92ceda6ceec50f43169f9ee8424fe2db276791afde7b2cd8bc084cb376ab" +dependencies = [ + "log 0.4.22", + "regex", +] + [[package]] name = "env_logger" -version = "0.10.1" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95b3f3e67048839cb0d0781f445682a35113da7121f7c949db0e2be96a4fbece" +checksum = "e13fa619b91fb2381732789fc5de83b45675e882f66623b7d8cb4f643017018d" dependencies = [ + "anstream", + "anstyle", + "env_filter", "humantime", - "is-terminal", "log 0.4.22", - "regex", - "termcolor", ] [[package]] @@ -915,12 +959,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -937,20 +981,20 @@ checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" [[package]] name = "fancy-regex" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531e46835a22af56d1e3b66f04844bed63158bc094a628bec1d321d9b4c44bf2" +checksum = "6e24cb5a94bcae1e5408b0effca5cd7172ea3c5755049c5f3af4cd283a165298" dependencies = [ - "bit-set", - "regex-automata 0.4.7", - "regex-syntax 0.8.2", + "bit-set 0.8.0", + "regex-automata 0.4.9", + "regex-syntax 0.8.5", ] [[package]] name = "fastrand" -version = "2.0.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" [[package]] name = "file-owner" @@ -963,14 +1007,14 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.23" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" dependencies = [ "cfg-if", "libc", - "redox_syscall", - "windows-sys 0.52.0", + "libredox", + "windows-sys 0.59.0", ] [[package]] @@ -980,7 +1024,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", - "miniz_oxide 0.8.0", + "miniz_oxide", ] [[package]] @@ -1007,6 +1051,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" + [[package]] name = "foreign-types" version = "0.3.2" @@ -1056,9 +1106,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -1087,9 +1137,9 @@ checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -1108,9 +1158,9 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ - "proc-macro2 1.0.89", - "quote 1.0.35", - "syn 2.0.85", + "proc-macro2 1.0.92", + "quote 1.0.37", + "syn 2.0.89", ] [[package]] @@ -1127,9 +1177,9 @@ checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-timer" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" +checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" [[package]] name = "futures-util" @@ -1161,9 +1211,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -1172,9 +1222,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "glob" @@ -1197,8 +1247,8 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "729f9bd3449d77e7831a18abfb7ba2f99ee813dfd15b8c2167c9a54ba20aa99d" dependencies = [ - "proc-macro2 1.0.89", - "quote 1.0.35", + "proc-macro2 1.0.92", + "quote 1.0.37", "syn 1.0.109", ] @@ -1213,7 +1263,7 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http 0.2.11", + "http 0.2.12", "indexmap", "slab", "tokio", @@ -1223,38 +1273,43 @@ dependencies = [ [[package]] name = "half" -version = "1.8.2" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" +checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" +dependencies = [ + "cfg-if", + "crunchy", +] [[package]] name = "handlebars" -version = "4.5.0" +version = "6.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faa67bab9ff362228eb3d00bd024a4965d8231bbb7921167f0cfa66c6626b225" +checksum = "fd4ccde012831f9a071a637b0d4e31df31c0f6c525784b35ae76a9ac6bc1e315" dependencies = [ "log 0.4.22", + "num-order", "pest", "pest_derive", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", ] [[package]] name = "hashbrown" -version = "0.15.1" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] name = "hashlink" @@ -1262,7 +1317,7 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" dependencies = [ - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -1271,10 +1326,10 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" dependencies = [ - "base64 0.21.6", + "base64 0.21.7", "bytes", "headers-core", - "http 0.2.11", + "http 0.2.12", "httpdate", "mime", "sha1", @@ -1286,7 +1341,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" dependencies = [ - "http 0.2.11", + "http 0.2.12", ] [[package]] @@ -1303,9 +1358,15 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "hermit-abi" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" [[package]] name = "hex" @@ -1335,23 +1396,23 @@ dependencies = [ [[package]] name = "html5ever" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bea68cab48b8459f17cf1c944c67ddc572d272d9f2b274140f223ecb1da4a3b7" +checksum = "c13771afe0e6e846f1e67d038d4cb29998a6779f93c809212e4e9c32efd244d4" dependencies = [ "log 0.4.22", "mac", "markup5ever", - "proc-macro2 1.0.89", - "quote 1.0.35", - "syn 1.0.109", + "proc-macro2 1.0.92", + "quote 1.0.37", + "syn 2.0.89", ] [[package]] name = "http" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ "bytes", "fnv", @@ -1376,7 +1437,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", - "http 0.2.11", + "http 0.2.12", "pin-project-lite", ] @@ -1405,9 +1466,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" @@ -1432,16 +1493,16 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.28" +version = "0.14.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" dependencies = [ "bytes", "futures-channel", "futures-core", "futures-util", "h2", - "http 0.2.11", + "http 0.2.12", "http-body 0.4.6", "httparse", "httpdate", @@ -1456,9 +1517,9 @@ dependencies = [ [[package]] name = "hyper" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" +checksum = "97818827ef4f364230e16705d4706e2897df2bb60617d6ca15d598025a3c481f" dependencies = [ "bytes", "futures-channel", @@ -1480,7 +1541,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", - "hyper 0.14.28", + "hyper 0.14.31", "native-tls", "tokio", "tokio-native-tls", @@ -1494,7 +1555,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper 1.5.0", + "hyper 1.5.1", "hyper-util", "native-tls", "tokio", @@ -1513,7 +1574,7 @@ dependencies = [ "futures-util", "http 1.1.0", "http-body 1.0.1", - "hyper 1.5.0", + "hyper 1.5.1", "pin-project-lite", "socket2", "tokio", @@ -1544,6 +1605,124 @@ dependencies = [ "cc", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2 1.0.92", + "quote 1.0.37", + "syn 2.0.89", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -1560,23 +1739,44 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + [[package]] name = "include_dir" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18762faeff7122e89e0857b02f7ce6fcc0d101d5e9ad2ad7846cc01d61b7f19e" +checksum = "923d117408f1e49d914f1a379a309cffe4f18c05cf4e3d12e613a15fc81bd0dd" dependencies = [ "include_dir_macros", ] [[package]] name = "include_dir_macros" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b139284b5cf57ecfa712bcc66950bb635b31aff41c188e8a4cfc758eca374a3f" +checksum = "7cab85a7ed0bd5f0e76d93846e0147172bed2e2d3f859bcc33a8d9699cad1a75" dependencies = [ - "proc-macro2 1.0.89", - "quote 1.0.35", + "proc-macro2 1.0.92", + "quote 1.0.37", ] [[package]] @@ -1586,16 +1786,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.15.1", + "hashbrown 0.15.2", ] [[package]] name = "inotify" -version = "0.10.2" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdd168d97690d0b8c412d6b6c10360277f4d7ee495c5d0d5d5fe0854923255cc" +checksum = "f37dccff2791ab604f9babef0ba14fbe0be30bd368dc541e2b08d07c8aa908f3" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "futures-core", "inotify-sys", "libc", @@ -1611,39 +1811,28 @@ dependencies = [ "libc", ] -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.48.0", -] - [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "is-terminal" -version = "0.4.10" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" +checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" dependencies = [ - "hermit-abi", - "rustix 0.38.34", + "hermit-abi 0.4.0", + "libc", "windows-sys 0.52.0", ] [[package]] name = "is_terminal_polyfill" -version = "1.70.0" +version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itertools" @@ -1654,15 +1843,6 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.13.0" @@ -1674,36 +1854,57 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "js-sys" -version = "0.3.66" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.164" +version = "0.2.166" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2ccc108bbc0b1331bd061864e7cd823c0cab660bbe6970e66e2c0614decde36" + +[[package]] +name = "libdbus-sys" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "433bfe06b8c75da9b2e3fbea6e5329ff87748f0b144ef75306e674c3f6f7c13f" +checksum = "06085512b750d640299b79be4bad3d2fa90a9c00b1fd9e1b46364f66f0485c72" +dependencies = [ + "cc", + "pkg-config", +] [[package]] name = "libm" -version = "0.2.8" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" + +[[package]] +name = "libredox" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.6.0", + "libc", + "redox_syscall", +] [[package]] name = "libsqlite3-sys" @@ -1727,21 +1928,21 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.1.4" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] -name = "linux-raw-sys" -version = "0.4.12" +name = "litemap" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -1792,9 +1993,9 @@ checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" [[package]] name = "markup5ever" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2629bb1404f3d34c2e921f21fd34ba00b206124c81f65c50b43b6aaefeb016" +checksum = "16ce3abbeba692c8b8441d036ef91aea6df8da2c6b6e21c7e14d3c18e526be45" dependencies = [ "log 0.4.22", "phf", @@ -1815,9 +2016,9 @@ dependencies = [ [[package]] name = "mdbook" -version = "0.4.36" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80992cb0e05f22cc052c99f8e883f1593b891014b96a8b4637fd274d7030c85e" +checksum = "fe1f98b8d66e537d2f0ba06e7dec4f44001deec539a2d18bfc102d6a86189148" dependencies = [ "ammonia", "anyhow", @@ -1831,7 +2032,6 @@ dependencies = [ "memchr", "once_cell", "opener", - "pathdiff", "pulldown-cmark", "regex", "serde", @@ -1865,9 +2065,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mime_guess" -version = "2.0.4" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" dependencies = [ "mime", "unicase", @@ -1907,15 +2107,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" -[[package]] -name = "miniz_oxide" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" -dependencies = [ - "adler", -] - [[package]] name = "miniz_oxide" version = "0.8.0" @@ -1927,13 +2118,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.11" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ + "hermit-abi 0.3.9", "libc", "wasi", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1948,11 +2140,10 @@ dependencies = [ [[package]] name = "native-tls" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" dependencies = [ - "lazy_static", "libc", "log 0.4.22", "openssl", @@ -1966,18 +2157,19 @@ dependencies = [ [[package]] name = "new_debug_unreachable" -version = "1.0.4" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" [[package]] name = "nix" -version = "0.27.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ "bitflags 2.6.0", "cfg-if", + "cfg_aliases", "libc", ] @@ -1999,11 +2191,11 @@ checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" [[package]] name = "normpath" -version = "1.1.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec60c60a693226186f5d6edf073232bfb6464ed97eb22cf3b01c1e8198fd97f5" +checksum = "c8911957c4b1549ac0dc74e30db9c8b0e66ddcd6d7acc33098f4c63a64a6d7ed" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -2032,62 +2224,68 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" [[package]] -name = "num-traits" -version = "0.2.17" +name = "num-modular" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17bb261bf36fa7d83f4c294f834e91256769097b3cb505d44831e0a179ac647f" + +[[package]] +name = "num-order" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "537b596b97c40fcf8056d153049eb22f481c17ebce72a513ec9286e4986d1bb6" dependencies = [ - "autocfg", - "libm", + "num-modular", ] [[package]] -name = "num_cpus" -version = "1.16.0" +name = "num-traits" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ - "hermit-abi", - "libc", + "autocfg", + "libm", ] [[package]] name = "object" -version = "0.32.2" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "oorandom" -version = "11.1.3" +version = "11.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" +checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" [[package]] name = "opener" -version = "0.6.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c62dcb6174f9cb326eac248f07e955d5d559c272730b6c03e396b443b562788" +checksum = "d0812e5e4df08da354c851a3376fead46db31c2214f849d3de356d774d057681" dependencies = [ "bstr", + "dbus", "normpath", - "winapi", + "windows-sys 0.59.0", ] [[package]] name = "openssl" -version = "0.10.66" +version = "0.10.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" +checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" dependencies = [ "bitflags 2.6.0", "cfg-if", @@ -2104,9 +2302,9 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ - "proc-macro2 1.0.89", - "quote 1.0.35", - "syn 2.0.85", + "proc-macro2 1.0.92", + "quote 1.0.37", + "syn 2.0.89", ] [[package]] @@ -2117,9 +2315,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.103" +version = "0.9.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" +checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" dependencies = [ "cc", "libc", @@ -2135,9 +2333,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -2145,15 +2343,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] @@ -2162,12 +2360,6 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" -[[package]] -name = "pathdiff" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" - [[package]] name = "percent-encoding" version = "2.3.1" @@ -2176,20 +2368,20 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.6" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f200d8d83c44a45b21764d1916299752ca035d15ecd46faca3e9a2a2bf6ad06" +checksum = "879952a81a83930934cbf1786752d6dedc3b1f29e8f8fb2ad1d0a36f377cf442" dependencies = [ "memchr", - "thiserror", + "thiserror 1.0.69", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.7.6" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcd6ab1236bbdb3a49027e920e693192ebfe8913f6d60e294de57463a493cfde" +checksum = "d214365f632b123a47fd913301e14c946c61d1c183ee245fa76eb752e59a02dd" dependencies = [ "pest", "pest_generator", @@ -2197,22 +2389,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.6" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a31940305ffc96863a735bef7c7994a00b325a7138fdbc5bda0f1a0476d3275" +checksum = "eb55586734301717aea2ac313f50b2eb8f60d2fc3dc01d190eefa2e625f60c4e" dependencies = [ "pest", "pest_meta", - "proc-macro2 1.0.89", - "quote 1.0.35", - "syn 2.0.85", + "proc-macro2 1.0.92", + "quote 1.0.37", + "syn 2.0.89", ] [[package]] name = "pest_meta" -version = "2.7.6" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7ff62f5259e53b78d1af898941cdcdccfae7385cf7d793a6e55de5d05bb4b7d" +checksum = "b75da2a70cf4d9cb76833c990ac9cd3923c9a8905a8929789ce347c84564d03d" dependencies = [ "once_cell", "pest", @@ -2221,21 +2413,21 @@ dependencies = [ [[package]] name = "phf" -version = "0.10.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" dependencies = [ - "phf_shared", + "phf_shared 0.11.2", ] [[package]] name = "phf_codegen" -version = "0.10.0" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb1c3a8bc4dd4e5cfce29b44ffc14bedd2ee294559a294e2a4d4c9e9a6a13cd" +checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a" dependencies = [ - "phf_generator", - "phf_shared", + "phf_generator 0.11.2", + "phf_shared 0.11.2", ] [[package]] @@ -2244,7 +2436,17 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" dependencies = [ - "phf_shared", + "phf_shared 0.10.0", + "rand", +] + +[[package]] +name = "phf_generator" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +dependencies = [ + "phf_shared 0.11.2", "rand", ] @@ -2257,31 +2459,40 @@ dependencies = [ "siphasher", ] +[[package]] +name = "phf_shared" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher", +] + [[package]] name = "pin-project" -version = "1.1.3" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.3" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ - "proc-macro2 1.0.89", - "quote 1.0.35", - "syn 2.0.85", + "proc-macro2 1.0.92", + "quote 1.0.37", + "syn 2.0.89", ] [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -2291,15 +2502,15 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69d3587f8a9e599cc7ec2c00e331f71c4e69a5f9a4b8a6efd5b07466b9736f9a" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "plotters" -version = "0.3.5" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2c224ba00d7cadd4d5c660deaf2098e5e80e07846537c51f9cfa4be50c1fd45" +checksum = "5aeb6f403d7a4911efb1e33402027fc44f29b5bf6def3effcc22d7bb75f2b747" dependencies = [ "num-traits", "plotters-backend", @@ -2310,15 +2521,15 @@ dependencies = [ [[package]] name = "plotters-backend" -version = "0.3.5" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e76628b4d3a7581389a35d5b6e2139607ad7c75b17aed325f210aa91f4a9609" +checksum = "df42e13c12958a16b3f7f4386b9ab1f3e7933914ecea48da7139435263a4172a" [[package]] name = "plotters-svg" -version = "0.3.5" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f6d39893cca0701371e3c27294f09797214b86f1fb951b89ade8ec04e2abab" +checksum = "51bae2ac328883f7acdfea3d66a7c35751187f870bc81f94563733a154d7a670" dependencies = [ "plotters-backend", ] @@ -2331,15 +2542,18 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "pq-sys" -version = "0.4.8" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c0052426df997c0cbd30789eb44ca097e3541717a7b8fa36b1c464ee7edebd" +checksum = "f6cc05d7ea95200187117196eee9edd0644424911821aeb28a18ce60ea0b8793" dependencies = [ "vcpkg", ] @@ -2352,14 +2566,13 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "predicates" -version = "3.0.4" +version = "3.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dfc28575c2e3f19cb3c73b93af36460ae898d426eba6fc15b9bd2a5220758a0" +checksum = "7e9086cc7640c29a356d1a29fd134380bee9d8f79a17410aa76e7ad295f42c97" dependencies = [ "anstyle", "difflib", "float-cmp", - "itertools 0.11.0", "normalize-line-endings", "predicates-core", "regex", @@ -2367,15 +2580,15 @@ dependencies = [ [[package]] name = "predicates-core" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174" +checksum = "ae8177bee8e75d6846599c6b9ff679ed51e882816914eec639944d7c9aa11931" [[package]] name = "predicates-tree" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368ba315fb8c5052ab692e68a0eefec6ec57b23a36959c14496f0b0df2c0cecf" +checksum = "41b740d195ed3166cd147c8047ec98db0e22ec019eb8eeb76d343b795304fb13" dependencies = [ "predicates-core", "termtree", @@ -2383,9 +2596,9 @@ dependencies = [ [[package]] name = "pretty_assertions" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af7cee1a6c8a5b9208b3cb1061f10c0cb689087b3d8ce85fb9d2dd7a29b6ba66" +checksum = "3ae130e2f271fbc2ac3a40fb1d07180839cdbbe443c7a27e1e3c13c5cac0116d" dependencies = [ "diff", "yansi", @@ -2397,7 +2610,7 @@ version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ - "toml_edit 0.22.22", + "toml_edit", ] [[package]] @@ -2411,31 +2624,41 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.89" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] [[package]] name = "procfs" -version = "0.14.2" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1de8dacb0873f77e6aefc6d71e044761fcc68060290f5b1089fcdf84626bb69" +checksum = "731e0d9356b0c25f16f33b5be79b1c57b562f141ebfcdb0ad8ac2c13a24293b4" dependencies = [ - "bitflags 1.3.2", - "byteorder", + "bitflags 2.6.0", + "hex", + "lazy_static", + "procfs-core", + "rustix", +] + +[[package]] +name = "procfs-core" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d3554923a69f4ce04c4a754260c338f505ce22642d3830e049a399fc2059a29" +dependencies = [ + "bitflags 2.6.0", "hex", - "lazy_static", - "rustix 0.36.17", ] [[package]] name = "prometheus" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" +checksum = "3d33c28a30771f7f96db69893f78b857f7450d7e0237e9c8fc6427a81bae7ed1" dependencies = [ "cfg-if", "fnv", @@ -2444,24 +2667,24 @@ dependencies = [ "memchr", "parking_lot", "procfs", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "proptest" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" +checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" dependencies = [ - "bit-set", - "bit-vec", + "bit-set 0.5.3", + "bit-vec 0.6.3", "bitflags 2.6.0", "lazy_static", "num-traits", "rand", "rand_chacha", "rand_xorshift", - "regex-syntax 0.8.2", + "regex-syntax 0.8.5", "rusty-fork", "tempfile", "unarray", @@ -2469,15 +2692,22 @@ dependencies = [ [[package]] name = "pulldown-cmark" -version = "0.9.3" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a1a2f1f0a7ecff9c31abbe177637be0e97a0aef46cf8738ece09327985d998" +checksum = "76979bea66e7875e7509c4ec5300112b316af87fa7a252ca91c448b32dfe3993" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "memchr", + "pulldown-cmark-escape", "unicase", ] +[[package]] +name = "pulldown-cmark-escape" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd348ff538bc9caeda7ee8cad2d1d48236a1f443c1fa3913c6a02fe0043b1dd3" + [[package]] name = "quick-error" version = "1.2.3" @@ -2486,9 +2716,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quick-xml" -version = "0.36.2" +version = "0.37.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7649a7b4df05aed9ea7ec6f628c67c9953a43869b8bc50929569b2999d443fe" +checksum = "f22f29bdff3987b4d8632ef95fd6424ec7e4e0a57e2f4fc63e489e75357f6a03" dependencies = [ "memchr", "serde", @@ -2505,11 +2735,11 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.35" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ - "proc-macro2 1.0.89", + "proc-macro2 1.0.92", ] [[package]] @@ -2564,9 +2794,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ "either", "rayon-core", @@ -2574,9 +2804,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.12.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ "crossbeam-deque", "crossbeam-utils", @@ -2584,23 +2814,23 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.4.1" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", ] [[package]] name = "regex" -version = "1.10.6" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.7", - "regex-syntax 0.8.2", + "regex-automata 0.4.9", + "regex-syntax 0.8.5", ] [[package]] @@ -2614,13 +2844,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.2", + "regex-syntax 0.8.5", ] [[package]] @@ -2631,31 +2861,31 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "relative-path" -version = "1.9.2" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e898588f33fdd5b9420719948f9f2a32c922a246964576f71ba7f24f80610fbc" +checksum = "ba39f3699c378cd8970968dcbff9c43159ea4cfbd88d43c00b22f2ef10a435d2" [[package]] name = "reqwest" -version = "0.11.23" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ - "base64 0.21.6", + "base64 0.21.7", "bytes", "encoding_rs", "futures-core", "futures-util", "h2", - "http 0.2.11", + "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.28", + "hyper 0.14.31", "hyper-tls 0.5.0", "ipnet", "js-sys", @@ -2665,9 +2895,11 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", + "rustls-pemfile 1.0.4", "serde", "serde_json", "serde_urlencoded", + "sync_wrapper 0.1.2", "system-configuration", "tokio", "tokio-native-tls", @@ -2695,7 +2927,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.1", "http-body-util", - "hyper 1.5.0", + "hyper 1.5.1", "hyper-tls 0.6.0", "hyper-util", "ipnet", @@ -2710,7 +2942,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 1.0.2", "tokio", "tokio-native-tls", "tower-service", @@ -2729,9 +2961,9 @@ checksum = "194d8e591e405d1eecf28819740abed6d719d1a2db87fc0bcdedee9a26d55560" [[package]] name = "rstest" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b423f0e62bdd61734b67cd21ff50871dfaeb9cc74f869dcd6af974fbcb19936" +checksum = "0a2c585be59b6b5dd66a9d2084aa1d8bd52fbdb806eafdeffb52791147862035" dependencies = [ "futures", "futures-timer", @@ -2741,19 +2973,19 @@ dependencies = [ [[package]] name = "rstest_macros" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5e1711e7d14f74b12a58411c542185ef7fb7f2e7f8ee6e2940a883628522b42" +checksum = "825ea780781b15345a146be27eaefb05085e337e869bff01b4306a4fd4a9ad5a" dependencies = [ "cfg-if", "glob", "proc-macro-crate", - "proc-macro2 1.0.89", - "quote 1.0.35", + "proc-macro2 1.0.92", + "quote 1.0.37", "regex", "relative-path", "rustc_version", - "syn 2.0.85", + "syn 2.0.89", "unicode-ident", ] @@ -2830,7 +3062,7 @@ dependencies = [ "reqwest 0.12.9", "rstest", "rudder_cli", - "secrecy 0.10.3", + "secrecy", "serde", "serde_ini", "serde_json", @@ -2859,7 +3091,7 @@ dependencies = [ "futures", "hex", "humantime", - "hyper 0.14.28", + "hyper 0.14.31", "inotify", "lazy_static", "nom", @@ -2869,16 +3101,17 @@ dependencies = [ "prometheus", "proptest", "regex", - "reqwest 0.11.23", - "secrecy 0.8.0", + "reqwest 0.11.27", + "secrecy", "serde", + "serde-inline-default", "serde_json", "sha2", "tempfile", - "thiserror", + "thiserror 2.0.3", "tokio", "tokio-stream", - "toml 0.8.8", + "toml 0.8.19", "tracing", "tracing-subscriber", "walkdir", @@ -2971,7 +3204,7 @@ dependencies = [ "serde", "serde_json", "serde_yaml", - "strsim 0.11.0", + "strsim", "tempfile", "test-generator", "tracing", @@ -3003,48 +3236,34 @@ dependencies = [ "cxx", "cxx-build", "paste", - "terminal_size", + "terminal_size 0.3.0", ] [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ "semver", ] [[package]] name = "rustix" -version = "0.36.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305efbd14fde4139eb501df5f136994bb520b033fa9fbdce287507dc23b8c7ed" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.1.4", - "windows-sys 0.45.0", -] - -[[package]] -name = "rustix" -version = "0.38.34" +version = "0.38.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" dependencies = [ "bitflags 2.6.0", "errno", "libc", - "linux-raw-sys 0.4.12", + "linux-raw-sys", "windows-sys 0.52.0", ] @@ -3054,7 +3273,7 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64 0.21.6", + "base64 0.21.7", ] [[package]] @@ -3074,9 +3293,9 @@ checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" [[package]] name = "rusty-fork" @@ -3092,9 +3311,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "same-file" @@ -3107,11 +3326,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -3141,16 +3360,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152" -[[package]] -name = "secrecy" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" -dependencies = [ - "serde", - "zeroize", -] - [[package]] name = "secrecy" version = "0.10.3" @@ -3163,11 +3372,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.9.2" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "core-foundation", "core-foundation-sys", "libc", @@ -3176,9 +3385,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.1" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +checksum = "fa39c7303dc58b5543c94d22c1766b0d31f2ee58306363ea622b10bbc075eaa2" dependencies = [ "core-foundation-sys", "libc", @@ -3186,15 +3395,15 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.21" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.214" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" dependencies = [ "serde_derive", ] @@ -3210,15 +3419,26 @@ dependencies = [ "serde_json", ] +[[package]] +name = "serde-inline-default" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3acbd21cb24261fc36f595b38d3b34d0ff4e31a6b42edd6a43387d27c5787c8" +dependencies = [ + "proc-macro2 1.0.92", + "quote 1.0.37", + "syn 2.0.89", +] + [[package]] name = "serde_derive" -version = "1.0.214" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ - "proc-macro2 1.0.89", - "quote 1.0.35", - "syn 2.0.85", + "proc-macro2 1.0.92", + "quote 1.0.37", + "syn 2.0.89", ] [[package]] @@ -3234,9 +3454,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.132" +version = "1.0.133" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" dependencies = [ "itoa", "memchr", @@ -3246,9 +3466,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" dependencies = [ "serde", ] @@ -3317,9 +3537,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] @@ -3353,12 +3573,12 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.5.5" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -3372,6 +3592,12 @@ dependencies = [ "strum", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "stdio-override" version = "0.1.3" @@ -3390,7 +3616,7 @@ dependencies = [ "new_debug_unreachable", "once_cell", "parking_lot", - "phf_shared", + "phf_shared 0.10.0", "precomputed-hash", "serde", ] @@ -3401,23 +3627,17 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988" dependencies = [ - "phf_generator", - "phf_shared", - "proc-macro2 1.0.89", - "quote 1.0.35", + "phf_generator 0.10.0", + "phf_shared 0.10.0", + "proc-macro2 1.0.92", + "quote 1.0.37", ] [[package]] name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - -[[package]] -name = "strsim" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" @@ -3435,8 +3655,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ "heck 0.4.1", - "proc-macro2 1.0.89", - "quote 1.0.35", + "proc-macro2 1.0.92", + "quote 1.0.37", "rustversion", "syn 1.0.109", ] @@ -3458,36 +3678,53 @@ version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "proc-macro2 1.0.89", - "quote 1.0.35", + "proc-macro2 1.0.92", + "quote 1.0.37", "unicode-ident", ] [[package]] name = "syn" -version = "2.0.85" +version = "2.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" +checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e" dependencies = [ - "proc-macro2 1.0.89", - "quote 1.0.35", + "proc-macro2 1.0.92", + "quote 1.0.37", "unicode-ident", ] [[package]] name = "sync_wrapper" -version = "1.0.1" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "sync_wrapper" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" dependencies = [ "futures-core", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2 1.0.92", + "quote 1.0.37", + "syn 2.0.89", +] + [[package]] name = "sysinfo" -version = "0.31.4" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "355dbe4f8799b304b05e1b0f05fc59b2a18d36645cf169607da45bde2f69a1be" +checksum = "4c33cd241af0f2e9e3b5c32163b873b29956890b5342e6745b917ce9d490f4af" dependencies = [ "core-foundation-sys", "libc", @@ -3520,9 +3757,9 @@ dependencies = [ [[package]] name = "tar" -version = "0.4.40" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" +checksum = "c65998313f8e17d0d553d28f91a0df93e4dbbbf770279c7bc21ca0f09ea1a1f6" dependencies = [ "filetime", "libc", @@ -3531,15 +3768,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.9.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" dependencies = [ "cfg-if", "fastrand", - "redox_syscall", - "rustix 0.38.34", - "windows-sys 0.52.0", + "once_cell", + "rustix", + "windows-sys 0.59.0", ] [[package]] @@ -3568,10 +3805,20 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" dependencies = [ - "rustix 0.38.34", + "rustix", "windows-sys 0.48.0", ] +[[package]] +name = "terminal_size" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f599bd7ca042cfdf8f4512b277c02ba102247820f9d9d4a9f521f496751a6ef" +dependencies = [ + "rustix", + "windows-sys 0.59.0", +] + [[package]] name = "termtree" version = "0.4.1" @@ -3591,29 +3838,49 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.65" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c006c85c7651b3cf2ada4584faa36773bd07bac24acfb39f3c431b36d7e667aa" +dependencies = [ + "thiserror-impl 2.0.3", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ - "thiserror-impl", + "proc-macro2 1.0.92", + "quote 1.0.37", + "syn 2.0.89", ] [[package]] name = "thiserror-impl" -version = "1.0.65" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +checksum = "f077553d607adc1caf65430528a576c757a71ed73944b66ebb58ef2bbd243568" dependencies = [ - "proc-macro2 1.0.89", - "quote 1.0.35", - "syn 2.0.85", + "proc-macro2 1.0.92", + "quote 1.0.37", + "syn 2.0.89", ] [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ "cfg-if", "once_cell", @@ -3650,6 +3917,16 @@ dependencies = [ "time-core", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinytemplate" version = "1.2.1" @@ -3662,9 +3939,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -3677,31 +3954,30 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.35.1" +version = "1.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" dependencies = [ "backtrace", "bytes", "libc", "mio", - "num_cpus", "pin-project-lite", "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ - "proc-macro2 1.0.89", - "quote 1.0.35", - "syn 2.0.85", + "proc-macro2 1.0.92", + "quote 1.0.37", + "syn 2.0.89", ] [[package]] @@ -3716,9 +3992,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.14" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" dependencies = [ "futures-core", "pin-project-lite", @@ -3727,16 +4003,15 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] @@ -3750,14 +4025,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.8" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.21.0", + "toml_edit", ] [[package]] @@ -3769,19 +4044,6 @@ dependencies = [ "serde", ] -[[package]] -name = "toml_edit" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" -dependencies = [ - "indexmap", - "serde", - "serde_spanned", - "toml_datetime", - "winnow 0.5.34", -] - [[package]] name = "toml_edit" version = "0.22.22" @@ -3789,8 +4051,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ "indexmap", + "serde", + "serde_spanned", "toml_datetime", - "winnow 0.6.20", + "winnow", ] [[package]] @@ -3801,15 +4065,15 @@ checksum = "ea68304e134ecd095ac6c3574494fc62b909f416c4fca77e440530221e549d3d" [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "log 0.4.22", "pin-project-lite", @@ -3824,27 +4088,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3566e8ce28cc0a3fe42519fc80e6b4c943cc4c8cef275620eb8dac2d3d4e06cf" dependencies = [ "crossbeam-channel", - "thiserror", + "thiserror 1.0.69", "time", "tracing-subscriber", ] [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ - "proc-macro2 1.0.89", - "quote 1.0.35", - "syn 2.0.85", + "proc-macro2 1.0.92", + "quote 1.0.37", + "syn 2.0.89", ] [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", "valuable", @@ -3906,9 +4170,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ucd-trie" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" [[package]] name = "uname-rs" @@ -3924,45 +4188,42 @@ checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" [[package]] name = "unicase" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] +checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" [[package]] name = "unicode-bidi" -version = "0.3.14" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.10.1" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" [[package]] name = "unicode-width" -version = "0.1.11" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "unicode-xid" @@ -3978,12 +4239,12 @@ checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" [[package]] name = "url" -version = "2.5.0" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", - "idna", + "idna 1.0.3", "percent-encoding", ] @@ -3993,17 +4254,29 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.6.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e395fcf16a7a3d8127ec99782007af141946b4795001f876d54fb0d55978560" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" dependencies = [ "getrandom", ] @@ -4022,9 +4295,9 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "void" @@ -4043,9 +4316,9 @@ dependencies = [ [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -4062,28 +4335,26 @@ dependencies = [ [[package]] name = "warp" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e92e22e03ff1230c03a1a8ee37d2f89cd489e2e541b7550d6afad96faed169" +checksum = "4378d202ff965b011c64817db11d5829506d3404edeadb61f190d111da3f231c" dependencies = [ "bytes", "futures-channel", "futures-util", "headers", - "http 0.2.11", - "hyper 0.14.28", + "http 0.2.12", + "hyper 0.14.31", "log 0.4.22", "mime", "mime_guess", "percent-encoding", "pin-project", - "rustls-pemfile 1.0.4", "scoped-tls", "serde", "serde_json", "serde_urlencoded", "tokio", - "tokio-stream", "tokio-util", "tower-service", "tracing", @@ -4097,34 +4368,35 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.89" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.89" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log 0.4.22", "once_cell", - "proc-macro2 1.0.89", - "quote 1.0.35", - "syn 2.0.85", + "proc-macro2 1.0.92", + "quote 1.0.37", + "syn 2.0.89", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.39" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" +checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" dependencies = [ "cfg-if", "js-sys", @@ -4134,38 +4406,38 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.89" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ - "quote 1.0.35", + "quote 1.0.37", "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.89" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ - "proc-macro2 1.0.89", - "quote 1.0.35", - "syn 2.0.85", + "proc-macro2 1.0.92", + "quote 1.0.37", + "syn 2.0.89", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.89" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "wasm-streams" -version = "0.3.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4609d447824375f43e1ffbc051b50ad8f4b3ae8219680c94452ea05eb240ac7" +checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" dependencies = [ "futures-util", "js-sys", @@ -4176,9 +4448,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.66" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" dependencies = [ "js-sys", "wasm-bindgen", @@ -4186,13 +4458,13 @@ dependencies = [ [[package]] name = "which" -version = "6.0.3" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ee928febd44d98f2f459a4a79bd4d928591333a494a10a868418ac1b39cf1f" +checksum = "c9cad3279ade7346b96e38731a641d7343dd6a53d55083dd54eadfa5a1b38c6b" dependencies = [ "either", "home", - "rustix 0.38.34", + "rustix", "winsafe", ] @@ -4214,11 +4486,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "winapi", + "windows-sys 0.59.0", ] [[package]] @@ -4274,9 +4546,9 @@ version = "0.57.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ - "proc-macro2 1.0.89", - "quote 1.0.35", - "syn 2.0.85", + "proc-macro2 1.0.92", + "quote 1.0.37", + "syn 2.0.89", ] [[package]] @@ -4285,9 +4557,9 @@ version = "0.57.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ - "proc-macro2 1.0.89", - "quote 1.0.35", - "syn 2.0.85", + "proc-macro2 1.0.92", + "quote 1.0.37", + "syn 2.0.89", ] [[package]] @@ -4329,15 +4601,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - [[package]] name = "windows-sys" version = "0.48.0" @@ -4357,18 +4620,12 @@ dependencies = [ ] [[package]] -name = "windows-targets" -version = "0.42.2" +name = "windows-sys" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", + "windows-targets 0.52.6", ] [[package]] @@ -4402,12 +4659,6 @@ dependencies = [ "windows_x86_64_msvc 0.52.6", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -4420,12 +4671,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -4438,12 +4683,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -4462,12 +4701,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -4480,12 +4713,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -4498,12 +4725,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -4516,12 +4737,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -4534,15 +4749,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" -[[package]] -name = "winnow" -version = "0.5.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7cf47b659b318dccbd69cc4797a39ae128f533dce7902a1096044d1967b9c16" -dependencies = [ - "memchr", -] - [[package]] name = "winnow" version = "0.6.20" @@ -4568,54 +4774,134 @@ version = "0.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904" +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[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 0.4.12", - "rustix 0.38.34", + "linux-raw-sys", + "rustix", ] [[package]] name = "yansi" -version = "0.5.1" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" + +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2 1.0.92", + "quote 1.0.37", + "syn 2.0.89", + "synstructure", +] [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ + "byteorder", "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2 1.0.92", + "quote 1.0.37", + "syn 2.0.89", +] + +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ - "proc-macro2 1.0.89", - "quote 1.0.35", - "syn 2.0.85", + "proc-macro2 1.0.92", + "quote 1.0.37", + "syn 2.0.89", + "synstructure", ] [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2 1.0.92", + "quote 1.0.37", + "syn 2.0.89", +] [[package]] name = "zip" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc5e4288ea4057ae23afc69a4472434a87a2495cafce6632fd1c4ec9f5cf3494" +checksum = "99d52293fc86ea7cf13971b3bb81eb21683636e7ae24c729cdaf1b7c4157a352" dependencies = [ "arbitrary", "crc32fast", @@ -4624,7 +4910,7 @@ dependencies = [ "flate2", "indexmap", "memchr", - "thiserror", + "thiserror 2.0.3", "time", "zopfli", ] diff --git a/Jenkinsfile b/Jenkinsfile index 22b84d4afe5..bb519f70b6e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,6 @@ def failedBuild = false -def version = "8.2" +def version = "8.3" def slackResponse = null def changeUrl = env.CHANGE_URL @@ -345,7 +345,9 @@ pipeline { agent { dockerfile { filename 'policies/Dockerfile' - additionalBuildArgs "--build-arg USER_ID=${env.JENKINS_UID} --build-arg RUDDER_VER=${env.RUDDER_VERSION}-nightly --build-arg PSANALYZER_VER=1.20.0" + // no 8.3 build for now + additionalBuildArgs "--build-arg USER_ID=${env.JENKINS_UID} --build-arg RUDDER_VER=8.2-nightly --build-arg PSANALYZER_VER=1.20.0" + //additionalBuildArgs "--build-arg USER_ID=${env.JENKINS_UID} --build-arg RUDDER_VER=${env.RUDDER_VERSION}-nightly --build-arg PSANALYZER_VER=1.20.0" // mount cache args '-v /srv/cache/cargo:/usr/local/cargo/registry -v /srv/cache/sccache:/home/jenkins/.cache/sccache -v /srv/cache/cargo-vet:/home/jenkins/.cache/cargo-vet' } diff --git a/Jenkinsfile-security b/Jenkinsfile-security index 6f50dbc3eb1..08dd12b126d 100644 --- a/Jenkinsfile-security +++ b/Jenkinsfile-security @@ -1,6 +1,6 @@ -def version = "8.2" +def version = "8.3" def slackResponse = null def errors = [] diff --git a/README.md b/README.md index 9f3e571da4f..bb228cdd4d5 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@

- - - Rudder logo + + + Rudder logo
diff --git a/api-doc/Makefile b/api-doc/Makefile index 9c3171c0598..f3e7a86286c 100644 --- a/api-doc/Makefile +++ b/api-doc/Makefile @@ -10,7 +10,7 @@ $(API): clean mkdir -p build target/$@ cp -r ../$@/sources/api-doc build/$@ mkdir -p build/$@/assets - cp -r assets/. build/$@/assets + cp ../logo/icons/svg/rudder-logo-rect-*.svg build/$@/assets/ cp node_modules/rapidoc/dist/rapidoc-min.js build/$@/assets/ cp -r rapidoc.html build/$@/ ./build.py $@ build target diff --git a/api-doc/assets/rudder-white.svg b/api-doc/assets/rudder-white.svg deleted file mode 100644 index 587b8314d37..00000000000 --- a/api-doc/assets/rudder-white.svg +++ /dev/null @@ -1,50 +0,0 @@ - -image/svg+xml \ No newline at end of file diff --git a/api-doc/assets/rudder.svg b/api-doc/assets/rudder.svg deleted file mode 100644 index 7eb08a77a34..00000000000 --- a/api-doc/assets/rudder.svg +++ /dev/null @@ -1,55 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/api-doc/rapidoc.html b/api-doc/rapidoc.html index fae4175155a..55148129c36 100644 --- a/api-doc/rapidoc.html +++ b/api-doc/rapidoc.html @@ -18,8 +18,8 @@ sans-serif' mono-font='SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace' nav-bg-color="#041922" theme="light" nav-text-color="#ffffffaa" nav-accent-color="#13BEB7" primary-color="#13BEB7" allow-spec-file-download="true" info-description-headings-in-navbar="true"> - + - \ No newline at end of file + diff --git a/ci/rust.sh b/ci/rust.sh index 223b9ea46b6..e71c214c0c1 100755 --- a/ci/rust.sh +++ b/ci/rust.sh @@ -6,7 +6,7 @@ rustup component add clippy rustup component add rustfmt # Install pre-compiled sccache -SCCACHE_VER=0.8.1 +SCCACHE_VER=0.8.2 wget --quiet https://github.com/mozilla/sccache/releases/download/v$SCCACHE_VER/sccache-v$SCCACHE_VER-x86_64-unknown-linux-musl.tar.gz tar -xf sccache-v$SCCACHE_VER-x86_64-unknown-linux-musl.tar.gz chmod +x sccache-v$SCCACHE_VER-x86_64-unknown-linux-musl/sccache @@ -20,4 +20,4 @@ mv cargo-deny-$DENY_VER-x86_64-unknown-linux-musl/cargo-deny /usr/local/bin/ # Build & check tools cargo install --locked cargo-auditable@0.6.4 -cargo install --locked cargo-cyclonedx@0.5.5 +cargo install --locked cargo-cyclonedx@0.5.6 diff --git a/ci/typos.Dockerfile b/ci/typos.Dockerfile index efe3cbcdfc3..e28303a9a77 100644 --- a/ci/typos.Dockerfile +++ b/ci/typos.Dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.81.0-bookworm +FROM rust:1.83.0-bookworm LABEL ci=rudder/ci/typos.Dockerfile ARG VERSION diff --git a/deny.toml b/deny.toml index 689f672ec2c..9ac0f742fbb 100644 --- a/deny.toml +++ b/deny.toml @@ -13,6 +13,7 @@ allow = [ "BSD-3-Clause", "BSL-1.0", "MPL-2.0", + "Unicode-3.0", ] [advisories] diff --git a/logo/.gitignore b/logo/.gitignore new file mode 100644 index 00000000000..65537ab81c8 --- /dev/null +++ b/logo/.gitignore @@ -0,0 +1,3 @@ +*.png +*.ico +*.svgz diff --git a/logo/README.md b/logo/README.md index 33dea1903b6..a0cada6049d 100644 --- a/logo/README.md +++ b/logo/README.md @@ -8,22 +8,31 @@ black - - + + white - - + + monochrome black - - + + monochrome white - - + + + + + no text + + + +### Build + +The build the full set of icons (optimized SVG and PNG), use the `convert.sh` script. diff --git a/logo/convert.sh b/logo/convert.sh new file mode 100755 index 00000000000..9d2f0ee7c8d --- /dev/null +++ b/logo/convert.sh @@ -0,0 +1,68 @@ +#!/bin/bash + +# This script requires: +# +# * inkscape (best for SVG -> PNG) +# * svgo (for SVG optimization) +# * zopfli (best png opimizer: https://iter.ca/post/zopfli/) +# +# NOTE: This script aims at best size result over time, and should be used for one-shot jobs. + +set -e + +target="icons" +archive="rudder-logos" +rm -rf "${target}" "${archive}.*" + +sources="../webapp/sources/rudder/rudder-web/src/main/svg/logo/*.svg" +png_sizes=(512 1024) + +################################################# +# Favicon + +out_dir="${target}/favicons" +mkdir -p "${out_dir}" +cd ../webapp/sources/rudder/rudder-web/src/main/ && ./favicon.sh && cd - >/dev/null +cp ../webapp/sources/rudder/rudder-web/src/main/webapp/images/rudder-favicon.ico "${target}/favicons/" + +################################################# +### Optimized SVG + +out_dir="${target}/svg" +mkdir -p "${out_dir}" +for file in ${sources} +do + basename=$(basename "${file}") + out="${out_dir}/${basename}" + zout="${out_dir}/${basename%.svg}.svgz" + echo "${file}" + echo " optimizing (svgo) -> ${out}" + svgo --quiet --multipass --input "${file}" --output "${out}" + #echo " compressing (gzip) -> ${zout}" + #gzip --best --stdout "${out}" > "${zout}" +done + +################################################# +# Optimized PNG + +for file in ${sources} +do + echo "${file}" + for size in "${png_sizes[@]}" + do + out_dir="${target}/png/${size}px" + mkdir -p "${out_dir}" + basename=$(basename "${file}") + out="${out_dir}/${basename%.svg}.png" + echo " generating (inkscape, ${size}px) -> ${out}" + inkscape --export-filename="${out}" -w "${size}" "${file}" + echo " optimizing (zopflipng)" + zopflipng -y -m "${out}" "${out}" >/dev/null + done +done + +################################################# +# Archive + +zip -q -r "${archive}" icons +tar -czf "${archive}.tar.gz" icons diff --git a/logo/icons/svg/rudder-logo-notext.svg b/logo/icons/svg/rudder-logo-notext.svg new file mode 100644 index 00000000000..c6f38e36c8d --- /dev/null +++ b/logo/icons/svg/rudder-logo-notext.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/logo/icons/svg/rudder-logo-rect-black.svg b/logo/icons/svg/rudder-logo-rect-black.svg new file mode 100644 index 00000000000..997d4ac965b --- /dev/null +++ b/logo/icons/svg/rudder-logo-rect-black.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/logo/icons/svg/rudder-logo-rect-monochrome-black.svg b/logo/icons/svg/rudder-logo-rect-monochrome-black.svg new file mode 100644 index 00000000000..cc7b5e17c30 --- /dev/null +++ b/logo/icons/svg/rudder-logo-rect-monochrome-black.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/logo/icons/svg/rudder-logo-rect-monochrome-white.svg b/logo/icons/svg/rudder-logo-rect-monochrome-white.svg new file mode 100644 index 00000000000..728b3591dd0 --- /dev/null +++ b/logo/icons/svg/rudder-logo-rect-monochrome-white.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/logo/icons/svg/rudder-logo-rect-white.svg b/logo/icons/svg/rudder-logo-rect-white.svg new file mode 100644 index 00000000000..cc40e56ac3b --- /dev/null +++ b/logo/icons/svg/rudder-logo-rect-white.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/logo/icons/svg/rudder-logo-square-black.svg b/logo/icons/svg/rudder-logo-square-black.svg new file mode 100644 index 00000000000..a1d6dbc099f --- /dev/null +++ b/logo/icons/svg/rudder-logo-square-black.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/logo/icons/svg/rudder-logo-square-monochrome-black.svg b/logo/icons/svg/rudder-logo-square-monochrome-black.svg new file mode 100644 index 00000000000..5dd5a3258bf --- /dev/null +++ b/logo/icons/svg/rudder-logo-square-monochrome-black.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/logo/icons/svg/rudder-logo-square-monochrome-white.svg b/logo/icons/svg/rudder-logo-square-monochrome-white.svg new file mode 100644 index 00000000000..68d8c78b3f6 --- /dev/null +++ b/logo/icons/svg/rudder-logo-square-monochrome-white.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/logo/icons/svg/rudder-logo-square-white.svg b/logo/icons/svg/rudder-logo-square-white.svg new file mode 100644 index 00000000000..fa567437e8e --- /dev/null +++ b/logo/icons/svg/rudder-logo-square-white.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/policies/Dockerfile b/policies/Dockerfile index 6c627e29e08..bf51d7d68e9 100644 --- a/policies/Dockerfile +++ b/policies/Dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.81.0-bookworm +FROM rust:1.83.0-bookworm LABEL ci=rudder/policies/Dockerfile ARG USER_ID=1000 diff --git a/policies/minifusion/Cargo.toml b/policies/minifusion/Cargo.toml index c13c4932976..c93f115c5f6 100644 --- a/policies/minifusion/Cargo.toml +++ b/policies/minifusion/Cargo.toml @@ -9,8 +9,8 @@ repository.workspace = true license.workspace = true [dependencies] -quick-xml = { version = "0.36.0", features = ["serialize"] } -sysinfo = "0.31.0" +quick-xml = { version = "0.37.0", features = ["serialize"] } +sysinfo = "0.32.0" serde = { version = "1", features = ["derive"] } hostname = "0.4" anyhow = "1" diff --git a/policies/minifusion/src/main.rs b/policies/minifusion/src/main.rs index e512f9e1fce..36fa99a6a89 100644 --- a/policies/minifusion/src/main.rs +++ b/policies/minifusion/src/main.rs @@ -163,7 +163,7 @@ impl Inventory { }) .collect(); - sys.refresh_processes(ProcessesToUpdate::All); + sys.refresh_processes(ProcessesToUpdate::All, true); let processes = sys .processes() diff --git a/policies/module-types/system-updates/src/campaign.rs b/policies/module-types/system-updates/src/campaign.rs index af0cc324d8e..31d7112c051 100644 --- a/policies/module-types/system-updates/src/campaign.rs +++ b/policies/module-types/system-updates/src/campaign.rs @@ -118,7 +118,6 @@ impl FullSchedule { /// /// The returned outcome is not linked to the success of the update, but to the success of the /// process. The update itself can fail, but the process can be successful. - pub fn do_schedule( p: &RunnerParameters, db: &mut PackageDatabase, diff --git a/policies/module-types/system-updates/src/package_manager/zypper.rs b/policies/module-types/system-updates/src/package_manager/zypper.rs index 26159587a14..b87ed228403 100644 --- a/policies/module-types/system-updates/src/package_manager/zypper.rs +++ b/policies/module-types/system-updates/src/package_manager/zypper.rs @@ -18,7 +18,6 @@ use rudder_module_type::ensure_root_user; /// /// * SLES 12 SP5+ /// * SLES 15 SP2+ - pub struct ZypperPackageManager { rpm: RpmPackageManager, } diff --git a/policies/rudder-commons/Cargo.toml b/policies/rudder-commons/Cargo.toml index 386a7845b74..ab614b2ba2c 100644 --- a/policies/rudder-commons/Cargo.toml +++ b/policies/rudder-commons/Cargo.toml @@ -13,8 +13,8 @@ anyhow = "1" colored = "2" serde = { version = "1", features = ["derive"] } serde_json = "1" +fancy-regex = "0.14.0" serde_yaml = "0.9.34" -fancy-regex = "0.13.0" nom = "7" walkdir = "2" log = "0.4" diff --git a/policies/rudder-commons/src/methods/method.rs b/policies/rudder-commons/src/methods/method.rs index c92dc606380..70ba61baa5d 100644 --- a/policies/rudder-commons/src/methods/method.rs +++ b/policies/rudder-commons/src/methods/method.rs @@ -130,7 +130,6 @@ impl Default for Parameter { } /// Parser - impl FromStr for MethodInfo { type Err = Error; diff --git a/policies/rudderc/Cargo.toml b/policies/rudderc/Cargo.toml index dd9128153cd..9360cfc4015 100644 --- a/policies/rudderc/Cargo.toml +++ b/policies/rudderc/Cargo.toml @@ -13,7 +13,7 @@ anyhow = "1" askama = "0.12" boon = "0.6.0" clap = { version = "4", features = ["derive"] } -quick-xml = { version = "0.36.0", features = ["serialize"] } +quick-xml = { version = "0.37.0", features = ["serialize"] } regex = "1" mdbook = { version = "0.4.28", default-features = false, features = ["search"] } nom = "7.1.3" diff --git a/policies/rudderc/docs/src/images/rudder.svg b/policies/rudderc/docs/src/images/rudder.svg deleted file mode 100644 index 204974bfb1e..00000000000 --- a/policies/rudderc/docs/src/images/rudder.svg +++ /dev/null @@ -1,55 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/policies/rudderc/docs/src/syntax.md b/policies/rudderc/docs/src/syntax.md index 2cd98f9c573..49eccc751a7 100644 --- a/policies/rudderc/docs/src/syntax.md +++ b/policies/rudderc/docs/src/syntax.md @@ -78,9 +78,6 @@ Each parameter contains the following fields: * `md5-crypt`: md5-crypt hash. * `sha256-crypt`: sha256-crypt hash. * `sha512-crypt`: sha512-crypt hash. - * `md5-crypt-aix`: md5-crypt hash for AIX. - * `sha256-crypt-aix`: sha256-crypt hash for AIX. - * `sha512-crypt-aix`: sha512-crypt hash for AIX. Example: diff --git a/policies/rudderc/docs/src/usage.md b/policies/rudderc/docs/src/usage.md index bfb7041988d..743f07245c7 100644 --- a/policies/rudderc/docs/src/usage.md +++ b/policies/rudderc/docs/src/usage.md @@ -8,7 +8,7 @@ It is especially important as techniques are not run as YAML, but compiled into an executable policy file depending on the target platform. There are currently two possible targets, which are the platforms Rudder has agents for: -* Linux/AIX +* Linux * Windows These platforms use different agent technology, but the YAML policies diff --git a/policies/rudderc/src/backends/unix.rs b/policies/rudderc/src/backends/unix.rs index f88bac3a42a..8cf5eb86318 100644 --- a/policies/rudderc/src/backends/unix.rs +++ b/policies/rudderc/src/backends/unix.rs @@ -45,18 +45,16 @@ impl Unix { // Static content including parts of the system techniques required to run most techniques, // i.e. lib loading and global vars (`g.X`). let static_prelude = include_str!("unix/prelude.cf"); - let init = Promise::usebundle("rudder_test_init", None, None, vec![]); + let init = Promise::usebundle("rudder_test_init", None, vec![]); let policy_mode = Promise::usebundle( "set_dry_run_mode", None, - None, vec!["${rudder_test_init.dry_run}".to_string()], ); // "CIS audit/CIS 9.1 configure cron" usebundle => set_dry_run_mode("true"); let technique_call = Promise::usebundle( technique_id.to_string(), None, - None, params .iter() .map(|p| cfengine::quoted(&format!("${{rudder_test_init.test_case[params][{p}]}}"))) @@ -82,10 +80,7 @@ impl Backend for Unix { match r { ItemKind::Block(r) => { let mut calls: Vec<(Promise, Option)> = vec![]; - if let Some(x) = dry_run_mode::push_policy_mode( - r.policy_mode_override, - format!("push_policy_mode_for_block_{}", r.id), - ) { + if let Some(x) = dry_run_mode::push_policy_mode(r.policy_mode_override) { calls.push((x, None)) } for inner in r.items { @@ -95,10 +90,7 @@ impl Backend for Unix { technique_id, )?); } - if let Some(x) = dry_run_mode::pop_policy_mode( - r.policy_mode_override, - format!("pop_policy_mode_for_block_{}", r.id), - ) { + if let Some(x) = dry_run_mode::pop_policy_mode(r.policy_mode_override) { calls.push((x, None)) } Ok(calls) diff --git a/policies/rudderc/src/backends/unix/cfengine/bundle.rs b/policies/rudderc/src/backends/unix/cfengine/bundle.rs index b7805d69c38..4400a2dccf0 100644 --- a/policies/rudderc/src/backends/unix/cfengine/bundle.rs +++ b/policies/rudderc/src/backends/unix/cfengine/bundle.rs @@ -5,16 +5,11 @@ use std::{collections::HashMap, fmt}; use crate::backends::unix::cfengine::promise::{Promise, PromiseType, LONGEST_ATTRIBUTE_LEN}; -const NORMAL_ORDERING: [PromiseType; 2] = [PromiseType::Vars, PromiseType::Methods]; - -/// ID that must be unique for each technique instance. Combined with a simple index, -/// it allows enforcing all methods are called, even with identical parameters. -/// This has no semantic meaning and can almost be considered syntactic sugar. -pub const UNIQUE_ID: &str = "${report_data.directive_id}"; -/// Indexes over three chars -const INDEX_LEN: usize = 3; -/// Length of directive id + _ + index -pub const UNIQUE_ID_LEN: usize = UNIQUE_ID.len() + 1 + INDEX_LEN; +const NORMAL_ORDERING: [PromiseType; 3] = [ + PromiseType::Vars, + PromiseType::Classes, + PromiseType::Methods, +]; #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] pub enum BundleType { @@ -50,12 +45,28 @@ pub struct Bundle { impl Bundle { pub fn agent>(name: T) -> Self { - Self { + let mut r = Self { name: name.into(), bundle_type: BundleType::Agent, parameters: Vec::new(), promises: HashMap::new(), - } + }; + + // Global index increment, once per bundle call + let guard_class = "rudder_increment_guard"; + let increment = Promise::int( + "report_data.index", + "int(eval(\"${report_data.index}+1\", \"math\", \"infix\"))", + ) + .unless_condition(guard_class); + // take a snapshot of the index for local use, as it will be incremented by methods + let local = + Promise::int("local_index", "${report_data.index}").unless_condition(guard_class); + // equivalent to pass1 but don't mess with business logic + let guard = Promise::class_expression(guard_class, "any"); + r.add_promise_group(vec![increment, local]); + r.add_promise_group(vec![guard]); + r } pub fn parameters(self, parameters: Vec) -> Self { @@ -96,18 +107,20 @@ impl fmt::Display for Bundle { }, )?; + let mut index = 0; + for (promise_type, promises) in NORMAL_ORDERING .iter() .filter_map(|t| self.promises.get(t).map(|p| (t, p))) { writeln!(f, " {}:", promise_type)?; - for (index, group) in promises.iter().enumerate() { + for group in promises { // Align promise groups let mut max_promiser = group.iter().map(|p| p.promiser.len()).max().unwrap_or(0); // Take special method promiser into account if *promise_type == PromiseType::Methods { - max_promiser = std::cmp::max(max_promiser, UNIQUE_ID_LEN); + max_promiser = std::cmp::max(max_promiser, Promise::unique_id(index).len()); } for promise in group { @@ -116,6 +129,10 @@ impl fmt::Display for Bundle { "{}", promise.format(index, max_promiser + LONGEST_ATTRIBUTE_LEN + 3) )?; + // Avoid useless increment for readability + if *promise_type == PromiseType::Methods { + index += 1; + } } writeln!(f)?; } @@ -135,17 +152,37 @@ mod tests { fn format_bundle() { assert_eq!( Bundle::agent("test").to_string(), - "bundle agent test {\n\n}" + r#"bundle agent test { + + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + +}"# ); assert_eq!( Bundle::agent("test") .parameters(vec!["file".to_string(), "lines".to_string()]) - .promise_group(vec![Promise::usebundle("test", None, None, vec![])]) + .promise_group(vec![Promise::usebundle("test", None, vec![])]) .to_string(), r#"bundle agent test(file, lines) { + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + methods: - "${report_data.directive_id}_0" usebundle => test(); + "index_${local_index}_0" usebundle => test(); }"# ); diff --git a/policies/rudderc/src/backends/unix/cfengine/promise.rs b/policies/rudderc/src/backends/unix/cfengine/promise.rs index 32a69f483ec..12abb4bed74 100644 --- a/policies/rudderc/src/backends/unix/cfengine/promise.rs +++ b/policies/rudderc/src/backends/unix/cfengine/promise.rs @@ -1,13 +1,13 @@ // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: 2019-2022 Normation SAS +use crate::backends::unix::cfengine::quoted; use std::{collections::HashMap, fmt}; -use crate::backends::unix::cfengine::{bundle::UNIQUE_ID, quoted}; - #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)] pub enum PromiseType { Vars, + Classes, Methods, } @@ -18,6 +18,7 @@ impl fmt::Display for PromiseType { "{}", match self { PromiseType::Vars => "vars", + PromiseType::Classes => "classes", PromiseType::Methods => "methods", } ) @@ -31,11 +32,15 @@ pub enum AttributeType { If, String, Slist, + Int, + Expression, } -const ATTRIBUTES_ORDERING: [AttributeType; 5] = [ +const ATTRIBUTES_ORDERING: [AttributeType; 7] = [ AttributeType::UseBundle, AttributeType::String, + AttributeType::Int, + AttributeType::Expression, AttributeType::Slist, AttributeType::Unless, AttributeType::If, @@ -52,6 +57,12 @@ impl PromiseType { AttributeType::If, AttributeType::String, AttributeType::Slist, + AttributeType::Int, + ], + PromiseType::Classes => vec![ + AttributeType::Unless, + AttributeType::If, + AttributeType::Expression, ], PromiseType::Methods => vec![ AttributeType::Unless, @@ -75,6 +86,8 @@ impl fmt::Display for AttributeType { AttributeType::If => "if", AttributeType::String => "string", AttributeType::Slist => "slist", + AttributeType::Int => "int", + AttributeType::Expression => "expression", } ) } @@ -86,7 +99,6 @@ pub struct Promise { comments: Option, /// Module/state the promise calls component: Option, - id: Option, /// Type of the promise pub promise_type: PromiseType, /// Target of the promise @@ -100,13 +112,11 @@ impl Promise { pub fn new>( promise_type: PromiseType, component: Option, - id: Option, promiser: T, ) -> Self { Self { promise_type, component, - id, promiser: promiser.into(), attributes: HashMap::new(), comments: None, @@ -129,13 +139,17 @@ impl Promise { /// Shortcut for building a string variable with a raw value pub fn string_raw, S: AsRef>(name: T, value: S) -> Self { - Promise::new(PromiseType::Vars, None, None, name) - .attribute(AttributeType::String, value.as_ref()) + Promise::new(PromiseType::Vars, None, name).attribute(AttributeType::String, value.as_ref()) + } + + /// Shortcut for building an int variable with a raw value + pub fn int, S: AsRef>(name: T, value: S) -> Self { + Promise::new(PromiseType::Vars, None, name).attribute(AttributeType::Int, value.as_ref()) } /// Shortcut for building an slist variable with a list of values to be quoted pub fn slist, S: AsRef>(name: T, values: Vec) -> Self { - Promise::new(PromiseType::Vars, None, None, name).attribute( + Promise::new(PromiseType::Vars, None, name).attribute( AttributeType::Slist, format!( "{{{}}}", @@ -148,18 +162,24 @@ impl Promise { ) } + /// Shortcut for building a class expression + pub fn class_expression, S: AsRef>(name: T, value: S) -> Self { + Promise::new(PromiseType::Classes, None, name) + .attribute(AttributeType::Expression, quoted(value.as_ref())) + } + /// Shortcut for calling a bundle with parameters + /// + /// The promiser is automatically set to a unique value. pub fn usebundle>( bundle: T, component: Option<&str>, - id: Option<&str>, parameters: Vec, ) -> Self { Promise::new( PromiseType::Methods, component.map(String::from), - id.map(String::from), - "${report_data.method_id}", + "placeholder", ) .attribute( AttributeType::UseBundle, @@ -170,14 +190,16 @@ impl Promise { /// Shortcut to add a condition expression pub fn if_condition>(mut self, condition: T) -> Self { self.attributes - .insert(AttributeType::If, format!("\"{}\"", condition.as_ref())); + .insert(AttributeType::If, quoted(condition.as_ref()).to_string()); self } /// Shortcut for adding a condition expression pub fn unless_condition>(mut self, condition: T) -> Self { - self.attributes - .insert(AttributeType::Unless, format!("\"{}\"", condition.as_ref())); + self.attributes.insert( + AttributeType::Unless, + quoted(condition.as_ref()).to_string(), + ); self } @@ -194,24 +216,21 @@ impl Promise { self } + pub fn unique_id(index: usize) -> String { + format!("index_${{local_index}}_{}", index) + } + /// Index is used to make methods promises unique /// It is ignored in other cases // // padding for arrows is promiser len + max attribute name pub fn format(&self, index: usize, padding: usize) -> String { - let promiser = match self.id.clone() { - Some(id) if !id.is_empty() => id, - _ => { - if self.promise_type == PromiseType::Methods { - // Methods need to be unique - match self.component.clone() { - Some(method) => format!("{}_{}_{}", method, UNIQUE_ID, index), - None => format!("{}_{}", UNIQUE_ID, index), - } - } else { - self.promiser.clone() - } - } + let promiser = if self.promise_type == PromiseType::Methods { + // Always override the promiser for methods + // It is not used by CFEngine + quoted(&Self::unique_id(index)) + } else { + quoted(&self.promiser) }; let mut first = true; @@ -226,7 +245,7 @@ impl Promise { }; if self.attributes.is_empty() { - format!("{}\"{}\";", comment, self.promiser) + format!("{}{};", comment, promiser) } else { format!( "{}{};", @@ -239,7 +258,7 @@ impl Promise { first = false; format!( " {:width$} => {}", - quoted(&promiser), + promiser, k, v, promiser_width = padding - LONGEST_ATTRIBUTE_LEN - 1, @@ -261,32 +280,37 @@ mod tests { use pretty_assertions::assert_eq; use super::*; - use crate::backends::unix::cfengine::bundle::UNIQUE_ID_LEN; #[test] fn format_promise() { + let len = Promise::unique_id(0).len(); + assert_eq!( - Promise::new(PromiseType::Vars, None, None, "test") - .format(0, LONGEST_ATTRIBUTE_LEN + 3 + UNIQUE_ID_LEN), + Promise::new(PromiseType::Vars, None, "test") + .format(0, LONGEST_ATTRIBUTE_LEN + 3 + len), "\"test\";" ); assert_eq!( - Promise::new(PromiseType::Vars, None, None, "test") + Promise::new(PromiseType::Vars, None, "test") .comment("test") - .format(0, LONGEST_ATTRIBUTE_LEN + 3 + UNIQUE_ID_LEN), + .format(0, LONGEST_ATTRIBUTE_LEN + 3 + len), " # test\n\"test\";" ); assert_eq!( Promise::string("test", "plop") .if_condition("debian") - .format(0, LONGEST_ATTRIBUTE_LEN + 3 + UNIQUE_ID_LEN), - " \"test\" string => \"plop\",\n if => \"debian\";" + .format(0, LONGEST_ATTRIBUTE_LEN + 3 + len), + " \"test\" string => \"plop\",\n if => \"debian\";" ); assert_eq!( Promise::string("test", "plop") .if_condition("debian.${my.var}") - .format(0, LONGEST_ATTRIBUTE_LEN + 3 + UNIQUE_ID_LEN), - " \"test\" string => \"plop\",\n if => \"debian.${my.var}\";" + .format( 0,LONGEST_ATTRIBUTE_LEN + 3 + len), + " \"test\" string => \"plop\",\n if => \"debian.${my.var}\";" + ); + assert_eq!( + Promise::int("test", "24").format(0, LONGEST_ATTRIBUTE_LEN + 3 + len), + " \"test\" int => 24;" ); } } diff --git a/policies/rudderc/src/backends/unix/ncf/dry_run_mode.rs b/policies/rudderc/src/backends/unix/ncf/dry_run_mode.rs index 6d4700f2c0b..d9957ecd0db 100644 --- a/policies/rudderc/src/backends/unix/ncf/dry_run_mode.rs +++ b/policies/rudderc/src/backends/unix/ncf/dry_run_mode.rs @@ -2,12 +2,11 @@ use rudder_commons::PolicyMode; use crate::backends::unix::cfengine::{promise::Promise, quoted}; -pub fn push_policy_mode(op: Option, promiser: String) -> Option { +pub fn push_policy_mode(op: Option) -> Option { op.map(|p| { Promise::usebundle( "push_dry_run_mode", None, - Some(&promiser), vec![match p { PolicyMode::Enforce => quoted("false").to_string(), PolicyMode::Audit => quoted("true").to_string(), @@ -15,14 +14,9 @@ pub fn push_policy_mode(op: Option, promiser: String) -> Option, promiser: String) -> Option { +pub fn pop_policy_mode(op: Option) -> Option { if op.is_some() { - Some(Promise::usebundle( - "pop_dry_run_mode", - None, - Some(&promiser), - vec![], - )) + Some(Promise::usebundle("pop_dry_run_mode", None, vec![])) } else { None } diff --git a/policies/rudderc/src/backends/unix/ncf/method_call.rs b/policies/rudderc/src/backends/unix/ncf/method_call.rs index c798d3898d4..d15f00063b0 100644 --- a/policies/rudderc/src/backends/unix/ncf/method_call.rs +++ b/policies/rudderc/src/backends/unix/ncf/method_call.rs @@ -42,12 +42,6 @@ pub fn method_call( let info = m.info.unwrap(); let id = m.id.as_ref(); - // Uniqueness for re-execution. - // method_id is not enough due to iterators. - // It also needs to be evaluated at run time to get the maximal variability. - // WARN: this may be non-evaluated if the resulting string is too long. - let unique = &format!("{}_${{report_data.directive_id}}", m.id.as_ref()); - let very_unique = &format!("{}_${{report_data.directive_id}}_${{c_key}}", m.id.as_ref()); let c_id = canonify(id); let condition = condition.and(&m.condition); @@ -76,23 +70,12 @@ pub fn method_call( }) } - let enable_report = Promise::usebundle( - "enable_reporting", - Some(&report_component), - Some(very_unique), - vec![], - ); - let disable_report = Promise::usebundle( - "disable_reporting", - Some(&report_component), - Some(very_unique), - vec![], - ); + let enable_report = Promise::usebundle("enable_reporting", Some(&report_component), vec![]); + let disable_report = Promise::usebundle("disable_reporting", Some(&report_component), vec![]); let reporting_context = Promise::usebundle( "_method_reporting_context_v4", Some(&report_component), - Some(very_unique), vec![expanded("c_name"), expanded("c_key"), expanded("report_id")], ); @@ -100,7 +83,6 @@ pub fn method_call( let method = Promise::usebundle( &info.bundle_name, Some(&report_component), - Some(very_unique), parameters_names .iter() .map(|p| expanded(p.as_str())) @@ -111,61 +93,59 @@ pub fn method_call( info.bundle_name ); - let push_policy_mode = - dry_run_mode::push_policy_mode(m.policy_mode_override, very_unique.clone()); - let pop_policy_mode = - dry_run_mode::pop_policy_mode(m.policy_mode_override, very_unique.clone()); + let push_policy_mode = dry_run_mode::push_policy_mode(m.policy_mode_override); + let pop_policy_mode = dry_run_mode::pop_policy_mode(m.policy_mode_override); let incall_condition = "${method_call_condition}".to_string(); let mut promises = match (&condition, is_supported) { - (Condition::Expression(_), true) => vec![ - Some(reporting_context), - push_policy_mode, - Some(method.if_condition(incall_condition.clone())), - pop_policy_mode, - Some(Promise::usebundle("_classes_noop", Some(&report_component), Some(very_unique), vec![na_condition.clone()]).unless_condition(incall_condition.clone())), - Some(Promise::usebundle("log_rudder", Some(&report_component), Some(very_unique), vec![ - quoted(&format!("Skipping method '{}' with key parameter '{}' since condition '{}' is not reached", &method_name, &report_parameter, condition)), - quoted(&report_parameter), - na_condition.clone(), - na_condition, - "@{args}".to_string() - ]).unless_condition(incall_condition)) - ].into_iter().flatten().collect(), - (Condition::NotDefined, true) => vec![ - reporting_context, - Promise::usebundle("_classes_noop", Some(&report_component), Some(very_unique), vec![na_condition.clone()]), - Promise::usebundle("log_rudder", Some(&report_component), Some(very_unique), vec![ - quoted(&format!("Skipping method '{}' with key parameter '{}' since condition '{}' is not reached", &method_name, &report_parameter, condition)), + (Condition::Expression(_), true) => vec![ + Some(reporting_context), + push_policy_mode, + Some(method.if_condition(incall_condition.clone())), + pop_policy_mode, + Some(Promise::usebundle("_classes_noop", Some(&report_component), vec![na_condition.clone()]).unless_condition(incall_condition.clone())), + Some(Promise::usebundle("log_rudder", Some(&report_component), vec![ + quoted(&format!("Skipping method '{}' with key parameter '{}' since condition '{}' is not reached", &method_name, &report_parameter, condition)), + quoted(&report_parameter), + na_condition.clone(), + na_condition, + "@{args}".to_string() + ]).unless_condition(incall_condition)) + ].into_iter().flatten().collect(), + (Condition::NotDefined, true) => vec![ + reporting_context, + Promise::usebundle("_classes_noop", Some(&report_component), vec![na_condition.clone()]), + Promise::usebundle("log_rudder", Some(&report_component), vec![ + quoted(&format!("Skipping method '{}' with key parameter '{}' since condition '{}' is not reached", &method_name, &report_parameter, condition)), + quoted(&report_parameter), + na_condition.clone(), + na_condition, + "@{args}".to_string() + ]) + ], + (Condition::Defined, true) => vec![ + Some(reporting_context), + push_policy_mode, + Some(method), + pop_policy_mode, + ].into_iter().flatten().collect(), + (_, false) => vec![ + reporting_context, + Promise::usebundle( + "log_na_rudder", + Some(&report_component), + vec![ + quoted(&format!( + "'{}' method is not available on classic Rudder agent, skip", + report_parameter, + )), quoted(&report_parameter), - na_condition.clone(), - na_condition, - "@{args}".to_string() - ]) - ], - (Condition::Defined, true) => vec![ - Some(reporting_context), - push_policy_mode, - Some(method), - pop_policy_mode, - ].into_iter().flatten().collect(), - (_, false) => vec![ - reporting_context, - Promise::usebundle( - "log_na_rudder", - Some(&report_component), Some(very_unique), - vec![ - quoted(&format!( - "'{}' method is not available on classic Rudder agent, skip", - report_parameter, - )), - quoted(&report_parameter), - quoted(very_unique), - "@{args}".to_string(), - ], - ) - ], - }; + "@{args}".to_string(), + ], + ) + ], + }; + let bundle_content = match m.reporting.mode { LeafReportingMode::Disabled => { let mut res = vec![disable_report]; @@ -198,7 +178,7 @@ pub fn method_call( } call_parameters.append(&mut parameters); - let bundle_call = Promise::usebundle(bundle_name.clone(), None, Some(unique), call_parameters); + let bundle_call = Promise::usebundle(bundle_name.clone(), None, call_parameters); // Get everything together let mut specific_parameters = parameters_names; diff --git a/policies/rudderc/src/backends/unix/ncf/technique.rs b/policies/rudderc/src/backends/unix/ncf/technique.rs index 50b829d875f..c442d2bdba5 100644 --- a/policies/rudderc/src/backends/unix/ncf/technique.rs +++ b/policies/rudderc/src/backends/unix/ncf/technique.rs @@ -101,7 +101,22 @@ mod tests { .version("1.0") .bundle(Bundle::agent("test")) .to_string(), - "# @name test\n# @version 1.0\n\nbundle agent test {\n\n}\n" + r#"# @name test +# @version 1.0 + +bundle agent test { + + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + +} +"# ); } } diff --git a/policies/rudderc/src/ir/technique.rs b/policies/rudderc/src/ir/technique.rs index 87dece9ff7b..106c6355c11 100644 --- a/policies/rudderc/src/ir/technique.rs +++ b/policies/rudderc/src/ir/technique.rs @@ -237,8 +237,6 @@ impl PasswordType { // https://fedoraproject.org/wiki/Changes/yescrypt_as_default_hashing_method_for_shadow PasswordType::Sha256Crypt, PasswordType::Sha512Crypt, - PasswordType::Sha256CryptAix, - PasswordType::Sha512CryptAix, ] } } @@ -255,10 +253,6 @@ pub enum PasswordType { Md5Crypt, Sha256Crypt, Sha512Crypt, - // AIX uses specific variants of those crypt hashes - Md5CryptAix, - Sha256CryptAix, - Sha512CryptAix, UnixCryptDes, } @@ -277,9 +271,6 @@ impl Display for PasswordType { PasswordType::Md5Crypt => "linux-shadow-md5", PasswordType::Sha256Crypt => "linux-shadow-sha256", PasswordType::Sha512Crypt => "linux-shadow-sha512", - PasswordType::Md5CryptAix => "aix-smd5", - PasswordType::Sha256CryptAix => "aix-ssha256", - PasswordType::Sha512CryptAix => "aix-ssha512", PasswordType::UnixCryptDes => "unix-crypt-des", } ) diff --git a/policies/rudderc/src/technique.schema.json b/policies/rudderc/src/technique.schema.json index 631e7d809ee..933effd8751 100644 --- a/policies/rudderc/src/technique.schema.json +++ b/policies/rudderc/src/technique.schema.json @@ -124,10 +124,7 @@ "sha512", "md5-crypt", "sha256-crypt", - "sha512-crypt", - "md5-crypt-aix", - "sha256-crypt-aix", - "sha512-crypt-aix" + "sha512-crypt" ] } }, diff --git a/policies/rudderc/tests/cases/general/escaping/metadata.xml b/policies/rudderc/tests/cases/general/escaping/metadata.xml index 541e4cb7c8f..977499975d5 100644 --- a/policies/rudderc/tests/cases/general/escaping/metadata.xml +++ b/policies/rudderc/tests/cases/general/escaping/metadata.xml @@ -41,26 +41,20 @@
- - ${sys.host} . | / ${sys.${host}} ' '' ''' $ $$ " "" \ \\😋aà3 - - + ${sys.host} . | / ${sys.${host}} ' '' ''' $ $$ " "" \ \\😋aà3 +
- - ${sys.host} . | / ${sys.${host}} ' '' ''' $ $$ " "" \ \\😋aà3 - - + ${sys.host} . | / ${sys.${host}} ' '' ''' $ $$ " "" \ \\😋aà3 +
- - cache_prefix="zapache-$UID-${STATUS_URL//[^a-zA-Z0-9_-]/_}" - + cache_prefix="zapache-$UID-${STATUS_URL//[^a-zA-Z0-9_-]/_}"
diff --git a/policies/rudderc/tests/cases/general/escaping/technique.cf b/policies/rudderc/tests/cases/general/escaping/technique.cf index d4bc1853178..35851b50db9 100644 --- a/policies/rudderc/tests/cases/general/escaping/technique.cf +++ b/policies/rudderc/tests/cases/general/escaping/technique.cf @@ -5,50 +5,85 @@ bundle agent escaping(server) { vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + "args" slist => {"${server}"}; "report_param" string => join("_", args); "full_class_prefix" string => canonify("escaping_${report_param}"); "class_prefix" string => string_head("${full_class_prefix}", "1000"); + classes: + "rudder_increment_guard" expression => "any"; + methods: - "a86ce2e5-d5b6-45cc-87e8-c11cca71d966_${report_data.directive_id}" usebundle => call_escaping_a86ce2e5_d5b6_45cc_87e8_c11cca71d966("${sys.host} . | / ${sys.${host}} ' '' ''' $ $$ \" \"\" \\ \\\\😋aà3 + "index_${local_index}_0" usebundle => call_escaping_a86ce2e5_d5b6_45cc_87e8_c11cca71d966("${sys.host} . | / ${sys.${host}} ' '' ''' $ $$ \" \"\" \\ \\\\😋aà3 ", "${sys.host} . | / ${sys.${host}} ' '' ''' $ $$ \" \"\" \\ \\\\😋aà3 ", "a86ce2e5-d5b6-45cc-87e8-c11cca71d966", @{args}, "${class_prefix}", concat("",canonify("${my_cond}"),".debian|",canonify("${sys.${plouf}"),"}"), "${sys.host} . | / ${sys.${host}} ' '' ''' $ $$ \" \"\" \\ \\\\😋aà3 ", "if(Get-Service \"Zabbix agent\") { write-output \"exists\" }", "", ""); - "a86ce2e5-d5b6-45cc-87e8-c11cca71d977_${report_data.directive_id}" usebundle => call_escaping_a86ce2e5_d5b6_45cc_87e8_c11cca71d977("${sys.host} . | / ${sys.${host}} ' '' ''' $ $$ \" \"\" \\ \\\\😋aà3 + "index_${local_index}_1" usebundle => call_escaping_a86ce2e5_d5b6_45cc_87e8_c11cca71d977("${sys.host} . | / ${sys.${host}} ' '' ''' $ $$ \" \"\" \\ \\\\😋aà3 ", "${sys.host} . | / ${sys.${host}} ' '' ''' $ $$ \" \"\" \\ \\\\😋aà3 ", "a86ce2e5-d5b6-45cc-87e8-c11cca71d977", @{args}, "${class_prefix}", "${sys.host} . | / ${sys.${host}} ' '' ''' $ $$ \" \"\" \\ \\\\😋aà3 ", "if(Get-Service \"Zabbix agent\") { write-output \"exists\" }", "", ""); - "a86ce2e5-d5b6-45cc-87e8-c11cca71d978_${report_data.directive_id}" usebundle => call_escaping_a86ce2e5_d5b6_45cc_87e8_c11cca71d978("cache_prefix=\"zapache-$UID-${STATUS_URL//[^a-zA-Z0-9_-]/_}\" ", "cache_prefix=\"zapache-$UID-${STATUS_URL//[^a-zA-Z0-9_-]/_}\" ", "a86ce2e5-d5b6-45cc-87e8-c11cca71d978", @{args}, "${class_prefix}", "cache_prefix=\"zapache-$UID-${STATUS_URL//[^a-zA-Z0-9_-]/_}\" ", "plop", "", ""); + "index_${local_index}_2" usebundle => call_escaping_a86ce2e5_d5b6_45cc_87e8_c11cca71d978("cache_prefix=\"zapache-$UID-${STATUS_URL//[^a-zA-Z0-9_-]/_}\" ", "cache_prefix=\"zapache-$UID-${STATUS_URL//[^a-zA-Z0-9_-]/_}\" ", "a86ce2e5-d5b6-45cc-87e8-c11cca71d978", @{args}, "${class_prefix}", "cache_prefix=\"zapache-$UID-${STATUS_URL//[^a-zA-Z0-9_-]/_}\" ", "plop", "", ""); } bundle agent call_escaping_a86ce2e5_d5b6_45cc_87e8_c11cca71d966(c_name, c_key, report_id, args, class_prefix, method_call_condition, name, version, architecture, provider) { + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + methods: - "a86ce2e5-d5b6-45cc-87e8-c11cca71d966_${report_data.directive_id}_${c_key}" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); - "a86ce2e5-d5b6-45cc-87e8-c11cca71d966_${report_data.directive_id}_${c_key}" usebundle => package_present("${name}", "${version}", "${architecture}", "${provider}"), - if => "${method_call_condition}"; - "a86ce2e5-d5b6-45cc-87e8-c11cca71d966_${report_data.directive_id}_${c_key}" usebundle => _classes_noop(canonify("${class_prefix}_package_present_${c_key}")), - unless => "${method_call_condition}"; - "a86ce2e5-d5b6-45cc-87e8-c11cca71d966_${report_data.directive_id}_${c_key}" usebundle => log_rudder("Skipping method 'Package present' with key parameter '${sys.host} . | / ${sys.${host}} ' '' ''' $ $$ \" \"\" \\ \\\\😋aà3 + "index_${local_index}_0" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); + "index_${local_index}_1" usebundle => package_present("${name}", "${version}", "${architecture}", "${provider}"), + if => "${method_call_condition}"; + "index_${local_index}_2" usebundle => _classes_noop(canonify("${class_prefix}_package_present_${c_key}")), + unless => "${method_call_condition}"; + "index_${local_index}_3" usebundle => log_rudder("Skipping method 'Package present' with key parameter '${sys.host} . | / ${sys.${host}} ' '' ''' $ $$ \" \"\" \\ \\\\😋aà3 ' since condition '${my_cond}.debian|${sys.${plouf}}' is not reached", "${sys.host} . | / ${sys.${host}} ' '' ''' $ $$ \" \"\" \\ \\\\😋aà3 ", canonify("${class_prefix}_package_present_${c_key}"), canonify("${class_prefix}_package_present_${c_key}"), @{args}), - unless => "${method_call_condition}"; + unless => "${method_call_condition}"; } bundle agent call_escaping_a86ce2e5_d5b6_45cc_87e8_c11cca71d977(c_name, c_key, report_id, args, class_prefix, name, version, architecture, provider) { + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + methods: - "a86ce2e5-d5b6-45cc-87e8-c11cca71d977_${report_data.directive_id}_${c_key}" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); - "a86ce2e5-d5b6-45cc-87e8-c11cca71d977_${report_data.directive_id}_${c_key}" usebundle => package_present("${name}", "${version}", "${architecture}", "${provider}"); + "index_${local_index}_0" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); + "index_${local_index}_1" usebundle => package_present("${name}", "${version}", "${architecture}", "${provider}"); } bundle agent call_escaping_a86ce2e5_d5b6_45cc_87e8_c11cca71d978(c_name, c_key, report_id, args, class_prefix, name, version, architecture, provider) { + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + methods: - "a86ce2e5-d5b6-45cc-87e8-c11cca71d978_${report_data.directive_id}_${c_key}" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); - "a86ce2e5-d5b6-45cc-87e8-c11cca71d978_${report_data.directive_id}_${c_key}" usebundle => package_present("${name}", "${version}", "${architecture}", "${provider}"); + "index_${local_index}_0" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); + "index_${local_index}_1" usebundle => package_present("${name}", "${version}", "${architecture}", "${provider}"); } diff --git a/policies/rudderc/tests/cases/general/form/metadata.xml b/policies/rudderc/tests/cases/general/form/metadata.xml index 3a2cf1645c1..c5bb9552eef 100644 --- a/policies/rudderc/tests/cases/general/form/metadata.xml +++ b/policies/rudderc/tests/cases/general/form/metadata.xml @@ -41,9 +41,7 @@ textarea true - - \d* - + \d* @@ -93,7 +91,7 @@ server_g password - pre-hashed,linux-shadow-sha256,linux-shadow-sha512,aix-ssha256,aix-ssha512 + pre-hashed,linux-shadow-sha256,linux-shadow-sha512 @@ -157,9 +155,7 @@
- - htop - + htop
diff --git a/policies/rudderc/tests/cases/general/form/technique.cf b/policies/rudderc/tests/cases/general/form/technique.cf index d8dd66fe6ee..2bc4c11e24f 100644 --- a/policies/rudderc/tests/cases/general/form/technique.cf +++ b/policies/rudderc/tests/cases/general/form/technique.cf @@ -4,24 +4,41 @@ bundle agent form(server_a, server_b, server_c, server_d, server_e, server_f, server_g, server_h, server_i, server_j, server_k, server_l, server_m, server_n) { vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + "args" slist => {"${server_a}", "${server_b}", "${server_c}", "${server_d}", "${server_e}", "${server_f}", "${server_g}", "${server_h}", "${server_i}", "${server_j}", "${server_k}", "${server_l}", "${server_m}", "${server_n}"}; "report_param" string => join("_", args); "full_class_prefix" string => canonify("form_${report_param}"); "class_prefix" string => string_head("${full_class_prefix}", "1000"); + classes: + "rudder_increment_guard" expression => "any"; + methods: - "d86ce2e5-d5b6-45cc-87e8-c11cca71d907_${report_data.directive_id}" usebundle => call_form_d86ce2e5_d5b6_45cc_87e8_c11cca71d907("Ensure correct ntp configuration", "htop", "d86ce2e5-d5b6-45cc-87e8-c11cca71d907", @{args}, "${class_prefix}", "debian", "htop", "2.3.4", "", ""); + "index_${local_index}_0" usebundle => call_form_d86ce2e5_d5b6_45cc_87e8_c11cca71d907("Ensure correct ntp configuration", "htop", "d86ce2e5-d5b6-45cc-87e8-c11cca71d907", @{args}, "${class_prefix}", "debian", "htop", "2.3.4", "", ""); } bundle agent call_form_d86ce2e5_d5b6_45cc_87e8_c11cca71d907(c_name, c_key, report_id, args, class_prefix, method_call_condition, name, version, architecture, provider) { + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + methods: - "d86ce2e5-d5b6-45cc-87e8-c11cca71d907_${report_data.directive_id}_${c_key}" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); - "d86ce2e5-d5b6-45cc-87e8-c11cca71d907_${report_data.directive_id}_${c_key}" usebundle => package_present("${name}", "${version}", "${architecture}", "${provider}"), - if => "${method_call_condition}"; - "d86ce2e5-d5b6-45cc-87e8-c11cca71d907_${report_data.directive_id}_${c_key}" usebundle => _classes_noop(canonify("${class_prefix}_package_present_${c_key}")), - unless => "${method_call_condition}"; - "d86ce2e5-d5b6-45cc-87e8-c11cca71d907_${report_data.directive_id}_${c_key}" usebundle => log_rudder("Skipping method 'Package present' with key parameter 'htop' since condition 'debian' is not reached", "htop", canonify("${class_prefix}_package_present_${c_key}"), canonify("${class_prefix}_package_present_${c_key}"), @{args}), - unless => "${method_call_condition}"; + "index_${local_index}_0" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); + "index_${local_index}_1" usebundle => package_present("${name}", "${version}", "${architecture}", "${provider}"), + if => "${method_call_condition}"; + "index_${local_index}_2" usebundle => _classes_noop(canonify("${class_prefix}_package_present_${c_key}")), + unless => "${method_call_condition}"; + "index_${local_index}_3" usebundle => log_rudder("Skipping method 'Package present' with key parameter 'htop' since condition 'debian' is not reached", "htop", canonify("${class_prefix}_package_present_${c_key}"), canonify("${class_prefix}_package_present_${c_key}"), @{args}), + unless => "${method_call_condition}"; } diff --git a/policies/rudderc/tests/cases/general/long_method_param_name/metadata.xml b/policies/rudderc/tests/cases/general/long_method_param_name/metadata.xml index 03ebd45448d..8292fc39b20 100644 --- a/policies/rudderc/tests/cases/general/long_method_param_name/metadata.xml +++ b/policies/rudderc/tests/cases/general/long_method_param_name/metadata.xml @@ -26,9 +26,7 @@
- - This should be ReportMessage - + This should be ReportMessage
diff --git a/policies/rudderc/tests/cases/general/long_method_param_name/technique.cf b/policies/rudderc/tests/cases/general/long_method_param_name/technique.cf index e48dab78465..0e6a01bc4ac 100644 --- a/policies/rudderc/tests/cases/general/long_method_param_name/technique.cf +++ b/policies/rudderc/tests/cases/general/long_method_param_name/technique.cf @@ -4,19 +4,36 @@ bundle agent Windows_long_param_names { vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + "args" slist => {}; "report_param" string => join("_", args); "full_class_prefix" string => canonify("Windows_long_param_names_${report_param}"); "class_prefix" string => string_head("${full_class_prefix}", "1000"); + classes: + "rudder_increment_guard" expression => "any"; + methods: - "d86ce2e5-d5b6-45cc-87e8-c11cca71d907_${report_data.directive_id}" usebundle => call_Windows_long_param_names_d86ce2e5_d5b6_45cc_87e8_c11cca71d907("Report if condition", "This should be ReportMessage", "d86ce2e5-d5b6-45cc-87e8-c11cca71d907", @{args}, "${class_prefix}", "This should be ReportMessage", "it_generates_properly"); + "index_${local_index}_0" usebundle => call_Windows_long_param_names_d86ce2e5_d5b6_45cc_87e8_c11cca71d907("Report if condition", "This should be ReportMessage", "d86ce2e5-d5b6-45cc-87e8-c11cca71d907", @{args}, "${class_prefix}", "This should be ReportMessage", "it_generates_properly"); } bundle agent call_Windows_long_param_names_d86ce2e5_d5b6_45cc_87e8_c11cca71d907(c_name, c_key, report_id, args, class_prefix, report_message, condition) { + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + methods: - "d86ce2e5-d5b6-45cc-87e8-c11cca71d907_${report_data.directive_id}_${c_key}" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); - "d86ce2e5-d5b6-45cc-87e8-c11cca71d907_${report_data.directive_id}_${c_key}" usebundle => report_if_condition("${report_message}", "${condition}"); + "index_${local_index}_0" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); + "index_${local_index}_1" usebundle => report_if_condition("${report_message}", "${condition}"); } diff --git a/policies/rudderc/tests/cases/general/min/metadata.xml b/policies/rudderc/tests/cases/general/min/metadata.xml index 66f066cd3b3..88c1e620a9e 100644 --- a/policies/rudderc/tests/cases/general/min/metadata.xml +++ b/policies/rudderc/tests/cases/general/min/metadata.xml @@ -26,9 +26,7 @@
- - htop - + htop
diff --git a/policies/rudderc/tests/cases/general/min/technique.cf b/policies/rudderc/tests/cases/general/min/technique.cf index 187308a4ca1..cf7346ba3ce 100644 --- a/policies/rudderc/tests/cases/general/min/technique.cf +++ b/policies/rudderc/tests/cases/general/min/technique.cf @@ -4,19 +4,36 @@ bundle agent min { vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + "args" slist => {}; "report_param" string => join("_", args); "full_class_prefix" string => canonify("min_${report_param}"); "class_prefix" string => string_head("${full_class_prefix}", "1000"); + classes: + "rudder_increment_guard" expression => "any"; + methods: - "d86ce2e5-d5b6-45cc-87e8-c11cca71d907_${report_data.directive_id}" usebundle => call_min_d86ce2e5_d5b6_45cc_87e8_c11cca71d907("Package present", "htop", "d86ce2e5-d5b6-45cc-87e8-c11cca71d907", @{args}, "${class_prefix}", "htop", "2.3.4", "", ""); + "index_${local_index}_0" usebundle => call_min_d86ce2e5_d5b6_45cc_87e8_c11cca71d907("Package present", "htop", "d86ce2e5-d5b6-45cc-87e8-c11cca71d907", @{args}, "${class_prefix}", "htop", "2.3.4", "", ""); } bundle agent call_min_d86ce2e5_d5b6_45cc_87e8_c11cca71d907(c_name, c_key, report_id, args, class_prefix, name, version, architecture, provider) { + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + methods: - "d86ce2e5-d5b6-45cc-87e8-c11cca71d907_${report_data.directive_id}_${c_key}" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); - "d86ce2e5-d5b6-45cc-87e8-c11cca71d907_${report_data.directive_id}_${c_key}" usebundle => package_present("${name}", "${version}", "${architecture}", "${provider}"); + "index_${local_index}_0" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); + "index_${local_index}_1" usebundle => package_present("${name}", "${version}", "${architecture}", "${provider}"); } diff --git a/policies/rudderc/tests/cases/general/ntp/metadata.xml b/policies/rudderc/tests/cases/general/ntp/metadata.xml index 3c689ff3446..80f3bb32b9b 100644 --- a/policies/rudderc/tests/cases/general/ntp/metadata.xml +++ b/policies/rudderc/tests/cases/general/ntp/metadata.xml @@ -53,17 +53,13 @@
- - htop - + htop
- - /bin/true "# ${node.inventory[os][fullName]}" - + /bin/true "# ${node.inventory[os][fullName]}"
diff --git a/policies/rudderc/tests/cases/general/ntp/technique.cf b/policies/rudderc/tests/cases/general/ntp/technique.cf index efa02963aa1..7418a502f33 100644 --- a/policies/rudderc/tests/cases/general/ntp/technique.cf +++ b/policies/rudderc/tests/cases/general/ntp/technique.cf @@ -4,6 +4,11 @@ bundle agent ntp_technique(server) { vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + "resources_dir" string => "${this.promise_dirname}/resources"; "args" slist => {"${server}"}; @@ -11,29 +16,50 @@ bundle agent ntp_technique(server) { "full_class_prefix" string => canonify("ntp_technique_${report_param}"); "class_prefix" string => string_head("${full_class_prefix}", "1000"); + classes: + "rudder_increment_guard" expression => "any"; + methods: - "d86ce2e5-d5b6-45cc-87e8-c11cca71d907_${report_data.directive_id}" usebundle => call_ntp_technique_d86ce2e5_d5b6_45cc_87e8_c11cca71d907("Ensure correct ntp configuration", "htop", "d86ce2e5-d5b6-45cc-87e8-c11cca71d907", @{args}, "${class_prefix}", "htop", "2.3.4", "", ""); + "index_${local_index}_0" usebundle => call_ntp_technique_d86ce2e5_d5b6_45cc_87e8_c11cca71d907("Ensure correct ntp configuration", "htop", "d86ce2e5-d5b6-45cc-87e8-c11cca71d907", @{args}, "${class_prefix}", "htop", "2.3.4", "", ""); - "cf06e919-02b7-41a7-a03f-4239592f3c12_${report_data.directive_id}" usebundle => call_ntp_technique_cf06e919_02b7_41a7_a03f_4239592f3c12("NTP service", "/bin/true \"# ${node.inventory[os][fullName]}\"", "cf06e919-02b7-41a7-a03f-4239592f3c12", @{args}, "${class_prefix}", "linux.fedora", "/bin/true \"# ${node.inventory[os][fullName]}\""); + "index_${local_index}_1" usebundle => call_ntp_technique_cf06e919_02b7_41a7_a03f_4239592f3c12("NTP service", "/bin/true \"# ${node.inventory[os][fullName]}\"", "cf06e919-02b7-41a7-a03f-4239592f3c12", @{args}, "${class_prefix}", "linux.fedora", "/bin/true \"# ${node.inventory[os][fullName]}\""); } bundle agent call_ntp_technique_d86ce2e5_d5b6_45cc_87e8_c11cca71d907(c_name, c_key, report_id, args, class_prefix, name, version, architecture, provider) { + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + methods: - "d86ce2e5-d5b6-45cc-87e8-c11cca71d907_${report_data.directive_id}_${c_key}" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); - "d86ce2e5-d5b6-45cc-87e8-c11cca71d907_${report_data.directive_id}_${c_key}" usebundle => _classes_noop(canonify("${class_prefix}_package_present_${c_key}")); - "d86ce2e5-d5b6-45cc-87e8-c11cca71d907_${report_data.directive_id}_${c_key}" usebundle => log_rudder("Skipping method 'Package present' with key parameter 'htop' since condition 'false' is not reached", "htop", canonify("${class_prefix}_package_present_${c_key}"), canonify("${class_prefix}_package_present_${c_key}"), @{args}); + "index_${local_index}_0" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); + "index_${local_index}_1" usebundle => _classes_noop(canonify("${class_prefix}_package_present_${c_key}")); + "index_${local_index}_2" usebundle => log_rudder("Skipping method 'Package present' with key parameter 'htop' since condition 'false' is not reached", "htop", canonify("${class_prefix}_package_present_${c_key}"), canonify("${class_prefix}_package_present_${c_key}"), @{args}); } bundle agent call_ntp_technique_cf06e919_02b7_41a7_a03f_4239592f3c12(c_name, c_key, report_id, args, class_prefix, method_call_condition, name) { + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + methods: - "cf06e919-02b7-41a7-a03f-4239592f3c12_${report_data.directive_id}_${c_key}" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); - "cf06e919-02b7-41a7-a03f-4239592f3c12_${report_data.directive_id}_${c_key}" usebundle => package_install("${name}"), - if => "${method_call_condition}"; - "cf06e919-02b7-41a7-a03f-4239592f3c12_${report_data.directive_id}_${c_key}" usebundle => _classes_noop(canonify("${class_prefix}_package_install_${c_key}")), - unless => "${method_call_condition}"; - "cf06e919-02b7-41a7-a03f-4239592f3c12_${report_data.directive_id}_${c_key}" usebundle => log_rudder("Skipping method 'Package install' with key parameter '/bin/true \"# ${node.inventory[os][fullName]}\"' since condition 'linux.fedora' is not reached", "/bin/true \"# ${node.inventory[os][fullName]}\"", canonify("${class_prefix}_package_install_${c_key}"), canonify("${class_prefix}_package_install_${c_key}"), @{args}), - unless => "${method_call_condition}"; + "index_${local_index}_0" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); + "index_${local_index}_1" usebundle => package_install("${name}"), + if => "${method_call_condition}"; + "index_${local_index}_2" usebundle => _classes_noop(canonify("${class_prefix}_package_install_${c_key}")), + unless => "${method_call_condition}"; + "index_${local_index}_3" usebundle => log_rudder("Skipping method 'Package install' with key parameter '/bin/true \"# ${node.inventory[os][fullName]}\"' since condition 'linux.fedora' is not reached", "/bin/true \"# ${node.inventory[os][fullName]}\"", canonify("${class_prefix}_package_install_${c_key}"), canonify("${class_prefix}_package_install_${c_key}"), @{args}), + unless => "${method_call_condition}"; } diff --git a/policies/rudderc/tests/cases/general/param_in_condition/metadata.xml b/policies/rudderc/tests/cases/general/param_in_condition/metadata.xml index 98b19a328b0..ad10d5247d6 100644 --- a/policies/rudderc/tests/cases/general/param_in_condition/metadata.xml +++ b/policies/rudderc/tests/cases/general/param_in_condition/metadata.xml @@ -36,16 +36,12 @@
- - /tmp/${file} - + /tmp/${file}
- - echo "May be executed or not" - + echo "May be executed or not"
diff --git a/policies/rudderc/tests/cases/general/param_in_condition/technique.cf b/policies/rudderc/tests/cases/general/param_in_condition/technique.cf index 41f9ccd595f..f58fc8d34ba 100644 --- a/policies/rudderc/tests/cases/general/param_in_condition/technique.cf +++ b/policies/rudderc/tests/cases/general/param_in_condition/technique.cf @@ -4,33 +4,59 @@ bundle agent param_in_condition(file) { vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + "args" slist => {"${file}"}; "report_param" string => join("_", args); "full_class_prefix" string => canonify("param_in_condition_${report_param}"); "class_prefix" string => string_head("${full_class_prefix}", "1000"); + classes: + "rudder_increment_guard" expression => "any"; + methods: - "9e763779-9f33-44bc-ad73-1c5d5732301c_${report_data.directive_id}" usebundle => call_param_in_condition_9e763779_9f33_44bc_ad73_1c5d5732301c("Check if a file exists", "/tmp/${file}", "9e763779-9f33-44bc-ad73-1c5d5732301c", @{args}, "${class_prefix}", "/tmp/${file}"); + "index_${local_index}_0" usebundle => call_param_in_condition_9e763779_9f33_44bc_ad73_1c5d5732301c("Check if a file exists", "/tmp/${file}", "9e763779-9f33-44bc-ad73-1c5d5732301c", @{args}, "${class_prefix}", "/tmp/${file}"); - "e8362340-dc50-4231-9b7f-748b51e9fa07_${report_data.directive_id}" usebundle => call_param_in_condition_e8362340_dc50_4231_9b7f_748b51e9fa07("Execute only if...", "echo \"May be executed or not\"", "e8362340-dc50-4231-9b7f-748b51e9fa07", @{args}, "${class_prefix}", concat("file_check_exists__tmp_",canonify("${file}"),"_kept"), "echo \"May be executed or not\""); + "index_${local_index}_1" usebundle => call_param_in_condition_e8362340_dc50_4231_9b7f_748b51e9fa07("Execute only if...", "echo \"May be executed or not\"", "e8362340-dc50-4231-9b7f-748b51e9fa07", @{args}, "${class_prefix}", concat("file_check_exists__tmp_",canonify("${file}"),"_kept"), "echo \"May be executed or not\""); } bundle agent call_param_in_condition_9e763779_9f33_44bc_ad73_1c5d5732301c(c_name, c_key, report_id, args, class_prefix, path) { + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + methods: - "9e763779-9f33-44bc-ad73-1c5d5732301c_${report_data.directive_id}_${c_key}" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); - "9e763779-9f33-44bc-ad73-1c5d5732301c_${report_data.directive_id}_${c_key}" usebundle => file_check_exists("${path}"); + "index_${local_index}_0" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); + "index_${local_index}_1" usebundle => file_check_exists("${path}"); } bundle agent call_param_in_condition_e8362340_dc50_4231_9b7f_748b51e9fa07(c_name, c_key, report_id, args, class_prefix, method_call_condition, command) { + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + methods: - "e8362340-dc50-4231-9b7f-748b51e9fa07_${report_data.directive_id}_${c_key}" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); - "e8362340-dc50-4231-9b7f-748b51e9fa07_${report_data.directive_id}_${c_key}" usebundle => command_execution("${command}"), - if => "${method_call_condition}"; - "e8362340-dc50-4231-9b7f-748b51e9fa07_${report_data.directive_id}_${c_key}" usebundle => _classes_noop(canonify("${class_prefix}_command_execution_${c_key}")), - unless => "${method_call_condition}"; - "e8362340-dc50-4231-9b7f-748b51e9fa07_${report_data.directive_id}_${c_key}" usebundle => log_rudder("Skipping method 'Command execution' with key parameter 'echo \"May be executed or not\"' since condition 'file_check_exists__tmp_${file}_kept' is not reached", "echo \"May be executed or not\"", canonify("${class_prefix}_command_execution_${c_key}"), canonify("${class_prefix}_command_execution_${c_key}"), @{args}), - unless => "${method_call_condition}"; + "index_${local_index}_0" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); + "index_${local_index}_1" usebundle => command_execution("${command}"), + if => "${method_call_condition}"; + "index_${local_index}_2" usebundle => _classes_noop(canonify("${class_prefix}_command_execution_${c_key}")), + unless => "${method_call_condition}"; + "index_${local_index}_3" usebundle => log_rudder("Skipping method 'Command execution' with key parameter 'echo \"May be executed or not\"' since condition 'file_check_exists__tmp_${file}_kept' is not reached", "echo \"May be executed or not\"", canonify("${class_prefix}_command_execution_${c_key}"), canonify("${class_prefix}_command_execution_${c_key}"), @{args}), + unless => "${method_call_condition}"; } diff --git a/policies/rudderc/tests/cases/general/policy_mode/metadata.xml b/policies/rudderc/tests/cases/general/policy_mode/metadata.xml index c12aec0aaa8..408ea6a6d88 100644 --- a/policies/rudderc/tests/cases/general/policy_mode/metadata.xml +++ b/policies/rudderc/tests/cases/general/policy_mode/metadata.xml @@ -26,75 +26,55 @@
- - /tmp/1 - + /tmp/1
- - /tmp/1 - + /tmp/1
- - /tmp/1 - + /tmp/1
- - /tmp/1 - + /tmp/1
- - /tmp/1 - + /tmp/1
- - /tmp/1 - + /tmp/1
- - /tmp/1 - + /tmp/1
- - /tmp/1 - + /tmp/1
- - /tmp/1 - + /tmp/1
- - /tmp/1 - + /tmp/1
@@ -102,17 +82,13 @@
- - /tmp/1 - + /tmp/1
- - /tmp/1 - + /tmp/1
diff --git a/policies/rudderc/tests/cases/general/policy_mode/technique.cf b/policies/rudderc/tests/cases/general/policy_mode/technique.cf index fbdebc81325..c4e8310a307 100644 --- a/policies/rudderc/tests/cases/general/policy_mode/technique.cf +++ b/policies/rudderc/tests/cases/general/policy_mode/technique.cf @@ -4,146 +4,262 @@ bundle agent test_audit { vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + "args" slist => {}; "report_param" string => join("_", args); "full_class_prefix" string => canonify("test_audit_${report_param}"); "class_prefix" string => string_head("${full_class_prefix}", "1000"); + classes: + "rudder_increment_guard" expression => "any"; + methods: - "46b8025a-0b06-485c-9127-50e4258ee7e6_${report_data.directive_id}" usebundle => call_test_audit_46b8025a_0b06_485c_9127_50e4258ee7e6("In audit mode", "/tmp/1", "46b8025a-0b06-485c-9127-50e4258ee7e6", @{args}, "${class_prefix}", "/tmp/1", "foobar", "true"); + "index_${local_index}_0" usebundle => call_test_audit_46b8025a_0b06_485c_9127_50e4258ee7e6("In audit mode", "/tmp/1", "46b8025a-0b06-485c-9127-50e4258ee7e6", @{args}, "${class_prefix}", "/tmp/1", "foobar", "true"); - "1eedce7b-3441-4251-bdd6-706fda3ec7a8_${report_data.directive_id}" usebundle => call_test_audit_1eedce7b_3441_4251_bdd6_706fda3ec7a8("In omit mode", "/tmp/1", "1eedce7b-3441-4251-bdd6-706fda3ec7a8", @{args}, "${class_prefix}", "/tmp/1", "foobar", "true"); + "index_${local_index}_1" usebundle => call_test_audit_1eedce7b_3441_4251_bdd6_706fda3ec7a8("In omit mode", "/tmp/1", "1eedce7b-3441-4251-bdd6-706fda3ec7a8", @{args}, "${class_prefix}", "/tmp/1", "foobar", "true"); - "dbd5ba50-8dfc-11ee-a57e-84a938c470d4_${report_data.directive_id}" usebundle => call_test_audit_dbd5ba50_8dfc_11ee_a57e_84a938c470d4("In enforce mode", "/tmp/1", "dbd5ba50-8dfc-11ee-a57e-84a938c470d4", @{args}, "${class_prefix}", "/tmp/1", "foobar", "true"); + "index_${local_index}_2" usebundle => call_test_audit_dbd5ba50_8dfc_11ee_a57e_84a938c470d4("In enforce mode", "/tmp/1", "dbd5ba50-8dfc-11ee-a57e-84a938c470d4", @{args}, "${class_prefix}", "/tmp/1", "foobar", "true"); - "1d809592-808e-4177-8351-8b7b7769af69_${report_data.directive_id}" usebundle => call_test_audit_1d809592_808e_4177_8351_8b7b7769af69("In default mode", "/tmp/1", "1d809592-808e-4177-8351-8b7b7769af69", @{args}, "${class_prefix}", "/tmp/1", "foobar", "true"); + "index_${local_index}_3" usebundle => call_test_audit_1d809592_808e_4177_8351_8b7b7769af69("In default mode", "/tmp/1", "1d809592-808e-4177-8351-8b7b7769af69", @{args}, "${class_prefix}", "/tmp/1", "foobar", "true"); - "push_policy_mode_for_block_57f54359-2b2e-49f9-ab61-a77705615302" usebundle => push_dry_run_mode("true"); + "index_${local_index}_4" usebundle => push_dry_run_mode("true"); - "ea274579-40fc-4545-b384-8d5576a7c69b_${report_data.directive_id}" usebundle => call_test_audit_ea274579_40fc_4545_b384_8d5576a7c69b("Resolve to audit", "/tmp/1", "ea274579-40fc-4545-b384-8d5576a7c69b", @{args}, "${class_prefix}", "/tmp/1", "foobar", "true"); + "index_${local_index}_5" usebundle => call_test_audit_ea274579_40fc_4545_b384_8d5576a7c69b("Resolve to audit", "/tmp/1", "ea274579-40fc-4545-b384-8d5576a7c69b", @{args}, "${class_prefix}", "/tmp/1", "foobar", "true"); - "85659b7e-968c-458c-b566-c90108c50833_${report_data.directive_id}" usebundle => call_test_audit_85659b7e_968c_458c_b566_c90108c50833("Resolve to enforce", "/tmp/1", "85659b7e-968c-458c-b566-c90108c50833", @{args}, "${class_prefix}", "/tmp/1", "foobar", "true"); + "index_${local_index}_6" usebundle => call_test_audit_85659b7e_968c_458c_b566_c90108c50833("Resolve to enforce", "/tmp/1", "85659b7e-968c-458c-b566-c90108c50833", @{args}, "${class_prefix}", "/tmp/1", "foobar", "true"); - "d8def455-cd43-441f-8dba-1ebae3a29389_${report_data.directive_id}" usebundle => call_test_audit_d8def455_cd43_441f_8dba_1ebae3a29389("Resolve to audit", "/tmp/1", "d8def455-cd43-441f-8dba-1ebae3a29389", @{args}, "${class_prefix}", "/tmp/1", "foobar", "true"); + "index_${local_index}_7" usebundle => call_test_audit_d8def455_cd43_441f_8dba_1ebae3a29389("Resolve to audit", "/tmp/1", "d8def455-cd43-441f-8dba-1ebae3a29389", @{args}, "${class_prefix}", "/tmp/1", "foobar", "true"); - "pop_policy_mode_for_block_57f54359-2b2e-49f9-ab61-a77705615302" usebundle => pop_dry_run_mode(); + "index_${local_index}_8" usebundle => pop_dry_run_mode(); - "push_policy_mode_for_block_1ff82fc2-38fc-4324-92ab-3de5fafcdc14" usebundle => push_dry_run_mode("false"); + "index_${local_index}_9" usebundle => push_dry_run_mode("false"); - "f9417d97-3a18-4db6-85c3-72e28618bff1_${report_data.directive_id}" usebundle => call_test_audit_f9417d97_3a18_4db6_85c3_72e28618bff1("Resolve to audit", "/tmp/1", "f9417d97-3a18-4db6-85c3-72e28618bff1", @{args}, "${class_prefix}", "/tmp/1", "foobar", "true"); + "index_${local_index}_10" usebundle => call_test_audit_f9417d97_3a18_4db6_85c3_72e28618bff1("Resolve to audit", "/tmp/1", "f9417d97-3a18-4db6-85c3-72e28618bff1", @{args}, "${class_prefix}", "/tmp/1", "foobar", "true"); - "c4b4faa1-85e5-4922-b713-c198bf99226e_${report_data.directive_id}" usebundle => call_test_audit_c4b4faa1_85e5_4922_b713_c198bf99226e("Resolve to enforce", "/tmp/1", "c4b4faa1-85e5-4922-b713-c198bf99226e", @{args}, "${class_prefix}", "/tmp/1", "foobar", "true"); + "index_${local_index}_11" usebundle => call_test_audit_c4b4faa1_85e5_4922_b713_c198bf99226e("Resolve to enforce", "/tmp/1", "c4b4faa1-85e5-4922-b713-c198bf99226e", @{args}, "${class_prefix}", "/tmp/1", "foobar", "true"); - "cce62a59-bd17-4858-ba06-6ae41f39b15a_${report_data.directive_id}" usebundle => call_test_audit_cce62a59_bd17_4858_ba06_6ae41f39b15a("Resolve to enforce", "/tmp/1", "cce62a59-bd17-4858-ba06-6ae41f39b15a", @{args}, "${class_prefix}", "/tmp/1", "foobar", "true"); + "index_${local_index}_12" usebundle => call_test_audit_cce62a59_bd17_4858_ba06_6ae41f39b15a("Resolve to enforce", "/tmp/1", "cce62a59-bd17-4858-ba06-6ae41f39b15a", @{args}, "${class_prefix}", "/tmp/1", "foobar", "true"); - "pop_policy_mode_for_block_1ff82fc2-38fc-4324-92ab-3de5fafcdc14" usebundle => pop_dry_run_mode(); + "index_${local_index}_13" usebundle => pop_dry_run_mode(); - "push_policy_mode_for_block_7def389a-78d2-4104-b6fc-19c74f14fe93" usebundle => push_dry_run_mode("false"); + "index_${local_index}_14" usebundle => push_dry_run_mode("false"); - "push_policy_mode_for_block_9fca6ca8-ccaa-4688-a5fc-e2a0d9d60165" usebundle => push_dry_run_mode("true"); + "index_${local_index}_15" usebundle => push_dry_run_mode("true"); - "0a4299dd-0902-48b2-85ee-13dfe6fc3af6_${report_data.directive_id}" usebundle => call_test_audit_0a4299dd_0902_48b2_85ee_13dfe6fc3af6("Resolve to audit", "/tmp/1", "0a4299dd-0902-48b2-85ee-13dfe6fc3af6", @{args}, "${class_prefix}", "/tmp/1", "foobar", "true"); + "index_${local_index}_16" usebundle => call_test_audit_0a4299dd_0902_48b2_85ee_13dfe6fc3af6("Resolve to audit", "/tmp/1", "0a4299dd-0902-48b2-85ee-13dfe6fc3af6", @{args}, "${class_prefix}", "/tmp/1", "foobar", "true"); - "pop_policy_mode_for_block_9fca6ca8-ccaa-4688-a5fc-e2a0d9d60165" usebundle => pop_dry_run_mode(); + "index_${local_index}_17" usebundle => pop_dry_run_mode(); - "3b8352df-1329-4956-a019-bb9c072bc830_${report_data.directive_id}" usebundle => call_test_audit_3b8352df_1329_4956_a019_bb9c072bc830("Resolve to enforce", "/tmp/1", "3b8352df-1329-4956-a019-bb9c072bc830", @{args}, "${class_prefix}", "/tmp/1", "foobar", "true"); + "index_${local_index}_18" usebundle => call_test_audit_3b8352df_1329_4956_a019_bb9c072bc830("Resolve to enforce", "/tmp/1", "3b8352df-1329-4956-a019-bb9c072bc830", @{args}, "${class_prefix}", "/tmp/1", "foobar", "true"); - "pop_policy_mode_for_block_7def389a-78d2-4104-b6fc-19c74f14fe93" usebundle => pop_dry_run_mode(); + "index_${local_index}_19" usebundle => pop_dry_run_mode(); } bundle agent call_test_audit_46b8025a_0b06_485c_9127_50e4258ee7e6(c_name, c_key, report_id, args, class_prefix, path, lines, enforce) { + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + methods: - "46b8025a-0b06-485c-9127-50e4258ee7e6_${report_data.directive_id}_${c_key}" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); - "46b8025a-0b06-485c-9127-50e4258ee7e6_${report_data.directive_id}_${c_key}" usebundle => push_dry_run_mode("true"); - "46b8025a-0b06-485c-9127-50e4258ee7e6_${report_data.directive_id}_${c_key}" usebundle => file_content("${path}", "${lines}", "${enforce}"); - "46b8025a-0b06-485c-9127-50e4258ee7e6_${report_data.directive_id}_${c_key}" usebundle => pop_dry_run_mode(); + "index_${local_index}_0" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); + "index_${local_index}_1" usebundle => push_dry_run_mode("true"); + "index_${local_index}_2" usebundle => file_content("${path}", "${lines}", "${enforce}"); + "index_${local_index}_3" usebundle => pop_dry_run_mode(); } bundle agent call_test_audit_1eedce7b_3441_4251_bdd6_706fda3ec7a8(c_name, c_key, report_id, args, class_prefix, path, lines, enforce) { + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + methods: - "1eedce7b-3441-4251-bdd6-706fda3ec7a8_${report_data.directive_id}_${c_key}" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); - "1eedce7b-3441-4251-bdd6-706fda3ec7a8_${report_data.directive_id}_${c_key}" usebundle => file_content("${path}", "${lines}", "${enforce}"); + "index_${local_index}_0" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); + "index_${local_index}_1" usebundle => file_content("${path}", "${lines}", "${enforce}"); } bundle agent call_test_audit_dbd5ba50_8dfc_11ee_a57e_84a938c470d4(c_name, c_key, report_id, args, class_prefix, path, lines, enforce) { + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + methods: - "dbd5ba50-8dfc-11ee-a57e-84a938c470d4_${report_data.directive_id}_${c_key}" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); - "dbd5ba50-8dfc-11ee-a57e-84a938c470d4_${report_data.directive_id}_${c_key}" usebundle => push_dry_run_mode("false"); - "dbd5ba50-8dfc-11ee-a57e-84a938c470d4_${report_data.directive_id}_${c_key}" usebundle => file_content("${path}", "${lines}", "${enforce}"); - "dbd5ba50-8dfc-11ee-a57e-84a938c470d4_${report_data.directive_id}_${c_key}" usebundle => pop_dry_run_mode(); + "index_${local_index}_0" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); + "index_${local_index}_1" usebundle => push_dry_run_mode("false"); + "index_${local_index}_2" usebundle => file_content("${path}", "${lines}", "${enforce}"); + "index_${local_index}_3" usebundle => pop_dry_run_mode(); } bundle agent call_test_audit_1d809592_808e_4177_8351_8b7b7769af69(c_name, c_key, report_id, args, class_prefix, path, lines, enforce) { + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + methods: - "1d809592-808e-4177-8351-8b7b7769af69_${report_data.directive_id}_${c_key}" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); - "1d809592-808e-4177-8351-8b7b7769af69_${report_data.directive_id}_${c_key}" usebundle => file_content("${path}", "${lines}", "${enforce}"); + "index_${local_index}_0" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); + "index_${local_index}_1" usebundle => file_content("${path}", "${lines}", "${enforce}"); } bundle agent call_test_audit_ea274579_40fc_4545_b384_8d5576a7c69b(c_name, c_key, report_id, args, class_prefix, path, lines, enforce) { + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + methods: - "ea274579-40fc-4545-b384-8d5576a7c69b_${report_data.directive_id}_${c_key}" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); - "ea274579-40fc-4545-b384-8d5576a7c69b_${report_data.directive_id}_${c_key}" usebundle => push_dry_run_mode("true"); - "ea274579-40fc-4545-b384-8d5576a7c69b_${report_data.directive_id}_${c_key}" usebundle => file_content("${path}", "${lines}", "${enforce}"); - "ea274579-40fc-4545-b384-8d5576a7c69b_${report_data.directive_id}_${c_key}" usebundle => pop_dry_run_mode(); + "index_${local_index}_0" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); + "index_${local_index}_1" usebundle => push_dry_run_mode("true"); + "index_${local_index}_2" usebundle => file_content("${path}", "${lines}", "${enforce}"); + "index_${local_index}_3" usebundle => pop_dry_run_mode(); } bundle agent call_test_audit_85659b7e_968c_458c_b566_c90108c50833(c_name, c_key, report_id, args, class_prefix, path, lines, enforce) { + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + methods: - "85659b7e-968c-458c-b566-c90108c50833_${report_data.directive_id}_${c_key}" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); - "85659b7e-968c-458c-b566-c90108c50833_${report_data.directive_id}_${c_key}" usebundle => push_dry_run_mode("false"); - "85659b7e-968c-458c-b566-c90108c50833_${report_data.directive_id}_${c_key}" usebundle => file_content("${path}", "${lines}", "${enforce}"); - "85659b7e-968c-458c-b566-c90108c50833_${report_data.directive_id}_${c_key}" usebundle => pop_dry_run_mode(); + "index_${local_index}_0" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); + "index_${local_index}_1" usebundle => push_dry_run_mode("false"); + "index_${local_index}_2" usebundle => file_content("${path}", "${lines}", "${enforce}"); + "index_${local_index}_3" usebundle => pop_dry_run_mode(); } bundle agent call_test_audit_d8def455_cd43_441f_8dba_1ebae3a29389(c_name, c_key, report_id, args, class_prefix, path, lines, enforce) { + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + methods: - "d8def455-cd43-441f-8dba-1ebae3a29389_${report_data.directive_id}_${c_key}" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); - "d8def455-cd43-441f-8dba-1ebae3a29389_${report_data.directive_id}_${c_key}" usebundle => file_content("${path}", "${lines}", "${enforce}"); + "index_${local_index}_0" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); + "index_${local_index}_1" usebundle => file_content("${path}", "${lines}", "${enforce}"); } bundle agent call_test_audit_f9417d97_3a18_4db6_85c3_72e28618bff1(c_name, c_key, report_id, args, class_prefix, path, lines, enforce) { + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + methods: - "f9417d97-3a18-4db6-85c3-72e28618bff1_${report_data.directive_id}_${c_key}" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); - "f9417d97-3a18-4db6-85c3-72e28618bff1_${report_data.directive_id}_${c_key}" usebundle => push_dry_run_mode("true"); - "f9417d97-3a18-4db6-85c3-72e28618bff1_${report_data.directive_id}_${c_key}" usebundle => file_content("${path}", "${lines}", "${enforce}"); - "f9417d97-3a18-4db6-85c3-72e28618bff1_${report_data.directive_id}_${c_key}" usebundle => pop_dry_run_mode(); + "index_${local_index}_0" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); + "index_${local_index}_1" usebundle => push_dry_run_mode("true"); + "index_${local_index}_2" usebundle => file_content("${path}", "${lines}", "${enforce}"); + "index_${local_index}_3" usebundle => pop_dry_run_mode(); } bundle agent call_test_audit_c4b4faa1_85e5_4922_b713_c198bf99226e(c_name, c_key, report_id, args, class_prefix, path, lines, enforce) { + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + methods: - "c4b4faa1-85e5-4922-b713-c198bf99226e_${report_data.directive_id}_${c_key}" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); - "c4b4faa1-85e5-4922-b713-c198bf99226e_${report_data.directive_id}_${c_key}" usebundle => push_dry_run_mode("false"); - "c4b4faa1-85e5-4922-b713-c198bf99226e_${report_data.directive_id}_${c_key}" usebundle => file_content("${path}", "${lines}", "${enforce}"); - "c4b4faa1-85e5-4922-b713-c198bf99226e_${report_data.directive_id}_${c_key}" usebundle => pop_dry_run_mode(); + "index_${local_index}_0" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); + "index_${local_index}_1" usebundle => push_dry_run_mode("false"); + "index_${local_index}_2" usebundle => file_content("${path}", "${lines}", "${enforce}"); + "index_${local_index}_3" usebundle => pop_dry_run_mode(); } bundle agent call_test_audit_cce62a59_bd17_4858_ba06_6ae41f39b15a(c_name, c_key, report_id, args, class_prefix, path, lines, enforce) { + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + methods: - "cce62a59-bd17-4858-ba06-6ae41f39b15a_${report_data.directive_id}_${c_key}" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); - "cce62a59-bd17-4858-ba06-6ae41f39b15a_${report_data.directive_id}_${c_key}" usebundle => file_content("${path}", "${lines}", "${enforce}"); + "index_${local_index}_0" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); + "index_${local_index}_1" usebundle => file_content("${path}", "${lines}", "${enforce}"); } bundle agent call_test_audit_0a4299dd_0902_48b2_85ee_13dfe6fc3af6(c_name, c_key, report_id, args, class_prefix, path, lines, enforce) { + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + methods: - "0a4299dd-0902-48b2-85ee-13dfe6fc3af6_${report_data.directive_id}_${c_key}" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); - "0a4299dd-0902-48b2-85ee-13dfe6fc3af6_${report_data.directive_id}_${c_key}" usebundle => file_content("${path}", "${lines}", "${enforce}"); + "index_${local_index}_0" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); + "index_${local_index}_1" usebundle => file_content("${path}", "${lines}", "${enforce}"); } bundle agent call_test_audit_3b8352df_1329_4956_a019_bb9c072bc830(c_name, c_key, report_id, args, class_prefix, path, lines, enforce) { + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + methods: - "3b8352df-1329-4956-a019-bb9c072bc830_${report_data.directive_id}_${c_key}" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); - "3b8352df-1329-4956-a019-bb9c072bc830_${report_data.directive_id}_${c_key}" usebundle => file_content("${path}", "${lines}", "${enforce}"); + "index_${local_index}_0" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); + "index_${local_index}_1" usebundle => file_content("${path}", "${lines}", "${enforce}"); } diff --git a/policies/rudderc/tests/cases/general/reporting/metadata.xml b/policies/rudderc/tests/cases/general/reporting/metadata.xml index 61371022a96..a12e3cbbb26 100644 --- a/policies/rudderc/tests/cases/general/reporting/metadata.xml +++ b/policies/rudderc/tests/cases/general/reporting/metadata.xml @@ -26,33 +26,25 @@
- - htop - + htop
- - htop - + htop
- - ntp - + ntp
- - ntp - + ntp
@@ -60,36 +52,28 @@
- - ntp - + ntp
- - ntp - + ntp
- - ntp - + ntp
- - ntp - + ntp
diff --git a/policies/rudderc/tests/cases/general/reporting/technique.cf b/policies/rudderc/tests/cases/general/reporting/technique.cf index d0a90e78862..341ffab583a 100644 --- a/policies/rudderc/tests/cases/general/reporting/technique.cf +++ b/policies/rudderc/tests/cases/general/reporting/technique.cf @@ -4,109 +4,207 @@ bundle agent reporting { vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + "args" slist => {}; "report_param" string => join("_", args); "full_class_prefix" string => canonify("reporting_${report_param}"); "class_prefix" string => string_head("${full_class_prefix}", "1000"); + classes: + "rudder_increment_guard" expression => "any"; + methods: - "a86ce2e5-d5b6-45cc-87e8-c11cca71d908_${report_data.directive_id}" usebundle => call_reporting_a86ce2e5_d5b6_45cc_87e8_c11cca71d908("No block without condition", "htop", "a86ce2e5-d5b6-45cc-87e8-c11cca71d908", @{args}, "${class_prefix}", "htop", "", "", ""); + "index_${local_index}_0" usebundle => call_reporting_a86ce2e5_d5b6_45cc_87e8_c11cca71d908("No block without condition", "htop", "a86ce2e5-d5b6-45cc-87e8-c11cca71d908", @{args}, "${class_prefix}", "htop", "", "", ""); - "b86ce2e5-d5b6-45cc-87e8-c11cca71d907_${report_data.directive_id}" usebundle => call_reporting_b86ce2e5_d5b6_45cc_87e8_c11cca71d907("No block with condition", "htop", "b86ce2e5-d5b6-45cc-87e8-c11cca71d907", @{args}, "${class_prefix}", "debian", "htop", "", "", ""); + "index_${local_index}_1" usebundle => call_reporting_b86ce2e5_d5b6_45cc_87e8_c11cca71d907("No block with condition", "htop", "b86ce2e5-d5b6-45cc-87e8-c11cca71d907", @{args}, "${class_prefix}", "debian", "htop", "", "", ""); - "df06e919-02b7-41a7-a03f-4239592f3c12_${report_data.directive_id}" usebundle => call_reporting_df06e919_02b7_41a7_a03f_4239592f3c12("NTP service", "ntp", "df06e919-02b7-41a7-a03f-4239592f3c12", @{args}, "${class_prefix}", "ntp", "", "", ""); + "index_${local_index}_2" usebundle => call_reporting_df06e919_02b7_41a7_a03f_4239592f3c12("NTP service", "ntp", "df06e919-02b7-41a7-a03f-4239592f3c12", @{args}, "${class_prefix}", "ntp", "", "", ""); - "df06e919-02b7-41a7-a03f-4239592f3c45_${report_data.directive_id}" usebundle => call_reporting_df06e919_02b7_41a7_a03f_4239592f3c45("NTP service", "ntp", "df06e919-02b7-41a7-a03f-4239592f3c45", @{args}, "${class_prefix}", "ntp", "", "", ""); + "index_${local_index}_3" usebundle => call_reporting_df06e919_02b7_41a7_a03f_4239592f3c45("NTP service", "ntp", "df06e919-02b7-41a7-a03f-4239592f3c45", @{args}, "${class_prefix}", "ntp", "", "", ""); - "cf06e919-02b7-41a7-a03f-4239592f3c14_${report_data.directive_id}" usebundle => call_reporting_cf06e919_02b7_41a7_a03f_4239592f3c14("NTP service", "ntp", "cf06e919-02b7-41a7-a03f-4239592f3c14", @{args}, "${class_prefix}", "ntp", "", "", ""); + "index_${local_index}_4" usebundle => call_reporting_cf06e919_02b7_41a7_a03f_4239592f3c14("NTP service", "ntp", "cf06e919-02b7-41a7-a03f-4239592f3c14", @{args}, "${class_prefix}", "ntp", "", "", ""); - "cf06e919-02b7-41a7-a03f-4239592f3c13_${report_data.directive_id}" usebundle => call_reporting_cf06e919_02b7_41a7_a03f_4239592f3c13("NTP service", "ntp", "cf06e919-02b7-41a7-a03f-4239592f3c13", @{args}, "${class_prefix}", "ntp", "", "", ""); + "index_${local_index}_5" usebundle => call_reporting_cf06e919_02b7_41a7_a03f_4239592f3c13("NTP service", "ntp", "cf06e919-02b7-41a7-a03f-4239592f3c13", @{args}, "${class_prefix}", "ntp", "", "", ""); - "cf06e919-02b7-41a7-a03f-4239592f3c21_${report_data.directive_id}" usebundle => call_reporting_cf06e919_02b7_41a7_a03f_4239592f3c21("Enabled reporting", "ntp", "cf06e919-02b7-41a7-a03f-4239592f3c21", @{args}, "${class_prefix}", "ntp", "", "", ""); + "index_${local_index}_6" usebundle => call_reporting_cf06e919_02b7_41a7_a03f_4239592f3c21("Enabled reporting", "ntp", "cf06e919-02b7-41a7-a03f-4239592f3c21", @{args}, "${class_prefix}", "ntp", "", "", ""); - "c76686bb-79ab-4ae5-b45f-108492ab4101_${report_data.directive_id}" usebundle => call_reporting_c76686bb_79ab_4ae5_b45f_108492ab4101("Disabled reporting", "ntp", "c76686bb-79ab-4ae5-b45f-108492ab4101", @{args}, "${class_prefix}", "ntp", "", "", ""); + "index_${local_index}_7" usebundle => call_reporting_c76686bb_79ab_4ae5_b45f_108492ab4101("Disabled reporting", "ntp", "c76686bb-79ab-4ae5-b45f-108492ab4101", @{args}, "${class_prefix}", "ntp", "", "", ""); - "df06e919-02b7-41a7-a03f-4239592f3c21_${report_data.directive_id}" usebundle => call_reporting_df06e919_02b7_41a7_a03f_4239592f3c21("Enabled reporting", "ntp", "df06e919-02b7-41a7-a03f-4239592f3c21", @{args}, "${class_prefix}", "ntp", "", "", ""); + "index_${local_index}_8" usebundle => call_reporting_df06e919_02b7_41a7_a03f_4239592f3c21("Enabled reporting", "ntp", "df06e919-02b7-41a7-a03f-4239592f3c21", @{args}, "${class_prefix}", "ntp", "", "", ""); - "d76686bb-79ab-4ae5-b45f-108492ab4101_${report_data.directive_id}" usebundle => call_reporting_d76686bb_79ab_4ae5_b45f_108492ab4101("Disabled reporting", "ntp", "d76686bb-79ab-4ae5-b45f-108492ab4101", @{args}, "${class_prefix}", "ntp", "", "", ""); + "index_${local_index}_9" usebundle => call_reporting_d76686bb_79ab_4ae5_b45f_108492ab4101("Disabled reporting", "ntp", "d76686bb-79ab-4ae5-b45f-108492ab4101", @{args}, "${class_prefix}", "ntp", "", "", ""); } bundle agent call_reporting_a86ce2e5_d5b6_45cc_87e8_c11cca71d908(c_name, c_key, report_id, args, class_prefix, name, version, architecture, provider) { + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + methods: - "a86ce2e5-d5b6-45cc-87e8-c11cca71d908_${report_data.directive_id}_${c_key}" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); - "a86ce2e5-d5b6-45cc-87e8-c11cca71d908_${report_data.directive_id}_${c_key}" usebundle => package_present("${name}", "${version}", "${architecture}", "${provider}"); + "index_${local_index}_0" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); + "index_${local_index}_1" usebundle => package_present("${name}", "${version}", "${architecture}", "${provider}"); } bundle agent call_reporting_b86ce2e5_d5b6_45cc_87e8_c11cca71d907(c_name, c_key, report_id, args, class_prefix, method_call_condition, name, version, architecture, provider) { + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + methods: - "b86ce2e5-d5b6-45cc-87e8-c11cca71d907_${report_data.directive_id}_${c_key}" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); - "b86ce2e5-d5b6-45cc-87e8-c11cca71d907_${report_data.directive_id}_${c_key}" usebundle => package_present("${name}", "${version}", "${architecture}", "${provider}"), - if => "${method_call_condition}"; - "b86ce2e5-d5b6-45cc-87e8-c11cca71d907_${report_data.directive_id}_${c_key}" usebundle => _classes_noop(canonify("${class_prefix}_package_present_${c_key}")), - unless => "${method_call_condition}"; - "b86ce2e5-d5b6-45cc-87e8-c11cca71d907_${report_data.directive_id}_${c_key}" usebundle => log_rudder("Skipping method 'Package present' with key parameter 'htop' since condition 'debian' is not reached", "htop", canonify("${class_prefix}_package_present_${c_key}"), canonify("${class_prefix}_package_present_${c_key}"), @{args}), - unless => "${method_call_condition}"; + "index_${local_index}_0" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); + "index_${local_index}_1" usebundle => package_present("${name}", "${version}", "${architecture}", "${provider}"), + if => "${method_call_condition}"; + "index_${local_index}_2" usebundle => _classes_noop(canonify("${class_prefix}_package_present_${c_key}")), + unless => "${method_call_condition}"; + "index_${local_index}_3" usebundle => log_rudder("Skipping method 'Package present' with key parameter 'htop' since condition 'debian' is not reached", "htop", canonify("${class_prefix}_package_present_${c_key}"), canonify("${class_prefix}_package_present_${c_key}"), @{args}), + unless => "${method_call_condition}"; } bundle agent call_reporting_df06e919_02b7_41a7_a03f_4239592f3c12(c_name, c_key, report_id, args, class_prefix, name, version, architecture, provider) { + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + methods: - "df06e919-02b7-41a7-a03f-4239592f3c12_${report_data.directive_id}_${c_key}" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); - "df06e919-02b7-41a7-a03f-4239592f3c12_${report_data.directive_id}_${c_key}" usebundle => package_present("${name}", "${version}", "${architecture}", "${provider}"); + "index_${local_index}_0" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); + "index_${local_index}_1" usebundle => package_present("${name}", "${version}", "${architecture}", "${provider}"); } bundle agent call_reporting_df06e919_02b7_41a7_a03f_4239592f3c45(c_name, c_key, report_id, args, class_prefix, name, version, architecture, provider) { + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + methods: - "df06e919-02b7-41a7-a03f-4239592f3c45_${report_data.directive_id}_${c_key}" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); - "df06e919-02b7-41a7-a03f-4239592f3c45_${report_data.directive_id}_${c_key}" usebundle => package_present("${name}", "${version}", "${architecture}", "${provider}"); + "index_${local_index}_0" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); + "index_${local_index}_1" usebundle => package_present("${name}", "${version}", "${architecture}", "${provider}"); } bundle agent call_reporting_cf06e919_02b7_41a7_a03f_4239592f3c14(c_name, c_key, report_id, args, class_prefix, name, version, architecture, provider) { + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + methods: - "cf06e919-02b7-41a7-a03f-4239592f3c14_${report_data.directive_id}_${c_key}" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); - "cf06e919-02b7-41a7-a03f-4239592f3c14_${report_data.directive_id}_${c_key}" usebundle => package_present("${name}", "${version}", "${architecture}", "${provider}"); + "index_${local_index}_0" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); + "index_${local_index}_1" usebundle => package_present("${name}", "${version}", "${architecture}", "${provider}"); } bundle agent call_reporting_cf06e919_02b7_41a7_a03f_4239592f3c13(c_name, c_key, report_id, args, class_prefix, name, version, architecture, provider) { + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + methods: - "cf06e919-02b7-41a7-a03f-4239592f3c13_${report_data.directive_id}_${c_key}" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); - "cf06e919-02b7-41a7-a03f-4239592f3c13_${report_data.directive_id}_${c_key}" usebundle => package_present("${name}", "${version}", "${architecture}", "${provider}"); + "index_${local_index}_0" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); + "index_${local_index}_1" usebundle => package_present("${name}", "${version}", "${architecture}", "${provider}"); } bundle agent call_reporting_cf06e919_02b7_41a7_a03f_4239592f3c21(c_name, c_key, report_id, args, class_prefix, name, version, architecture, provider) { + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + methods: - "cf06e919-02b7-41a7-a03f-4239592f3c21_${report_data.directive_id}_${c_key}" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); - "cf06e919-02b7-41a7-a03f-4239592f3c21_${report_data.directive_id}_${c_key}" usebundle => package_present("${name}", "${version}", "${architecture}", "${provider}"); + "index_${local_index}_0" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); + "index_${local_index}_1" usebundle => package_present("${name}", "${version}", "${architecture}", "${provider}"); } bundle agent call_reporting_c76686bb_79ab_4ae5_b45f_108492ab4101(c_name, c_key, report_id, args, class_prefix, name, version, architecture, provider) { + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + methods: - "c76686bb-79ab-4ae5-b45f-108492ab4101_${report_data.directive_id}_${c_key}" usebundle => disable_reporting(); - "c76686bb-79ab-4ae5-b45f-108492ab4101_${report_data.directive_id}_${c_key}" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); - "c76686bb-79ab-4ae5-b45f-108492ab4101_${report_data.directive_id}_${c_key}" usebundle => package_present("${name}", "${version}", "${architecture}", "${provider}"); - "c76686bb-79ab-4ae5-b45f-108492ab4101_${report_data.directive_id}_${c_key}" usebundle => enable_reporting(); + "index_${local_index}_0" usebundle => disable_reporting(); + "index_${local_index}_1" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); + "index_${local_index}_2" usebundle => package_present("${name}", "${version}", "${architecture}", "${provider}"); + "index_${local_index}_3" usebundle => enable_reporting(); } bundle agent call_reporting_df06e919_02b7_41a7_a03f_4239592f3c21(c_name, c_key, report_id, args, class_prefix, name, version, architecture, provider) { + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + methods: - "df06e919-02b7-41a7-a03f-4239592f3c21_${report_data.directive_id}_${c_key}" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); - "df06e919-02b7-41a7-a03f-4239592f3c21_${report_data.directive_id}_${c_key}" usebundle => package_present("${name}", "${version}", "${architecture}", "${provider}"); + "index_${local_index}_0" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); + "index_${local_index}_1" usebundle => package_present("${name}", "${version}", "${architecture}", "${provider}"); } bundle agent call_reporting_d76686bb_79ab_4ae5_b45f_108492ab4101(c_name, c_key, report_id, args, class_prefix, name, version, architecture, provider) { + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + methods: - "d76686bb-79ab-4ae5-b45f-108492ab4101_${report_data.directive_id}_${c_key}" usebundle => disable_reporting(); - "d76686bb-79ab-4ae5-b45f-108492ab4101_${report_data.directive_id}_${c_key}" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); - "d76686bb-79ab-4ae5-b45f-108492ab4101_${report_data.directive_id}_${c_key}" usebundle => package_present("${name}", "${version}", "${architecture}", "${provider}"); - "d76686bb-79ab-4ae5-b45f-108492ab4101_${report_data.directive_id}_${c_key}" usebundle => enable_reporting(); + "index_${local_index}_0" usebundle => disable_reporting(); + "index_${local_index}_1" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); + "index_${local_index}_2" usebundle => package_present("${name}", "${version}", "${architecture}", "${provider}"); + "index_${local_index}_3" usebundle => enable_reporting(); } diff --git a/policies/rudderc/tests/cases/general/variables/metadata.xml b/policies/rudderc/tests/cases/general/variables/metadata.xml index 42381c9c676..f6672d2a7fb 100644 --- a/policies/rudderc/tests/cases/general/variables/metadata.xml +++ b/policies/rudderc/tests/cases/general/variables/metadata.xml @@ -36,9 +36,7 @@
- - /some/path - + /some/path
diff --git a/policies/rudderc/tests/cases/general/variables/technique.cf b/policies/rudderc/tests/cases/general/variables/technique.cf index 363054cf3fc..dd63abbed42 100644 --- a/policies/rudderc/tests/cases/general/variables/technique.cf +++ b/policies/rudderc/tests/cases/general/variables/technique.cf @@ -4,13 +4,21 @@ bundle agent test_windows(content) { vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + "args" slist => {"${content}"}; "report_param" string => join("_", args); "full_class_prefix" string => canonify("test_windows_${report_param}"); "class_prefix" string => string_head("${full_class_prefix}", "1000"); + classes: + "rudder_increment_guard" expression => "any"; + methods: - "d982a7e6-494a-40a5-aea1-7d9a185eed61_${report_data.directive_id}" usebundle => call_test_windows_d982a7e6_494a_40a5_aea1_7d9a185eed61("File content", "/some/path", "d982a7e6-494a-40a5-aea1-7d9a185eed61", @{args}, "${class_prefix}", "/some/path", "# Raw string + "index_${local_index}_0" usebundle => call_test_windows_d982a7e6_494a_40a5_aea1_7d9a185eed61("File content", "/some/path", "d982a7e6-494a-40a5-aea1-7d9a185eed61", @{args}, "${class_prefix}", "/some/path", "# Raw string foo foobar # With parameter foo ${content} foobar @@ -24,8 +32,17 @@ ${node.properties[name][key]}", "true"); } bundle agent call_test_windows_d982a7e6_494a_40a5_aea1_7d9a185eed61(c_name, c_key, report_id, args, class_prefix, path, lines, enforce) { + vars: + "report_data.index" int => int(eval("${report_data.index}+1", "math", "infix")), + unless => "rudder_increment_guard"; + "local_index" int => ${report_data.index}, + unless => "rudder_increment_guard"; + + classes: + "rudder_increment_guard" expression => "any"; + methods: - "d982a7e6-494a-40a5-aea1-7d9a185eed61_${report_data.directive_id}_${c_key}" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); - "d982a7e6-494a-40a5-aea1-7d9a185eed61_${report_data.directive_id}_${c_key}" usebundle => file_content("${path}", "${lines}", "${enforce}"); + "index_${local_index}_0" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}"); + "index_${local_index}_1" usebundle => file_content("${path}", "${lines}", "${enforce}"); } diff --git a/policies/rudderc/tests/metadata/serialized.xml b/policies/rudderc/tests/metadata/serialized.xml index 9d6eb277b8b..fef414e68ef 100644 --- a/policies/rudderc/tests/metadata/serialized.xml +++ b/policies/rudderc/tests/metadata/serialized.xml @@ -28,9 +28,7 @@
- - key - + key
diff --git a/relay/sources/api-doc/openapi.src.yml b/relay/sources/api-doc/openapi.src.yml index aab8fb4251e..4c84ff5a1eb 100644 --- a/relay/sources/api-doc/openapi.src.yml +++ b/relay/sources/api-doc/openapi.src.yml @@ -6,7 +6,7 @@ info: version: "1" description: introduction.yml x-logo: - url: "assets/rudder.svg" + url: "assets/rudder-logo-rect-black.svg" contact: email: dev@rudder.io name: Rudder developers diff --git a/relay/sources/relayd/Cargo.toml b/relay/sources/relayd/Cargo.toml index 02c917179b3..b32e5c0a9b9 100644 --- a/relay/sources/relayd/Cargo.toml +++ b/relay/sources/relayd/Cargo.toml @@ -28,7 +28,7 @@ futures = { version = "0.3", default-features = false } hex = "0.4" humantime = "2" hyper = { version = "0.14", default-features = false } -inotify = "0.10" +inotify = "0.11" lazy_static = "1" nom = "7" openssl = "0.10" @@ -37,11 +37,12 @@ prometheus = { version = "0.13", default-features = false, features = ["process" regex = "1" # Use openssl for TLS to be consistent reqwest = { version = "0.11.1", default-features = false, features = ["stream", "blocking", "native-tls"] } -secrecy = { version = "0.8", features = ["serde"] } +secrecy = { version = "0.10", features = ["serde"] } serde = { version = "1", features = ["derive"] } serde_json = "1" +serde-inline-default = "0.2" sha2 = "0.10" -thiserror = "1" +thiserror = "2" tokio = { version = "1", default-features = false, features = [ "rt-multi-thread", "process", "macros", "signal", "fs"] } tokio-stream = { version = "0.1", default-features = false, features = ["io-util"] } toml = "0.8.8" diff --git a/relay/sources/relayd/Dockerfile b/relay/sources/relayd/Dockerfile index 7a72f45dbfd..90553a9d927 100644 --- a/relay/sources/relayd/Dockerfile +++ b/relay/sources/relayd/Dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.81.0-bookworm +FROM rust:1.83.0-bookworm LABEL ci=rudder/relay/sources/relayd/Dockerfile ARG USER_ID=1000 diff --git a/relay/sources/relayd/benches/benches.rs b/relay/sources/relayd/benches/benches.rs index f415fe3343d..1bb1ee6c185 100644 --- a/relay/sources/relayd/benches/benches.rs +++ b/relay/sources/relayd/benches/benches.rs @@ -21,7 +21,6 @@ use rudder_relayd::{ *, }, }; -use secrecy::SecretString; fn bench_nodeslist(c: &mut Criterion) { c.bench_function("parse nodes list", move |b| { @@ -98,7 +97,7 @@ fn bench_uncompress_runlog(c: &mut Criterion) { pub fn db() -> PgPool { let db_config = DatabaseConfig { url: "postgres://rudderreports@127.0.0.1/rudder".to_string(), - password: SecretString::new("PASSWORD".to_string()), + password: Some("PASSWORD".into()), max_pool_size: 10, }; pg_pool(&db_config).unwrap() diff --git a/relay/sources/relayd/src/configuration/main.rs b/relay/sources/relayd/src/configuration/main.rs index 0756a8900bb..b808c656ab1 100644 --- a/relay/sources/relayd/src/configuration/main.rs +++ b/relay/sources/relayd/src/configuration/main.rs @@ -11,12 +11,13 @@ use std::{ time::Duration, }; -use anyhow::{anyhow, Context, Error}; +use anyhow::{anyhow, bail, Context, Error}; use secrecy::SecretString; use serde::{ de::{Deserializer, Error as SerdeError, Unexpected, Visitor}, Deserialize, }; +use serde_inline_default::serde_inline_default; use tracing::{debug, warn}; use crate::data::node::NodeId; @@ -33,7 +34,7 @@ where { struct V; - impl<'de2> Visitor<'de2> for V { + impl Visitor<'_> for V { type Value = Duration; fn expecting(&self, fmt: &mut fmt::Formatter) -> fmt::Result { @@ -75,6 +76,8 @@ pub struct Configuration { pub shared_files: SharedFiles, #[serde(default)] pub shared_folder: SharedFolder, + #[serde(default)] + pub rsync: RsyncConfig, } impl Configuration { @@ -113,7 +116,28 @@ impl Configuration { .map(|u| u.is_empty()) .unwrap_or(true)) { - return Err(anyhow!("missing upstream server configuration")); + bail!("missing upstream server configuration"); + } + + // When upstream is selected, it must have a password + if (matches!( + self.processing.reporting.output, + ReportingOutputSelect::Upstream + ) || matches!( + self.processing.inventory.output, + InventoryOutputSelect::Upstream + )) && self.output.upstream.password.is_none() + { + bail!("missing upstream password configuration"); + } + + // When database is selected, it must have a password + if matches!( + self.processing.reporting.output, + ReportingOutputSelect::Database + ) && self.output.database.password.is_none() + { + bail!("missing database password configuration"); } Ok(self) @@ -183,88 +207,52 @@ impl FromStr for Configuration { } } +impl Default for Configuration { + fn default() -> Self { + toml::from_str::("").unwrap() + } +} + /// Strategy for default values: /// /// * `#[serde(default)]` when section is not there /// * `#[serde(default)]` or `#[serde(default = ...)]` when a value is missing in a section +#[serde_inline_default] #[derive(Deserialize, Debug, PartialEq, Eq, Clone)] pub struct GeneralConfig { - #[serde(default = "GeneralConfig::default_nodes_list_file")] + #[serde_inline_default(PathBuf::from("/var/rudder/lib/relay/nodeslist.json"))] pub nodes_list_file: NodesListFile, - #[serde(default = "GeneralConfig::default_nodes_certs_file")] + #[serde_inline_default(PathBuf::from("/var/rudder/lib/ssl/allnodescerts.pem"))] // needs to be /var/rudder/lib/ssl/nodescerts.pem on simple relays pub nodes_certs_file: NodesCertsFile, /// Has priority over node_id_file, use the /// `Configuration::node_id()` method to get correct value node_id: Option, /// File containing the node id - #[serde(default = "GeneralConfig::default_node_id_file")] + #[serde_inline_default(PathBuf::from("/opt/rudder/etc/uuid.hive"))] node_id_file: PathBuf, - #[serde(default = "GeneralConfig::default_listen")] + #[serde_inline_default("127.0.0.1:3030".to_string())] pub listen: String, /// None means using the number of available CPUs pub core_threads: Option, /// Max number of threads for the blocking operations pub blocking_threads: Option, /// Port to use for communication - #[serde(default = "GeneralConfig::default_https_port")] + #[serde_inline_default(443)] pub https_port: u16, /// Timeout for idle connections being kept-alive #[serde(deserialize_with = "compat_humantime")] - #[serde(default = "GeneralConfig::default_https_idle_timeout")] + #[serde_inline_default(Duration::from_secs(2))] pub https_idle_timeout: Duration, /// Which certificate validation model to use - #[serde(default = "GeneralConfig::default_peer_authentication")] + #[serde_inline_default(PeerAuthentication::SystemRootCerts)] peer_authentication: PeerAuthentication, } -impl GeneralConfig { - fn default_nodes_list_file() -> PathBuf { - PathBuf::from("/var/rudder/lib/relay/nodeslist.json") - } - - fn default_nodes_certs_file() -> PathBuf { - // config for root servers - PathBuf::from("/var/rudder/lib/ssl/allnodescerts.pem") - } - - fn default_node_id_file() -> PathBuf { - PathBuf::from("/opt/rudder/etc/uuid.hive") - } - - fn default_listen() -> String { - "127.0.0.1:3030".to_string() - } - - fn default_https_port() -> u16 { - 443 - } - - fn default_https_idle_timeout() -> Duration { - Duration::from_secs(2) - } - - fn default_peer_authentication() -> PeerAuthentication { - // For compatibility - PeerAuthentication::SystemRootCerts - } -} - impl Default for GeneralConfig { fn default() -> Self { - Self { - nodes_list_file: Self::default_nodes_list_file(), - nodes_certs_file: Self::default_nodes_certs_file(), - node_id_file: Self::default_node_id_file(), - node_id: None, - listen: Self::default_listen(), - core_threads: None, - blocking_threads: None, - https_port: Self::default_https_port(), - https_idle_timeout: Self::default_https_idle_timeout(), - peer_authentication: Self::default_peer_authentication(), - } + toml::from_str::("").unwrap() } } @@ -276,62 +264,36 @@ pub enum PeerAuthentication { DangerousNone, } +#[serde_inline_default] #[derive(Deserialize, Debug, PartialEq, Eq, Copy, Clone)] pub struct CatchupConfig { #[serde(deserialize_with = "compat_humantime")] - #[serde(default = "CatchupConfig::default_catchup_frequency")] + #[serde_inline_default(Duration::from_secs(10))] pub frequency: Duration, - #[serde(default = "CatchupConfig::default_catchup_limit")] + #[serde_inline_default(50)] pub limit: u64, } -impl CatchupConfig { - fn default_catchup_frequency() -> Duration { - Duration::from_secs(10) - } - - fn default_catchup_limit() -> u64 { - 50 - } -} - impl Default for CatchupConfig { fn default() -> Self { - Self { - frequency: Self::default_catchup_frequency(), - limit: Self::default_catchup_limit(), - } + toml::from_str::("").unwrap() } } +#[serde_inline_default] #[derive(Deserialize, Debug, PartialEq, Eq, Copy, Clone)] pub struct CleanupConfig { #[serde(deserialize_with = "compat_humantime")] - #[serde(default = "CleanupConfig::default_cleanup_frequency")] + #[serde_inline_default(Duration::from_secs(3600))] pub frequency: Duration, #[serde(deserialize_with = "compat_humantime")] - #[serde(default = "CleanupConfig::default_cleanup_retention")] + #[serde_inline_default(Duration::from_secs(3600 * 24 * 7))] pub retention: Duration, } -impl CleanupConfig { - /// 1 hour - fn default_cleanup_frequency() -> Duration { - Duration::from_secs(3600) - } - - /// 1 week - fn default_cleanup_retention() -> Duration { - Duration::from_secs(3600 * 24 * 7) - } -} - impl Default for CleanupConfig { fn default() -> Self { - Self { - frequency: Self::default_cleanup_frequency(), - retention: Self::default_cleanup_retention(), - } + toml::from_str::("").unwrap() } } @@ -343,9 +305,10 @@ pub struct ProcessingConfig { pub reporting: ReportingConfig, } +#[serde_inline_default] #[derive(Deserialize, Debug, PartialEq, Eq, Clone)] pub struct InventoryConfig { - #[serde(default = "InventoryConfig::default_directory")] + #[serde_inline_default(PathBuf::from("/var/rudder/inventories/"))] pub directory: BaseDirectory, #[serde(default)] pub output: InventoryOutputSelect, @@ -355,20 +318,9 @@ pub struct InventoryConfig { pub cleanup: CleanupConfig, } -impl InventoryConfig { - fn default_directory() -> PathBuf { - PathBuf::from("/var/rudder/inventories/") - } -} - impl Default for InventoryConfig { fn default() -> Self { - Self { - directory: Self::default_directory(), - output: InventoryOutputSelect::default(), - catchup: Default::default(), - cleanup: Default::default(), - } + toml::from_str::("").unwrap() } } @@ -385,9 +337,10 @@ impl Default for InventoryOutputSelect { } } +#[serde_inline_default] #[derive(Deserialize, Debug, PartialEq, Eq, Clone)] pub struct ReportingConfig { - #[serde(default = "ReportingConfig::default_directory")] + #[serde_inline_default(PathBuf::from("/var/rudder/reports/"))] pub directory: BaseDirectory, #[serde(default)] pub output: ReportingOutputSelect, @@ -399,21 +352,9 @@ pub struct ReportingConfig { pub skip_event_types: HashSet, } -impl ReportingConfig { - fn default_directory() -> PathBuf { - PathBuf::from("/var/rudder/reports/") - } -} - impl Default for ReportingConfig { fn default() -> Self { - Self { - directory: Self::default_directory(), - output: ReportingOutputSelect::default(), - catchup: Default::default(), - cleanup: Default::default(), - skip_event_types: Default::default(), - } + toml::from_str::("").unwrap() } } @@ -447,103 +388,63 @@ impl OutputSelect for InventoryOutputSelect { } } +#[serde_inline_default] #[derive(Deserialize, Debug, PartialEq, Eq, Clone)] pub struct RemoteRun { /// Enable remote-run feature - #[serde(default = "RemoteRun::default_enabled")] + #[serde_inline_default(true)] pub enabled: bool, - #[serde(default = "RemoteRun::default_command")] + #[serde_inline_default(PathBuf::from("/opt/rudder/bin/rudder"))] pub command: PathBuf, - #[serde(default = "RemoteRun::default_use_sudo")] + #[serde_inline_default(true)] pub use_sudo: bool, } -impl RemoteRun { - fn default_command() -> PathBuf { - PathBuf::from("/opt/rudder/bin/rudder") - } - - fn default_use_sudo() -> bool { - true - } - - fn default_enabled() -> bool { - true - } -} - impl Default for RemoteRun { fn default() -> Self { - Self { - enabled: Self::default_enabled(), - command: Self::default_command(), - use_sudo: Self::default_use_sudo(), - } + toml::from_str::("").unwrap() } } +#[serde_inline_default] #[derive(Deserialize, Debug, PartialEq, Eq, Copy, Clone)] pub struct SharedFilesCleanupConfig { #[serde(deserialize_with = "compat_humantime")] - #[serde(default = "CleanupConfig::default_cleanup_frequency")] + #[serde_inline_default(Duration::from_secs(600))] pub frequency: Duration, } -impl SharedFilesCleanupConfig { - /// 10 minutes - fn default_cleanup_frequency() -> Duration { - Duration::from_secs(600) - } -} - impl Default for SharedFilesCleanupConfig { fn default() -> Self { - Self { - frequency: Self::default_cleanup_frequency(), - } + toml::from_str::("").unwrap() } } +#[serde_inline_default] #[derive(Deserialize, Debug, PartialEq, Eq, Clone)] pub struct SharedFiles { - #[serde(default = "SharedFiles::default_path")] + #[serde_inline_default(PathBuf::from("/var/rudder/shared-files/"))] pub path: PathBuf, #[serde(default)] pub cleanup: SharedFilesCleanupConfig, } -impl SharedFiles { - fn default_path() -> PathBuf { - PathBuf::from("/var/rudder/shared-files/") - } -} - impl Default for SharedFiles { fn default() -> Self { - Self { - path: Self::default_path(), - cleanup: SharedFilesCleanupConfig::default(), - } + toml::from_str::("").unwrap() } } +#[serde_inline_default] #[derive(Deserialize, Debug, PartialEq, Eq, Clone)] pub struct SharedFolder { - #[serde(default = "SharedFolder::default_path")] + #[serde_inline_default(PathBuf::from("/var/rudder/configuration-repository/shared-files/"))] pub path: PathBuf, } -impl SharedFolder { - fn default_path() -> PathBuf { - PathBuf::from("/var/rudder/configuration-repository/shared-files/") - } -} - impl Default for SharedFolder { fn default() -> Self { - Self { - path: Self::default_path(), - } + toml::from_str::("").unwrap() } } @@ -555,14 +456,15 @@ pub struct OutputConfig { pub upstream: UpstreamConfig, } +#[serde_inline_default] #[derive(Deserialize, Debug, Clone)] pub struct DatabaseConfig { /// URL without the password - #[serde(default = "DatabaseConfig::default_url")] + #[serde_inline_default("postgres://rudder@127.0.0.1/rudder".to_string())] pub url: String, - /// When the section is there, password is mandatory - pub password: SecretString, - #[serde(default = "DatabaseConfig::default_max_pool_size")] + #[serde(default)] + pub password: Option, + #[serde_inline_default(10)] pub max_pool_size: u32, } @@ -574,26 +476,13 @@ impl PartialEq for DatabaseConfig { impl Eq for DatabaseConfig {} -impl DatabaseConfig { - fn default_url() -> String { - "postgres://rudder@127.0.0.1/rudder".to_string() - } - - fn default_max_pool_size() -> u32 { - 10 - } -} - impl Default for DatabaseConfig { fn default() -> Self { - Self { - url: Self::default_url(), - password: SecretString::new("".to_string()), - max_pool_size: Self::default_max_pool_size(), - } + toml::from_str::("").unwrap() } } +#[serde_inline_default] #[derive(Deserialize, Debug, Clone)] pub struct UpstreamConfig { /// DEPRECATED: use host and global.https_port @@ -602,25 +491,25 @@ pub struct UpstreamConfig { /// When the section is there, host is mandatory #[serde(default)] host: String, - #[serde(default = "UpstreamConfig::default_user")] + #[serde_inline_default("rudder".to_string())] pub user: String, - /// When the section is there, password is mandatory - pub password: SecretString, + #[serde(default)] + pub password: Option, /// Default password, to be used for new inventories - #[serde(default = "UpstreamConfig::default_default_password")] + #[serde_inline_default(SecretString::new("rudder".into()))] pub default_password: SecretString, - #[serde(default = "UpstreamConfig::default_verify_certificates")] /// Allows to completely disable certificate validation. /// /// If true, https is required for all connections /// /// This preserves compatibility with 6.X configs /// DEPRECATED: replaced by certificate_verification_mode = DangerousNone + #[serde_inline_default(true)] pub verify_certificates: bool, /// Allows specifying the root certificate path /// Used for our Rudder PKI /// Not used if the verification model is not `Rudder`. - #[serde(default = "UpstreamConfig::default_server_certificate_file")] + #[serde_inline_default(PathBuf::from("/var/rudder/lib/ssl/policy_server.pem"))] pub server_certificate_file: PathBuf, // TODO timeout? } @@ -637,35 +526,27 @@ impl PartialEq for UpstreamConfig { impl Eq for UpstreamConfig {} -impl UpstreamConfig { - fn default_user() -> String { - "rudder".to_string() - } - - fn default_verify_certificates() -> bool { - true +impl Default for UpstreamConfig { + fn default() -> Self { + toml::from_str::("").unwrap() } +} - fn default_default_password() -> SecretString { - SecretString::new("rudder".into()) - } +#[serde_inline_default] +#[derive(Deserialize, Debug, PartialEq, Eq, Clone)] +pub struct RsyncConfig { + // where to listen on + #[serde_inline_default("localhost:5310".into())] + listen: String, - fn default_server_certificate_file() -> PathBuf { - PathBuf::from("/var/rudder/lib/ssl/policy_server.pem") - } + // False to allow non authenticated clients + #[serde_inline_default(true)] + authentication: bool, } -impl Default for UpstreamConfig { +impl Default for RsyncConfig { fn default() -> Self { - Self { - url: Default::default(), - host: Default::default(), - user: Self::default_user(), - password: SecretString::new("".to_string()), - default_password: SecretString::new("".to_string()), - verify_certificates: Self::default_verify_certificates(), - server_certificate_file: Self::default_server_certificate_file(), - } + toml::from_str::("").unwrap() } } @@ -753,14 +634,14 @@ mod tests { url: None, host: "".to_string(), user: "rudder".to_string(), - password: SecretString::new("".to_string()), - default_password: SecretString::new("".to_string()), + password: None, + default_password: "".into(), verify_certificates: true, server_certificate_file: PathBuf::from("/var/rudder/lib/ssl/policy_server.pem"), }, database: DatabaseConfig { url: "postgres://rudder@127.0.0.1/rudder".to_string(), - password: SecretString::new("".to_string()), + password: None, max_pool_size: 10, }, }, @@ -778,6 +659,10 @@ mod tests { shared_folder: SharedFolder { path: PathBuf::from("/var/rudder/configuration-repository/shared-files/"), }, + rsync: RsyncConfig { + listen: "localhost:5310".to_string(), + authentication: true, + }, }; assert_eq!(config, reference); @@ -787,12 +672,15 @@ mod tests { #[test] fn it_fails_when_password_is_missing() { - let default = "[general]\n\ + let missing_password = "[general]\n\ node_id = \"root\"\n\ + [processing.reporting]\n\ + directory = \"target/tmp/reporting/\"\n\ + output = \"database\"\n\ [output.database]\n"; - let with_password = format!("{}\npassword = \"test\"", default); - assert!(default.parse::().is_err()); - assert!(with_password.parse::().is_ok()); + let conf = missing_password.parse::(); + assert!(conf.is_ok()); + assert!(conf.unwrap().validate().is_err()); } #[test] @@ -852,8 +740,8 @@ mod tests { url: None, host: "rudder.example.com".to_string(), user: "rudder".to_string(), - password: SecretString::new("password".to_string()), - default_password: SecretString::new("rudder".to_string()), + password: Some("password".into()), + default_password: "rudder".into(), verify_certificates: true, server_certificate_file: PathBuf::from( "tests/files/keys/e745a140-40bc-4b86-b6dc-084488fc906b.cert", @@ -861,7 +749,7 @@ mod tests { }, database: DatabaseConfig { url: "postgres://rudderreports@postgres/rudder".to_string(), - password: SecretString::new("PASSWORD".to_string()), + password: Some("PASSWORD".into()), max_pool_size: 5, }, }, @@ -879,6 +767,10 @@ mod tests { shared_folder: SharedFolder { path: PathBuf::from("tests/api_shared_folder"), }, + rsync: RsyncConfig { + listen: "localhost:1234".to_string(), + authentication: false, + }, }; assert_eq!(config, reference); assert_eq!(config.node_id().unwrap(), "root".to_string()); diff --git a/relay/sources/relayd/src/output/database.rs b/relay/sources/relayd/src/output/database.rs index 414b802b3c0..ec1a5e9b3f4 100644 --- a/relay/sources/relayd/src/output/database.rs +++ b/relay/sources/relayd/src/output/database.rs @@ -68,7 +68,13 @@ pub fn pg_pool(configuration: &DatabaseConfig) -> Result { "?" }, percent_encoding::percent_encode( - configuration.password.expose_secret().as_bytes(), + // database is selected at this point, so validation must have detected None password + configuration + .password + .as_ref() + .unwrap() + .expose_secret() + .as_bytes(), NON_ALPHANUMERIC ) )); @@ -171,7 +177,6 @@ pub fn insert_runlog(pool: &PgPool, runlog: &RunLog) -> Result PgPool { let db_config = DatabaseConfig { url: "postgres://rudderreports:@postgres/rudder".to_string(), - password: SecretString::new("PASSWORD".to_string()), + password: Some("PASSWORD".into()), max_pool_size: 5, }; pg_pool(&db_config).unwrap() diff --git a/relay/sources/relayd/src/output/upstream.rs b/relay/sources/relayd/src/output/upstream.rs index 3c3daf27e15..b0ca323e8a6 100644 --- a/relay/sources/relayd/src/output/upstream.rs +++ b/relay/sources/relayd/src/output/upstream.rs @@ -15,7 +15,15 @@ pub async fn send_report(job_config: Arc, path: PathBuf) -> Result<() job_config.clone(), "reports", path, - job_config.cfg.output.upstream.password.clone(), + // upstream is selected at this point, so validation must have detected None password + job_config + .cfg + .output + .upstream + .password + .as_ref() + .unwrap() + .clone(), ) .await } @@ -35,7 +43,15 @@ pub async fn send_inventory( path, match inventory_type { InventoryType::New => job_config.cfg.output.upstream.default_password.clone(), - InventoryType::Update => job_config.cfg.output.upstream.password.clone(), + // upstream is selected at this point, so validation must have detected None password + InventoryType::Update => job_config + .cfg + .output + .upstream + .password + .as_ref() + .unwrap() + .clone(), }, ) .await diff --git a/relay/sources/relayd/tests/files/config/main.conf b/relay/sources/relayd/tests/files/config/main.conf index 145e3dac963..0ff537adfbf 100644 --- a/relay/sources/relayd/tests/files/config/main.conf +++ b/relay/sources/relayd/tests/files/config/main.conf @@ -65,3 +65,6 @@ frequency = "43s" [shared_folder] path = "tests/api_shared_folder" +[rsync] +listen = "localhost:1234" +authentication = false \ No newline at end of file diff --git a/relay/sources/rudder-package/Cargo.toml b/relay/sources/rudder-package/Cargo.toml index f413922ea1d..fb7b0b3e414 100644 --- a/relay/sources/rudder-package/Cargo.toml +++ b/relay/sources/rudder-package/Cargo.toml @@ -18,7 +18,7 @@ clap = { version = "4.5.11", features = ["derive"] } clap_complete = "4.5.10" chrono = { version = "0.4.31", default-features = false, features = ["clock", "std", "serde"] } lzma-rs = "0.3.0" -quick-xml = "0.36.0" +quick-xml = "0.37.0" reqwest = { version = "0.12", default-features = false, features = ["blocking", "native-tls"] } regex = "1.10.2" secrecy = { version = "0.10.3", features = ["serde"] } @@ -31,7 +31,7 @@ tempfile = "3.8.0" # Compile dev and release with trace logs enabled tracing = { version = "0.1", features = ["max_level_trace", "release_max_level_trace"] } tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] } -which = "6.0.1" +which = "7" flate2 = "1.0.28" cli-table = "0.4.7" spinners = "4.1.1" @@ -43,7 +43,7 @@ clap = { version = "4.5.11", features = ["derive"] } clap_complete = "4.5.10" [dev-dependencies] -rstest = "0.22.0" +rstest = "0.23.0" assert-json-diff = "2.0.2" dir-diff = "0.3.2" pretty_assertions = "1.4.0" diff --git a/relay/sources/rudder-package/Dockerfile b/relay/sources/rudder-package/Dockerfile index a2cfabbbae8..f1efa709eac 100644 --- a/relay/sources/rudder-package/Dockerfile +++ b/relay/sources/rudder-package/Dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.81.0-bookworm +FROM rust:1.83.0-bookworm LABEL ci=rudder/relay/sources/rudder-package/Dockerfile ARG USER_ID=1000 diff --git a/relay/sources/rudder-package/src/archive.rs b/relay/sources/rudder-package/src/archive.rs index da03236e6d4..df6049b37a6 100644 --- a/relay/sources/rudder-package/src/archive.rs +++ b/relay/sources/rudder-package/src/archive.rs @@ -89,7 +89,7 @@ impl Rpkg { if txz_name == PACKAGE_SCRIPTS_ARCHIVE { return PathBuf::from(PACKAGES_FOLDER).join(self.metadata.name.clone()); } - return PathBuf::from(self.metadata.content.get(txz_name).unwrap().to_string()); + PathBuf::from(self.metadata.content.get(txz_name).unwrap().to_string()) } fn get_archive_installed_files(&self) -> Result> { diff --git a/relay/sources/rudder-package/tools/rudder-pkg.conf b/relay/sources/rudder-package/tools/rudder-pkg.conf index 7d9584a8a90..ffc91dcc17a 100644 --- a/relay/sources/rudder-package/tools/rudder-pkg.conf +++ b/relay/sources/rudder-package/tools/rudder-pkg.conf @@ -1,7 +1,9 @@ [Rudder] -url = https://download.rudder.io/plugins -username = username -password = password -proxy_url = -proxy_user = -proxy_password = +# The default values are commented below +# +#url = https://download.rudder.io/plugins +#username = +#password = +#proxy_url = +#proxy_user = +#proxy_password = diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 1de01fa45c4..0193dee3606 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.81.0" +channel = "1.83.0" diff --git a/rust.makefile b/rust.makefile index 54f70a1ce46..fa3240ca601 100644 --- a/rust.makefile +++ b/rust.makefile @@ -18,7 +18,7 @@ version: # https://matklad.github.io/2021/09/04/fast-rust-builds.html#ci-workflow build: CARGO_INCREMENTAL=0 build: version - cargo install --locked cargo-auditable@0.6.1 + cargo install --locked cargo-auditable@0.6.4 cargo auditable build --features=${CARGO_FEATURES} --release --locked --jobs 2 dev-doc: diff --git a/sbom/Dockerfile b/sbom/Dockerfile index 87e734ff85f..86e4060f0fd 100644 --- a/sbom/Dockerfile +++ b/sbom/Dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.81.0-bookworm +FROM rust:1.83.0-bookworm LABEL ci=rudder/policies/Dockerfile ARG USER_ID=1000 diff --git a/webapp/sources/api-doc/openapi.src.yml b/webapp/sources/api-doc/openapi.src.yml index e3f23f9b480..d7d13b5c677 100644 --- a/webapp/sources/api-doc/openapi.src.yml +++ b/webapp/sources/api-doc/openapi.src.yml @@ -7,7 +7,7 @@ info: # Will be substituted by content of the file at build description: "introduction.md" x-logo: - url: "assets/rudder.svg" + url: "assets/rudder-logo-rect-black.svg" contact: email: dev@rudder.io name: Rudder developers diff --git a/webapp/sources/ldap-inventory/inventory-api/pom.xml b/webapp/sources/ldap-inventory/inventory-api/pom.xml index dfe0c335a74..29619f6b1d9 100644 --- a/webapp/sources/ldap-inventory/inventory-api/pom.xml +++ b/webapp/sources/ldap-inventory/inventory-api/pom.xml @@ -34,7 +34,7 @@ along with Rudder. If not, see . com.normation.inventory inventory-parent - 8.2.4-SNAPSHOT + 8.3.0~alpha1-SNAPSHOT 4.0.0 inventory-api diff --git a/webapp/sources/ldap-inventory/inventory-api/src/main/scala/com/normation/inventory/domain/AgentTypes.scala b/webapp/sources/ldap-inventory/inventory-api/src/main/scala/com/normation/inventory/domain/AgentTypes.scala index 3ee4c45b9f0..9ecd97672bb 100644 --- a/webapp/sources/ldap-inventory/inventory-api/src/main/scala/com/normation/inventory/domain/AgentTypes.scala +++ b/webapp/sources/ldap-inventory/inventory-api/src/main/scala/com/normation/inventory/domain/AgentTypes.scala @@ -37,10 +37,8 @@ package com.normation.inventory.domain -import com.normation.errors.* import enumeratum.* -import zio.* -import zio.syntax.* +import zio.json.* /** * The enumeration holding the values for the agent @@ -48,8 +46,8 @@ import zio.syntax.* sealed trait AgentType extends EnumEntry { /* * this is the default agent identifier, the main name, used in: - * - in hooks: RUDDER_AGENT_TYPE: dsc (cfengine-community, cfengine-nova) - * - in technique metadata: ... (cfengine-community, cfengine-nova) + * - in hooks: RUDDER_AGENT_TYPE: dsc (cfengine-community) + * - in technique metadata: ... (cfengine-community) * - in serialisation */ def id: String @@ -59,7 +57,7 @@ sealed trait AgentType extends EnumEntry { /* * This is the old, short name, which used to be used in LDAP "agentName" - * attribute and in (very old) fusion inventories (i.e: community, nova). + * attribute and in (very old) fusion inventories (i.e: community, ...). */ def oldShortName: String @@ -69,14 +67,14 @@ sealed trait AgentType extends EnumEntry { def displayName: String /* - * - for policy generation: /var/rudder/share/xxxx/rules/dsc (/rules/cfengine-community, /rules/cfengine-nova) + * - for policy generation: /var/rudder/share/xxxx/rules/dsc (/rules/cfengine-community, ...) */ def toRulesPath: String /* * This is the list of to look for in inventory and in LDAP * to choose the agent type. - * - in inventory file: dsc ("Community" => "cfengine-community", "Nova" => "cfengine-nova") + * - in inventory file: dsc ("Community" => "cfengine-community", ...) * - in LDAP agentName attribute * This is a set, because we want to accept renaming along the way. * Everything must be lower case in it. @@ -86,7 +84,7 @@ sealed trait AgentType extends EnumEntry { /* * the name to look for in the inventory to know the agent version (when not reported in ) - * - for inventory software name (i.e package name in software): rudder-agent-dsc ("rudder-agent", "cfengine nova") + * - for inventory software name (i.e package name in software): rudder-agent-dsc ("rudder-agent", ...) */ def inventorySoftwareName: String // and a transformation function from reported software version name to agent version name, internal use only @@ -97,17 +95,8 @@ sealed trait AgentType extends EnumEntry { } object AgentType extends Enum[AgentType] { - - case object CfeEnterprise extends AgentType { - override def id = "cfengine-nova" - override def oldShortName = "nova" - override def displayName = "CFEngine Enterprise" - override def toRulesPath = "/cfengine-nova" - override def inventoryAgentNames: Set[String] = Set("cfengine-nova", "nova") - override val inventorySoftwareName = "cfengine nova" - override def toAgentVersionName(softwareVersionName: String): String = s"cfe-${softwareVersionName}" - override val defaultPolicyExtension = ".cf" - } + implicit val codecAgentType: JsonCodec[AgentType] = + JsonCodec.string.transformOrFail[AgentType](s => AgentType.fromValue(s).left.map(_.fullMsg), _.id) case object CfeCommunity extends AgentType { override def id = "cfengine-community" @@ -152,6 +141,10 @@ object AgentType extends Enum[AgentType] { */ final case class AgentVersion(value: String) extends AnyVal +object AgentVersion { + implicit val agentVersionCodec: JsonCodec[AgentVersion] = JsonCodec[String].transform(AgentVersion.apply, _.value) +} + final case class AgentInfo( agentType: AgentType, // for now, the version must be an option, because we don't add it in the inventory @@ -159,108 +152,12 @@ final case class AgentInfo( version: Option[AgentVersion], securityToken: SecurityToken, // agent capabilities are lower case string used as tags giving information about what agent can do - capabilities: Set[AgentCapability] + capabilities: Set[AgentCapability] = Set() // default value is needed for JSON decoding when "capabilities" is missing ) -object AgentInfoSerialisation { - import net.liftweb.json.* - import net.liftweb.json.JsonDSL.* - - implicit class ToJson(val agent: AgentInfo) extends AnyVal { - - def toJsonString: String = { - compactRender( - ("agentType" -> agent.agentType.id) - ~ ("version" -> agent.version.map(_.value)) - ~ ("securityToken" -> - ("value" -> agent.securityToken.key) - ~ ("type" -> SecurityToken.kind(agent.securityToken))) - ~ ("capabilities" -> JArray(agent.capabilities.map(_.value).toList.sorted.map(JString(_)))) - ) - } - } - - def parseSecurityToken( - agentType: AgentType, - tokenJson: JValue, - tokenDefault: Option[String] - ): Either[InventoryError.SecurityToken, SecurityToken] = { - import net.liftweb.json.compactRender - - def extractValue(tokenJson: JValue): Option[String] = { - tokenJson \ "value" match { - case JString(s) => Some(s) - case _ => None - } - } - def error(kind: String) = - s"""Bad value defined for security token. Expected format is: "securityToken: {"type":"${kind}","value":"...."} """ - - tokenJson \ "type" match { - case JString(Certificate.kind) => - extractValue(tokenJson) match { - case Some(token) => Right(Certificate(token)) - case None => Left(InventoryError.SecurityToken(error(Certificate.kind))) - } - case JString(PublicKey.kind) => - Left( - InventoryError.SecurityToken( - "since Rudder 7.0, public key are not supported anymore for agent authentication: please use a certificate" - ) - ) - case invalidJson => - tokenDefault match { - case Some(default) => Right(PublicKey(default)) - case None => - val error = invalidJson match { - case JNothing => "no value define for security token" - case x => compactRender(invalidJson) - } - Left(InventoryError.SecurityToken(s"Invalid value for security token: ${error}, and no public key were stored")) - } - } - } - - /* - * Retrieve the agent information from JSON. "agentType" is mandatory, - * but version isn't, and even if we don't parse it correctly, we - * successfully return an agent (without version). - */ - def parseJson(s: String, optToken: Option[String]): IOResult[AgentInfo] = { - for { - json <- ZIO.attempt(parse(s)) mapError { ex => - InventoryError.Deserialisation(s"Can not parse agent info: ${ex.getMessage}", ex) - } - agentType <- (json \ "agentType") match { - case JString(tpe) => AgentType.fromValue(tpe).toIO - case JNothing => InventoryError.SecurityToken("No value defined for security token").fail - case invalidJson => - InventoryError - .AgentType( - s"Error when trying to parse string as JSON Agent Info (missing required field 'agentType'): ${compactRender(invalidJson)}" - ) - .fail - } - agentVersion = json \ "version" match { - case JString(version) => Some(AgentVersion(version)) - case _ => None - } - token <- (json \ "securityToken" match { - case JObject(json) => parseSecurityToken(agentType, json, optToken) - case _ => parseSecurityToken(agentType, JNothing, optToken) - }).toIO - capabilities <- IOResult.attempt(json \ "capabilities" match { - case JArray(capa) => - capa.flatMap(c => { - c match { - case JString(s) => Some(AgentCapability(s)) - case _ => None - } - }) - case _ => Nil - }) - } yield { - AgentInfo(agentType, agentVersion, token, capabilities.toSet) - } - } +object AgentInfo { + // make capabilities sorted when written + implicit val encoderSetAgentCapability: JsonEncoder[Set[AgentCapability]] = + JsonEncoder.list[AgentCapability].contramap(_.toList.sortBy(_.value)) + implicit val codecAgentInfo: JsonCodec[AgentInfo] = DeriveJsonCodec.gen } diff --git a/webapp/sources/ldap-inventory/inventory-api/src/main/scala/com/normation/inventory/domain/DataTypes.scala b/webapp/sources/ldap-inventory/inventory-api/src/main/scala/com/normation/inventory/domain/DataTypes.scala index 71034b1b8d9..432f2b26bd5 100644 --- a/webapp/sources/ldap-inventory/inventory-api/src/main/scala/com/normation/inventory/domain/DataTypes.scala +++ b/webapp/sources/ldap-inventory/inventory-api/src/main/scala/com/normation/inventory/domain/DataTypes.scala @@ -42,12 +42,11 @@ import com.normation.errors.* import com.normation.inventory.domain.InventoryError.CryptoEx import com.normation.inventory.services.provisioning.ParsedSecurityToken import java.io.StringReader -import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo import org.bouncycastle.cert.X509CertificateHolder import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter import org.bouncycastle.openssl.PEMParser -import org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter import zio.* +import zio.json.* import zio.syntax.* /** @@ -66,25 +65,32 @@ final case class Manufacturer(name: String) extends AnyVal */ final case class SoftwareEditor(val name: String) extends AnyVal -sealed trait SecurityToken { - def key: String +// this class is used to decode JSON "securityToken" before key validation and typing +// (the alias is because at some point, it was named "token" in NodeFact) +final case class JsonDecSecurityToken(@jsonAliases("token") value: String) +final case class JsonEncSecurityToken(@jsonField("type") @jsonAliases("kind") kind: String, value: String) + +sealed abstract class SecurityToken(val kind: String) { + def key: String + def value: String } object SecurityToken { + implicit val securityTokenEncoder: JsonEncoder[SecurityToken] = + DeriveJsonEncoder.gen[JsonEncSecurityToken].contramap(t => JsonEncSecurityToken(t.kind, t.value)) + implicit val securityTokenDecoder: JsonDecoder[SecurityToken] = + DeriveJsonDecoder.gen[JsonDecSecurityToken].map(t => Certificate(t.value)) + def kind(token: SecurityToken): String = { - token match { - case _: PublicKey => PublicKey.kind - case _: Certificate => Certificate.kind - } + token.kind } def token(kind: String, value: String): Either[String, SecurityToken] = { kind match { - case PublicKey.kind => Right(PublicKey(value)) case Certificate.kind => Right(Certificate(value)) case _ => Left( - s"Value '${kind}' is not recognized as a valid security token, expecting '${PublicKey.kind}' or '${Certificate.kind}'" + s"Value '${kind}' is not recognized as a valid security token, expecting '${Certificate.kind}'" ) } } @@ -139,16 +145,22 @@ object SecurityToken { .readObject() ) .left - .map(ex => InventoryError.CryptoEx(s"Key '${key}' cannot be parsed as a public key", ex.cause): InventoryError) + .map(ex => InventoryError.CryptoEx(s"Key '${key}' cannot be parsed as a PEM certificate", ex.cause): InventoryError) .flatMap { obj => obj match { - case _: SubjectPublicKeyInfo => Right(PublicKey(key)) case _: X509CertificateHolder => Right(Certificate(key)) - case _ => + case null => + Left( + InventoryError + .Crypto( + s"Provided agent key cannot be parsed a certificate. Please use a certificate in PEM format" + ) + ) + case _ => Left( InventoryError .Crypto( - s"Provided agent key is in an unknown format. Please use a certificate or public key in PEM format" + s"Provided agent key is in an unknown format. Please use a certificate in PEM format" ) ) } @@ -156,42 +168,11 @@ object SecurityToken { } } -object PublicKey { - val kind = "publicKey" -} object Certificate { val kind = "certificate" } -/** - * A simple class to denote a software cryptographic public key - */ -final case class PublicKey(value: String) extends SecurityToken { - - // Value of the key may be stored (with old fusion inventory version) as one line and without rsa header and footer, we should add them if missing and format the key - val key: String = { - if (value.startsWith("-----BEGIN RSA PUBLIC KEY-----")) { - value - } else { - s"""-----BEGIN RSA PUBLIC KEY----- - |${value.grouped(80).mkString("\n")} - |-----END RSA PUBLIC KEY-----""".stripMargin - } - } - def publicKey: IOResult[java.security.PublicKey] = { - ZIO.attempt { - (new PEMParser(new StringReader(key))).readObject() - }.mapError(ex => InventoryError.CryptoEx(s"Key '${key}' cannot be parsed as a public key", ex)).flatMap { obj => - obj match { - case a: SubjectPublicKeyInfo => - (new JcaPEMKeyConverter().getPublicKey(a)).succeed - case _ => InventoryError.Crypto(s"Key '${key}' cannot be parsed as a public key").fail - } - } - } -} - -final case class Certificate(value: String) extends SecurityToken { +final case class Certificate(value: String) extends SecurityToken(Certificate.kind) { // Value of the key may be stored (with old fusion inventory version) as one line and without rsa header and footer, we should add them if missing and format the key val key: String = { diff --git a/webapp/sources/ldap-inventory/inventory-api/src/main/scala/com/normation/inventory/domain/MachineInventory.scala b/webapp/sources/ldap-inventory/inventory-api/src/main/scala/com/normation/inventory/domain/MachineInventory.scala index 85736367c6c..b25428148a4 100644 --- a/webapp/sources/ldap-inventory/inventory-api/src/main/scala/com/normation/inventory/domain/MachineInventory.scala +++ b/webapp/sources/ldap-inventory/inventory-api/src/main/scala/com/normation/inventory/domain/MachineInventory.scala @@ -66,7 +66,7 @@ final case class Controller( ) extends PhysicalElement final case class MemorySlot( - slotNumber: String, // string, because sometime it looks like: RAM slot #0 + slotNumber: String, // string, because sometimes it looks like: RAM slot #0 name: Option[String] = None, description: Option[String] = None, diff --git a/webapp/sources/ldap-inventory/inventory-api/src/main/scala/com/normation/inventory/domain/NodeInventory.scala b/webapp/sources/ldap-inventory/inventory-api/src/main/scala/com/normation/inventory/domain/NodeInventory.scala index dde3bddf711..4b3eca5ba0f 100644 --- a/webapp/sources/ldap-inventory/inventory-api/src/main/scala/com/normation/inventory/domain/NodeInventory.scala +++ b/webapp/sources/ldap-inventory/inventory-api/src/main/scala/com/normation/inventory/domain/NodeInventory.scala @@ -39,9 +39,9 @@ package com.normation.inventory.domain import enumeratum.* import java.net.InetAddress -import net.liftweb.json.JsonAST.JValue import org.joda.time.DateTime import zio.json.* +import zio.json.ast.* sealed trait NodeElement { def description: Option[String] @@ -100,6 +100,10 @@ final case class Process( description: Option[String] = None ) extends NodeElement +object Process { + implicit val codecProcess: JsonCodec[Process] = DeriveJsonCodec.gen +} + final case class VirtualMachine( @jsonField("type") @jsonAliases("vmtype") vmtype: Option[String] = None, subsystem: Option[String] = None, @@ -114,10 +118,16 @@ final case class VirtualMachine( ) extends NodeElement final case class EnvironmentVariable( - name: String, - value: Option[String] = None, - description: Option[String] = None -) extends NodeElement + name: String, + value: Option[String] = None +) extends NodeElement { + // description is never present in Environment Variable, and we don't store it if it was + val description: Option[String] = None +} + +object EnvironmentVariable { + implicit val codecEnvironmentVariable: JsonCodec[EnvironmentVariable] = DeriveJsonCodec.gen +} object InetAddressUtils { @@ -470,9 +480,13 @@ final case class NodeTimezone( final case class CustomProperty( name: String, - value: JValue + value: Json ) +object CustomProperty { + implicit val codecCustomProperty: JsonCodec[CustomProperty] = DeriveJsonCodec.gen +} + sealed abstract class SoftwareUpdateKind(override val entryName: String) extends EnumEntry { def name: String = entryName } @@ -548,6 +562,10 @@ object KeyStatus { final case class AgentCapability(value: String) extends AnyVal +object AgentCapability { + implicit val codecAgentCapability: JsonCodec[AgentCapability] = JsonCodec.string.transform(AgentCapability.apply, _.value) +} + final case class NodeInventory( main: NodeSummary, name: Option[String] = None, diff --git a/webapp/sources/ldap-inventory/inventory-api/src/main/scala/com/normation/inventory/services/provisioning/CheckInventoryDigest.scala b/webapp/sources/ldap-inventory/inventory-api/src/main/scala/com/normation/inventory/services/provisioning/CheckInventoryDigest.scala index 54d6768804f..abb7c10cff3 100644 --- a/webapp/sources/ldap-inventory/inventory-api/src/main/scala/com/normation/inventory/services/provisioning/CheckInventoryDigest.scala +++ b/webapp/sources/ldap-inventory/inventory-api/src/main/scala/com/normation/inventory/services/provisioning/CheckInventoryDigest.scala @@ -38,7 +38,7 @@ package com.normation.inventory.services.provisioning import com.normation.errors.* import com.normation.errors.IOResult -import com.normation.inventory.domain.{PublicKey as AgentKey, *} +import com.normation.inventory.domain.* import java.io.InputStream import java.security.PublicKey import java.security.Signature @@ -155,7 +155,6 @@ trait GetKey { def parseSecurityToken(token: SecurityToken): IOResult[ParsedSecurityToken] = { token match { - case x: AgentKey => x.publicKey.map(pk => ParsedSecurityToken(pk, None)) case x: Certificate => SecurityToken.parseCertificate(x).map { case (p, s) => ParsedSecurityToken(p, Some(s)) } } diff --git a/webapp/sources/ldap-inventory/inventory-api/src/main/scala/com/normation/inventory/services/provisioning/GenericIdFinder.scala b/webapp/sources/ldap-inventory/inventory-api/src/main/scala/com/normation/inventory/services/provisioning/GenericIdFinder.scala index 5f5f592f734..74a61d5e817 100644 --- a/webapp/sources/ldap-inventory/inventory-api/src/main/scala/com/normation/inventory/services/provisioning/GenericIdFinder.scala +++ b/webapp/sources/ldap-inventory/inventory-api/src/main/scala/com/normation/inventory/services/provisioning/GenericIdFinder.scala @@ -39,7 +39,6 @@ package com.normation.inventory.services.provisioning import com.normation.errors.* import com.normation.inventory.domain.* -import net.liftweb.common.* import zio.* import zio.syntax.* @@ -79,7 +78,7 @@ class NodeInventoryDNFinderService(actions: Seq[NamedNodeInventoryDNFinderAction */ sealed case class NamedMachineDNFinderAction(val name: String, val action: MachineDNFinderAction) -class MachineDNFinderService(actions: Seq[NamedMachineDNFinderAction]) extends MachineDNFinderAction with Loggable { +class MachineDNFinderService(actions: Seq[NamedMachineDNFinderAction]) extends MachineDNFinderAction { override def tryWith(entity: MachineInventory): IOResult[Option[(MachineUuid, InventoryStatus)]] = { ZIO diff --git a/webapp/sources/ldap-inventory/inventory-api/src/main/scala/com/normation/inventory/services/provisioning/InventorySaver.scala b/webapp/sources/ldap-inventory/inventory-api/src/main/scala/com/normation/inventory/services/provisioning/InventorySaver.scala index c2f423f8f27..96984c41727 100644 --- a/webapp/sources/ldap-inventory/inventory-api/src/main/scala/com/normation/inventory/services/provisioning/InventorySaver.scala +++ b/webapp/sources/ldap-inventory/inventory-api/src/main/scala/com/normation/inventory/services/provisioning/InventorySaver.scala @@ -41,7 +41,6 @@ import com.normation.errors.* import com.normation.inventory.domain.Inventory import com.normation.inventory.domain.InventoryProcessingLogger import com.normation.zio.* -import net.liftweb.common.Loggable import zio.* /** @@ -75,7 +74,7 @@ trait InventorySaver[R] { * middle */ -trait PipelinedInventorySaver[R] extends InventorySaver[R] with Loggable { +trait PipelinedInventorySaver[R] extends InventorySaver[R] { val preCommitPipeline: Seq[PreCommit] val basePostPipeline: Seq[PostCommit[R]] diff --git a/webapp/sources/ldap-inventory/inventory-api/src/test/scala/com/normation/inventory/domain/AgentTypeEnumTest.scala b/webapp/sources/ldap-inventory/inventory-api/src/test/scala/com/normation/inventory/domain/AgentTypeEnumTest.scala index 3591f0bc5c3..2cddf98e622 100644 --- a/webapp/sources/ldap-inventory/inventory-api/src/test/scala/com/normation/inventory/domain/AgentTypeEnumTest.scala +++ b/webapp/sources/ldap-inventory/inventory-api/src/test/scala/com/normation/inventory/domain/AgentTypeEnumTest.scala @@ -11,8 +11,7 @@ object AgentTypeEnumTest extends ZIOSpecDefault { override def spec: Spec[TestEnvironment & Scope, Any] = suite("AgentType")( test("should never remove existing type for backward compatibility") { assertTrue( - AgentType.values == - IndexedSeq(AgentType.CfeEnterprise, AgentType.CfeCommunity, AgentType.Dsc) + AgentType.values == IndexedSeq(AgentType.CfeCommunity, AgentType.Dsc) ) } ) diff --git a/webapp/sources/ldap-inventory/inventory-api/src/test/scala/com/normation/inventory/domain/AgentTypesTest.scala b/webapp/sources/ldap-inventory/inventory-api/src/test/scala/com/normation/inventory/domain/AgentTypesTest.scala index 2c829d1754d..0aeefcf9698 100644 --- a/webapp/sources/ldap-inventory/inventory-api/src/test/scala/com/normation/inventory/domain/AgentTypesTest.scala +++ b/webapp/sources/ldap-inventory/inventory-api/src/test/scala/com/normation/inventory/domain/AgentTypesTest.scala @@ -37,10 +37,10 @@ package com.normation.inventory.domain -import com.normation.zio.ZioRuntime import org.junit.runner.* import org.specs2.mutable.* import org.specs2.runner.* +import zio.json.* /** * Test properties about agent type, especially regarding serialisation @@ -51,7 +51,7 @@ class AgentTypesTest extends Specification { // test serialisation of agent type and security token. /* - * In 4.1 and before, we add two seperated attribute: + * In 4.1 and before, we add two separated attribute: * - agentType for agent type and version * - publicKey to store node RSA public key in pkcs1 format * @@ -70,29 +70,46 @@ class AgentTypesTest extends Specification { * */ - val key = - "-----BEGIN RSA PUBLIC KEY-----\nMIIBCgKCAQEAtDTtbfw2ic1pcUludrs1I+HGGdRL0r5dKjMzLhUGahCrVaH7H3ND\n/py+XPZKY/Iolttgf1RriQAazEVbFEWXozistMTXtWJu/5IxV47QNqbS82KrhQNp\ns4abfqraGOlYbYS5BXCaHYrKI2VzvAwwvCsE7vmhnO1Br4AueagrFU+itjr/0gMd\nu58xYDiAADXqGDzES75NIxCZelv5vefMfpEMlBmztKmgY+iT+Q8lhf42WUsZ9OBl\nRDRfQ9VCW+8336C1JEpcHAcSElF4mn4D0GN7RvxNOSGpuLjxAvp5qFVbp4Xtd+4q\n8DaGe+w8MplwMVCFTyEMS3E1pS4DdctdLwIDAQAB\n-----END RSA PUBLIC KEY-----" + "Parsing agent type" should { + "works for an agent without capabilities in 8.0 format" in { + val cert = { + """-----BEGIN CERTIFICATE-----\nMIIFTjCCAzagAwIBAgIUfa0+S+CyJahRzuwNNOFLNQQjIH8wDQYJKoZIhvcNAQEL\nBQAwFzEVMBMGCgmSJomT8ixkAQEMBW5vZGU3MB4XDTI0MDMwMTExMDIxM1oXDTM0\nMDIyNzExMDIxM1owFzEVMBMGCgmSJomT8ixkAQEMBW5vZGU3MIICIjANBgkqhkiG\n9w0BAQEFAAOCAg8AMIICCgKCAgEAsmBUYI1A5vqkOTCW24m/mQhBaRu4WaAUXDAr\nArdIAAMN0KyHhEXP1/X32Flw90E0VjtUH4P+DYLBozXYWhJrUxdWLyn3TRSbv3Kr\npXoCWhMhMp8OK2s/mG+rfiMpTXIwaMhPnBaJFNV3c+bkijGAMHtFjl3+leXJvNZ7\nw3bIg4cA3e77kz7EWMyqxOUvvLMyY6wpd03ahe/By+iLgtOkgUwl9hMqMU8tJeaz\nNIeUporsHk5rrk8bSf6Mxxdknm43Sk6oflnueNCIUFdd4rS2JLieMugsTh8n/oH+\nk29ZyirE3ikhftmZ3vY8GQ3IcIzaXwiAOGnCKcze79zVx5jmOTGSZitGZaU/cZc6\nLjzEp+ZDmE8caVIksiA+hIlaZeBXNHB+YRv/gV1Rbt7kS1am+XUZJSfVFf+99YqE\nlZ5p0hqJsczkBb2RuMxWxxsWO3pesPUNCuL/yaeggTIp7eK06tQWi1EfXr40ctrf\noimbzMAKNBpRKWruL7652SlF75Usaq+PaPi1TtqYQjLRZmbpr+IR4uMeKnEMIZPw\n3dLDKBV6d71XkTAalCmcJU+fgYrRmgz1dEnaZDIXY+f+fYR15hsFpDrZ0avHgkzJ\nca/nT/rKeX7136BttxVSbZaTU9hnmjAvl+v0BF+JUWPQ3VPTcrmyUNAICt8xdVae\nuo1tsvkCAwEAAaOBkTCBjjAMBgNVHRMEBTADAQH/MB0GA1UdDgQWBBSRG0uHQRIA\ngl91YqzSjaeaw+F7PDBSBgNVHSMESzBJgBSRG0uHQRIAgl91YqzSjaeaw+F7PKEb\npBkwFzEVMBMGCgmSJomT8ixkAQEMBW5vZGU3ghR9rT5L4LIlqFHO7A004Us1BCMg\nfzALBgNVHQ8EBAMCArwwDQYJKoZIhvcNAQELBQADggIBABR2vTH/6WlqjaTZ/hQc\nB+crqRlFimqCiVTRdX6qfkt0tLX2dK6scHNTBT04ORLjLTAn0KbcOUz3k6i0mIqB\nnG5UjqCFEQR+i2V4Hz7aK6+7LBQuwXWRhDhvO5xMn7MxjvP0LGgNf5iiA4r/N22L\nEMc1prDESIOGmWdKg9XlfLxd877R2d8/3hXyT82Y2uJHO25b53skj4pbUOWLsGSw\nd4FBNnWqM+7Hbg2v9xFvmtfs2G2Inqk4Xjtjnj8qkVk3ft6KzClUIMXGXQ8QqaRp\nYPkTJm5g2UBYDiguD/tlz3VmbsNYU6fkap7DKqhttbaseIx1zDwdAv4jtVOWDyjx\nWq4b7pljYiczfRa84X/9v1x05pT3raELy5udY+Pxmnz+hOXOM+jY5bzSKS24b8rS\n5Sklmutm0IdflMKd5vNrXd9yPFLu3QzN50ArzHHXczwBLgjaMlZsPAp1wITlqM7+\nWCjy3qM5/KgAjH3L24MPTq23o9PokBVh1NH7lesZqgJPgsj+OG7FMQDvKzg7ytrs\nQlIDF1c8Ko+9/RrnRVAS8C4GZOqbmMmfJjMp09GBz2d0ixlTusF6m6iwfIVMf/nI\nP/V0D7STRiV62cfnZ3e0w8kIeZwWAgXI7RMHJU3skLyurUu8yxkp635IQyzQsW2A\nYo7t7O7fxjqD9yVI2QfkERZ7\n-----END CERTIFICATE-----\n""" + } - val json61: String = s""" - { - "agentType":"cfengine-community" - ,"version" :"6.1.0" - ,"securityToken": { "value":"$key","type":"certificate"} - , "capabilities": ["https", "very", "good"] - }""" + val json80 = + s"""{"agentType":"cfengine-community","version":"8.0.0","securityToken":{"type":"certificate","value":"${cert}"}}""" + val res = json80.fromJson[AgentInfo] + res must beRight( + AgentInfo( + AgentType.CfeCommunity, + Some(AgentVersion("8.0.0")), + Certificate(cert.replaceAll("""\\n""", "\n")), // this is needed because the json format writes the \n literaly + Set() + ) + ) + } - "Parsing agent type" should { + "works for an agent with capabilities in 8.0 format" in { + val cert = { + """-----BEGIN CERTIFICATE-----\nMIIFTjCCAzagAwIBAgIUfa0+S+CyJahRzuwNNOFLNQQjIH8wDQYJKoZIhvcNAQEL\nBQAwFzEVMBMGCgmSJomT8ixkAQEMBW5vZGU3MB4XDTI0MDMwMTExMDIxM1oXDTM0\nMDIyNzExMDIxM1owFzEVMBMGCgmSJomT8ixkAQEMBW5vZGU3MIICIjANBgkqhkiG\n9w0BAQEFAAOCAg8AMIICCgKCAgEAsmBUYI1A5vqkOTCW24m/mQhBaRu4WaAUXDAr\nArdIAAMN0KyHhEXP1/X32Flw90E0VjtUH4P+DYLBozXYWhJrUxdWLyn3TRSbv3Kr\npXoCWhMhMp8OK2s/mG+rfiMpTXIwaMhPnBaJFNV3c+bkijGAMHtFjl3+leXJvNZ7\nw3bIg4cA3e77kz7EWMyqxOUvvLMyY6wpd03ahe/By+iLgtOkgUwl9hMqMU8tJeaz\nNIeUporsHk5rrk8bSf6Mxxdknm43Sk6oflnueNCIUFdd4rS2JLieMugsTh8n/oH+\nk29ZyirE3ikhftmZ3vY8GQ3IcIzaXwiAOGnCKcze79zVx5jmOTGSZitGZaU/cZc6\nLjzEp+ZDmE8caVIksiA+hIlaZeBXNHB+YRv/gV1Rbt7kS1am+XUZJSfVFf+99YqE\nlZ5p0hqJsczkBb2RuMxWxxsWO3pesPUNCuL/yaeggTIp7eK06tQWi1EfXr40ctrf\noimbzMAKNBpRKWruL7652SlF75Usaq+PaPi1TtqYQjLRZmbpr+IR4uMeKnEMIZPw\n3dLDKBV6d71XkTAalCmcJU+fgYrRmgz1dEnaZDIXY+f+fYR15hsFpDrZ0avHgkzJ\nca/nT/rKeX7136BttxVSbZaTU9hnmjAvl+v0BF+JUWPQ3VPTcrmyUNAICt8xdVae\nuo1tsvkCAwEAAaOBkTCBjjAMBgNVHRMEBTADAQH/MB0GA1UdDgQWBBSRG0uHQRIA\ngl91YqzSjaeaw+F7PDBSBgNVHSMESzBJgBSRG0uHQRIAgl91YqzSjaeaw+F7PKEb\npBkwFzEVMBMGCgmSJomT8ixkAQEMBW5vZGU3ghR9rT5L4LIlqFHO7A004Us1BCMg\nfzALBgNVHQ8EBAMCArwwDQYJKoZIhvcNAQELBQADggIBABR2vTH/6WlqjaTZ/hQc\nB+crqRlFimqCiVTRdX6qfkt0tLX2dK6scHNTBT04ORLjLTAn0KbcOUz3k6i0mIqB\nnG5UjqCFEQR+i2V4Hz7aK6+7LBQuwXWRhDhvO5xMn7MxjvP0LGgNf5iiA4r/N22L\nEMc1prDESIOGmWdKg9XlfLxd877R2d8/3hXyT82Y2uJHO25b53skj4pbUOWLsGSw\nd4FBNnWqM+7Hbg2v9xFvmtfs2G2Inqk4Xjtjnj8qkVk3ft6KzClUIMXGXQ8QqaRp\nYPkTJm5g2UBYDiguD/tlz3VmbsNYU6fkap7DKqhttbaseIx1zDwdAv4jtVOWDyjx\nWq4b7pljYiczfRa84X/9v1x05pT3raELy5udY+Pxmnz+hOXOM+jY5bzSKS24b8rS\n5Sklmutm0IdflMKd5vNrXd9yPFLu3QzN50ArzHHXczwBLgjaMlZsPAp1wITlqM7+\nWCjy3qM5/KgAjH3L24MPTq23o9PokBVh1NH7lesZqgJPgsj+OG7FMQDvKzg7ytrs\nQlIDF1c8Ko+9/RrnRVAS8C4GZOqbmMmfJjMp09GBz2d0ixlTusF6m6iwfIVMf/nI\nP/V0D7STRiV62cfnZ3e0w8kIeZwWAgXI7RMHJU3skLyurUu8yxkp635IQyzQsW2A\nYo7t7O7fxjqD9yVI2QfkERZ7\n-----END CERTIFICATE-----\n""" + } - "works for 6_1 format" in { - val res = ZioRuntime.runNow(AgentInfoSerialisation.parseJson(json61, None)) + val json80 = + s"""{"agentType":"cfengine-community","version":"8.0.0","securityToken":{"type":"certificate","value":"${cert}"},"capabilities":["acl","cfengine","curl","http_reporting","jq","xml","yaml"]}""" + val res = json80.fromJson[AgentInfo] match { + case Left(err) => throw new RuntimeException(s"bad result: ${err}") + case Right(x) => x + } + val ser = res.toJson res must beEqualTo( AgentInfo( AgentType.CfeCommunity, - Some(AgentVersion("6.1.0")), - Certificate(key), - Set("https", "very", "good").map(AgentCapability.apply) + Some(AgentVersion("8.0.0")), + Certificate(cert.replaceAll("""\\n""", "\n")), // this is needed because the json format writes the \n literaly + Set("acl", "cfengine", "curl", "http_reporting", "jq", "xml", "yaml").map(AgentCapability.apply) ) - ) + ) and ser === json80 } } + } diff --git a/webapp/sources/ldap-inventory/inventory-fusion/pom.xml b/webapp/sources/ldap-inventory/inventory-fusion/pom.xml index 532c4e432a8..00e3ef7d824 100644 --- a/webapp/sources/ldap-inventory/inventory-fusion/pom.xml +++ b/webapp/sources/ldap-inventory/inventory-fusion/pom.xml @@ -35,7 +35,7 @@ along with Rudder. If not, see . com.normation.inventory inventory-parent - 8.2.4-SNAPSHOT + 8.3.0~alpha1-SNAPSHOT inventory-fusion diff --git a/webapp/sources/ldap-inventory/inventory-fusion/src/main/scala/com/normation/inventory/provisioning/fusion/FusionInventoryParser.scala b/webapp/sources/ldap-inventory/inventory-fusion/src/main/scala/com/normation/inventory/provisioning/fusion/FusionInventoryParser.scala index b9a9c894dbd..24049c9906c 100644 --- a/webapp/sources/ldap-inventory/inventory-fusion/src/main/scala/com/normation/inventory/provisioning/fusion/FusionInventoryParser.scala +++ b/webapp/sources/ldap-inventory/inventory-fusion/src/main/scala/com/normation/inventory/provisioning/fusion/FusionInventoryParser.scala @@ -48,12 +48,13 @@ import com.normation.utils.StringUuidGenerator import com.softwaremill.quicklens.* import java.net.InetAddress import java.util.Locale -import net.liftweb.json.JsonAST.JString import org.joda.time.DateTime import org.joda.time.format.DateTimeFormat import org.joda.time.format.DateTimeFormatter import scala.xml.* import zio.* +import zio.json.* +import zio.json.ast.* import zio.syntax.* class FusionInventoryParser( @@ -283,19 +284,17 @@ class FusionInventoryParser( // the whole content of the CUSTOM_PROPERTIES attribute should be valid JSON Array def processCustomProperties(xml: NodeSeq): List[CustomProperty] = { - import net.liftweb.json.* - - parseOpt(xml.text) match { - case None => Nil - case Some(json) => + xml.text.fromJson[Json] match { + case Left(err) => Nil + case Right(json) => json match { // only Json Array is OK - case JArray(values) => + case Json.Arr(values) => // each values must be an object, with each key a property name (and values... it depends :) values.flatMap { - case JObject(fields) => fields.map(f => CustomProperty(f.name, f.value)) - case _ => Nil - } - case x => Nil + case Json.Obj(fields) => fields.map(f => CustomProperty(f._1, f._2)) + case _ => Nil + }.toList + case x => Nil } } } @@ -328,10 +327,10 @@ class FusionInventoryParser( val origHostname = sortedAlternatives.collectFirst { case Some(fqdn) if validHostname(fqdn) => fqdn } customProperties.collectFirst { - case CustomProperty(CUSTOM_PROPERTY_OVERRIDE_HOSTNAME, JString(x)) if validHostname(x) => x + case CustomProperty(CUSTOM_PROPERTY_OVERRIDE_HOSTNAME, Json.Str(x)) if validHostname(x) => x } match { case Some(x) => - val orig = CustomProperty(CUSTOM_PROPERTY_ORIGINAL_HOSTNAME, JString(origHostname.getOrElse("none"))) + val orig = CustomProperty(CUSTOM_PROPERTY_ORIGINAL_HOSTNAME, Json.Str(origHostname.getOrElse("none"))) (x, orig :: customProperties).succeed case None => origHostname match { @@ -414,16 +413,10 @@ class FusionInventoryParser( */ val agentList = ZIO.foreach((xml \\ "AGENT").toList) { agentXML => val agent = for { - agentName <- optText(agentXML \ "AGENT_NAME").notOptional( - "could not parse agent name (tag AGENT_NAME) from Rudder specific inventory" - ) - rawAgentType <- ZIO.fromEither(AgentType.fromValue(agentName)) - agentType <- if (rawAgentType == AgentType.CfeEnterprise) { - Inconsistency( - "CFEngine Enterprise/Nova agents are not supported anymore" - ).fail - } else { rawAgentType.succeed } - + agentName <- optText(agentXML \ "AGENT_NAME").notOptional( + "could not parse agent name (tag AGENT_NAME) from Rudder specific inventory" + ) + agentType <- ZIO.fromEither(AgentType.fromValue(agentName)) rootUser <- optText(agentXML \\ "OWNER").notOptional("could not parse rudder user (tag OWNER) from rudder specific inventory") policyServerId <- optText(agentXML \\ "POLICY_SERVER_UUID").notOptional( diff --git a/webapp/sources/ldap-inventory/inventory-fusion/src/main/scala/com/normation/inventory/provisioning/fusion/PreInventoryParserCheckConsistency.scala b/webapp/sources/ldap-inventory/inventory-fusion/src/main/scala/com/normation/inventory/provisioning/fusion/PreInventoryParserCheckConsistency.scala index be27454b847..2f57eada0ac 100644 --- a/webapp/sources/ldap-inventory/inventory-fusion/src/main/scala/com/normation/inventory/provisioning/fusion/PreInventoryParserCheckConsistency.scala +++ b/webapp/sources/ldap-inventory/inventory-fusion/src/main/scala/com/normation/inventory/provisioning/fusion/PreInventoryParserCheckConsistency.scala @@ -58,8 +58,8 @@ class PreInventoryParserCheckConsistency extends PreInventoryParser { /** * There is a list of variables that MUST be set at that point: - * - an id for the node (it is ok that it may be change latter on the process, for ex. for unusal changes) - * - an hostname + * - an id for the node (it is ok that it may be change later on the process, for ex. for unusual changes) + * - a hostname * - an admin (root user on the node) * - a policy server id * - an OS name @@ -85,7 +85,7 @@ class PreInventoryParserCheckConsistency extends PreInventoryParser { ZIO.foldLeft(checks)(inventory)((currentInventory, check) => check(currentInventory)) } - // Utilitary method to get only once the RUDDER and the AGENT + // Utility method to get only once the RUDDER and the AGENT private def getInTags(xml: NodeSeq, tag: String): NodeSeq = { xml \\ tag } @@ -200,7 +200,7 @@ class PreInventoryParserCheckConsistency extends PreInventoryParser { /** * Kernel version: either - * - non empty OPERATINGSYSTEM > KERNEL_VERSION + * - non-empty OPERATINGSYSTEM > KERNEL_VERSION * or * - (on AIX and non empty HARDWARE > OSVERSION ) * Other cases are failure (missing required info) diff --git a/webapp/sources/ldap-inventory/inventory-fusion/src/main/scala/com/normation/inventory/provisioning/fusion/PreInventoryParserCheckInventoryAge.scala b/webapp/sources/ldap-inventory/inventory-fusion/src/main/scala/com/normation/inventory/provisioning/fusion/PreInventoryParserCheckInventoryAge.scala new file mode 100644 index 00000000000..58f48e8fec6 --- /dev/null +++ b/webapp/sources/ldap-inventory/inventory-fusion/src/main/scala/com/normation/inventory/provisioning/fusion/PreInventoryParserCheckInventoryAge.scala @@ -0,0 +1,131 @@ +/* + ************************************************************************************* + * Copyright 2024 Normation SAS + ************************************************************************************* + * + * This file is part of Rudder. + * + * Rudder is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * In accordance with the terms of section 7 (7. Additional Terms.) of + * the GNU General Public License version 3, the copyright holders add + * the following Additional permissions: + * Notwithstanding to the terms of section 5 (5. Conveying Modified Source + * Versions) and 6 (6. Conveying Non-Source Forms.) of the GNU General + * Public License version 3, when you create a Related Module, this + * Related Module is not considered as a part of the work and may be + * distributed under the license agreement of your choice. + * A "Related Module" means a set of sources files including their + * documentation that, without modification of the Source Code, enables + * supplementary functions or services in addition to those offered by + * the Software. + * + * Rudder is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Rudder. If not, see . + + * + ************************************************************************************* + */ + +package com.normation.inventory.provisioning.fusion + +import com.normation.errors.* +import com.normation.inventory.provisioning.fusion.OptText.optText +import com.normation.inventory.services.provisioning.* +import java.time.* +import java.time.format.DateTimeFormatter +import scala.xml.NodeSeq +import zio.* + +class PreInventoryParserCheckInventoryAge(maxBeforeNow: Duration, maxAfterNow: Duration) extends PreInventoryParser { + override val name = "post_process_inventory:check_inventory_age" + + /** + * We don't want to accept inventories; + * - older than maxBeforeNow + * - more in the future than maxAfterNow + * + * Age is deducted from the attribute: + * - ACCESSLOG > LOGDATE, which is a datetime in local server time, without timezone. + * - OPERATINGSYSTEM > TIMEZONE > TIMEZONE that may not be there, for more fun. + * + * If we are not able to parse the timezone, then assume UTC because it's at least a known error. + * If logdate is missing or not parsable, assume the inventory is out of range (it will likely + * be refused further one). + */ + override def apply(inventory: NodeSeq): IOResult[NodeSeq] = { + val now = OffsetDateTime.now() + val date = PreInventoryParserCheckInventoryAge.extracDateValue(inventory) + + (for { + d <- PreInventoryParserCheckInventoryAge.parseInventoryDate(date) + _ <- PreInventoryParserCheckInventoryAge.checkDate(d, now, maxBeforeNow, maxAfterNow) + } yield inventory).toIO + } + +} + +object PreInventoryParserCheckInventoryAge { + + val dateTimeFormat = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss") + val offsetDateTimeFormat = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ssZ") + + def extracDateValue(inventory: NodeSeq): String = { + val logdate = optText(inventory \\ "ACCESSLOG" \ "LOGDATE").getOrElse("") + val timezone = optText(inventory \\ "OPERATINGSYSTEM" \ "TIMEZONE" \ "OFFSET").getOrElse("") + + logdate + timezone + } + + // try to parse the inventory date in format YYYY-MM-dd HH:mm:ssZ + // ex UTC: 2023-11-16 10:46:35+0000 + // ex Europe/Paris: 2023-11-16 11:46:12+0100 + def parseOffsetDateTime(date: String): PureResult[OffsetDateTime] = { + PureResult.attempt(s"Error when parsing date '${date}' as a time-zoned date with offset")( + OffsetDateTime.parse(date, offsetDateTimeFormat) + ) + } + + // try to parse the inventory date in format: YYYY-MM-dd HH:mm:ss + // Since in that case, we don't have timezone information, we need to chose arbitrary, + // and we chose UTC so that it's easier to identify problem when they arise. + def parseLocalDateTime(date: String): PureResult[OffsetDateTime] = { + PureResult + .attempt(s"Error when parsing date '${date}' as a local date time")( + LocalDateTime.parse(date, dateTimeFormat) + ) + .map(OffsetDateTime.of(_, ZoneOffset.UTC)) + } + + def parseInventoryDate(date: String): PureResult[OffsetDateTime] = { + parseOffsetDateTime(date) match { + case Left(_) => parseLocalDateTime(date) + case Right(d) => Right(d) + } + } + + // check that date is in window between [now-maxBeforeNow, now+maxAfterNow] + def checkDate(date: OffsetDateTime, now: OffsetDateTime, maxBeforeNow: Duration, maxAfterNow: Duration): PureResult[Unit] = { + val pastLimit = now.minus(maxBeforeNow) + val futureLimit = now.plus(maxAfterNow) + + val beforePastLimit = Inconsistency(s"Inventory is too old, refusing (inventory date is before '${pastLimit.toString}')") + val afterFutureLimit = Inconsistency( + s"Inventory is too far in the future, refusing (inventory date is after '${futureLimit.toString}')" + ) + + (date.isBefore(pastLimit), date.isAfter(futureLimit)) match { + case (false, false) => Right(()) + case (true, _) => Left(beforePastLimit) + case (_, true) => Left(afterFutureLimit) + } + } +} diff --git a/webapp/sources/ldap-inventory/inventory-fusion/src/test/resources/fusion-inventories/WIN-2017-rudder-4-1.ocs b/webapp/sources/ldap-inventory/inventory-fusion/src/test/resources/fusion-inventories/WIN-2017-rudder-4-1.ocs deleted file mode 100644 index 44b1c0f1852..00000000000 --- a/webapp/sources/ldap-inventory/inventory-fusion/src/test/resources/fusion-inventories/WIN-2017-rudder-4-1.ocs +++ /dev/null @@ -1,548 +0,0 @@ - - - - - - -Invité -demo -Administrateur - - - 2017-05-09 18:15:19 - - - 12/01/2006 - innotek GmbH - VirtualBox - Oracle Corporation - VirtualBox - 0 - innotek GmbH - VirtualBox - 0 - - - 82801HM/HEM (ICH8M/ICH8M-E) SATA Controller [AHCI mode] - Intel Corporation - 82801HM/HEM (ICH8M/ICH8M-E) SATA Controller [AHCI mode] - 0000:0000 - 2829 - Contrôleur Serial ATA standard AHCI 1.0 - 8086 - - - KeyLargo/Intrepid USB - Apple Inc. - KeyLargo/Intrepid USB - 0000:0000 - 003f - Contrôleur hôte USB OpenHCD standard - 106b - - - 82540EM Gigabit Ethernet Controller - Intel Corporation - PRO/1000 MT Desktop Adapter - 8086:001e - 100e - Carte Intel(R) PRO/1000 MT pour station de travail - 8086 - - - VirtualBox Guest Service - InnoTek Systemberatung GmbH - VirtualBox Guest Service - 0000:0000 - cafe - VirtualBox Device - 80ee - - - 440FX - 82441FX PMC [Natoma] - Intel Corporation - 440FX - 82441FX PMC [Natoma] - 0000:0000 - 1237 - Pont Intel 82441FX Processeur Pentium(R) Pro vers PCI - 8086 - - - 82801FB/FBM/FR/FW/FRW (ICH6 Family) High Definition Audio Controller - Intel Corporation - 82801FB/FBM/FR/FW/FRW (ICH6 Family) High Definition Audio Controller - 8384:7680 - 2668 - Contrôleur audio haute définition - 8086 - - - 82371SB PIIX3 ISA [Natoma/Triton II] - Intel Corporation - 82371SB PIIX3 ISA [Natoma/Triton II] - 0000:0000 - 7000 - Pont Intel 82371SB PCI vers ISA - 8086 - - - VirtualBox Graphics Adapter - InnoTek Systemberatung GmbH - VirtualBox Graphics Adapter - 0000:0000 - beef - VirtualBox Graphics Adapter - 80ee - - - 1 - Intel64 Family 6 Model 69 Stepping 1 - 6 - Intel - 69 - Intel(R) Core(TM) i5-4200U CPU @ 1.60GHz - 1600 - 1 - 1 - - - Disque fixe local - NTFS - 11002 - - C: - E478E77B - 1 - 20555 - Local Disk - - - - Disque CD-ROM - D: - - Compact Disc - - - ComSpec - %SystemRoot%\system32\cmd.exe - - - FP_NO_HOST_CHECK - NO - - - OS - Windows_NT - - - Path - %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Cfengine\bin\ - - - PATHEXT - .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC - - - PROCESSOR_ARCHITECTURE - AMD64 - - - TEMP - %SystemRoot%\TEMP - - - TMP - %SystemRoot%\TEMP - - - USERNAME - SYSTEM - - - windir - %SystemRoot% - - - PSModulePath - %SystemRoot%\system32\WindowsPowerShell\v1.0\Modules\ - - - NUMBER_OF_PROCESSORS - 1 - - - PROCESSOR_LEVEL - 6 - - - PROCESSOR_IDENTIFIER - Intel64 Family 6 Model 69 Stepping 1, GenuineIntel - - - PROCESSOR_REVISION - 4501 - - - MSWin32-x64-multi-thread - Other - 131071 - 10.0.2.2 - 10.0.2.3 - 19 - 10.0.2.15/192.168.43.10 - vagrant - 2047 - WIN-UC3QD07D2PO - Microsoft Windows Server 2008 R2 Standard - 6.1.7600 - 1 - 1600 - Intel(R) Core(TM) i5-4200U CPU @ 1.60GHz - vagrant - B1F2330E-9D66-0C4E-B9CC-CD455F007AC1 - VirtualBox - 1036 - Utilisateur Windows - 00477-179-0000007-84674 - HMG6P-C7VGP-47GJ9-TWBD4-2YYCD - WORKGROUP - - - Étendu (101 ou 102 touches) - Clavier standard PS/2 - 0000040C - Étendu (101 ou 102 touches) - - - Souris Microsoft PS/2 - Souris Microsoft PS/2 - PS/2 - Microsoft - Souris Microsoft PS/2 - 2 - - - Périphérique d’entrée USB - Périphérique d’entrée USB - USB - (Périphériques système standard) - Périphérique d’entrée USB - 2 - - - S-1-5-32-574 - Accès DCOM service de certificats - - - S-1-5-32-544 - Administrateurs - - - S-1-5-32-552 - Duplicateurs - - - S-1-5-32-568 - IIS_IUSRS - - - S-1-5-32-546 - Invités - - - S-1-5-32-573 - Lecteurs des journaux d’événements - - - S-1-5-32-569 - Opérateurs de chiffrement - - - S-1-5-32-556 - Opérateurs de configuration réseau - - - S-1-5-32-551 - Opérateurs de sauvegarde - - - S-1-5-32-550 - Opérateurs d’impression - - - S-1-5-32-545 - Utilisateurs - - - S-1-5-32-547 - Utilisateurs avec pouvoir - - - S-1-5-32-558 - Utilisateurs de l’Analyseur de performances - - - S-1-5-32-555 - Utilisateurs du Bureau à distance - - - S-1-5-32-559 - Utilisateurs du journal de performances - - - S-1-5-32-562 - Utilisateurs du modèle COM distribué - - - S-1-5-21-3455907242-2152756475-1308380486-500 - Administrateur - - - S-1-5-21-3455907242-2152756475-1308380486-1001 - demo - - - S-1-5-21-3455907242-2152756475-1308380486-1000 - vagrant - - - Carte Intel(R) PRO/1000 MT pour station de travail - 10.0.2.15 - 10.0.2.2 - 10.0.2.2 - 255.255.255.0 - 10.0.2.0 - 08:00:27:E2:3A:B7 - 8086:100E:001E:8086 - PCI\VEN_8086&DEV_100E&SUBSYS_001E8086&REV_02\3&267A616A&0&18 - 1000 - Up - ethernet - 0 - - - Carte Intel(R) PRO/1000 MT pour station de travail - fe80::95e:ef68:9f33:1690 - ffff:ffff:ffff:ffff:: - fe80:: - 08:00:27:E2:3A:B7 - 8086:100E:001E:8086 - PCI\VEN_8086&DEV_100E&SUBSYS_001E8086&REV_02\3&267A616A&0&18 - 1000 - Up - ethernet - 0 - - - Carte Intel(R) PRO/1000 MT pour station de travail #2 - 192.168.43.10 - 255.255.255.0 - 192.168.43.0 - 08:00:27:A6:80:AA - 8086:100E:001E:8086 - PCI\VEN_8086&DEV_100E&SUBSYS_001E8086&REV_02\3&267A616A&0&40 - 1000 - Up - ethernet - 0 - - - Carte Intel(R) PRO/1000 MT pour station de travail #2 - fe80::6810:6ee7:237f:9c7f - ffff:ffff:ffff:ffff:: - fe80:: - 08:00:27:A6:80:AA - 8086:100E:001E:8086 - PCI\VEN_8086&DEV_100E&SUBSYS_001E8086&REV_02\3&267A616A&0&40 - 1000 - Up - ethernet - 0 - - - 64-bit - 2017-05-09 13:17:07 - - WIN-UC3QD07D2PO - Microsoft Windows Server 2008 R2 Standard - 2017-04-04 16:56:36 - MSWin32 - 6.1.7600 - Windows - - - Microsoft XPS Document Writer - Microsoft XPS Document Writer - 0 - XPSPort: - winprint - 600x600 - 0 - Idle - - - - cfengine-nova - -----BEGIN CERTIFICATE----- -MIIFgTCCA2mgAwIBAgIUTOUJeR7kGBPch+AvEUcfL+fFP6wwDQYJKoZIhvcNAQEL -BQAwUDEYMBYGA1UEAwwPV0lOLUdOR0RIUFZIVlROMTQwMgYKCZImiZPyLGQBAQwk -YjczZWE0NTEtYzQyYS00MjBkLWE1NDAtNDdiNDQ1ZTU4MzEzMB4XDTE5MDcxMjE2 -MzEyOVoXDTI3MDkyODE2MzEyOVowUDEYMBYGA1UEAwwPV0lOLUdOR0RIUFZIVlRO -MTQwMgYKCZImiZPyLGQBAQwkYjczZWE0NTEtYzQyYS00MjBkLWE1NDAtNDdiNDQ1 -ZTU4MzEzMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAzVWb3HUyZEnl -zR9X4SZMORYmgw7iZZgs41cyfuskBX2dYa9m5MyQSUHkVGc5/pYPq0Qns9l8MJ7o -ay+uQsg7ow36vViQm4hLZmkyCUs2BLdP28MiX1mHjWmYGqt+ZpkRgsZqYrGjwKzi -5HA1IESMh0lPNAyKMbr0MUra+RdjijXvQAHGxRv1oHbrJsjBKsnscBx9/VIX8X3H -J8i35rLwrij9O+Vl1t0z6UzAMSeLI5pFI6zuHifG66OJpcHqOq9WvG5Z5MVUspqe -qmw+voI2UFFsbVy8q+RaIJt3Ogn6Z45iipkUSSZyAr3kbpj6XQmhpvL2/XBFfDcL -7NKY1dPr4VV9NirtnVrk7XbOuOIRKptYYld+Dqolv03uBVO4Kx4jQc95aPyCxDeE -0VCtDZCySITKCkgwQ861LeseCb2Vik+rvGO5QJ6Ssdo20WexjrCEIqWWsOc9KF0s -ZI7gVeEOrR4+wBdvWZkBw6kJyG6gbR4yswxI/2DwS1sN0WZn83nozW2CdjKmQy18 -zXtP1Z3gMUY0YqQGsNG49kbf7nWjNHw+7rus6CcpmgyjDSkGrqNfgSn3JQSQn2FT -+wazZ0t6DJxBB5HK7UywzA+0M+3q+RdSJ/WEH6u7famvMvxoiRA6M/ZbLINGdC/4 -omifV+i8xFEQWmosdhFx0QWounnIU3kCAwEAAaNTMFEwHQYDVR0OBBYEFByrvy4Y -sNqPewRSj58sh4a7HkXTMB8GA1UdIwQYMBaAFByrvy4YsNqPewRSj58sh4a7HkXT -MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggIBAHT2n8zbHMdRQwka -/lOdEQVsE++Jr5EMtwCHN/OzHEzFAkCeZwrZPgx0gwbrCDDujsKaNhgqo+2xjpuA -CmzjsanuubvK5/lJ3vVarB/6qvaWARGYAZd9RjDxS0OCL43rPOEzYN8qaAXp8M+Y -EOOw8bQOy/eJEs2oSdJzTILIqAKsXiZpW1G//bVL+baY6KjgI/2ZAml0NWX5wUsT -/JrEvookXW0FqqlW6ukyTyx4zsHxLFJ48ydcVsdOYwrhSvfx21H9f/T7s3XlX3vh -9HBZAQULDbMiwMu2OOskmNTegsKUXaqyAgtHRqWYORlhMv3afW2Sy86CbLuwrlww -U3ytQVfgEmdIba03IlxzHTJL4NQn6WsZyzRzgLxJf2eJ2ACf7RX/Lf3tjW0OI+sq -gQ7QpOVFPHficPfhiQkoThvHoc2kGMWL/WkENTPrcUZ6bhwIqJ+orK6dL4NGiJiB -TuHOsJOv21y7l90fnaenL5lyBkMWeHfzYQkhGfcUN/55yWkjkrOkgeFUqXkyQQ1v -Jq19A1ObBOe7axqsHvqeW4GJapXBjcWFRsq2ltP19lefKu27ikMWzEvkYJu1TX7t -RmA82uwwqMa4eo5lXYkLCkVLyN3sSb39vqMb9C45y2fjBZv9OcpWCt/c0FwKz00K -TZEW7+Ri43DsMyRwYiCafuVThL+J ------END CERTIFICATE----- - - win-uc3qd07d2po\vagrant - 192.168.43.2 - root - - WIN-UC3QD07D2PO - D02D7F7A-49DC-443C-A98D-F3265E8721F9 - - - x86_64 - registry - FusionInventory-Agent - http://forge.fusioninventory.org/projects/fusioninventory-agent - FusionInventory Agent 2.3.17 (x64 edition) - FusionInventory Team - C:\Program Files\FusionInventory-Agent\Uninstall.exe - 2.3.17 - - - x86_64 - registry - Oracle VM VirtualBox Guest Additions - Oracle VM VirtualBox Guest Additions 5.0.32 - Oracle Corporation - C:\Program Files\Oracle\VirtualBox Guest Additions\uninst.exe - http://www.virtualbox.org - 5.0.32.0 - - - x86_64 - registry - {1EF75B76-EBA6-4342-87F8-043CA9BBB3FD} - 09/05/2017 - CFEngine Nova - CFEngine AS - MsiExec.exe /I{1EF75B76-EBA6-4342-87F8-043CA9BBB3FD} - 3.7.4.65534 - - - x86_64 - registry - Internet Explorer (64bit) - Microsoft Corporation - 8.0.7600.16385 - - - i586 - registry - {22FA28AB-3C1B-438B-A8B5-E23892C8B567} - 09/05/2017 - NXLOG-CE - nxsec.com - MsiExec.exe /X{22FA28AB-3C1B-438B-A8B5-E23892C8B567} - 2.8.1248 - - - i586 - registry - Internet Explorer - Microsoft Corporation - 8.0.7600.16385 - - - Périphérique High Definition Audio - Périphérique High Definition Audio - Microsoft - Périphérique High Definition Audio - - - Lecteur de disque - 21661 - 1.0 - IDE - (Lecteurs de disque standard) - VBOX HARDDISK - \\.\PHYSICALDRIVE0 - 0 - 0 - 0 - VB320f0b43-8fc6de1d - VB320f0b43-8fc6de1d - Fixed hard disk media - - - Lecteur de CD-ROM - (Lecteurs de CD-ROM standard) - VBOX CD-ROM ATA Device - VBOX CD-ROM ATA Device - 1 - 0 - 0 - UNKNOWN - - - USB Tablet - VirtualBox - USB Tablet - 0021 - 80EE - - - WIN-UC3QD07D2PO - vagrant - - FusionInventory-Agent_v2.3.17 - - VirtualBox Graphics Adapter - - - WIN-UC3QD07D2PO-2017-05-09-12-37-45 -D02D7F7A-49DC-443C-A98D-F3265E8721F9 -vagrant - -Nova - -B1F2330E-9D66-0C4E-B9CC-CD455F007AC1 ------BEGIN RSA PUBLIC KEY----- -MIIBCgKCAQEArHBxshmpqEuF9X6UR0hdkgL1ZzUfwEnbnBRHxVRgymsfFkI2H3G4 -h2rgMcJlwx7RTMlfpI81IS7F5AUlMZygTROXX/rKpMXqK4ss+X6M3mSCsGfk1S8E -VYXyQ7VOXLzQdvJGiqgr0vAKg3UIMl5Du5PmopO84KZF7zSut4beIFNA8qSlAi3s -Nc2TGS5RJrEIhvFT/aZ05hmG2FMxScdgGsA5vG02FUaL32Xxp4aZjXCmbt0M1wGi -cY1jyDuuNXpGE2rmPxb0LHQXdTo342DJl+tJmPUxoMsqCf3r0S4W+rNEw14gAbFe -Wyrmdk0V6uvRM2mc/soF63RCeZ+MmMOmZQIDAQAB ------END RSA PUBLIC KEY----- -root - - - - INVENTORY - diff --git a/webapp/sources/ldap-inventory/inventory-fusion/src/test/resources/fusion-inventories/WIN-AI8CLNPLOV5-2014-06-20-18-15-49.ocs b/webapp/sources/ldap-inventory/inventory-fusion/src/test/resources/fusion-inventories/WIN-AI8CLNPLOV5-2014-06-20-18-15-49.ocs index 3f1925ab8e8..e9e6e6859e3 100644 --- a/webapp/sources/ldap-inventory/inventory-fusion/src/test/resources/fusion-inventories/WIN-AI8CLNPLOV5-2014-06-20-18-15-49.ocs +++ b/webapp/sources/ldap-inventory/inventory-fusion/src/test/resources/fusion-inventories/WIN-AI8CLNPLOV5-2014-06-20-18-15-49.ocs @@ -371,16 +371,6 @@ C:\Program Files\NVIDIA Corporation\nView\nViewSetup.exe -uninstall 6.14.10.13618 - - x86_64 - registry - {6795D59A-91ED-49C4-81EF-BDCA9C9CD15D} - 20/06/2014 - CFEngine Nova - CFEngine AS - MsiExec.exe /I{6795D59A-91ED-49C4-81EF-BDCA9C9CD15D} - 3.6.0.65534 - x86_64 registry diff --git a/webapp/sources/ldap-inventory/inventory-fusion/src/test/resources/fusion-inventories/rudder-tag/minimal-two-agents-fails.ocs b/webapp/sources/ldap-inventory/inventory-fusion/src/test/resources/fusion-inventories/rudder-tag/minimal-two-agents-fails.ocs index 81d7a945591..94cbcd5fe97 100644 --- a/webapp/sources/ldap-inventory/inventory-fusion/src/test/resources/fusion-inventories/rudder-tag/minimal-two-agents-fails.ocs +++ b/webapp/sources/ldap-inventory/inventory-fusion/src/test/resources/fusion-inventories/rudder-tag/minimal-two-agents-fails.ocs @@ -17,7 +17,7 @@ root_1 - nova + cfengine-community -----BEGIN RSA PUBLIC KEY-----foo-----END RSA PUBLIC KEY----- root 192.168.110.47 diff --git a/webapp/sources/ldap-inventory/inventory-fusion/src/test/resources/fusion-inventories/rudder-tag/minimal-two-agents.ocs b/webapp/sources/ldap-inventory/inventory-fusion/src/test/resources/fusion-inventories/rudder-tag/minimal-two-agents.ocs index 16a644fc6e7..79d2f9642a9 100644 --- a/webapp/sources/ldap-inventory/inventory-fusion/src/test/resources/fusion-inventories/rudder-tag/minimal-two-agents.ocs +++ b/webapp/sources/ldap-inventory/inventory-fusion/src/test/resources/fusion-inventories/rudder-tag/minimal-two-agents.ocs @@ -17,7 +17,7 @@ root - CFEngine-nova + CFEngine-community -----BEGIN RSA PUBLIC KEY-----foo-----END RSA PUBLIC KEY----- root 192.168.110.47 diff --git a/webapp/sources/ldap-inventory/inventory-fusion/src/test/scala/com/normation/inventory/provisioning/fusion/TestPreParsingDate.scala b/webapp/sources/ldap-inventory/inventory-fusion/src/test/scala/com/normation/inventory/provisioning/fusion/TestPreParsingDate.scala new file mode 100644 index 00000000000..56e382d37ee --- /dev/null +++ b/webapp/sources/ldap-inventory/inventory-fusion/src/test/scala/com/normation/inventory/provisioning/fusion/TestPreParsingDate.scala @@ -0,0 +1,97 @@ +/* + ************************************************************************************* + * Copyright 2024 Normation SAS + ************************************************************************************* + * + * This file is part of Rudder. + * + * Rudder is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * In accordance with the terms of section 7 (7. Additional Terms.) of + * the GNU General Public License version 3, the copyright holders add + * the following Additional permissions: + * Notwithstanding to the terms of section 5 (5. Conveying Modified Source + * Versions) and 6 (6. Conveying Non-Source Forms.) of the GNU General + * Public License version 3, when you create a Related Module, this + * Related Module is not considered as a part of the work and may be + * distributed under the license agreement of your choice. + * A "Related Module" means a set of sources files including their + * documentation that, without modification of the Source Code, enables + * supplementary functions or services in addition to those offered by + * the Software. + * + * Rudder is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Rudder. If not, see . + * + ************************************************************************************* + */ + +package com.normation.inventory.provisioning.fusion + +import better.files.Resource +import com.normation.inventory.provisioning.fusion.PreInventoryParserCheckInventoryAge.* +import com.normation.zio.* +import java.time.OffsetDateTime +import java.time.ZoneOffset +import org.junit.runner.* +import org.specs2.mutable.* +import org.specs2.runner.* +import scala.xml.XML +import zio.* + +@RunWith(classOf[JUnitRunner]) +class TestPreParsingDate extends Specification { + + val now = OffsetDateTime.of(2023, 11, 16, 11, 26, 18, 0, ZoneOffset.UTC) + val centos8 = OffsetDateTime.of(2023, 11, 16, 11, 26, 18, 0, ZoneOffset.UTC) + val maxBefore = 1.day + val maxAfter = 2.hours + val okDate = centos8 + val before = now.minus(maxBefore).minusSeconds(1) + val after = now.plus(maxAfter).plusSeconds(1) + + "Pre inventory check age" should { + "be able to extract a date without timezone info in inventory" in { + val xml = XML.load(Resource.getAsStream("fusion-inventories/8.0/centos8.ocs")) + val v = extracDateValue(xml) + val date = parseInventoryDate(v) + (v === "2023-11-16 11:26:18") and + (date must beRight[OffsetDateTime](beEqualTo(centos8))) + } + "be able to extract a date timezone info in inventory" in { + val xml = XML.load(Resource.getAsStream("fusion-inventories/8.0/sles15sp4.ocs")) + val v = extracDateValue(xml) + val date = parseInventoryDate(v) + (v === "2023-11-16 11:46:12+0100") and + (date must beRight[OffsetDateTime](beEqualTo(OffsetDateTime.of(2023, 11, 16, 11, 46, 12, 0, ZoneOffset.ofHours(1))))) + } + "accept date in range" in { + checkDate(okDate, now, maxBefore, maxAfter) === Right(()) + } + "reject date before" in { + checkDate(before, now, maxBefore, maxAfter).left.map(_.fullMsg) must beLeft( + matching(s".*Inventory is too old.*") + ) + } + "reject date after" in { + checkDate(after, now, maxBefore, maxAfter).left.map(_.fullMsg) must beLeft( + matching(s".*Inventory is too far in the future.*") + ) + } + "reject centos8 inventory from 2023 (testing full process)" in { + val xml = XML.load(Resource.getAsStream("fusion-inventories/8.0/centos8.ocs")) + val checker = new PreInventoryParserCheckInventoryAge(maxBefore, maxAfter) + ZioRuntime.unsafeRun(checker(xml).either).left.map(_.fullMsg) must beLeft( + matching(s".*Inventory is too old.*") + ) + } + } +} diff --git a/webapp/sources/ldap-inventory/inventory-fusion/src/test/scala/com/normation/inventory/provisioning/fusion/TestReportParsing.scala b/webapp/sources/ldap-inventory/inventory-fusion/src/test/scala/com/normation/inventory/provisioning/fusion/TestReportParsing.scala index 6b84f6f53d5..8fb5ceaa60b 100644 --- a/webapp/sources/ldap-inventory/inventory-fusion/src/test/scala/com/normation/inventory/provisioning/fusion/TestReportParsing.scala +++ b/webapp/sources/ldap-inventory/inventory-fusion/src/test/scala/com/normation/inventory/provisioning/fusion/TestReportParsing.scala @@ -44,12 +44,13 @@ import com.normation.utils.StringUuidGeneratorImpl import com.normation.zio.ZioRuntime import java.io.File import net.liftweb.common.* -import net.liftweb.json.JsonAST.* import org.junit.runner.* import org.specs2.mutable.* import org.specs2.runner.* import scala.annotation.nowarn import zio.* +import zio.json.* +import zio.json.ast.* /** * A simple test class to check that the demo data file is up to date @@ -173,19 +174,17 @@ class TestInventoryParsing extends Specification with Loggable { "Custom properties" should { "correctly be parsed" in { - import net.liftweb.json.parse - val expected = List( - CustomProperty("hook1_k1", JInt(42)), - CustomProperty("hook1_k2", JBool(value = true)), - CustomProperty("hook1_k3", JString("a string")), + CustomProperty("hook1_k1", Json.Num(42)), + CustomProperty("hook1_k2", Json.Bool(value = true)), + CustomProperty("hook1_k3", Json.Str("a string")), CustomProperty( "hook2", - parse(""" + """ { "some": "more" , "json": [1, 2, 3] , "deep": { "and": "deeper"} - }""") + }""".fromJson[Json].getOrElse(throw new IllegalArgumentException("error in test")) ) ) @@ -198,8 +197,8 @@ class TestInventoryParsing extends Specification with Loggable { // after parsing, we also have custom property for original hostname val expected = List( - CustomProperty("rudder_override_hostname", JString("node1-overridden.rudder.local.override")), - CustomProperty("rudder_original_hostname", JString("node1.rudder.local")) + CustomProperty("rudder_override_hostname", Json.Str("node1-overridden.rudder.local.override")), + CustomProperty("rudder_original_hostname", Json.Str("node1.rudder.local")) ) val inventory = parseRun("fusion-inventories/7.1/node1-4d3a43bc-8508-46a2-92d7-cfe7320309a5.ocs") @@ -326,17 +325,17 @@ class TestInventoryParsing extends Specification with Loggable { inventory.node.customProperties === List( CustomProperty( "cpu_vulnerabilities", - JObject( - List( - JField( + Json.Obj( + Chunk( + ( "spectre_v2", - JObject(List(JField("status", JString("vulnerable")), JField("details", JString("Retpoline without IBPB")))) + Json.Obj(Chunk(("status", Json.Str("vulnerable")), ("details", Json.Str("Retpoline without IBPB")))) ), - JField( + ( "spectre_v1", - JObject(List(JField("status", JString("mitigated")), JField("details", JString("Load fences")))) + Json.Obj(Chunk(("status", Json.Str("mitigated")), ("details", Json.Str("Load fences")))) ), - JField("meltdown", JObject(List(JField("status", JString("mitigated")), JField("details", JString("PTI"))))) + ("meltdown", Json.Obj(Chunk(("status", Json.Str("mitigated")), ("details", Json.Str("PTI"))))) ) ) ) diff --git a/webapp/sources/ldap-inventory/inventory-provisioning-core/pom.xml b/webapp/sources/ldap-inventory/inventory-provisioning-core/pom.xml index 71ced64a69c..1f4261ce7b1 100644 --- a/webapp/sources/ldap-inventory/inventory-provisioning-core/pom.xml +++ b/webapp/sources/ldap-inventory/inventory-provisioning-core/pom.xml @@ -35,7 +35,7 @@ along with Rudder. If not, see . com.normation.inventory inventory-parent - 8.2.4-SNAPSHOT + 8.3.0~alpha1-SNAPSHOT inventory-provisioning-core diff --git a/webapp/sources/ldap-inventory/inventory-repository/pom.xml b/webapp/sources/ldap-inventory/inventory-repository/pom.xml index 712def3dc30..463b720b5e3 100644 --- a/webapp/sources/ldap-inventory/inventory-repository/pom.xml +++ b/webapp/sources/ldap-inventory/inventory-repository/pom.xml @@ -34,7 +34,7 @@ along with Rudder. If not, see . com.normation.inventory inventory-parent - 8.2.4-SNAPSHOT + 8.3.0~alpha1-SNAPSHOT 4.0.0 inventory-repository diff --git a/webapp/sources/ldap-inventory/inventory-repository/src/main/resources/ldap/inventory.schema b/webapp/sources/ldap-inventory/inventory-repository/src/main/resources/ldap/inventory.schema index 3092fae7634..7816c64049c 100644 --- a/webapp/sources/ldap-inventory/inventory-repository/src/main/resources/ldap/inventory.schema +++ b/webapp/sources/ldap-inventory/inventory-repository/src/main/resources/ldap/inventory.schema @@ -303,7 +303,7 @@ attributetype ( InventoryAttributes:300.12 attributetype ( InventoryAttributes:300.13 NAME 'agentName' - DESC 'List of name of the agent (Nova, Community, ...)' + DESC 'List of name of the agent (Community, DSC,...)' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} ) diff --git a/webapp/sources/ldap-inventory/inventory-repository/src/main/scala/com/normation/inventory/ldap/core/InventoryMapper.scala b/webapp/sources/ldap-inventory/inventory-repository/src/main/scala/com/normation/inventory/ldap/core/InventoryMapper.scala index 9a443b7ddf7..7e44e9dd5a3 100644 --- a/webapp/sources/ldap-inventory/inventory-repository/src/main/scala/com/normation/inventory/ldap/core/InventoryMapper.scala +++ b/webapp/sources/ldap-inventory/inventory-repository/src/main/scala/com/normation/inventory/ldap/core/InventoryMapper.scala @@ -51,9 +51,9 @@ import com.normation.ldap.sdk.schema.LDAPObjectClass import com.softwaremill.quicklens.* import com.unboundid.ldap.sdk.{Version as _, *} import java.net.InetAddress -import net.liftweb.json.* import org.joda.time.DateTime import zio.* +import zio.json.* import zio.syntax.* sealed trait InventoryMappingRudderError extends RudderError @@ -89,50 +89,6 @@ object InventoryMappingResult { } -////////////////// Node Custom Properties ///////////////////////// -object CustomPropertiesSerialization { - - import net.liftweb.json.* - - /* - * CustomProperty serialization must follow NodeProperties one: - * {"name":"propkey","value": JVALUE} - * with JVALUE either a simple type (string, int, etc) or a valid JSON - */ - implicit class Serialise(val cs: CustomProperty) extends AnyVal { - def toJson: String = { - Serialization.write(cs)(DefaultFormats) - } - } - - implicit class Unserialize(val json: String) extends AnyVal { - def toCustomProperty: Either[Throwable, CustomProperty] = { - implicit val formats: Formats = DefaultFormats - try { - Right(Serialization.read[CustomProperty](json)) - } catch { - case ex: Exception => Left(ex) - } - } - } -} - -class DateTimeSerializer extends Serializer[DateTime] { - private val IntervalClass = classOf[DateTime] - - def deserialize(implicit format: Formats): PartialFunction[(TypeInfo, JValue), DateTime] = { - case (TypeInfo(IntervalClass, _), json) => - json match { - case JObject(JField("datetime", JString(date)) :: Nil) => DateTime.parse(date) - case x => throw new MappingException("Can't convert " + x + " to DateTime") - } - } - - def serialize(implicit format: Formats): PartialFunction[Any, JValue] = { - case date: DateTime => JObject(JField("datetime", JString(date.toString())) :: Nil) - } -} - object InventoryMapper { def getSoftwareUpdate(entry: LDAPEntry): IOResult[Chunk[SoftwareUpdate]] = { ZIO @@ -159,8 +115,6 @@ class InventoryMapper( removedDit: InventoryDit ) { - implicit val formats: Formats = DefaultFormats + new DateTimeSerializer - //////////////////////////////////////////////////////////// ///////////////////////// Software ///////////////////////// //////////////////////////////////////////////////////////// @@ -741,30 +695,6 @@ class InventoryMapper( } } - ////////////////// Node Custom Properties ///////////////////////// - object CustomPropertiesSerialization { - - import net.liftweb.json.* - - /* - * CustomProperty serialization must follow NodeProperties one: - * {"name":"propkey","value": JVALUE} - * with JVALUE either a simple type (string, int, etc) or a valid JSON - */ - implicit class Serialise(cs: CustomProperty) { - def toJson: String = { - Serialization.write(cs)(DefaultFormats) - } - } - - implicit class Unserialize(json: String) { - def toCustomProperty: IOResult[CustomProperty] = { - implicit val formats: Formats = DefaultFormats - IOResult.attempt(Serialization.read[CustomProperty](json)) - } - } - } - ////////////////// Node/ NodeInventory ///////////////////////// private def createNodeModelFromServer(server: NodeInventory): LDAPEntry = { @@ -857,8 +787,6 @@ class InventoryMapper( // This won't include the Process in it, it needs to be done with method // processesFromNode below def treeFromNode(server: NodeInventory): LDAPTree = { - import com.normation.inventory.domain.AgentInfoSerialisation.* - val dit = ditService.getDit(server.main.status) // the root entry of the tree: the machine inventory val root = rootEntryFromNode(server) @@ -877,9 +805,9 @@ class InventoryMapper( root.setOpt(server.lastLoggedUserTime, A_LAST_LOGGED_USER_TIME, (x: DateTime) => GeneralizedTime(x).toString) root.setOpt(server.inventoryDate, A_INVENTORY_DATE, (x: DateTime) => GeneralizedTime(x).toString) root.setOpt(server.receiveDate, A_RECEIVE_DATE, (x: DateTime) => GeneralizedTime(x).toString) - root.resetValuesTo(A_AGENTS_NAME, server.agents.map(x => x.toJsonString)*) + root.resetValuesTo(A_AGENTS_NAME, server.agents.map(x => x.toJson)*) root.resetValuesTo(A_SOFTWARE_DN, server.softwareIds.map(x => dit.SOFTWARE.SOFT.dn(x).toString)*) - root.resetValuesTo(A_EV, server.environmentVariables.map(x => Serialization.write(x))*) + root.resetValuesTo(A_EV, server.environmentVariables.map(_.toJson)*) root.resetValuesTo(A_LIST_OF_IP, server.serverIps.distinct*) // we don't know their dit... root.resetValuesTo( @@ -894,12 +822,8 @@ class InventoryMapper( root.resetValuesTo(A_TIMEZONE_NAME, timezone.name) root.resetValuesTo(A_TIMEZONE_OFFSET, timezone.offset) } - server.customProperties.foreach { cp => - import CustomPropertiesSerialization.Serialise - root.addValues(A_CUSTOM_PROPERTY, cp.toJson) - } + server.customProperties.foreach(cp => root.addValues(A_CUSTOM_PROPERTY, cp.toJson)) server.softwareUpdates.foreach { s => - import zio.json.* import JsonSerializers.implicits.* root.addValues(A_SOFTWARE_UPDATE, s.toJson) } @@ -924,7 +848,7 @@ class InventoryMapper( // map process from node def processesFromNode(node: NodeInventory): Seq[String] = { // convert the processes - node.processes.map(x => Serialization.write(x)) + node.processes.map(_.toJson) } // Create the entry with only processes @@ -1073,31 +997,28 @@ class InventoryMapper( hostname <- entry.required(A_HOSTNAME).toIO rootUser <- entry.required(A_ROOT_USER).toIO policyServerId <- entry.required(A_POLICY_SERVER_UUID).toIO - publicKeys = entry.valuesFor(A_PKEYS).map(Some(_)) - agentNames <- { - val agents = entry.valuesFor(A_AGENTS_NAME).toSeq.map(Some(_)) - val agentWithKeys = agents.zipAll(publicKeys, None, None).filter(_._1.isDefined) - ZIO - .foreach(agentWithKeys) { - case (opt, key) => - ((opt, key) match { - case (Some(agent), key) => - AgentInfoSerialisation - .parseJson(agent, key) - .chainError(s"Error when parsing agent security token '${agent}'") - case (None, _) => - InventoryMappingRudderError.MissingMandatory("Error when parsing agent security token: agent is undefined").fail - }).foldZIO( - err => - InventoryDataLogger.error( - s"Error when parsing agent information for node '${id.value}': that agent will be " + - s"ignored for the node, which will likely cause problem like the node being ignored: ${err.fullMsg}" - ) *> None.succeed, - ok => Some(ok).succeed - ) - } - .map(_.flatten) - } + agentNames <- ZIO + .foreach(entry.valuesFor(A_AGENTS_NAME).toList) { + case agent => + agent.fromJson[AgentInfo].toIO.chainError(s"Error when parsing agent security token '${agent}'") + } + .foldZIO( + err => + InventoryDataLogger.error( + s"Error when parsing agent information for node '${id.value}': that agent will be " + + s"ignored for the node, which will likely cause problem like the node being ignored: ${err.fullMsg}" + ) *> Nil.succeed, + _.distinct match { + case Nil => Nil.succeed + case a :: Nil => List(a).succeed + // we must have exactly one agent + case several => + InventoryDataLogger.error( + s"Error: inventory for node '${id.value}' has several (${several.size}) different agents defined, which is not supported. Ignoring all agents." + ) *> Nil.succeed + } + ) + // now, look for the OS type osDetails <- mapOsDetailsFromEntry(entry).toIO // optional information @@ -1109,17 +1030,42 @@ class InventoryMapper( lastLoggedUser = entry(A_LAST_LOGGED_USER) lastLoggedUserTime = entry.getAsGTime(A_LAST_LOGGED_USER_TIME).map(_.dateTime) - publicKeys = entry.valuesFor(A_PKEYS).map(k => PublicKey(k)) - ev = entry.valuesFor(A_EV).toSeq.map(Serialization.read[EnvironmentVariable](_)) - process = entry.valuesFor(A_PROCESS).toSeq.map(Serialization.read[Process](_)) - softwareIds = entry.valuesFor(A_SOFTWARE_DN).toSeq.flatMap(x => dit.SOFTWARE.SOFT.idFromDN(new DN(x)).toOption) + ev <- ZIO.foldLeft(entry.valuesFor(A_EV))(List.empty[EnvironmentVariable]) { + case (l, json) => + json.fromJson[EnvironmentVariable] match { + case Left(err) => + InventoryProcessingLogger + .warn(s"Error when deserializing environment variable, ignoring it: ${json} ; error: ${err}") *> l.succeed + case Right(ev) => (ev :: l).succeed + } + } + process <- ZIO.foldLeft(entry.valuesFor(A_PROCESS))(List.empty[Process]) { + case (l, json) => + json.fromJson[Process] match { + case Left(err) => + InventoryProcessingLogger + .warn(s"Error when deserializing process, ignoring it: ${json} ; error: ${err}") *> l.succeed + case Right(p) => (p :: l).succeed + } + } + softwareIds <- ZIO.foldLeft(entry.valuesFor(A_SOFTWARE_DN))(List.empty[SoftwareUuid]) { + case (l, x) => + dit.SOFTWARE.SOFT.idFromDN(new DN(x)) match { + case Left(err) => + InventoryProcessingLogger + .warn( + s"Error when deserializing software, ignoring it: ${x} ; error: ${err.msg}" + ) *> l.succeed + case Right(s) => (s :: l).succeed + } + } machineId <- mapSeqStringToMachineIdAndStatus(entry.valuesFor(A_CONTAINER_DN)).toList match { case Nil => None.succeed case m :: Nil => Some(m).succeed case l @ (m1 :: m2 :: _) => InventoryProcessingLogger.error( "Several machine were registered for a node. That is not supported. " + - "The first in the following list will be choosen, but you may encouter strange " + + "The first in the following list will be chosen, but you may encounter strange " + "results in the future: %s".format( l.map { case (id, status) => "%s [%s]".format(id.value, status.name) }.mkString(" ; ") ) @@ -1134,28 +1080,28 @@ class InventoryMapper( case (Some(tzName), Some(offset)) => Some(NodeTimezone(tzName, offset)) case _ => None } - customProperties <- { - import CustomPropertiesSerialization.Unserialize - ZIO.foreach(entry.valuesFor(A_CUSTOM_PROPERTY))(a => { - a.toCustomProperty.foldZIO( - err => - InventoryProcessingLogger.warn( - Chained(s"Error when deserializing node inventory custom property (ignoring that property)", err).fullMsg - ) *> None.succeed, - p => Some(p).succeed - ) - }) - } - softwareUpdates <- InventoryMapper.getSoftwareUpdate(entry) - main = NodeSummary( - id, - inventoryStatus, - rootUser, - hostname, - osDetails, - NodeId(policyServerId), - keyStatus - ) + customProperties <- ZIO.foreach(entry.valuesFor(A_CUSTOM_PROPERTY)) { a => + a.fromJson[CustomProperty] match { + case Left(err) => + InventoryProcessingLogger.warn( + Unexpected( + s"Error when deserializing node inventory custom property (ignoring that property): ${a}; error: ${err}" + ).fullMsg + ) *> None.succeed + case Right(p) => Some(p).succeed + } + } + + softwareUpdates <- InventoryMapper.getSoftwareUpdate(entry) + main = NodeSummary( + id, + inventoryStatus, + rootUser, + hostname, + osDetails, + NodeId(policyServerId), + keyStatus + ) } yield { NodeInventory( main, diff --git a/webapp/sources/ldap-inventory/inventory-repository/src/main/scala/com/normation/inventory/ldap/core/LDAPConstants.scala b/webapp/sources/ldap-inventory/inventory-repository/src/main/scala/com/normation/inventory/ldap/core/LDAPConstants.scala index 56ec9de0c3a..a4977fec365 100644 --- a/webapp/sources/ldap-inventory/inventory-repository/src/main/scala/com/normation/inventory/ldap/core/LDAPConstants.scala +++ b/webapp/sources/ldap-inventory/inventory-repository/src/main/scala/com/normation/inventory/ldap/core/LDAPConstants.scala @@ -57,7 +57,6 @@ object LDAPConstants { val A_HOSTNAME = "nodeHostname" val A_ROOT_USER = "localAdministratorAccountName" val A_DEF = "definition" - val A_PKEYS = "publicKey" val A_AGENTS_NAME = "agentName" val A_DESCRIPTION = "description" val A_REV_ID = "revision" @@ -398,7 +397,6 @@ object LDAPConstants { may = Set( A_NAME, A_DESCRIPTION, - A_PKEYS, A_AGENTS_NAME, A_CONTAINER_DN, A_SOFTWARE_DN, diff --git a/webapp/sources/ldap-inventory/inventory-repository/src/test/resources/ldap-data/schema/099-0-inventory.ldif b/webapp/sources/ldap-inventory/inventory-repository/src/test/resources/ldap-data/schema/099-0-inventory.ldif index a860ee72e78..f8bc8307ccc 100644 --- a/webapp/sources/ldap-inventory/inventory-repository/src/test/resources/ldap-data/schema/099-0-inventory.ldif +++ b/webapp/sources/ldap-inventory/inventory-repository/src/test/resources/ldap-data/schema/099-0-inventory.ldif @@ -216,12 +216,6 @@ attributeTypes: ( 1.3.6.1.4.1.35061.1.1.300.7 SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 EQUALITY generalizedTimeMatch ORDERING generalizedTimeOrderingMatch ) -attributeTypes: ( 1.3.6.1.4.1.35061.1.1.300.8 - NAME 'publicKey' - DESC 'A public key in PEM representation' - EQUALITY caseIgnoreMatch - SUBSTR caseIgnoreSubstringsMatch - SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} ) attributeTypes: ( 1.3.6.1.4.1.35061.1.1.300.9 NAME 'nodeTechniques' DESC 'Name of techniques applied to that node' @@ -248,7 +242,7 @@ attributeTypes: ( 1.3.6.1.4.1.35061.1.1.300.12 ORDERING generalizedTimeOrderingMatch ) attributeTypes: ( 1.3.6.1.4.1.35061.1.1.300.13 NAME 'agentName' - DESC 'List of name of the agent (Nova, Community, ...)' + DESC 'List of name of the agent (Dsc, Community, ...)' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} ) @@ -856,7 +850,7 @@ objectClasses: ( 1.3.6.1.4.1.35061.1.2.14 ABSTRACT MUST ( nodeId $ localAdministratorAccountName $ nodeHostname $ policyServerId $ osName $ osVersion $ osKernelVersion ) - MAY ( description $ cn $ publicKey $ agentName $ hostedVm $ container $ + MAY ( description $ cn $ agentName $ hostedVm $ container $ software $ localAccountName $ osServicePack $ nodeTechniques $ ram $ swap $ confirmed $ inventoryDate $ receiveDate $ ipHostNumber $ osFullName $ diff --git a/webapp/sources/ldap-inventory/inventory-repository/src/test/scala/com/normation/inventory/ldap/core/TestInventory.scala b/webapp/sources/ldap-inventory/inventory-repository/src/test/scala/com/normation/inventory/ldap/core/TestInventory.scala index 4417671b9a1..a9a80165921 100644 --- a/webapp/sources/ldap-inventory/inventory-repository/src/test/scala/com/normation/inventory/ldap/core/TestInventory.scala +++ b/webapp/sources/ldap-inventory/inventory-repository/src/test/scala/com/normation/inventory/ldap/core/TestInventory.scala @@ -206,7 +206,38 @@ class TestInventory extends Specification { AgentInfo( AgentType.CfeCommunity, None, - Certificate("""-----BEGIN CERTIFICATE-----\ndummy-certificate-value\n-----END CERTIFICATE-----)"""), + Certificate("""-----BEGIN CERTIFICATE----- + |MIIFTjCCAzagAwIBAgIUfa0+S+CyJahRzuwNNOFLNQQjIH8wDQYJKoZIhvcNAQEL + |BQAwFzEVMBMGCgmSJomT8ixkAQEMBW5vZGU3MB4XDTI0MDMwMTExMDIxM1oXDTM0 + |MDIyNzExMDIxM1owFzEVMBMGCgmSJomT8ixkAQEMBW5vZGU3MIICIjANBgkqhkiG + |9w0BAQEFAAOCAg8AMIICCgKCAgEAsmBUYI1A5vqkOTCW24m/mQhBaRu4WaAUXDAr + |ArdIAAMN0KyHhEXP1/X32Flw90E0VjtUH4P+DYLBozXYWhJrUxdWLyn3TRSbv3Kr + |pXoCWhMhMp8OK2s/mG+rfiMpTXIwaMhPnBaJFNV3c+bkijGAMHtFjl3+leXJvNZ7 + |w3bIg4cA3e77kz7EWMyqxOUvvLMyY6wpd03ahe/By+iLgtOkgUwl9hMqMU8tJeaz + |NIeUporsHk5rrk8bSf6Mxxdknm43Sk6oflnueNCIUFdd4rS2JLieMugsTh8n/oH+ + |k29ZyirE3ikhftmZ3vY8GQ3IcIzaXwiAOGnCKcze79zVx5jmOTGSZitGZaU/cZc6 + |LjzEp+ZDmE8caVIksiA+hIlaZeBXNHB+YRv/gV1Rbt7kS1am+XUZJSfVFf+99YqE + |lZ5p0hqJsczkBb2RuMxWxxsWO3pesPUNCuL/yaeggTIp7eK06tQWi1EfXr40ctrf + |oimbzMAKNBpRKWruL7652SlF75Usaq+PaPi1TtqYQjLRZmbpr+IR4uMeKnEMIZPw + |3dLDKBV6d71XkTAalCmcJU+fgYrRmgz1dEnaZDIXY+f+fYR15hsFpDrZ0avHgkzJ + |ca/nT/rKeX7136BttxVSbZaTU9hnmjAvl+v0BF+JUWPQ3VPTcrmyUNAICt8xdVae + |uo1tsvkCAwEAAaOBkTCBjjAMBgNVHRMEBTADAQH/MB0GA1UdDgQWBBSRG0uHQRIA + |gl91YqzSjaeaw+F7PDBSBgNVHSMESzBJgBSRG0uHQRIAgl91YqzSjaeaw+F7PKEb + |pBkwFzEVMBMGCgmSJomT8ixkAQEMBW5vZGU3ghR9rT5L4LIlqFHO7A004Us1BCMg + |fzALBgNVHQ8EBAMCArwwDQYJKoZIhvcNAQELBQADggIBABR2vTH/6WlqjaTZ/hQc + |B+crqRlFimqCiVTRdX6qfkt0tLX2dK6scHNTBT04ORLjLTAn0KbcOUz3k6i0mIqB + |nG5UjqCFEQR+i2V4Hz7aK6+7LBQuwXWRhDhvO5xMn7MxjvP0LGgNf5iiA4r/N22L + |EMc1prDESIOGmWdKg9XlfLxd877R2d8/3hXyT82Y2uJHO25b53skj4pbUOWLsGSw + |d4FBNnWqM+7Hbg2v9xFvmtfs2G2Inqk4Xjtjnj8qkVk3ft6KzClUIMXGXQ8QqaRp + |YPkTJm5g2UBYDiguD/tlz3VmbsNYU6fkap7DKqhttbaseIx1zDwdAv4jtVOWDyjx + |Wq4b7pljYiczfRa84X/9v1x05pT3raELy5udY+Pxmnz+hOXOM+jY5bzSKS24b8rS + |5Sklmutm0IdflMKd5vNrXd9yPFLu3QzN50ArzHHXczwBLgjaMlZsPAp1wITlqM7+ + |WCjy3qM5/KgAjH3L24MPTq23o9PokBVh1NH7lesZqgJPgsj+OG7FMQDvKzg7ytrs + |QlIDF1c8Ko+9/RrnRVAS8C4GZOqbmMmfJjMp09GBz2d0ixlTusF6m6iwfIVMf/nI + |P/V0D7STRiV62cfnZ3e0w8kIeZwWAgXI7RMHJU3skLyurUu8yxkp635IQyzQsW2A + |Yo7t7O7fxjqD9yVI2QfkERZ7 + |-----END CERTIFICATE----- + |""".stripMargin), Set() ) ) diff --git a/webapp/sources/ldap-inventory/inventory-repository/src/test/scala/com/normation/inventory/ldap/core/TestNodeUnserialisation.scala b/webapp/sources/ldap-inventory/inventory-repository/src/test/scala/com/normation/inventory/ldap/core/TestNodeUnserialisation.scala index 495fa2a3d87..aecaedbecae 100644 --- a/webapp/sources/ldap-inventory/inventory-repository/src/test/scala/com/normation/inventory/ldap/core/TestNodeUnserialisation.scala +++ b/webapp/sources/ldap-inventory/inventory-repository/src/test/scala/com/normation/inventory/ldap/core/TestNodeUnserialisation.scala @@ -45,6 +45,8 @@ import com.unboundid.ldap.sdk.Entry import org.junit.runner.* import org.specs2.mutable.* import org.specs2.runner.* +import zio.* +import zio.json.ast.* /** * Test node unserialisation frome entries, in particular @@ -76,62 +78,34 @@ class TestNodeUnserialisation extends Specification { new InventoryMapper(inventoryDitService, pendingNodesDitImpl, acceptedNodesDitImpl, removedNodesDitImpl) } - val linux41Ldif: String = { - """dn: nodeId=root,ou=Nodes,ou=Accepted Inventories,ou=Inventories,cn=rudder-configuration - |objectClass: top + val dsc61Ldif: String = { + """dn: nodeId=aff80e6d-68fb-43dd-9a33-a5204b7e3153,ou=Nodes,ou=Accepted Inventories,ou=Inventories,cn=rudder-configuration + |nodeId: aff80e6d-68fb-43dd-9a33-a5204b7e3153 |objectClass: node - |objectClass: unixNode - |objectClass: linuxNode - |nodeId: root - |localAdministratorAccountName: root - |nodeHostname: server.rudder.local - |policyServerId: root - |osFullName: Debian GNU/Linux 9.4 (stretch) - |keyStatus: certified - |ram: 1572864000 - |swap: 1072693248 - |osArchitectureType: x86_64 - |lastLoggedUser: vagrant - |lastLoggedUserTime: 20000714125900.000Z - |publicKey: publickey - |timezoneName: UTC - |timezoneOffset: +0000 - |osKernelVersion: 4.9.0-6-amd64 - |osName: Debian - |osVersion: 9.4 - |inventoryDate: 20180713130033.000Z - |receiveDate: 20180713130534.772Z - |agentName: {"agentType":"Community","version":"4.1.14"}""".stripMargin - } - - val linux42Ldif: String = { - """dn: nodeId=root,ou=Nodes,ou=Accepted Inventories,ou=Inventories,cn=rudder-configuration |objectClass: top - |objectClass: node - |objectClass: unixNode - |objectClass: linuxNode - |nodeId: root - |localAdministratorAccountName: root - |nodeHostname: server.rudder.local + |objectClass: windowsNode + |osName: Windows2012R2 + |windowsRegistrationCompany: Vagrant + |windowsKey: PN79T-M7QXW-R8FVX-FDF89-7XKCB + |windowsId: 00252-00105-69793-AA339 + |osFullName: Microsoft Windows Server 2012 R2 Standard + |osVersion: N/A + |osKernelVersion: 6.3.9600 + |localAdministratorAccountName: vagrant-2012-r2 + |nodeHostname: vagrant-2012-r2 + |keyStatus: undefined |policyServerId: root - |osFullName: Ubuntu 16.04 LTS - |keyStatus: certified - |ram: 1568669696 - |swap: 804257792 + |ram: 535822336 |osArchitectureType: x86_64 |lastLoggedUser: vagrant - |timezoneName: EDT - |timezoneOffset: -0400 - |osKernelVersion: 4.4.0-21-generic - |osName: Ubuntu - |osVersion: 16.04 - |lastLoggedUserTime: 20000710133300.000Z - |inventoryDate: 20180716134036.000Z - |receiveDate: 20180716134537.505Z - |agentName: {"agentType":"cfengine-community","version":"4.2.8","securityToken":{"value":"publickey","type":"publicKey"}}""".stripMargin + |inventoryDate: 20180716104920.000Z + |receiveDate: 20180716135035.945Z + |agentName: {"agentType":"dsc","version":"6.1-1.9","securityToken": {"value":"-----BEGIN CERTIFICATE-----\nMIIFTjCCAzagAwIBAgIUfa0+S+CyJahRzuwNNOFLNQQjIH8wDQYJKoZIhvcNAQEL\nBQAwFzEVMBMGCgmSJomT8ixkAQEMBW5vZGU3MB4XDTI0MDMwMTExMDIxM1oXDTM0\nMDIyNzExMDIxM1owFzEVMBMGCgmSJomT8ixkAQEMBW5vZGU3MIICIjANBgkqhkiG\n9w0BAQEFAAOCAg8AMIICCgKCAgEAsmBUYI1A5vqkOTCW24m/mQhBaRu4WaAUXDAr\nArdIAAMN0KyHhEXP1/X32Flw90E0VjtUH4P+DYLBozXYWhJrUxdWLyn3TRSbv3Kr\npXoCWhMhMp8OK2s/mG+rfiMpTXIwaMhPnBaJFNV3c+bkijGAMHtFjl3+leXJvNZ7\nw3bIg4cA3e77kz7EWMyqxOUvvLMyY6wpd03ahe/By+iLgtOkgUwl9hMqMU8tJeaz\nNIeUporsHk5rrk8bSf6Mxxdknm43Sk6oflnueNCIUFdd4rS2JLieMugsTh8n/oH+\nk29ZyirE3ikhftmZ3vY8GQ3IcIzaXwiAOGnCKcze79zVx5jmOTGSZitGZaU/cZc6\nLjzEp+ZDmE8caVIksiA+hIlaZeBXNHB+YRv/gV1Rbt7kS1am+XUZJSfVFf+99YqE\nlZ5p0hqJsczkBb2RuMxWxxsWO3pesPUNCuL/yaeggTIp7eK06tQWi1EfXr40ctrf\noimbzMAKNBpRKWruL7652SlF75Usaq+PaPi1TtqYQjLRZmbpr+IR4uMeKnEMIZPw\n3dLDKBV6d71XkTAalCmcJU+fgYrRmgz1dEnaZDIXY+f+fYR15hsFpDrZ0avHgkzJ\nca/nT/rKeX7136BttxVSbZaTU9hnmjAvl+v0BF+JUWPQ3VPTcrmyUNAICt8xdVae\nuo1tsvkCAwEAAaOBkTCBjjAMBgNVHRMEBTADAQH/MB0GA1UdDgQWBBSRG0uHQRIA\ngl91YqzSjaeaw+F7PDBSBgNVHSMESzBJgBSRG0uHQRIAgl91YqzSjaeaw+F7PKEb\npBkwFzEVMBMGCgmSJomT8ixkAQEMBW5vZGU3ghR9rT5L4LIlqFHO7A004Us1BCMg\nfzALBgNVHQ8EBAMCArwwDQYJKoZIhvcNAQELBQADggIBABR2vTH/6WlqjaTZ/hQc\nB+crqRlFimqCiVTRdX6qfkt0tLX2dK6scHNTBT04ORLjLTAn0KbcOUz3k6i0mIqB\nnG5UjqCFEQR+i2V4Hz7aK6+7LBQuwXWRhDhvO5xMn7MxjvP0LGgNf5iiA4r/N22L\nEMc1prDESIOGmWdKg9XlfLxd877R2d8/3hXyT82Y2uJHO25b53skj4pbUOWLsGSw\nd4FBNnWqM+7Hbg2v9xFvmtfs2G2Inqk4Xjtjnj8qkVk3ft6KzClUIMXGXQ8QqaRp\nYPkTJm5g2UBYDiguD/tlz3VmbsNYU6fkap7DKqhttbaseIx1zDwdAv4jtVOWDyjx\nWq4b7pljYiczfRa84X/9v1x05pT3raELy5udY+Pxmnz+hOXOM+jY5bzSKS24b8rS\n5Sklmutm0IdflMKd5vNrXd9yPFLu3QzN50ArzHHXczwBLgjaMlZsPAp1wITlqM7+\nWCjy3qM5/KgAjH3L24MPTq23o9PokBVh1NH7lesZqgJPgsj+OG7FMQDvKzg7ytrs\nQlIDF1c8Ko+9/RrnRVAS8C4GZOqbmMmfJjMp09GBz2d0ixlTusF6m6iwfIVMf/nI\nP/V0D7STRiV62cfnZ3e0w8kIeZwWAgXI7RMHJU3skLyurUu8yxkp635IQyzQsW2A\nYo7t7O7fxjqD9yVI2QfkERZ7\n-----END CERTIFICATE-----\n","type":"certificate"}} + |timezoneName: Pacific Standard Time + |timezoneOffset: -0700""".stripMargin } - val linux43Ldif: String = { + val linux61Ldif: String = { """dn: nodeId=root,ou=Nodes,ou=Accepted Inventories,ou=Inventories,cn=rudder-configuration |objectClass: top |objectClass: node @@ -153,40 +127,13 @@ class TestNodeUnserialisation extends Specification { |osArchitectureType: x86_64 |timezoneOffset: +0200 |timezoneName: Europe/Paris - |agentName: {"agentType":"cfengine-community","version":"4.3.2","securityToken":{"value":"publickey","type":"publicKey"}} + |agentName: {"agentType":"cfengine-community","version":"6.1.0","securityToken":{"value":"-----BEGIN CERTIFICATE-----\nMIIFTjCCAzagAwIBAgIUfa0+S+CyJahRzuwNNOFLNQQjIH8wDQYJKoZIhvcNAQEL\nBQAwFzEVMBMGCgmSJomT8ixkAQEMBW5vZGU3MB4XDTI0MDMwMTExMDIxM1oXDTM0\nMDIyNzExMDIxM1owFzEVMBMGCgmSJomT8ixkAQEMBW5vZGU3MIICIjANBgkqhkiG\n9w0BAQEFAAOCAg8AMIICCgKCAgEAsmBUYI1A5vqkOTCW24m/mQhBaRu4WaAUXDAr\nArdIAAMN0KyHhEXP1/X32Flw90E0VjtUH4P+DYLBozXYWhJrUxdWLyn3TRSbv3Kr\npXoCWhMhMp8OK2s/mG+rfiMpTXIwaMhPnBaJFNV3c+bkijGAMHtFjl3+leXJvNZ7\nw3bIg4cA3e77kz7EWMyqxOUvvLMyY6wpd03ahe/By+iLgtOkgUwl9hMqMU8tJeaz\nNIeUporsHk5rrk8bSf6Mxxdknm43Sk6oflnueNCIUFdd4rS2JLieMugsTh8n/oH+\nk29ZyirE3ikhftmZ3vY8GQ3IcIzaXwiAOGnCKcze79zVx5jmOTGSZitGZaU/cZc6\nLjzEp+ZDmE8caVIksiA+hIlaZeBXNHB+YRv/gV1Rbt7kS1am+XUZJSfVFf+99YqE\nlZ5p0hqJsczkBb2RuMxWxxsWO3pesPUNCuL/yaeggTIp7eK06tQWi1EfXr40ctrf\noimbzMAKNBpRKWruL7652SlF75Usaq+PaPi1TtqYQjLRZmbpr+IR4uMeKnEMIZPw\n3dLDKBV6d71XkTAalCmcJU+fgYrRmgz1dEnaZDIXY+f+fYR15hsFpDrZ0avHgkzJ\nca/nT/rKeX7136BttxVSbZaTU9hnmjAvl+v0BF+JUWPQ3VPTcrmyUNAICt8xdVae\nuo1tsvkCAwEAAaOBkTCBjjAMBgNVHRMEBTADAQH/MB0GA1UdDgQWBBSRG0uHQRIA\ngl91YqzSjaeaw+F7PDBSBgNVHSMESzBJgBSRG0uHQRIAgl91YqzSjaeaw+F7PKEb\npBkwFzEVMBMGCgmSJomT8ixkAQEMBW5vZGU3ghR9rT5L4LIlqFHO7A004Us1BCMg\nfzALBgNVHQ8EBAMCArwwDQYJKoZIhvcNAQELBQADggIBABR2vTH/6WlqjaTZ/hQc\nB+crqRlFimqCiVTRdX6qfkt0tLX2dK6scHNTBT04ORLjLTAn0KbcOUz3k6i0mIqB\nnG5UjqCFEQR+i2V4Hz7aK6+7LBQuwXWRhDhvO5xMn7MxjvP0LGgNf5iiA4r/N22L\nEMc1prDESIOGmWdKg9XlfLxd877R2d8/3hXyT82Y2uJHO25b53skj4pbUOWLsGSw\nd4FBNnWqM+7Hbg2v9xFvmtfs2G2Inqk4Xjtjnj8qkVk3ft6KzClUIMXGXQ8QqaRp\nYPkTJm5g2UBYDiguD/tlz3VmbsNYU6fkap7DKqhttbaseIx1zDwdAv4jtVOWDyjx\nWq4b7pljYiczfRa84X/9v1x05pT3raELy5udY+Pxmnz+hOXOM+jY5bzSKS24b8rS\n5Sklmutm0IdflMKd5vNrXd9yPFLu3QzN50ArzHHXczwBLgjaMlZsPAp1wITlqM7+\nWCjy3qM5/KgAjH3L24MPTq23o9PokBVh1NH7lesZqgJPgsj+OG7FMQDvKzg7ytrs\nQlIDF1c8Ko+9/RrnRVAS8C4GZOqbmMmfJjMp09GBz2d0ixlTusF6m6iwfIVMf/nI\nP/V0D7STRiV62cfnZ3e0w8kIeZwWAgXI7RMHJU3skLyurUu8yxkp635IQyzQsW2A\nYo7t7O7fxjqD9yVI2QfkERZ7\n-----END CERTIFICATE-----\n","type":"certificate"},"capabilities":["https"]} |inventoryDate: 20180717000031.000Z |receiveDate: 20180717000527.050Z |lastLoggedUserTime: 20000714084300.000Z""".stripMargin } - val dsc42Ldif: String = { - s"""dn: nodeId=aff80e6d-68fb-43dd-9a33-a5204b7e3153,ou=Nodes,ou=Accepted Inventories,ou=Inventories,cn=rudder-configuration - |nodeId: aff80e6d-68fb-43dd-9a33-a5204b7e3153 - |objectClass: node - |objectClass: top - |objectClass: windowsNode - |osName: Windows2012R2 - |windowsRegistrationCompany: Vagrant - |windowsKey: PN79T-M7QXW-R8FVX-FDF89-7XKCB - |windowsId: 00252-00105-69793-AA339 - |osFullName: Microsoft Windows Server 2012 R2 Standard - |osVersion: N/A - |osKernelVersion: 6.3.9600 - |localAdministratorAccountName: vagrant-2012-r2 - |nodeHostname: vagrant-2012-r2 - |keyStatus: undefined - |policyServerId: root - |ram: 535822336 - |osArchitectureType: x86_64 - |lastLoggedUser: vagrant - |inventoryDate: 20180716104920.000Z - |receiveDate: 20180716135035.945Z - |agentName: {"agentType":"dsc","version":"4.2-1.9","securityToken": {"value":"certificate","type":"certificate"}} - |timezoneName: Pacific Standard Time - |timezoneOffset: -0700""".stripMargin - } - - val linux61Ldif: String = { + val linux70Ldif: String = { """dn: nodeId=root,ou=Nodes,ou=Accepted Inventories,ou=Inventories,cn=rudder-configuration |objectClass: top |objectClass: node @@ -208,13 +155,24 @@ class TestNodeUnserialisation extends Specification { |osArchitectureType: x86_64 |timezoneOffset: +0200 |timezoneName: Europe/Paris - |agentName: {"agentType":"cfengine-community","version":"6.1.0","securityToken":{"value":"certificate","type":"certificate"},"capabilities":["https"]} + |agentName: {"agentType":"cfengine-community","version":"6.1.0","securityToken":{"type":"certificate","value":"-----BEGIN CERTIFICATE-----\nMIIFTjCCAzagAwIBAgIUfa0+S+CyJahRzuwNNOFLNQQjIH8wDQYJKoZIhvcNAQEL\nBQAwFzEVMBMGCgmSJomT8ixkAQEMBW5vZGU3MB4XDTI0MDMwMTExMDIxM1oXDTM0\nMDIyNzExMDIxM1owFzEVMBMGCgmSJomT8ixkAQEMBW5vZGU3MIICIjANBgkqhkiG\n9w0BAQEFAAOCAg8AMIICCgKCAgEAsmBUYI1A5vqkOTCW24m/mQhBaRu4WaAUXDAr\nArdIAAMN0KyHhEXP1/X32Flw90E0VjtUH4P+DYLBozXYWhJrUxdWLyn3TRSbv3Kr\npXoCWhMhMp8OK2s/mG+rfiMpTXIwaMhPnBaJFNV3c+bkijGAMHtFjl3+leXJvNZ7\nw3bIg4cA3e77kz7EWMyqxOUvvLMyY6wpd03ahe/By+iLgtOkgUwl9hMqMU8tJeaz\nNIeUporsHk5rrk8bSf6Mxxdknm43Sk6oflnueNCIUFdd4rS2JLieMugsTh8n/oH+\nk29ZyirE3ikhftmZ3vY8GQ3IcIzaXwiAOGnCKcze79zVx5jmOTGSZitGZaU/cZc6\nLjzEp+ZDmE8caVIksiA+hIlaZeBXNHB+YRv/gV1Rbt7kS1am+XUZJSfVFf+99YqE\nlZ5p0hqJsczkBb2RuMxWxxsWO3pesPUNCuL/yaeggTIp7eK06tQWi1EfXr40ctrf\noimbzMAKNBpRKWruL7652SlF75Usaq+PaPi1TtqYQjLRZmbpr+IR4uMeKnEMIZPw\n3dLDKBV6d71XkTAalCmcJU+fgYrRmgz1dEnaZDIXY+f+fYR15hsFpDrZ0avHgkzJ\nca/nT/rKeX7136BttxVSbZaTU9hnmjAvl+v0BF+JUWPQ3VPTcrmyUNAICt8xdVae\nuo1tsvkCAwEAAaOBkTCBjjAMBgNVHRMEBTADAQH/MB0GA1UdDgQWBBSRG0uHQRIA\ngl91YqzSjaeaw+F7PDBSBgNVHSMESzBJgBSRG0uHQRIAgl91YqzSjaeaw+F7PKEb\npBkwFzEVMBMGCgmSJomT8ixkAQEMBW5vZGU3ghR9rT5L4LIlqFHO7A004Us1BCMg\nfzALBgNVHQ8EBAMCArwwDQYJKoZIhvcNAQELBQADggIBABR2vTH/6WlqjaTZ/hQc\nB+crqRlFimqCiVTRdX6qfkt0tLX2dK6scHNTBT04ORLjLTAn0KbcOUz3k6i0mIqB\nnG5UjqCFEQR+i2V4Hz7aK6+7LBQuwXWRhDhvO5xMn7MxjvP0LGgNf5iiA4r/N22L\nEMc1prDESIOGmWdKg9XlfLxd877R2d8/3hXyT82Y2uJHO25b53skj4pbUOWLsGSw\nd4FBNnWqM+7Hbg2v9xFvmtfs2G2Inqk4Xjtjnj8qkVk3ft6KzClUIMXGXQ8QqaRp\nYPkTJm5g2UBYDiguD/tlz3VmbsNYU6fkap7DKqhttbaseIx1zDwdAv4jtVOWDyjx\nWq4b7pljYiczfRa84X/9v1x05pT3raELy5udY+Pxmnz+hOXOM+jY5bzSKS24b8rS\n5Sklmutm0IdflMKd5vNrXd9yPFLu3QzN50ArzHHXczwBLgjaMlZsPAp1wITlqM7+\nWCjy3qM5/KgAjH3L24MPTq23o9PokBVh1NH7lesZqgJPgsj+OG7FMQDvKzg7ytrs\nQlIDF1c8Ko+9/RrnRVAS8C4GZOqbmMmfJjMp09GBz2d0ixlTusF6m6iwfIVMf/nI\nP/V0D7STRiV62cfnZ3e0w8kIeZwWAgXI7RMHJU3skLyurUu8yxkp635IQyzQsW2A\nYo7t7O7fxjqD9yVI2QfkERZ7\n-----END CERTIFICATE-----\n"},"capabilities":["https"]} |inventoryDate: 20180717000031.000Z |receiveDate: 20180717000527.050Z - |lastLoggedUserTime: 20000714084300.000Z""".stripMargin + |lastLoggedUserTime: 20000714084300.000Z + |softwareUpdate: {"name":"rudder-agent","version":"7.0.0-realease","arch":"x86_64","from":"yum","kind":"none","description":"Local privilege escalation in pkexec","severity":"low","date":"2022-01-26T00:00:00Z","ids":["RHSA-2020-4566","CVE-2021-4034"]} + |customProperty: {"name":"simpleString","value":"a simple string"} + |customProperty: {"name":"someJson","value":{"foo":"bar","i":42,"b":true,"arr":[1,2]}} + |environmentVariable: {"name":"UPSTART_INSTANCE"} + |environmentVariable: {"name":"SHELL","value":"/bin/bash"} + |process: {"pid":193,"commandName":"/var/rudder/cfengine-community/bin/cf-serverd","cpuUsage":0.0,"memory":0.0,"started":"2014-09-25 09:45","tty":"?","user":"root","virtualMemory":36664} + |""".stripMargin } - val linux70Ldif: String = { + /* + * Mains changes from 7.0~8.2 + * - process: commandName => name + */ + val linux83Ldif: String = { """dn: nodeId=root,ou=Nodes,ou=Accepted Inventories,ou=Inventories,cn=rudder-configuration |objectClass: top |objectClass: node @@ -236,11 +194,17 @@ class TestNodeUnserialisation extends Specification { |osArchitectureType: x86_64 |timezoneOffset: +0200 |timezoneName: Europe/Paris - |agentName: {"agentType":"cfengine-community","version":"6.1.0","securityToken":{"value":"certificate","type":"certificate"},"capabilities":["https"]} + |agentName: {"agentType":"cfengine-community","version":"6.1.0","securityToken":{"type":"certificate","value":"-----BEGIN CERTIFICATE-----\nMIIFTjCCAzagAwIBAgIUfa0+S+CyJahRzuwNNOFLNQQjIH8wDQYJKoZIhvcNAQEL\nBQAwFzEVMBMGCgmSJomT8ixkAQEMBW5vZGU3MB4XDTI0MDMwMTExMDIxM1oXDTM0\nMDIyNzExMDIxM1owFzEVMBMGCgmSJomT8ixkAQEMBW5vZGU3MIICIjANBgkqhkiG\n9w0BAQEFAAOCAg8AMIICCgKCAgEAsmBUYI1A5vqkOTCW24m/mQhBaRu4WaAUXDAr\nArdIAAMN0KyHhEXP1/X32Flw90E0VjtUH4P+DYLBozXYWhJrUxdWLyn3TRSbv3Kr\npXoCWhMhMp8OK2s/mG+rfiMpTXIwaMhPnBaJFNV3c+bkijGAMHtFjl3+leXJvNZ7\nw3bIg4cA3e77kz7EWMyqxOUvvLMyY6wpd03ahe/By+iLgtOkgUwl9hMqMU8tJeaz\nNIeUporsHk5rrk8bSf6Mxxdknm43Sk6oflnueNCIUFdd4rS2JLieMugsTh8n/oH+\nk29ZyirE3ikhftmZ3vY8GQ3IcIzaXwiAOGnCKcze79zVx5jmOTGSZitGZaU/cZc6\nLjzEp+ZDmE8caVIksiA+hIlaZeBXNHB+YRv/gV1Rbt7kS1am+XUZJSfVFf+99YqE\nlZ5p0hqJsczkBb2RuMxWxxsWO3pesPUNCuL/yaeggTIp7eK06tQWi1EfXr40ctrf\noimbzMAKNBpRKWruL7652SlF75Usaq+PaPi1TtqYQjLRZmbpr+IR4uMeKnEMIZPw\n3dLDKBV6d71XkTAalCmcJU+fgYrRmgz1dEnaZDIXY+f+fYR15hsFpDrZ0avHgkzJ\nca/nT/rKeX7136BttxVSbZaTU9hnmjAvl+v0BF+JUWPQ3VPTcrmyUNAICt8xdVae\nuo1tsvkCAwEAAaOBkTCBjjAMBgNVHRMEBTADAQH/MB0GA1UdDgQWBBSRG0uHQRIA\ngl91YqzSjaeaw+F7PDBSBgNVHSMESzBJgBSRG0uHQRIAgl91YqzSjaeaw+F7PKEb\npBkwFzEVMBMGCgmSJomT8ixkAQEMBW5vZGU3ghR9rT5L4LIlqFHO7A004Us1BCMg\nfzALBgNVHQ8EBAMCArwwDQYJKoZIhvcNAQELBQADggIBABR2vTH/6WlqjaTZ/hQc\nB+crqRlFimqCiVTRdX6qfkt0tLX2dK6scHNTBT04ORLjLTAn0KbcOUz3k6i0mIqB\nnG5UjqCFEQR+i2V4Hz7aK6+7LBQuwXWRhDhvO5xMn7MxjvP0LGgNf5iiA4r/N22L\nEMc1prDESIOGmWdKg9XlfLxd877R2d8/3hXyT82Y2uJHO25b53skj4pbUOWLsGSw\nd4FBNnWqM+7Hbg2v9xFvmtfs2G2Inqk4Xjtjnj8qkVk3ft6KzClUIMXGXQ8QqaRp\nYPkTJm5g2UBYDiguD/tlz3VmbsNYU6fkap7DKqhttbaseIx1zDwdAv4jtVOWDyjx\nWq4b7pljYiczfRa84X/9v1x05pT3raELy5udY+Pxmnz+hOXOM+jY5bzSKS24b8rS\n5Sklmutm0IdflMKd5vNrXd9yPFLu3QzN50ArzHHXczwBLgjaMlZsPAp1wITlqM7+\nWCjy3qM5/KgAjH3L24MPTq23o9PokBVh1NH7lesZqgJPgsj+OG7FMQDvKzg7ytrs\nQlIDF1c8Ko+9/RrnRVAS8C4GZOqbmMmfJjMp09GBz2d0ixlTusF6m6iwfIVMf/nI\nP/V0D7STRiV62cfnZ3e0w8kIeZwWAgXI7RMHJU3skLyurUu8yxkp635IQyzQsW2A\nYo7t7O7fxjqD9yVI2QfkERZ7\n-----END CERTIFICATE-----\n"},"capabilities":["https"]} |inventoryDate: 20180717000031.000Z |receiveDate: 20180717000527.050Z |lastLoggedUserTime: 20000714084300.000Z - |softwareUpdate: {"name":"rudder-agent","version":"7.0.0-realease","from":"yum","arch":"x86_64","kind":"none","description":"Local privilege escalation in pkexec","severity":"low","date":"2022-01-26T00:00:00Z","ids":["RHSA-2020-4566","CVE-2021-4034"]}""".stripMargin + |softwareUpdate: {"name":"rudder-agent","version":"7.0.0-realease","arch":"x86_64","from":"yum","kind":"none","description":"Local privilege escalation in pkexec","severity":"low","date":"2022-01-26T00:00:00Z","ids":["RHSA-2020-4566","CVE-2021-4034"]} + |customProperty: {"name":"simpleString","value":"a simple string"} + |customProperty: {"name":"someJson","value":{"foo":"bar","i":42,"b":true,"arr":[1,2]}} + |environmentVariable: {"name":"UPSTART_INSTANCE"} + |environmentVariable: {"name":"SHELL","value":"/bin/bash"} + |process: {"pid":193,"name":"/var/rudder/cfengine-community/bin/cf-serverd","cpuUsage":0.0,"memory":0.0,"started":"2014-09-25 09:45","tty":"?","user":"root","virtualMemory":36664.0} + |""".stripMargin } def node(ldif: String): NodeInventory = { @@ -248,16 +212,49 @@ class TestNodeUnserialisation extends Specification { ZioRuntime.unsafeRun(mapper.nodeFromEntry(nodeEntry).either).getOrElse(throw new Exception("Error when getting node")) } + val cert = """-----BEGIN CERTIFICATE----- + |MIIFTjCCAzagAwIBAgIUfa0+S+CyJahRzuwNNOFLNQQjIH8wDQYJKoZIhvcNAQEL + |BQAwFzEVMBMGCgmSJomT8ixkAQEMBW5vZGU3MB4XDTI0MDMwMTExMDIxM1oXDTM0 + |MDIyNzExMDIxM1owFzEVMBMGCgmSJomT8ixkAQEMBW5vZGU3MIICIjANBgkqhkiG + |9w0BAQEFAAOCAg8AMIICCgKCAgEAsmBUYI1A5vqkOTCW24m/mQhBaRu4WaAUXDAr + |ArdIAAMN0KyHhEXP1/X32Flw90E0VjtUH4P+DYLBozXYWhJrUxdWLyn3TRSbv3Kr + |pXoCWhMhMp8OK2s/mG+rfiMpTXIwaMhPnBaJFNV3c+bkijGAMHtFjl3+leXJvNZ7 + |w3bIg4cA3e77kz7EWMyqxOUvvLMyY6wpd03ahe/By+iLgtOkgUwl9hMqMU8tJeaz + |NIeUporsHk5rrk8bSf6Mxxdknm43Sk6oflnueNCIUFdd4rS2JLieMugsTh8n/oH+ + |k29ZyirE3ikhftmZ3vY8GQ3IcIzaXwiAOGnCKcze79zVx5jmOTGSZitGZaU/cZc6 + |LjzEp+ZDmE8caVIksiA+hIlaZeBXNHB+YRv/gV1Rbt7kS1am+XUZJSfVFf+99YqE + |lZ5p0hqJsczkBb2RuMxWxxsWO3pesPUNCuL/yaeggTIp7eK06tQWi1EfXr40ctrf + |oimbzMAKNBpRKWruL7652SlF75Usaq+PaPi1TtqYQjLRZmbpr+IR4uMeKnEMIZPw + |3dLDKBV6d71XkTAalCmcJU+fgYrRmgz1dEnaZDIXY+f+fYR15hsFpDrZ0avHgkzJ + |ca/nT/rKeX7136BttxVSbZaTU9hnmjAvl+v0BF+JUWPQ3VPTcrmyUNAICt8xdVae + |uo1tsvkCAwEAAaOBkTCBjjAMBgNVHRMEBTADAQH/MB0GA1UdDgQWBBSRG0uHQRIA + |gl91YqzSjaeaw+F7PDBSBgNVHSMESzBJgBSRG0uHQRIAgl91YqzSjaeaw+F7PKEb + |pBkwFzEVMBMGCgmSJomT8ixkAQEMBW5vZGU3ghR9rT5L4LIlqFHO7A004Us1BCMg + |fzALBgNVHQ8EBAMCArwwDQYJKoZIhvcNAQELBQADggIBABR2vTH/6WlqjaTZ/hQc + |B+crqRlFimqCiVTRdX6qfkt0tLX2dK6scHNTBT04ORLjLTAn0KbcOUz3k6i0mIqB + |nG5UjqCFEQR+i2V4Hz7aK6+7LBQuwXWRhDhvO5xMn7MxjvP0LGgNf5iiA4r/N22L + |EMc1prDESIOGmWdKg9XlfLxd877R2d8/3hXyT82Y2uJHO25b53skj4pbUOWLsGSw + |d4FBNnWqM+7Hbg2v9xFvmtfs2G2Inqk4Xjtjnj8qkVk3ft6KzClUIMXGXQ8QqaRp + |YPkTJm5g2UBYDiguD/tlz3VmbsNYU6fkap7DKqhttbaseIx1zDwdAv4jtVOWDyjx + |Wq4b7pljYiczfRa84X/9v1x05pT3raELy5udY+Pxmnz+hOXOM+jY5bzSKS24b8rS + |5Sklmutm0IdflMKd5vNrXd9yPFLu3QzN50ArzHHXczwBLgjaMlZsPAp1wITlqM7+ + |WCjy3qM5/KgAjH3L24MPTq23o9PokBVh1NH7lesZqgJPgsj+OG7FMQDvKzg7ytrs + |QlIDF1c8Ko+9/RrnRVAS8C4GZOqbmMmfJjMp09GBz2d0ixlTusF6m6iwfIVMf/nI + |P/V0D7STRiV62cfnZ3e0w8kIeZwWAgXI7RMHJU3skLyurUu8yxkp635IQyzQsW2A + |Yo7t7O7fxjqD9yVI2QfkERZ7 + |-----END CERTIFICATE----- + |""".stripMargin + "Agent type " should { - "correctly unserialize Linux node from 4_3" in { + "correctly unserialize Linux node from 6_1" in { node(linux61Ldif).agents(0) must beEqualTo( - AgentInfo(AgentType.CfeCommunity, Some(AgentVersion("6.1.0")), Certificate("certificate"), Set(AgentCapability("https"))) + AgentInfo(AgentType.CfeCommunity, Some(AgentVersion("6.1.0")), Certificate(cert), Set(AgentCapability("https"))) ) } - "correctly unserialize DSC node from 4_2" in { - node(dsc42Ldif).agents(0) must beEqualTo( - AgentInfo(AgentType.Dsc, Some(AgentVersion("4.2-1.9")), Certificate("certificate"), Set()) + "correctly unserialize DSC node from 6_1" in { + node(dsc61Ldif).agents(0) must beEqualTo( + AgentInfo(AgentType.Dsc, Some(AgentVersion("6.1-1.9")), Certificate(cert), Set()) ) } @@ -278,5 +275,114 @@ class TestNodeUnserialisation extends Specification { ) )) } + + "correctly unserialize custom properties from 7_0" in { + import Json.* + node(linux70Ldif).customProperties must containTheSameElementsAs( + List( + CustomProperty("simpleString", Str("a simple string")), + CustomProperty( + "someJson", + Obj( + Chunk( + ("foo" -> Str("bar")), + ("i" -> Num(42)), + ("b" -> Bool(true)), + ("arr" -> Arr(Num(1), Num(2))) + ) + ) + ) + ) + ) + } + + "correctly unserialize environment variable" in { + node(linux70Ldif).environmentVariables must containTheSameElementsAs( + List( + EnvironmentVariable("UPSTART_INSTANCE"), + EnvironmentVariable("SHELL", Some("/bin/bash")) + ) + ) + } + + "correctly unserialize processes" in { + node(linux70Ldif).processes must containTheSameElementsAs( + List( + Process( + 193, + Some("/var/rudder/cfengine-community/bin/cf-serverd"), + Some(0.0f), + Some(0.0f), + Some("2014-09-25 09:45"), + Some("?"), + Some("root"), + Some(36664) + ) + ) + ) + } + + "7.0 and 8.3 ldif lead to the same node" in { + val n1 = node(linux70Ldif) + val n2 = node(linux83Ldif) + n1 === n2 + } + + "idempotence of unser/ser for 8.3" in { + val nodeEntry = new LDAPEntry(new Entry(linux83Ldif.split("\n").toSeq*)) + val prog = for { + n <- mapper.nodeFromEntry(nodeEntry) + e = mapper.treeFromNode(n).root + p = mapper.processesFromNode(n) + _ = e.resetValuesTo(LDAPConstants.A_PROCESS, p*) + } yield e + + val entry = ZioRuntime.unsafeRun(prog) + val diff = com.unboundid.ldap.sdk.Entry.diff(nodeEntry.backed, entry.backed, false, true) + diff.toArray() must beEmpty + } + + "correctly unserialize a node even with malformed env var, process, soft update" in { + val nodeEntry = new LDAPEntry( + new Entry( + """dn: nodeId=root,ou=Nodes,ou=Accepted Inventories,ou=Inventories,cn=rudder-configuration + |objectClass: top + |objectClass: node + |objectClass: unixNode + |objectClass: linuxNode + |nodeId: root + |localAdministratorAccountName: root + |policyServerId: root + |osFullName: SUSE Linux Enterprise Server 11 (x86_64) + |osServicePack: 3 + |ram: 1572864000 + |swap: 781189120 + |lastLoggedUser: root + |osKernelVersion: 3.0.76-0.11-default + |osName: Suse + |osVersion: 11 + |keyStatus: certified + |nodeHostname: orchestrateur-3.labo.normation.com + |osArchitectureType: x86_64 + |timezoneOffset: +0200 + |timezoneName: Europe/Paris + |agentName: {"agentType":"cfengine-community","version":"6.1.0","securityToken":{"type":"certificate","value":"-----BEGIN CERTIFICATE-----\nMIIFTjCCAzagAwIBAgIUfa0+S+CyJahRzuwNNOFLNQQjIH8wDQYJKoZIhvcNAQEL\nBQAwFzEVMBMGCgmSJomT8ixkAQEMBW5vZGU3MB4XDTI0MDMwMTExMDIxM1oXDTM0\nMDIyNzExMDIxM1owFzEVMBMGCgmSJomT8ixkAQEMBW5vZGU3MIICIjANBgkqhkiG\n9w0BAQEFAAOCAg8AMIICCgKCAgEAsmBUYI1A5vqkOTCW24m/mQhBaRu4WaAUXDAr\nArdIAAMN0KyHhEXP1/X32Flw90E0VjtUH4P+DYLBozXYWhJrUxdWLyn3TRSbv3Kr\npXoCWhMhMp8OK2s/mG+rfiMpTXIwaMhPnBaJFNV3c+bkijGAMHtFjl3+leXJvNZ7\nw3bIg4cA3e77kz7EWMyqxOUvvLMyY6wpd03ahe/By+iLgtOkgUwl9hMqMU8tJeaz\nNIeUporsHk5rrk8bSf6Mxxdknm43Sk6oflnueNCIUFdd4rS2JLieMugsTh8n/oH+\nk29ZyirE3ikhftmZ3vY8GQ3IcIzaXwiAOGnCKcze79zVx5jmOTGSZitGZaU/cZc6\nLjzEp+ZDmE8caVIksiA+hIlaZeBXNHB+YRv/gV1Rbt7kS1am+XUZJSfVFf+99YqE\nlZ5p0hqJsczkBb2RuMxWxxsWO3pesPUNCuL/yaeggTIp7eK06tQWi1EfXr40ctrf\noimbzMAKNBpRKWruL7652SlF75Usaq+PaPi1TtqYQjLRZmbpr+IR4uMeKnEMIZPw\n3dLDKBV6d71XkTAalCmcJU+fgYrRmgz1dEnaZDIXY+f+fYR15hsFpDrZ0avHgkzJ\nca/nT/rKeX7136BttxVSbZaTU9hnmjAvl+v0BF+JUWPQ3VPTcrmyUNAICt8xdVae\nuo1tsvkCAwEAAaOBkTCBjjAMBgNVHRMEBTADAQH/MB0GA1UdDgQWBBSRG0uHQRIA\ngl91YqzSjaeaw+F7PDBSBgNVHSMESzBJgBSRG0uHQRIAgl91YqzSjaeaw+F7PKEb\npBkwFzEVMBMGCgmSJomT8ixkAQEMBW5vZGU3ghR9rT5L4LIlqFHO7A004Us1BCMg\nfzALBgNVHQ8EBAMCArwwDQYJKoZIhvcNAQELBQADggIBABR2vTH/6WlqjaTZ/hQc\nB+crqRlFimqCiVTRdX6qfkt0tLX2dK6scHNTBT04ORLjLTAn0KbcOUz3k6i0mIqB\nnG5UjqCFEQR+i2V4Hz7aK6+7LBQuwXWRhDhvO5xMn7MxjvP0LGgNf5iiA4r/N22L\nEMc1prDESIOGmWdKg9XlfLxd877R2d8/3hXyT82Y2uJHO25b53skj4pbUOWLsGSw\nd4FBNnWqM+7Hbg2v9xFvmtfs2G2Inqk4Xjtjnj8qkVk3ft6KzClUIMXGXQ8QqaRp\nYPkTJm5g2UBYDiguD/tlz3VmbsNYU6fkap7DKqhttbaseIx1zDwdAv4jtVOWDyjx\nWq4b7pljYiczfRa84X/9v1x05pT3raELy5udY+Pxmnz+hOXOM+jY5bzSKS24b8rS\n5Sklmutm0IdflMKd5vNrXd9yPFLu3QzN50ArzHHXczwBLgjaMlZsPAp1wITlqM7+\nWCjy3qM5/KgAjH3L24MPTq23o9PokBVh1NH7lesZqgJPgsj+OG7FMQDvKzg7ytrs\nQlIDF1c8Ko+9/RrnRVAS8C4GZOqbmMmfJjMp09GBz2d0ixlTusF6m6iwfIVMf/nI\nP/V0D7STRiV62cfnZ3e0w8kIeZwWAgXI7RMHJU3skLyurUu8yxkp635IQyzQsW2A\nYo7t7O7fxjqD9yVI2QfkERZ7\n-----END CERTIFICATE-----\n"},"capabilities":["https"]} + |inventoryDate: 20180717000031.000Z + |receiveDate: 20180717000527.050Z + |lastLoggedUserTime: 20000714084300.000Z + |# + |# this is the interesting parts: even with that, we get a valid inventory + |# + |customProperty: malformed json + |environmentVariable: malformed json + |process: malformed json + |softwareUuid: malformed DN + |""".stripMargin.linesIterator.toSeq* + ) + ) + + ZioRuntime.unsafeRun(mapper.nodeFromEntry(nodeEntry).either) must beRight + } + } } diff --git a/webapp/sources/ldap-inventory/pom.xml b/webapp/sources/ldap-inventory/pom.xml index b940773f133..9a202ca85c2 100644 --- a/webapp/sources/ldap-inventory/pom.xml +++ b/webapp/sources/ldap-inventory/pom.xml @@ -40,7 +40,7 @@ along with Rudder. If not, see . com.normation parent-pom - 8.2.4-SNAPSHOT + 8.3.0~alpha1-SNAPSHOT diff --git a/webapp/sources/pom.xml b/webapp/sources/pom.xml index 8f5bc4a3972..7bdcde5a8ad 100644 --- a/webapp/sources/pom.xml +++ b/webapp/sources/pom.xml @@ -18,7 +18,7 @@ limitations under the License. com.normation parent-pom - 8.2.4-SNAPSHOT + 8.3.0~alpha1-SNAPSHOT pom @@ -120,7 +120,7 @@ limitations under the License. ch.epfl.scala scala3-migrate-rules_2.13 - 0.6.2 + 0.7.1 @@ -419,8 +419,8 @@ limitations under the License. 2024 - 8.2 - 8.2.4-SNAPSHOT + 8.3 + 8.3.0~alpha1-SNAPSHOT 5.0.0 2.13.12 @@ -432,44 +432,44 @@ limitations under the License. parser option - see https://github.com/scala/scala-xml/releases/tag/v2.1.0 --> 1.3.0 4.0.0-M1 - 2.0.13 - 1.5.6 - 2.12.7 - 2.2.3 - 2.16.1 - 3.15.0 + 2.0.16 + 1.5.12 + 2.13.0 + 3.0.1 + 2.17.0 + 3.17.0 1.12.0 - 1.17.0 + 1.17.1 2.0.0-M2 - 1.11.0 - 6.10.0.202406032230-r - 6.1.12 - 6.3.3 + 1.12.0 + 7.0.0.202409031743-r + 6.1.14 + 6.3.4 3.3.0 - 9.7 + 9.7.1 jdk18on - 1.78.1 + 1.79 3.9.2 0.4.2 - 1.9.7 - 5.1.0 + 1.9.9 + 6.0.0 3.0.0 - 42.7.3 + 42.7.4 2.9.0 2.5.1 2.4.2 - 7.0.0 + 7.0.1 3.1.1 1.4.3 3.1.8 1.5.2 0.10.2 - 24.0.2 - 1.4.0 + 24.1.1 + 1.5.0 0.7.0 - 5.5.0 - 2.2 + 5.5.1 + 2.3 2.0.0-RC11 @@ -478,18 +478,18 @@ limitations under the License. We declare cats in "test" here, because it is not directly needed in any project before rudder. --> - 4.20.8 + 4.20.9 4.13.2 2.12.0 3.6.0 1.0.0-RC5 3.10.2 2.3.12 - 3.5.4 - 2.0.22 - 23.1.0.2 - 0.7.1 - 1.7.4 + 3.5.5 + 2.1.12 + 23.1.0.3 + 0.7.3 + 1.7.5 - -image/svg+xml \ No newline at end of file diff --git a/webapp/sources/rudder/rudder-web/src/main/webapp/images/logo-rudder.svg b/webapp/sources/rudder/rudder-web/src/main/webapp/images/logo-rudder.svg deleted file mode 100644 index 7eb08a77a34..00000000000 --- a/webapp/sources/rudder/rudder-web/src/main/webapp/images/logo-rudder.svg +++ /dev/null @@ -1,55 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/webapp/sources/rudder/rudder-web/src/main/webapp/images/rudder-favicon.ico b/webapp/sources/rudder/rudder-web/src/main/webapp/images/rudder-favicon.ico index 7d823fb4d31..e13ecb9b7d9 100644 Binary files a/webapp/sources/rudder/rudder-web/src/main/webapp/images/rudder-favicon.ico and b/webapp/sources/rudder/rudder-web/src/main/webapp/images/rudder-favicon.ico differ diff --git a/webapp/sources/rudder/rudder-web/src/main/webapp/images/tableau/fdTaboHead.jpg b/webapp/sources/rudder/rudder-web/src/main/webapp/images/tableau/fdTaboHead.jpg deleted file mode 100644 index fe14f309d35..00000000000 Binary files a/webapp/sources/rudder/rudder-web/src/main/webapp/images/tableau/fdTaboHead.jpg and /dev/null differ diff --git a/webapp/sources/rudder/rudder-web/src/main/webapp/index.html b/webapp/sources/rudder/rudder-web/src/main/webapp/index.html index b8644d55b03..09bec3e17bd 100644 --- a/webapp/sources/rudder/rudder-web/src/main/webapp/index.html +++ b/webapp/sources/rudder/rudder-web/src/main/webapp/index.html @@ -10,7 +10,9 @@ + + @@ -21,7 +23,7 @@
- Rudder + Rudder
diff --git a/webapp/sources/rudder/rudder-web/src/main/webapp/secure/administration/databaseManagement.html b/webapp/sources/rudder/rudder-web/src/main/webapp/secure/administration/databaseManagement.html index 95c2ddeaef8..8689c4d1dd4 100644 --- a/webapp/sources/rudder/rudder-web/src/main/webapp/secure/administration/databaseManagement.html +++ b/webapp/sources/rudder/rudder-web/src/main/webapp/secure/administration/databaseManagement.html @@ -2,15 +2,7 @@ Rudder - Reports database - + @@ -59,7 +33,7 @@

-
+
This div gets the content of the eventDetailPopup injected within diff --git a/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/Popup/accept_new_server.html b/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/Popup/accept_new_server.html index 8f73a30fa6a..f3db33cb860 100644 --- a/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/Popup/accept_new_server.html +++ b/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/Popup/accept_new_server.html @@ -17,7 +17,7 @@
Please confirm that you wish to accept the following nodes in Rudder
-
+
diff --git a/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/Popup/createCloneGroupPopup.html b/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/Popup/createCloneGroupPopup.html index c86d57d68ce..2feda40eab7 100644 --- a/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/Popup/createCloneGroupPopup.html +++ b/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/Popup/createCloneGroupPopup.html @@ -10,7 +10,7 @@ -
+
diff --git a/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/Popup/expected_policy_popup.html b/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/Popup/expected_policy_popup.html index 39f9ce6c9b5..f667f5d5ab1 100644 --- a/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/Popup/expected_policy_popup.html +++ b/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/Popup/expected_policy_popup.html @@ -37,7 +37,7 @@

The following Rules will be applied to this node as it j
All the following grid will be replace by the real grid
-
+

diff --git a/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/Popup/refuse_new_server.html b/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/Popup/refuse_new_server.html index 1fc0c59b65b..cfcfe10eadf 100644 --- a/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/Popup/refuse_new_server.html +++ b/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/Popup/refuse_new_server.html @@ -17,7 +17,7 @@
Please confirm that you wish to refuse the following nodes in Rudder
-
+
diff --git a/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/common-layout.html b/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/common-layout.html index 06f100bb320..439128cea66 100644 --- a/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/common-layout.html +++ b/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/common-layout.html @@ -15,9 +15,6 @@ - - - @@ -30,6 +27,7 @@ + @@ -108,8 +106,8 @@
-
+
Here comes the longDescription field
diff --git a/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/components/ComponentRuleEditForm.html b/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/components/ComponentRuleEditForm.html index 9ea544a4e96..e0025e50df3 100644 --- a/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/components/ComponentRuleEditForm.html +++ b/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/components/ComponentRuleEditForm.html @@ -168,10 +168,10 @@

Rule

-

No description defined, click on to edit

+

No description defined, click on to edit

-
+
Here comes the longDescription field
diff --git a/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/components/ComponentTechniqueEditForm.html b/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/components/ComponentTechniqueEditForm.html index ac90dfde4a2..7915370ad00 100644 --- a/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/components/ComponentTechniqueEditForm.html +++ b/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/components/ComponentTechniqueEditForm.html @@ -110,7 +110,7 @@

@@ -160,7 +160,7 @@

Change Audit Log

diff --git a/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/components/NodeGroupForm.html b/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/components/NodeGroupForm.html index 59ac646ebee..a187e74786b 100644 --- a/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/components/NodeGroupForm.html +++ b/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/components/NodeGroupForm.html @@ -82,10 +82,10 @@

-

No description defined, click on to edit

+

No description defined, click on to edit

-
+
Here comes the longDescription field
diff --git a/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/server/server_details.html b/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/server/server_details.html index 5f41c6abefd..050beb48d67 100644 --- a/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/server/server_details.html +++ b/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/server/server_details.html @@ -64,23 +64,6 @@ This part is the detail of a node -
diff --git a/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/server_grid.html b/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/server_grid.html index 4d5e6315dd8..ef700cfbe62 100644 --- a/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/server_grid.html +++ b/webapp/sources/rudder/rudder-web/src/main/webapp/templates-hidden/server_grid.html @@ -5,7 +5,6 @@ --> -
@@ -17,5 +16,4 @@
- diff --git a/webapp/sources/rudder/rudder-web/src/test/resources/configuration-repository-migrate-json-8_0/post-migration/ncf_techniques/technique_with_blocks/1.0/metadata.xml b/webapp/sources/rudder/rudder-web/src/test/resources/configuration-repository-migrate-json-8_0/post-migration/ncf_techniques/technique_with_blocks/1.0/metadata.xml index c9a6460bc41..0aee4135a7c 100644 --- a/webapp/sources/rudder/rudder-web/src/test/resources/configuration-repository-migrate-json-8_0/post-migration/ncf_techniques/technique_with_blocks/1.0/metadata.xml +++ b/webapp/sources/rudder/rudder-web/src/test/resources/configuration-repository-migrate-json-8_0/post-migration/ncf_techniques/technique_with_blocks/1.0/metadata.xml @@ -1,7 +1,7 @@ regenerated true - + technique_with_blocks diff --git a/webapp/sources/rudder/rudder-web/src/test/resources/configuration-repository-migrate-json-8_0/post-migration/ncf_techniques/technique_with_parameters/1.0/metadata.xml b/webapp/sources/rudder/rudder-web/src/test/resources/configuration-repository-migrate-json-8_0/post-migration/ncf_techniques/technique_with_parameters/1.0/metadata.xml index cc9c9c1668b..2d7787e3e07 100644 --- a/webapp/sources/rudder/rudder-web/src/test/resources/configuration-repository-migrate-json-8_0/post-migration/ncf_techniques/technique_with_parameters/1.0/metadata.xml +++ b/webapp/sources/rudder/rudder-web/src/test/resources/configuration-repository-migrate-json-8_0/post-migration/ncf_techniques/technique_with_parameters/1.0/metadata.xml @@ -3,7 +3,7 @@ true A technique with some parameters true - + technique_with_parameters @@ -49,4 +49,4 @@

- \ No newline at end of file + diff --git a/webapp/sources/rudder/rudder-web/src/test/resources/configuration-repository-migrate-json-8_0/post-migration/ncf_techniques/test_import_export_archive/1.0/metadata.xml b/webapp/sources/rudder/rudder-web/src/test/resources/configuration-repository-migrate-json-8_0/post-migration/ncf_techniques/test_import_export_archive/1.0/metadata.xml index 928ce4aaad9..fb28e27dd9e 100644 --- a/webapp/sources/rudder/rudder-web/src/test/resources/configuration-repository-migrate-json-8_0/post-migration/ncf_techniques/test_import_export_archive/1.0/metadata.xml +++ b/webapp/sources/rudder/rudder-web/src/test/resources/configuration-repository-migrate-json-8_0/post-migration/ncf_techniques/test_import_export_archive/1.0/metadata.xml @@ -1,7 +1,7 @@ true - + test import export archive diff --git a/webapp/sources/rudder/rudder-web/src/test/resources/configuration-repository-migrate-json-8_0/techniques/ncf_techniques/technique_with_blocks/1.0/metadata.xml b/webapp/sources/rudder/rudder-web/src/test/resources/configuration-repository-migrate-json-8_0/techniques/ncf_techniques/technique_with_blocks/1.0/metadata.xml index fbf5892aaba..621415857dd 100644 --- a/webapp/sources/rudder/rudder-web/src/test/resources/configuration-repository-migrate-json-8_0/techniques/ncf_techniques/technique_with_blocks/1.0/metadata.xml +++ b/webapp/sources/rudder/rudder-web/src/test/resources/configuration-repository-migrate-json-8_0/techniques/ncf_techniques/technique_with_blocks/1.0/metadata.xml @@ -1,7 +1,7 @@ true - + technique_with_blocks diff --git a/webapp/sources/rudder/rudder-web/src/test/resources/configuration-repository-migrate-json-8_0/techniques/ncf_techniques/technique_with_parameters/1.0/metadata.xml b/webapp/sources/rudder/rudder-web/src/test/resources/configuration-repository-migrate-json-8_0/techniques/ncf_techniques/technique_with_parameters/1.0/metadata.xml index cc9c9c1668b..2d7787e3e07 100644 --- a/webapp/sources/rudder/rudder-web/src/test/resources/configuration-repository-migrate-json-8_0/techniques/ncf_techniques/technique_with_parameters/1.0/metadata.xml +++ b/webapp/sources/rudder/rudder-web/src/test/resources/configuration-repository-migrate-json-8_0/techniques/ncf_techniques/technique_with_parameters/1.0/metadata.xml @@ -3,7 +3,7 @@ true A technique with some parameters true - + technique_with_parameters @@ -49,4 +49,4 @@
- \ No newline at end of file + diff --git a/webapp/sources/rudder/rudder-web/src/test/resources/configuration-repository-migrate-json-8_0/techniques/ncf_techniques/test_import_export_archive/1.0/metadata.xml b/webapp/sources/rudder/rudder-web/src/test/resources/configuration-repository-migrate-json-8_0/techniques/ncf_techniques/test_import_export_archive/1.0/metadata.xml index 928ce4aaad9..fb28e27dd9e 100644 --- a/webapp/sources/rudder/rudder-web/src/test/resources/configuration-repository-migrate-json-8_0/techniques/ncf_techniques/test_import_export_archive/1.0/metadata.xml +++ b/webapp/sources/rudder/rudder-web/src/test/resources/configuration-repository-migrate-json-8_0/techniques/ncf_techniques/test_import_export_archive/1.0/metadata.xml @@ -1,7 +1,7 @@ true - + test import export archive diff --git a/webapp/sources/rudder/rudder-web/src/test/resources/historical-inventories/fb0096f3-a928-454d-9776-e8079d48cdd8/2023-04-11T22:15:53.375+02:00 b/webapp/sources/rudder/rudder-web/src/test/resources/historical-inventories/fb0096f3-a928-454d-9776-e8079d48cdd8/2023-04-11T22:15:53.375+02:00 index f356daf9e17..9b92940a5c4 100644 --- a/webapp/sources/rudder/rudder-web/src/test/resources/historical-inventories/fb0096f3-a928-454d-9776-e8079d48cdd8/2023-04-11T22:15:53.375+02:00 +++ b/webapp/sources/rudder/rudder-web/src/test/resources/historical-inventories/fb0096f3-a928-454d-9776-e8079d48cdd8/2023-04-11T22:15:53.375+02:00 @@ -17,7 +17,7 @@ swap: 416284672 osArchitectureType: x86_64 inventoryDate: 20190912231642.000Z receiveDate: 20201115124940.616Z -agentName: {"agentType":"cfengine-community","version":"4.3.10-lucid0","securityToken":{"value":"-----BEGIN RSA PUBLIC KEY-----\nMIIBCgKCAQEAxV6J9wZyte9pcrAKF7+I66kz7K/Qr6EmGrQz7uWgnDd5RpybhhZa\ncldhl7GywwRne21eTkSYfYJZgkN9CivtdS7YffX6J7G82B60EcjcDeLvmCYWPo8B\nzNO+ewCoA8XMRZakBB3OdZV6JeXpfbEdwYr8GIyVrg2RKodexUDbVOY8H9pGp1GG\nshGY9qmVY1zyEIQbFCn5dCtvpWS8CjVYu8B8NOdfAk6wGywpuKiwgyV625HKvPyu\noa6WCr3gJ37JUMtgFPNu3JwCFHnDVouG51RsqbbZzyuiWaJ0uGHVgXurZZ1qWdgE\nQmltnCYkXUMnN2W4e4VTbXLJ5ecDIdXnGwIDAQAB\n-----END RSA PUBLIC KEY-----","type":"publicKey"},"capabilities":["acl","bodydefault","cfengine","curl","dumpdatastate","xml","yaml"]} +agentName: {"agentType":"cfengine-community","version":"4.3.10-lucid0","securityToken":{"value":"-----BEGIN CERTIFICATE-----\nMIIFqDCCA5CgAwIBAgIUFKaSnZN/LYRXXbI+Pz1d2Z384ikwDQYJKoZIhvcNAQEL\nBQAwNjE0MDIGCgmSJomT8ixkAQEMJDU5NTEyYTU2LTUzZTktNDFlMS1iMzZmLWNh\nMjJkM2NkZmNiYzAeFw0yMDAyMjgxMDAzMjhaFw0zMDAyMjUxMDAzMjhaMDYxNDAy\nBgoJkiaJk/IsZAEBDCQ1OTUxMmE1Ni01M2U5LTQxZTEtYjM2Zi1jYTIyZDNjZGZj\nYmMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDqwTjPASvhpk52b+0o\nI5GpoWtAtRVac3WmG3fEXvKNmhU03S52HG9HL8QcJeluZsCFkxKNl+1VrpMmIDmt\n2GsnZmBvWwQGUdoLUpxSNHBSD03x0iK5+qs4COnklxXfuJxk/JoOEBHRBKebbxXs\nVLyW4R05CWamrQKzCviGoaK3/4qb2lKY8mC+tT23np62FKtY7gN9uqEVk21SZE83\n1W2mXsETNaXKBR0xR5vbqKgSo1eQmDkauwxN1QoFjX2J7+8UOSSUQE4bsaC41Z6y\n4HdW4pqLdC4K//OsGS4NtVpMEInlI5WWnBk+pV09cHivZWr6yHcqOgMPGMWglNUu\nWL8bZCIo4EbRIKHydR41vZBIg7D25IJIcsx+4bg3T+ZQEzZjBg0CEWE32yAmHB2G\n8JJjyyMSMnfaenfSOG51UhlZfIWiyZsHLp5tB1xMq79B7jT3GtYskA55kPm7xe6l\nGNevsl1MGu126kOvUjoLRGZfj86urbToysho862a1NAZ6QGmfkG3FHMrZAVOMhfb\nRPbGWH1Mut2eWxVyeDYLNjIlRUc/RPvp8VUpe06unOpVrSqMcwRkBGZlbDZWSWG4\nS/VK8KwjeyYDtzGoj4yQbtmR2EXVEHJvFnVq63265lyRYulTSXmx01Uco9K+8g/i\n7SpTn6wEYHdm8nmNPRt0ZInaBQIDAQABo4GtMIGqMAkGA1UdEwQCMAAwHQYDVR0O\nBBYEFF90PBSY3aV97ewxT9iNSr/p16bGMHEGA1UdIwRqMGiAFF90PBSY3aV97ewx\nT9iNSr/p16bGoTqkODA2MTQwMgYKCZImiZPyLGQBAQwkNTk1MTJhNTYtNTNlOS00\nMWUxLWIzNmYtY2EyMmQzY2RmY2JjghQUppKdk38thFddsj4/PV3ZnfziKTALBgNV\nHQ8EBAMCA7gwDQYJKoZIhvcNAQELBQADggIBAJ/xpoJ1Y4EtUKY9dRzNtRpaCzMc\nfeO/s44IuHcylOvSgfAoLOmY7W87JTiiK1khVAmShbQfXXEJBv4K+MKVkjZl93BW\nGcNmeTMCGZyFzYjxC34WU9Ik6lHBjd9kOnOACK5QWYD6oC4Z1KP0bpbrA+o51B0C\n8QurqUQgIaN6FfmET8xbAV/9T+WvydFQepBsIb/g7rW2gWhicajrRZwv/dXt0WYG\nNzFuSt8NBWxwK+11UxB53EoZloJanaWKl/qZfNgCIlu/BbpMyVAj94khXG9Do0Ck\nButatB6HR7WxLP9m82mHiHbDnefzrTXxDiHvdYut5KuauaMzP2uufTT+F2Mnff3P\nlwrLrIT8O8odiMS/oqzY9U3Br4CQXosSo9Ia6QqVuGVTbngklP+sa67XqYBKaFrK\ncVAJBKcmhaehIvMUrlyeDt2pM0VmbfSE+Poncx3TL9Yg6L/otvMnW9LultrjumOn\nzgahsDi7l1ZQnTMI2sZNuyUK9pBfZtO/1N+QLA1bphOXyim5bAsZ4O+0oXeFScTA\nmoDd8+/+Bmp1sjsrtgUchXipnX/O8+J0oQYfX+mqHLAII4ypJ128eGs2jrEdjowG\noVMureSwzxWAC4QPBMUAqe2Avnc3DFuMAMFq6njK7Z39Eb0+FGdPQhp87w1CNjq9\nwRHToEDvajGEHbAz\n-----END CERTIFICATE-----","type":"certificate"},"capabilities":["acl","bodydefault","cfengine","curl","dumpdatastate","xml","yaml"]} software: softwareId=a8c43188-be44-4526-821d-fc62761573a5,ou=Software,ou=Inventories,cn=rudder-configuration software: softwareId=4f70b599-479a-4c0c-96a2-2ac9efce50ff,ou=Software,ou=Inventories,cn=rudder-configuration software: softwareId=33353d7c-a83c-4eba-a63d-efb2ac888b58,ou=Software,ou=Inventories,cn=rudder-configuration diff --git a/webapp/sources/rudder/rudder-web/src/test/resources/historical-inventories/fb0096f4-a928-454d-9776-e8079d48cdd8/2021-04-11T22:15:53.375+02:00 b/webapp/sources/rudder/rudder-web/src/test/resources/historical-inventories/fb0096f4-a928-454d-9776-e8079d48cdd8/2021-04-11T22:15:53.375+02:00 index f356daf9e17..9b92940a5c4 100644 --- a/webapp/sources/rudder/rudder-web/src/test/resources/historical-inventories/fb0096f4-a928-454d-9776-e8079d48cdd8/2021-04-11T22:15:53.375+02:00 +++ b/webapp/sources/rudder/rudder-web/src/test/resources/historical-inventories/fb0096f4-a928-454d-9776-e8079d48cdd8/2021-04-11T22:15:53.375+02:00 @@ -17,7 +17,7 @@ swap: 416284672 osArchitectureType: x86_64 inventoryDate: 20190912231642.000Z receiveDate: 20201115124940.616Z -agentName: {"agentType":"cfengine-community","version":"4.3.10-lucid0","securityToken":{"value":"-----BEGIN RSA PUBLIC KEY-----\nMIIBCgKCAQEAxV6J9wZyte9pcrAKF7+I66kz7K/Qr6EmGrQz7uWgnDd5RpybhhZa\ncldhl7GywwRne21eTkSYfYJZgkN9CivtdS7YffX6J7G82B60EcjcDeLvmCYWPo8B\nzNO+ewCoA8XMRZakBB3OdZV6JeXpfbEdwYr8GIyVrg2RKodexUDbVOY8H9pGp1GG\nshGY9qmVY1zyEIQbFCn5dCtvpWS8CjVYu8B8NOdfAk6wGywpuKiwgyV625HKvPyu\noa6WCr3gJ37JUMtgFPNu3JwCFHnDVouG51RsqbbZzyuiWaJ0uGHVgXurZZ1qWdgE\nQmltnCYkXUMnN2W4e4VTbXLJ5ecDIdXnGwIDAQAB\n-----END RSA PUBLIC KEY-----","type":"publicKey"},"capabilities":["acl","bodydefault","cfengine","curl","dumpdatastate","xml","yaml"]} +agentName: {"agentType":"cfengine-community","version":"4.3.10-lucid0","securityToken":{"value":"-----BEGIN CERTIFICATE-----\nMIIFqDCCA5CgAwIBAgIUFKaSnZN/LYRXXbI+Pz1d2Z384ikwDQYJKoZIhvcNAQEL\nBQAwNjE0MDIGCgmSJomT8ixkAQEMJDU5NTEyYTU2LTUzZTktNDFlMS1iMzZmLWNh\nMjJkM2NkZmNiYzAeFw0yMDAyMjgxMDAzMjhaFw0zMDAyMjUxMDAzMjhaMDYxNDAy\nBgoJkiaJk/IsZAEBDCQ1OTUxMmE1Ni01M2U5LTQxZTEtYjM2Zi1jYTIyZDNjZGZj\nYmMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDqwTjPASvhpk52b+0o\nI5GpoWtAtRVac3WmG3fEXvKNmhU03S52HG9HL8QcJeluZsCFkxKNl+1VrpMmIDmt\n2GsnZmBvWwQGUdoLUpxSNHBSD03x0iK5+qs4COnklxXfuJxk/JoOEBHRBKebbxXs\nVLyW4R05CWamrQKzCviGoaK3/4qb2lKY8mC+tT23np62FKtY7gN9uqEVk21SZE83\n1W2mXsETNaXKBR0xR5vbqKgSo1eQmDkauwxN1QoFjX2J7+8UOSSUQE4bsaC41Z6y\n4HdW4pqLdC4K//OsGS4NtVpMEInlI5WWnBk+pV09cHivZWr6yHcqOgMPGMWglNUu\nWL8bZCIo4EbRIKHydR41vZBIg7D25IJIcsx+4bg3T+ZQEzZjBg0CEWE32yAmHB2G\n8JJjyyMSMnfaenfSOG51UhlZfIWiyZsHLp5tB1xMq79B7jT3GtYskA55kPm7xe6l\nGNevsl1MGu126kOvUjoLRGZfj86urbToysho862a1NAZ6QGmfkG3FHMrZAVOMhfb\nRPbGWH1Mut2eWxVyeDYLNjIlRUc/RPvp8VUpe06unOpVrSqMcwRkBGZlbDZWSWG4\nS/VK8KwjeyYDtzGoj4yQbtmR2EXVEHJvFnVq63265lyRYulTSXmx01Uco9K+8g/i\n7SpTn6wEYHdm8nmNPRt0ZInaBQIDAQABo4GtMIGqMAkGA1UdEwQCMAAwHQYDVR0O\nBBYEFF90PBSY3aV97ewxT9iNSr/p16bGMHEGA1UdIwRqMGiAFF90PBSY3aV97ewx\nT9iNSr/p16bGoTqkODA2MTQwMgYKCZImiZPyLGQBAQwkNTk1MTJhNTYtNTNlOS00\nMWUxLWIzNmYtY2EyMmQzY2RmY2JjghQUppKdk38thFddsj4/PV3ZnfziKTALBgNV\nHQ8EBAMCA7gwDQYJKoZIhvcNAQELBQADggIBAJ/xpoJ1Y4EtUKY9dRzNtRpaCzMc\nfeO/s44IuHcylOvSgfAoLOmY7W87JTiiK1khVAmShbQfXXEJBv4K+MKVkjZl93BW\nGcNmeTMCGZyFzYjxC34WU9Ik6lHBjd9kOnOACK5QWYD6oC4Z1KP0bpbrA+o51B0C\n8QurqUQgIaN6FfmET8xbAV/9T+WvydFQepBsIb/g7rW2gWhicajrRZwv/dXt0WYG\nNzFuSt8NBWxwK+11UxB53EoZloJanaWKl/qZfNgCIlu/BbpMyVAj94khXG9Do0Ck\nButatB6HR7WxLP9m82mHiHbDnefzrTXxDiHvdYut5KuauaMzP2uufTT+F2Mnff3P\nlwrLrIT8O8odiMS/oqzY9U3Br4CQXosSo9Ia6QqVuGVTbngklP+sa67XqYBKaFrK\ncVAJBKcmhaehIvMUrlyeDt2pM0VmbfSE+Poncx3TL9Yg6L/otvMnW9LultrjumOn\nzgahsDi7l1ZQnTMI2sZNuyUK9pBfZtO/1N+QLA1bphOXyim5bAsZ4O+0oXeFScTA\nmoDd8+/+Bmp1sjsrtgUchXipnX/O8+J0oQYfX+mqHLAII4ypJ128eGs2jrEdjowG\noVMureSwzxWAC4QPBMUAqe2Avnc3DFuMAMFq6njK7Z39Eb0+FGdPQhp87w1CNjq9\nwRHToEDvajGEHbAz\n-----END CERTIFICATE-----","type":"certificate"},"capabilities":["acl","bodydefault","cfengine","curl","dumpdatastate","xml","yaml"]} software: softwareId=a8c43188-be44-4526-821d-fc62761573a5,ou=Software,ou=Inventories,cn=rudder-configuration software: softwareId=4f70b599-479a-4c0c-96a2-2ac9efce50ff,ou=Software,ou=Inventories,cn=rudder-configuration software: softwareId=33353d7c-a83c-4eba-a63d-efb2ac888b58,ou=Software,ou=Inventories,cn=rudder-configuration diff --git a/webapp/sources/rudder/rudder-web/src/test/resources/ldap-data/schema/099-0-inventory.ldif b/webapp/sources/rudder/rudder-web/src/test/resources/ldap-data/schema/099-0-inventory.ldif index a860ee72e78..4196323afe8 100644 --- a/webapp/sources/rudder/rudder-web/src/test/resources/ldap-data/schema/099-0-inventory.ldif +++ b/webapp/sources/rudder/rudder-web/src/test/resources/ldap-data/schema/099-0-inventory.ldif @@ -248,7 +248,7 @@ attributeTypes: ( 1.3.6.1.4.1.35061.1.1.300.12 ORDERING generalizedTimeOrderingMatch ) attributeTypes: ( 1.3.6.1.4.1.35061.1.1.300.13 NAME 'agentName' - DESC 'List of name of the agent (Nova, Community, ...)' + DESC 'List of name of the agent (Dsc, Community, ...)' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} ) diff --git a/webapp/sources/rudder/rudder-web/src/test/scala/bootstrap/liftweb/checks/migration/TestMigrateNodeAcceptationInventories.scala b/webapp/sources/rudder/rudder-web/src/test/scala/bootstrap/liftweb/checks/migration/TestMigrateNodeAcceptationInventories.scala index e353cc05c6f..e645809eaa2 100644 --- a/webapp/sources/rudder/rudder-web/src/test/scala/bootstrap/liftweb/checks/migration/TestMigrateNodeAcceptationInventories.scala +++ b/webapp/sources/rudder/rudder-web/src/test/scala/bootstrap/liftweb/checks/migration/TestMigrateNodeAcceptationInventories.scala @@ -50,10 +50,8 @@ import com.normation.inventory.ldap.core.InventoryDitServiceImpl import com.normation.inventory.ldap.core.InventoryMapper import com.normation.rudder.db.DBCommon import com.normation.rudder.db.Doobie -import com.normation.rudder.domain.nodes.Node -import com.normation.rudder.domain.nodes.NodeInfo +import com.normation.rudder.facts.nodes.CoreNodeFactRepository import com.normation.rudder.facts.nodes.NodeFact -import com.normation.rudder.services.nodes.NodeInfoService import com.normation.rudder.services.nodes.history.HistoryLogRepository import com.normation.rudder.services.nodes.history.impl.FactLog import com.normation.rudder.services.nodes.history.impl.FactLogData @@ -65,6 +63,7 @@ import com.normation.rudder.services.nodes.history.impl.NodeDeleteEvent import com.normation.rudder.services.policies.NodeConfigData import com.normation.utils.DateFormaterService import com.normation.zio.* +import com.softwaremill.quicklens.* import com.unboundid.ldap.sdk.DN import org.apache.commons.io.FileUtils import org.joda.time.DateTime @@ -250,32 +249,16 @@ trait TestMigrateNodeAcceptationInventories extends Specification with AfterAll // 59512a56-53e9-41e1-b36f-ca22d3cdfcbc => ok, 2 files, both ok in age // fb0096f3-a928-454d-9776-e8079d48cdd8 => deleted, age ok // fb0096f4-a928-454d-9776-e8079d48cdd8 => deleted, too old - object nodeInfoService extends NodeInfoService { - import com.softwaremill.quicklens.* - val n = NodeConfigData.node1 - def success(nodeId: NodeId): ZIO[Any, Nothing, Some[NodeInfo]] = Some(n.modify(_.node.id).setTo(nodeId)).succeed - - override def getAll(): IOResult[Map[NodeId, NodeInfo]] = ??? - override def getNodeInfo(nodeId: NodeId): IOResult[Option[NodeInfo]] = nodeId.value match { - case "0afa1d13-d125-4c91-9d71-24c47dc867e9" => None.succeed - case "0bd58a1f-3faa-4783-a7a2-52d84021663a" => success(nodeId) - case "1bd58a1f-3faa-4783-a7a2-52d84021663a" => success(nodeId) - case "4d3a43bc-8508-46a2-92d7-cfe7320309a5" => success(nodeId) - case "59512a56-53e9-41e1-b36f-ca22d3cdfcbc" => success(nodeId) - case "fb0096f3-a928-454d-9776-e8079d48cdd8" => None.succeed - case "fb0096f4-a928-454d-9776-e8079d48cdd8" => None.succeed - } - override def getNodeInfosSeq(nodesId: Seq[NodeId]): IOResult[Seq[NodeInfo]] = ??? - override def getNumberOfManagedNodes: IOResult[Int] = ??? - override def getAllNodesIds(): IOResult[Set[NodeId]] = ??? - override def getAllNodes(): IOResult[Map[NodeId, Node]] = ??? - override def getAllSystemNodeIds(): IOResult[Seq[NodeId]] = ??? - override def getPendingNodeInfos(): IOResult[Map[NodeId, NodeInfo]] = ??? - override def getPendingNodeInfo(nodeId: NodeId): IOResult[Option[NodeInfo]] = ??? - override def getAllNodeInfos(): IOResult[Seq[NodeInfo]] = ??? - } + val nodes = List( + NodeConfigData.fact1.modify(_.id.value).setTo("0bd58a1f-3faa-4783-a7a2-52d84021663a"), + NodeConfigData.fact1.modify(_.id.value).setTo("1bd58a1f-3faa-4783-a7a2-52d84021663a"), + NodeConfigData.fact1.modify(_.id.value).setTo("4d3a43bc-8508-46a2-92d7-cfe7320309a5"), + NodeConfigData.fact1.modify(_.id.value).setTo("59512a56-53e9-41e1-b36f-ca22d3cdfcbc") + ).map(x => (x.id, x)).toMap + + val repo = CoreNodeFactRepository.makeNoop(nodes).runNow - lazy val migration = new MigrateNodeAcceptationInventories(nodeInfoService, null, fileLog, testFactLog, 365.days) + lazy val migration = new MigrateNodeAcceptationInventories(repo, null, fileLog, testFactLog, 365.days) val referenceNow: DateTime = dateFormat.parseDateTime("2023-06-01T04:15:35.000+02:00") diff --git a/webapp/sources/scala-ldap/pom.xml b/webapp/sources/scala-ldap/pom.xml index e48fcc4a01e..df004db59fc 100644 --- a/webapp/sources/scala-ldap/pom.xml +++ b/webapp/sources/scala-ldap/pom.xml @@ -19,7 +19,7 @@ limitations under the License. com.normation parent-pom - 8.2.4-SNAPSHOT + 8.3.0~alpha1-SNAPSHOT scala-ldap diff --git a/webapp/sources/utils/pom.xml b/webapp/sources/utils/pom.xml index 17edb176a49..11e9cbffdb4 100644 --- a/webapp/sources/utils/pom.xml +++ b/webapp/sources/utils/pom.xml @@ -19,7 +19,7 @@ limitations under the License. com.normation parent-pom - 8.2.4-SNAPSHOT + 8.3.0~alpha1-SNAPSHOT utils diff --git a/webapp/sources/utils/src/main/scala/com/normation/ZioCommons.scala b/webapp/sources/utils/src/main/scala/com/normation/ZioCommons.scala index 826e79ef6fc..d2dccf27eb3 100644 --- a/webapp/sources/utils/src/main/scala/com/normation/ZioCommons.scala +++ b/webapp/sources/utils/src/main/scala/com/normation/ZioCommons.scala @@ -43,8 +43,8 @@ import org.slf4j.Logger /** * This is our based error for Rudder. Any method that can * error should return that RudderError type to allow - * seemless interaction between modules. - * None the less, all module should have its own domain error + * seamless interaction between modules. + * Nonetheless, all module should have its own domain error * for meaningful semantic intra-module. */ object errors { @@ -90,10 +90,13 @@ object errors { * use `IOResult.succeed`). */ object IOResult { - def attempt[A](error: String)(effect: => A): IO[SystemError, A] = { + // attempt is blocking + def attempt[A](error: String)(effect: => A): IO[SystemError, A] = { // In ZIO 2 blocking is automagically managed - https://github.com/zio/zio/issues/1275 - ZIO.attempt(effect).mapError(ex => SystemError(error, ex)) + // in 2.1.0, they remove the auto-blocking. Our code is not ready for that, so we need to set it back. + ZIO.attemptBlocking(effect).mapError(ex => SystemError(error, ex)) } + def attempt[A](effect: => A): IO[SystemError, A] = { this.attempt("An error occurred")(effect) } @@ -108,6 +111,29 @@ object errors { def attemptZIO[A](ioeffect: => IOResult[A]): IOResult[A] = { attemptZIO("An error occurred")(ioeffect) } + + // for non-blocking case + def nonBlocking[A](error: String)(effect: => A): IO[SystemError, A] = { + // in ZIO 2.1, attempt is for non blocking, CPU bound effects + ZIO.attempt(effect).mapError(ex => SystemError(error, ex)) + } + + def nonBlocking[A](effect: => A): IO[SystemError, A] = { + this.nonBlocking("An error occurred")(effect) + } + + def nonBlockingZIO[A](error: String)(ioeffect: => IOResult[A]): IOResult[A] = { + ZIO + .attempt(ioeffect) + .foldZIO( + ex => SystemError(error, ex).fail, + res => res + ) + } + def nonBlockingZIO[A](ioeffect: => IOResult[A]): IOResult[A] = { + nonBlockingZIO("An error occurred")(ioeffect) + } + } object PureResult {