diff --git a/Cargo.lock b/Cargo.lock index 9fe24b6f..8a3abd96 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,6 +17,12 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + [[package]] name = "aead" version = "0.5.2" @@ -120,27 +126,39 @@ version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" +[[package]] +name = "async-compression" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "942c7cd7ae39e91bde4820d74132e9862e62c2f386c3aa90ccf55949f5bad63a" +dependencies = [ + "flate2", + "futures-core", + "memchr", + "pin-project-lite", + "tokio", +] + [[package]] name = "async-nats" -version = "0.33.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbc1f1a75fd07f0f517322d103211f12d757658e91676def9a2e688774656c60" +checksum = "f71e5a1bab60f46b0b005f4808b8ee83ef6d577608923de938403393c9a30cf8" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "bytes", "futures", - "http 0.2.12", "memchr", - "nkeys 0.3.2", + "nkeys", "nuid 0.5.0", "once_cell", + "portable-atomic", "rand", "regex", "ring", - "rustls 0.21.12", - "rustls-native-certs 0.6.3", - "rustls-pemfile 1.0.4", - "rustls-webpki 0.101.7", + "rustls-native-certs", + "rustls-pemfile", + "rustls-webpki", "serde", "serde_json", "serde_nanos", @@ -148,9 +166,10 @@ dependencies = [ "thiserror", "time", "tokio", - "tokio-retry", - "tokio-rustls 0.24.1", + "tokio-rustls", + "tokio-util 0.7.11", "tracing", + "tryhard", "url", ] @@ -195,9 +214,9 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "aws-lc-rs" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae74d9bd0a7530e8afd1770739ad34b36838829d6ad61818f9230f683f5ad77" +checksum = "2f95446d919226d587817a7d21379e6eb099b97b45110a7f272a444ca5c54070" dependencies = [ "aws-lc-sys", "mirai-annotations", @@ -207,9 +226,9 @@ dependencies = [ [[package]] name = "aws-lc-sys" -version = "0.20.1" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f0e249228c6ad2d240c2dc94b714d711629d52bad946075d8e9b2f5391f0703" +checksum = "b3ddc4a5b231dd6958b140ff3151b6412b3f4321fab354f399eec8f14b06df62" dependencies = [ "bindgen", "cc", @@ -230,7 +249,7 @@ dependencies = [ "cc", "cfg-if", "libc", - "miniz_oxide", + "miniz_oxide 0.7.4", "object", "rustc-demangle", ] @@ -282,7 +301,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "rustc-hash", + "rustc-hash 1.1.0", "shlex", "syn 2.0.68", "which", @@ -341,14 +360,14 @@ dependencies = [ "http-body-util", "hyper 1.4.1", "hyper-named-pipe", - "hyper-rustls 0.27.2", + "hyper-rustls", "hyper-util", "hyperlocal", "log", "pin-project-lite", - "rustls 0.23.10", - "rustls-native-certs 0.7.1", - "rustls-pemfile 2.1.2", + "rustls", + "rustls-native-certs", + "rustls-pemfile", "rustls-pki-types", "serde", "serde_derive", @@ -392,12 +411,6 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855" -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - [[package]] name = "bytes" version = "1.7.2" @@ -575,6 +588,15 @@ dependencies = [ "libc", ] +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + [[package]] name = "crossbeam-channel" version = "0.5.13" @@ -866,12 +888,34 @@ version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" +[[package]] +name = "filetime" +version = "0.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.4.1", + "windows-sys 0.52.0", +] + [[package]] name = "fixedbitset" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" +[[package]] +name = "flate2" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" +dependencies = [ + "crc32fast", + "miniz_oxide 0.8.0", +] + [[package]] name = "fnv" version = "1.0.7" @@ -1257,20 +1301,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "hyper-rustls" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" -dependencies = [ - "futures-util", - "http 0.2.12", - "hyper 0.14.29", - "rustls 0.21.12", - "tokio", - "tokio-rustls 0.24.1", -] - [[package]] name = "hyper-rustls" version = "0.27.2" @@ -1282,12 +1312,13 @@ dependencies = [ "hyper 1.4.1", "hyper-util", "log", - "rustls 0.23.10", - "rustls-native-certs 0.7.1", + "rustls", + "rustls-native-certs", "rustls-pki-types", "tokio", - "tokio-rustls 0.26.0", + "tokio-rustls", "tower-service", + "webpki-roots", ] [[package]] @@ -1489,7 +1520,7 @@ dependencies = [ "parking_lot", "percent-encoding", "regex", - "reqwest", + "reqwest 0.11.27", "serde", "serde_json", "time", @@ -1620,6 +1651,15 @@ dependencies = [ "adler", ] +[[package]] +name = "miniz_oxide" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +dependencies = [ + "adler2", +] + [[package]] name = "mio" version = "1.0.1" @@ -1644,22 +1684,6 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" -[[package]] -name = "nkeys" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aad178aad32087b19042ee36dfd450b73f5f934fbfb058b59b198684dfec4c47" -dependencies = [ - "byteorder 1.5.0", - "data-encoding", - "ed25519", - "ed25519-dalek", - "getrandom", - "log", - "rand", - "signatory", -] - [[package]] name = "nkeys" version = "0.4.4" @@ -1811,25 +1835,25 @@ dependencies = [ [[package]] name = "oci-distribution" -version = "0.9.4" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ac5b780ce1bd6c3c2ff72a3013f4b2d56d53ae03b20d424e99d2f6556125138" +checksum = "b95a2c51531af0cb93761f66094044ca6ea879320bccd35ab747ff3fcab3f422" dependencies = [ - "futures", + "bytes", + "chrono", "futures-util", - "http 0.2.12", + "http 1.1.0", "http-auth", "jwt", "lazy_static", "olpc-cjson", "regex", - "reqwest", + "reqwest 0.12.5", "serde", "serde_json", "sha2", "thiserror", "tokio", - "tokio-util 0.7.11", "tracing", "unicase", ] @@ -1886,18 +1910,16 @@ dependencies = [ [[package]] name = "opentelemetry" -version = "0.21.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e32339a5dc40459130b3bd269e9892439f55b33e772d2a9d402a789baaf4e8a" +checksum = "1b69a91d4893e713e06f724597ad630f1fa76057a5e1026c0ca67054a9032a76" dependencies = [ "futures-core", "futures-sink", - "indexmap 2.5.0", "js-sys", "once_cell", "pin-project-lite", "thiserror", - "urlencoding", ] [[package]] @@ -1910,7 +1932,7 @@ dependencies = [ "bytes", "http 0.2.12", "opentelemetry 0.17.0", - "reqwest", + "reqwest 0.11.27", ] [[package]] @@ -1927,7 +1949,7 @@ dependencies = [ "opentelemetry-http", "prost", "prost-build", - "reqwest", + "reqwest 0.11.27", "thiserror", "tokio", "tonic", @@ -1936,17 +1958,17 @@ dependencies = [ [[package]] name = "opentelemetry_sdk" -version = "0.21.2" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f16aec8a98a457a52664d69e0091bac3a0abd18ead9b641cb00202ba4e0efe4" +checksum = "ae312d58eaa90a82d2e627fd86e075cf5230b3f11794e2ed74199ebbe572d4fd" dependencies = [ "async-trait", - "crossbeam-channel", "futures-channel", "futures-executor", "futures-util", + "lazy_static", "once_cell", - "opentelemetry 0.21.0", + "opentelemetry 0.23.0", "ordered-float", "percent-encoding", "rand", @@ -1995,7 +2017,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.5.2", "smallvec", "windows-targets 0.52.5", ] @@ -2109,6 +2131,12 @@ dependencies = [ "universal-hash", ] +[[package]] +name = "portable-atomic" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d30538d42559de6b034bc76fd6dd4c38961b1ee5c6c56e3808c50128fdbc22ce" + [[package]] name = "powerfmt" version = "0.2.0" @@ -2217,6 +2245,68 @@ dependencies = [ "prost", ] +[[package]] +name = "provider-archive" +version = "0.12.0" +dependencies = [ + "async-compression", + "data-encoding", + "ring", + "serde_json", + "tokio", + "tokio-stream", + "tokio-tar", + "wascap 0.15.0", +] + +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash 2.0.0", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash 2.0.0", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -2256,6 +2346,24 @@ dependencies = [ "getrandom", ] +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "redox_syscall" version = "0.5.2" @@ -2335,7 +2443,6 @@ dependencies = [ "http 0.2.12", "http-body 0.4.6", "hyper 0.14.29", - "hyper-rustls 0.24.2", "ipnet", "js-sys", "log", @@ -2343,15 +2450,53 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.21.12", - "rustls-pemfile 1.0.4", "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 0.1.2", "system-configuration", "tokio", - "tokio-rustls 0.24.1", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg 0.50.0", +] + +[[package]] +name = "reqwest" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" +dependencies = [ + "base64 0.22.1", + "bytes", + "futures-core", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "hyper 1.4.1", + "hyper-rustls", + "hyper-util", + "ipnet", + "js-sys", + "log", + "mime", + "once_cell", + "percent-encoding", + "pin-project-lite", + "quinn", + "rustls", + "rustls-pemfile", + "rustls-pki-types", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper 1.0.1", + "tokio", + "tokio-rustls", "tokio-util 0.7.11", "tower-service", "url", @@ -2360,7 +2505,7 @@ dependencies = [ "wasm-streams", "web-sys", "webpki-roots", - "winreg", + "winreg 0.52.0", ] [[package]] @@ -2390,6 +2535,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc-hash" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" + [[package]] name = "rustc_version" version = "0.4.0" @@ -2414,44 +2565,20 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.12" +version = "0.23.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" -dependencies = [ - "log", - "ring", - "rustls-webpki 0.101.7", - "sct", -] - -[[package]] -name = "rustls" -version = "0.23.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" +checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" dependencies = [ "aws-lc-rs", "log", "once_cell", "ring", "rustls-pki-types", - "rustls-webpki 0.102.4", + "rustls-webpki", "subtle", "zeroize", ] -[[package]] -name = "rustls-native-certs" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" -dependencies = [ - "openssl-probe", - "rustls-pemfile 1.0.4", - "schannel", - "security-framework", -] - [[package]] name = "rustls-native-certs" version = "0.7.1" @@ -2459,21 +2586,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a88d6d420651b496bdd98684116959239430022a115c1240e6c3993be0b15fba" dependencies = [ "openssl-probe", - "rustls-pemfile 2.1.2", + "rustls-pemfile", "rustls-pki-types", "schannel", "security-framework", ] -[[package]] -name = "rustls-pemfile" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" -dependencies = [ - "base64 0.21.7", -] - [[package]] name = "rustls-pemfile" version = "2.1.2" @@ -2492,19 +2610,9 @@ checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" [[package]] name = "rustls-webpki" -version = "0.101.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "rustls-webpki" -version = "0.102.4" +version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ "aws-lc-rs", "ring", @@ -2575,22 +2683,21 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "sct" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "sdd" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9c386cfeafd20018fe07344e72dc4787f3432911e6c35d399457d86d2f146c4" +[[package]] +name = "secrecy" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" +dependencies = [ + "zeroize", +] + [[package]] name = "security-framework" version = "2.11.0" @@ -2957,6 +3064,12 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "sync_wrapper" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" + [[package]] name = "system-configuration" version = "0.5.1" @@ -3133,34 +3246,13 @@ dependencies = [ "syn 2.0.68", ] -[[package]] -name = "tokio-retry" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f57eb36ecbe0fc510036adff84824dd3c24bb781e21bfa67b69d556aa85214f" -dependencies = [ - "pin-project", - "rand", - "tokio", -] - -[[package]] -name = "tokio-rustls" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" -dependencies = [ - "rustls 0.21.12", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.10", + "rustls", "rustls-pki-types", "tokio", ] @@ -3176,6 +3268,20 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-tar" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d5714c010ca3e5c27114c1cdeb9d14641ace49874aa5626d7149e47aedace75" +dependencies = [ + "filetime", + "futures-core", + "libc", + "redox_syscall 0.3.5", + "tokio", + "tokio-stream", +] + [[package]] name = "tokio-util" version = "0.6.10" @@ -3198,7 +3304,6 @@ checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", - "futures-io", "futures-sink", "pin-project-lite", "tokio", @@ -3360,18 +3465,18 @@ dependencies = [ [[package]] name = "tracing-opentelemetry" -version = "0.22.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c67ac25c5407e7b961fafc6f7e9aa5958fd297aada2d20fa2ae1737357e55596" +checksum = "f68803492bf28ab40aeccaecc7021096bd256baf7ca77c3d425d89b35a7be4e4" dependencies = [ "js-sys", "once_cell", - "opentelemetry 0.21.0", + "opentelemetry 0.23.0", "opentelemetry_sdk", "tracing", "tracing-core", "tracing-subscriber", - "web-time 0.2.4", + "web-time", ] [[package]] @@ -3411,6 +3516,17 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "tryhard" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c9f0a709784e86923586cff0d872dba54cd2d2e116b3bc57587d15737cfce9d" +dependencies = [ + "futures", + "pin-project-lite", + "tokio", +] + [[package]] name = "typenum" version = "1.17.0" @@ -3426,7 +3542,7 @@ dependencies = [ "getrandom", "rand", "serde", - "web-time 1.1.0", + "web-time", ] [[package]] @@ -3505,12 +3621,6 @@ dependencies = [ "serde", ] -[[package]] -name = "urlencoding" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" - [[package]] name = "utf8parse" version = "0.2.2" @@ -3578,7 +3688,7 @@ dependencies = [ "indexmap 2.5.0", "jsonschema", "lazy_static", - "nkeys 0.4.4", + "nkeys", "rand", "regex", "semver", @@ -3609,7 +3719,7 @@ dependencies = [ "chrono", "clap", "futures", - "nkeys 0.4.4", + "nkeys", "opentelemetry 0.17.0", "opentelemetry-otlp", "schemars", @@ -3637,7 +3747,7 @@ dependencies = [ "async-nats", "bytes", "futures", - "nkeys 0.4.4", + "nkeys", "serde", "serde_json", "serde_yaml", @@ -3662,7 +3772,7 @@ dependencies = [ "indexmap 2.5.0", "jsonschema", "lazy_static", - "nkeys 0.4.4", + "nkeys", "rand", "regex", "schemars", @@ -3694,21 +3804,18 @@ dependencies = [ [[package]] name = "wascap" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "802ee1beca185fd4d61bcfd937360d1dddacc88fefa39b08209e875d99c95711" +version = "0.15.0" dependencies = [ "data-encoding", "humantime", - "log", - "nkeys 0.3.2", + "nkeys", "nuid 0.4.1", "ring", "serde", "serde_json", - "wasm-encoder 0.41.2", + "wasm-encoder 0.217.0", "wasm-gen", - "wasmparser 0.121.2", + "wasmparser 0.217.0", ] [[package]] @@ -3719,7 +3826,7 @@ checksum = "6d394c2c59661bff13bea8bd7c8bf30618bafa671ef9f408ae9c3aa71ede5bb0" dependencies = [ "data-encoding", "humantime", - "nkeys 0.4.4", + "nkeys", "nuid 0.4.1", "ring", "serde", @@ -3803,18 +3910,18 @@ checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasm-encoder" -version = "0.41.2" +version = "0.208.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "972f97a5d8318f908dded23594188a90bcd09365986b1163e66d70170e5287ae" +checksum = "6425e84e42f7f558478e40ecc2287912cb319f2ca68e5c0bb93c61d4fc63fa17" dependencies = [ "leb128", ] [[package]] name = "wasm-encoder" -version = "0.208.1" +version = "0.217.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6425e84e42f7f558478e40ecc2287912cb319f2ca68e5c0bb93c61d4fc63fa17" +checksum = "7b88b0814c9a2b323a9b46c687e726996c255ac8b64aa237dd11c81ed4854760" dependencies = [ "leb128", ] @@ -3825,7 +3932,7 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b854b1461005a7b3365742310f7faa3cac3add809d66928c64a40c7e9e842ebb" dependencies = [ - "byteorder 0.5.3", + "byteorder", "leb128", ] @@ -3844,9 +3951,7 @@ dependencies = [ [[package]] name = "wasmcloud-control-interface" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa9ce0245be791548d153536d4a849f7db9abc9340657bae00250e8a0f7f6bbc" +version = "2.0.0" dependencies = [ "anyhow", "async-nats", @@ -3855,21 +3960,19 @@ dependencies = [ "cloudevents-sdk", "futures", "oci-distribution", - "opentelemetry 0.21.0", + "opentelemetry 0.23.0", "opentelemetry_sdk", "serde", "serde_json", "tokio", "tracing", - "tracing-opentelemetry 0.22.0", + "tracing-opentelemetry 0.24.0", "wasmcloud-core", ] [[package]] name = "wasmcloud-core" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a646a51b5c4410c6bd93aecbcc98f24921c88712de4549ab64617d88fb4acb88" +version = "0.10.0" dependencies = [ "anyhow", "async-nats", @@ -3877,20 +3980,21 @@ dependencies = [ "bytes", "futures", "hex", - "nkeys 0.3.2", + "nkeys", "once_cell", - "rustls 0.23.10", + "provider-archive", + "rustls", + "rustls-pemfile", + "secrecy", "serde", "serde_bytes", "sha2", "tokio", - "tower", "tracing", "ulid", + "url", "uuid", - "wascap 0.13.0", - "wrpc-transport", - "wrpc-transport-nats", + "wascap 0.15.0", ] [[package]] @@ -3902,18 +4006,18 @@ dependencies = [ "anyhow", "async-trait", "bytes", - "nkeys 0.4.4", + "nkeys", "serde", "serde_json", "thiserror", - "wascap 0.15.0", + "wascap 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasmparser" -version = "0.121.2" +version = "0.202.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dbe55c8f9d0dbd25d9447a5a889ff90c0cc3feaa7395310d3d826b2c703eaab" +checksum = "d6998515d3cf3f8b980ef7c11b29a9b1017d4cf86b99ae93b546992df9931413" dependencies = [ "bitflags 2.6.0", "indexmap 2.5.0", @@ -3922,13 +4026,11 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.202.0" +version = "0.217.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6998515d3cf3f8b980ef7c11b29a9b1017d4cf86b99ae93b546992df9931413" +checksum = "ca917a21307d3adf2b9857b94dd05ebf8496bdcff4437a9b9fb3899d3e6c74e7" dependencies = [ "bitflags 2.6.0", - "indexmap 2.5.0", - "semver", ] [[package]] @@ -3941,16 +4043,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "web-time" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa30049b1c872b72c89866d458eae9f20380ab280ffd1b1e18df2d3e2d98cfe0" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - [[package]] name = "web-time" version = "1.1.0" @@ -3963,9 +4055,12 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.25.4" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" +checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" +dependencies = [ + "rustls-pki-types", +] [[package]] name = "which" @@ -4159,6 +4254,16 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "winreg" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + [[package]] name = "wit-bindgen-core" version = "0.24.0" @@ -4247,22 +4352,6 @@ dependencies = [ "wrpc-types", ] -[[package]] -name = "wrpc-transport-nats" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7a40219678cc9e65164487ff3540cddc463d2040950f010bd1d8ce27c8c9a6c" -dependencies = [ - "anyhow", - "async-nats", - "bytes", - "futures", - "tokio", - "tower", - "tracing", - "wrpc-transport", -] - [[package]] name = "wrpc-types" version = "0.6.0" @@ -4299,17 +4388,3 @@ name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" -dependencies = [ - "zeroize_derive", -] - -[[package]] -name = "zeroize_derive" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.68", -] diff --git a/Cargo.toml b/Cargo.toml index e6ebefbd..db0fdf5a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,7 +47,7 @@ wadm-types = { workspace = true } [workspace.dependencies] anyhow = "1" -async-nats = "0.33" +async-nats = "0.36" async-trait = "0.1" base64 = "0.22.1" bytes = "1" @@ -86,7 +86,7 @@ uuid = "1" wadm = { version = "0.15.0", path = "./crates/wadm" } wadm-client = { version = "0.4.0", path = "./crates/wadm-client" } wadm-types = { version = "0.4.0", path = "./crates/wadm-types" } -wasmcloud-control-interface = "1.0.0" +wasmcloud-control-interface = { version = "2.0.0", path = "/home/mrman/code/work/cosmonic/forks/wasmCloud/crates/control-interface" } wasmcloud-secrets-types = "0.2.0" wit-bindgen-wrpc = { version = "0.3.7", default-features = false } diff --git a/crates/wadm/src/commands/mod.rs b/crates/wadm/src/commands/mod.rs index 4e1df86d..93514a28 100644 --- a/crates/wadm/src/commands/mod.rs +++ b/crates/wadm/src/commands/mod.rs @@ -6,7 +6,7 @@ use std::{ }; use serde::{Deserialize, Serialize}; -use wasmcloud_control_interface::InterfaceLinkDefinition; +use wasmcloud_control_interface::Link; use crate::{ events::{ComponentScaleFailed, ComponentScaled, Event, ProviderStartFailed, ProviderStarted}, @@ -235,9 +235,9 @@ pub struct PutLink { pub model_name: String, } -impl From for InterfaceLinkDefinition { - fn from(value: PutLink) -> InterfaceLinkDefinition { - InterfaceLinkDefinition { +impl From for Link { + fn from(value: PutLink) -> Link { + Link { source_id: value.source_id, target: value.target, name: value.name, diff --git a/crates/wadm/src/events/types.rs b/crates/wadm/src/events/types.rs index 111bd2b4..a06c70d6 100644 --- a/crates/wadm/src/events/types.rs +++ b/crates/wadm/src/events/types.rs @@ -11,9 +11,7 @@ use std::{ use cloudevents::{AttributesReader, Data, Event as CloudEvent, EventBuilder, EventBuilderV10}; use serde::{Deserialize, Serialize}; use thiserror::Error; -use wasmcloud_control_interface::{ - ComponentDescription, InterfaceLinkDefinition, ProviderDescription, -}; +use wasmcloud_control_interface::{ComponentDescription, Link, ProviderDescription}; use wadm_types::Manifest; @@ -424,7 +422,7 @@ event_impl!( #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)] pub struct LinkdefSet { #[serde(flatten)] - pub linkdef: InterfaceLinkDefinition, + pub linkdef: Link, } event_impl!(LinkdefSet, "com.wasmcloud.lattice.linkdef_set"); diff --git a/crates/wadm/src/scaler/daemonscaler/mod.rs b/crates/wadm/src/scaler/daemonscaler/mod.rs index 617993d2..bccdc688 100644 --- a/crates/wadm/src/scaler/daemonscaler/mod.rs +++ b/crates/wadm/src/scaler/daemonscaler/mod.rs @@ -360,7 +360,7 @@ mod test { use anyhow::Result; use chrono::Utc; use wadm_types::{api::StatusType, Spread, SpreadScalerProperty}; - use wasmcloud_control_interface::{HostInventory, InterfaceLinkDefinition}; + use wasmcloud_control_interface::{HostInventory, Link}; use crate::{ commands::Command, @@ -957,7 +957,7 @@ mod test { .is_empty()); assert!(blobby_daemonscaler .handle_event(&Event::LinkdefSet(LinkdefSet { - linkdef: InterfaceLinkDefinition::default() + linkdef: Link::default() })) .await? .is_empty()); diff --git a/crates/wadm/src/scaler/spreadscaler/link.rs b/crates/wadm/src/scaler/spreadscaler/link.rs index 7b6206a4..9421ae9a 100644 --- a/crates/wadm/src/scaler/spreadscaler/link.rs +++ b/crates/wadm/src/scaler/spreadscaler/link.rs @@ -149,12 +149,15 @@ where ( true, // TODO(#88): reverse compare too - // Ensure all named configs are the same - linkdef.source_config.iter().all(|config_name| { - self.config.source_config.iter().any(|c| c == config_name) - }) || linkdef.target_config.iter().all(|config_name| { - self.config.target_config.iter().any(|c| c == config_name) - }), + // Ensure all supplied configs (both source and target) are the same + linkdef + .source_config + .iter() + .eq(self.config.source_config.iter()) + && linkdef + .target_config + .iter() + .eq(self.config.target_config.iter()), ) }) .unwrap_or((false, false)); @@ -275,7 +278,7 @@ mod test { vec, }; - use wasmcloud_control_interface::InterfaceLinkDefinition; + use wasmcloud_control_interface::Link; use chrono::Utc; @@ -427,7 +430,7 @@ mod test { let provider_ref = "provider_ref".to_string(); let provider_id = "provider".to_string(); - let linkdef = InterfaceLinkDefinition { + let linkdef = Link { source_id: component_id.to_string(), target: provider_id.to_string(), wit_namespace: "namespace".to_string(), @@ -580,7 +583,7 @@ mod test { let commands = link_scaler .handle_event(&Event::LinkdefSet(LinkdefSet { - linkdef: InterfaceLinkDefinition { + linkdef: Link { // NOTE: contract, link, and provider id matches but the component is different source_id: "nm0001772".to_string(), target: "VASDASD".to_string(), diff --git a/crates/wadm/src/scaler/spreadscaler/mod.rs b/crates/wadm/src/scaler/spreadscaler/mod.rs index 6175b8d2..eda37148 100644 --- a/crates/wadm/src/scaler/spreadscaler/mod.rs +++ b/crates/wadm/src/scaler/spreadscaler/mod.rs @@ -482,7 +482,7 @@ mod test { use anyhow::Result; use chrono::Utc; use wadm_types::{Spread, SpreadScalerProperty}; - use wasmcloud_control_interface::InterfaceLinkDefinition; + use wasmcloud_control_interface::Link; use crate::{ commands::Command, @@ -1499,7 +1499,7 @@ mod test { .is_empty()); assert!(blobby_spreadscaler .handle_event(&Event::LinkdefSet(LinkdefSet { - linkdef: InterfaceLinkDefinition::default() + linkdef: Link::default() })) .await? .is_empty()); diff --git a/crates/wadm/src/storage/snapshot.rs b/crates/wadm/src/storage/snapshot.rs index e4d7426b..2a567da6 100644 --- a/crates/wadm/src/storage/snapshot.rs +++ b/crates/wadm/src/storage/snapshot.rs @@ -3,7 +3,7 @@ use std::sync::Arc; use tokio::sync::RwLock; use tracing::debug; -use wasmcloud_control_interface::InterfaceLinkDefinition; +use wasmcloud_control_interface::Link; use wasmcloud_secrets_types::SecretConfig; use crate::storage::{Component, Host, Provider, ReadStore, StateKind}; @@ -28,7 +28,7 @@ pub struct SnapshotStore { lattice_source: L, lattice_id: String, stored_state: Arc>, - links: Arc>>, + links: Arc>>, } impl Clone for SnapshotStore @@ -165,7 +165,7 @@ where S: Send + Sync, L: Send + Sync, { - async fn get_links(&self) -> anyhow::Result> { + async fn get_links(&self) -> anyhow::Result> { Ok(self.links.read().await.clone()) } } diff --git a/crates/wadm/src/storage/state.rs b/crates/wadm/src/storage/state.rs index d701f5e3..4f9be121 100644 --- a/crates/wadm/src/storage/state.rs +++ b/crates/wadm/src/storage/state.rs @@ -286,8 +286,8 @@ impl From for Host { .into_iter() .map(|component| { ( - component.id, // SAFETY: Unlikely to not fit into a usize, but fallback just in case - component.max_instances.try_into().unwrap_or(usize::MAX), + component.id().into(), // SAFETY: Unlikely to not fit into a usize, but fallback just in case + component.max_instances().try_into().unwrap_or(usize::MAX), ) }) .collect(); @@ -326,9 +326,9 @@ impl From<&HostHeartbeat> for Host { .iter() .map(|component| { ( - component.id.to_owned(), + component.id().to_owned(), // SAFETY: Unlikely to not fit into a usize, but fallback just in case - component.max_instances.try_into().unwrap_or(usize::MAX), + component.max_instances().try_into().unwrap_or(usize::MAX), ) }) .collect(); diff --git a/crates/wadm/src/test_util.rs b/crates/wadm/src/test_util.rs index db587305..313e1b19 100644 --- a/crates/wadm/src/test_util.rs +++ b/crates/wadm/src/test_util.rs @@ -3,7 +3,7 @@ use std::{collections::HashMap, sync::Arc}; use serde::{de::DeserializeOwned, Serialize}; use tokio::sync::RwLock; -use wasmcloud_control_interface::{HostInventory, InterfaceLinkDefinition}; +use wasmcloud_control_interface::{HostInventory, Link}; use wasmcloud_secrets_types::SecretConfig; use crate::publisher::Publisher; @@ -111,7 +111,7 @@ impl crate::storage::Store for TestStore { pub struct TestLatticeSource { pub claims: HashMap, pub inventory: Arc>>, - pub links: Vec, + pub links: Vec, pub config: HashMap>, } @@ -131,7 +131,7 @@ impl InventorySource for TestLatticeSource { #[async_trait::async_trait] impl LinkSource for TestLatticeSource { - async fn get_links(&self) -> anyhow::Result> { + async fn get_links(&self) -> anyhow::Result> { Ok(self.links.clone()) } } diff --git a/crates/wadm/src/workers/command.rs b/crates/wadm/src/workers/command.rs index ba571092..91861a6d 100644 --- a/crates/wadm/src/workers/command.rs +++ b/crates/wadm/src/workers/command.rs @@ -101,9 +101,11 @@ impl Worker for CommandWorker { .map_err(|e| anyhow::anyhow!("{e:?}")); match res { - Ok(ack) if !ack.success => { + Ok(ack) if !ack.succeeded() => { message.nack().await; - Err(WorkError::Other(anyhow::anyhow!("{}", ack.message).into())) + Err(WorkError::Other( + anyhow::anyhow!("{}", ack.message()).into(), + )) } Ok(_) => message.ack().await.map_err(WorkError::from), Err(e) => { diff --git a/crates/wadm/src/workers/event.rs b/crates/wadm/src/workers/event.rs index edf287fd..b3bbe4cb 100644 --- a/crates/wadm/src/workers/event.rs +++ b/crates/wadm/src/workers/event.rs @@ -495,46 +495,49 @@ where .into_iter() .map(|component_description| { let instance = HashSet::from_iter([WadmComponentInfo { - count: component_description.max_instances as usize, + count: component_description.max_instances() as usize, annotations: component_description - .annotations - .map(|a| a.into_iter().collect()) + .annotations() + .map(|a| a.clone()) .unwrap_or_default(), }]); - if let Some(component) = components.get(&component_description.id) { + if let Some(component) = components.get(component_description.id()) { // Construct modified Component with new instances included let mut new_instances = component.instances.clone(); new_instances.insert(host_id.to_owned(), instance); let component = Component { instances: new_instances, - reference: component_description.image_ref, - name: component_description.name.unwrap_or(component.name.clone()), + reference: component_description.image_ref().into(), + name: component_description + .name() + .unwrap_or(&component.name) + .into(), ..component.clone() }; - (component_description.id, component) - } else if let Some(claim) = claims.get(&component_description.id) { + (component_description.id().to_string(), component) + } else if let Some(claim) = claims.get(component_description.id()) { ( - component_description.id.clone(), + component_description.id().to_string(), Component { - id: component_description.id, + id: component_description.id().into(), name: claim.name.to_owned(), issuer: claim.issuer.to_owned(), instances: HashMap::from_iter([(host_id.to_owned(), instance)]), - reference: component_description.image_ref, + reference: component_description.image_ref().into(), }, ) } else { debug!("Claims not found for component on host, component is unsigned"); ( - component_description.id.clone(), + component_description.id().to_string(), Component { - id: component_description.id, + id: component_description.id().into(), name: "".to_owned(), issuer: "".to_owned(), instances: HashMap::from_iter([(host_id.to_owned(), instance)]), - reference: component_description.image_ref, + reference: component_description.image_ref().into(), }, ) } @@ -558,12 +561,12 @@ where .iter() .filter_map(|component_description| { if components - .get(&component_description.id) + .get(component_description.id()) // NOTE(brooksmtownsend): This code maps the component to a boolean indicating if it's up-to-date with the heartbeat or not. // If the component matches what the heartbeat says, we return None, otherwise we return Some(component_description). .map(|component| { // If the stored reference isn't what we receive on the heartbeat, update - component_description.image_ref == component.reference + component_description.image_ref() == component.reference && component .instances .get(&host.host_id) @@ -575,14 +578,14 @@ where // Update if annotations or counts are different let annotations: BTreeMap = component_description - .annotations - .clone() + .annotations() + .cloned() .map(|a| a.into_iter().collect()) .unwrap_or_default(); store_instances.get(&annotations).map_or( false, |store_instance| { - component_description.max_instances as usize + component_description.max_instances() as usize == store_instance.count }, ) diff --git a/crates/wadm/src/workers/event_helpers.rs b/crates/wadm/src/workers/event_helpers.rs index d3da1dbe..d83f9a26 100644 --- a/crates/wadm/src/workers/event_helpers.rs +++ b/crates/wadm/src/workers/event_helpers.rs @@ -6,7 +6,7 @@ use wasmcloud_secrets_types::SecretConfig; use tracing::{debug, instrument, trace, warn}; use wadm_types::api::Status; -use wasmcloud_control_interface::{CtlResponse, HostInventory, InterfaceLinkDefinition}; +use wasmcloud_control_interface::{HostInventory, Link}; use crate::{commands::Command, publisher::Publisher, APP_SPEC_ANNOTATION}; @@ -43,7 +43,7 @@ pub trait InventorySource { /// due to testing, but it does allow us to abstract away the concrete type of the client #[async_trait::async_trait] pub trait LinkSource { - async fn get_links(&self) -> anyhow::Result>; + async fn get_links(&self) -> anyhow::Result>; } /// A trait for anything that can fetch a piece of named configuration @@ -95,11 +95,8 @@ pub fn secret_config_from_map(map: HashMap) -> anyhow::Result anyhow::Result> { match self.get_claims().await.map_err(|e| anyhow::anyhow!("{e}")) { - Ok(CtlResponse { - success: true, - response: Some(claims), - .. - }) => { + Ok(ctl_resp) if ctl_resp.succeeded() => { + let claims = ctl_resp.data().context("missing claims data")?.to_owned(); Ok(claims .into_iter() .filter_map(|mut claim| { @@ -134,13 +131,12 @@ impl InventorySource for wasmcloud_control_interface::Client { .await .map_err(|e| anyhow::anyhow!("{e:?}"))? { - CtlResponse { - success: true, - response: Some(host_inventory), - .. - } => Ok(host_inventory), - CtlResponse { message, .. } => Err(anyhow::anyhow!( - "Failed to get inventory for host {host_id}, {message}" + ctl_resp if ctl_resp.succeeded() && ctl_resp.data().is_some() => Ok(ctl_resp + .into_data() + .context("missing host inventory data")?), + ctl_resp => Err(anyhow::anyhow!( + "Failed to get inventory for host {host_id}, {}", + ctl_resp.message() )), } } @@ -152,18 +148,19 @@ impl InventorySource for wasmcloud_control_interface::Client { // links #[async_trait::async_trait] impl LinkSource for wasmcloud_control_interface::Client { - async fn get_links(&self) -> anyhow::Result> { + async fn get_links(&self) -> anyhow::Result> { match self .get_links() .await .map_err(|e| anyhow::anyhow!("{e:?}"))? { - CtlResponse { - success: true, - response: Some(links), - .. - } => Ok(links), - CtlResponse { message, .. } => Err(anyhow::anyhow!("Failed to get links, {message}")), + ctl_resp if ctl_resp.succeeded() && ctl_resp.data().is_some() => { + Ok(ctl_resp.into_data().context("missing link data")?) + } + ctl_resp => Err(anyhow::anyhow!( + "Failed to get links, {}", + ctl_resp.message() + )), } } } @@ -176,15 +173,13 @@ impl ConfigSource for wasmcloud_control_interface::Client { .await .map_err(|e| anyhow::anyhow!("{e:?}"))? { - CtlResponse { - success: true, - response: Some(config), - .. - } => Ok(Some(config)), + ctl_resp if ctl_resp.succeeded() && ctl_resp.data().is_some() => { + Ok(ctl_resp.into_data()) + } // TODO(https://github.com/wasmCloud/wasmCloud/issues/1906): The control interface should return a None when config isn't found // instead of returning an error. - CtlResponse { message, .. } => { - debug!("Failed to get config for {name}, {message}"); + ctl_resp => { + debug!("Failed to get config for {name}, {}", ctl_resp.message()); Ok(None) } } @@ -199,21 +194,16 @@ impl SecretSource for wasmcloud_control_interface::Client { .await .map_err(|e| anyhow::anyhow!("{e:?}"))? { - CtlResponse { - success: true, - response: Some(secret), - .. - } => secret_config_from_map(secret).map(Some), - CtlResponse { - message, - response: None, - .. - } => { - debug!("Failed to get secret for {name}, {message}"); + ctl_resp if ctl_resp.succeeded() && ctl_resp.data().is_some() => { + secret_config_from_map(ctl_resp.into_data().context("missing secret data")?) + .map(Some) + } + ctl_resp if ctl_resp.data().is_none() => { + debug!("Failed to get secret for {name}, {}", ctl_resp.message()); Ok(None) } - CtlResponse { message, .. } => { - debug!("Failed to get secret for {name}, {message}"); + ctl_resp => { + debug!("Failed to get secret for {name}, {}", ctl_resp.message()); Ok(None) } } diff --git a/tests/command_worker_integration.rs b/tests/command_worker_integration.rs index dd458be8..91896d79 100644 --- a/tests/command_worker_integration.rs +++ b/tests/command_worker_integration.rs @@ -32,12 +32,10 @@ async fn test_commands() { .await .expect("should get hosts back") .first() - .as_ref() .expect("Should be able to find hosts") - .response - .as_ref() - .expect("Should be able to get host") - .id + .data() + .map(|h| h.id()) + .expect("should be able to get host") .to_owned(); let mut sub = nats_client @@ -70,13 +68,13 @@ async fn test_commands() { tokio::time::sleep(std::time::Duration::from_secs(1)).await; // Get the current components and make sure stuff was started - let inventory = ctl_client + let resp_data = ctl_client .get_host_inventory(&host_id) .await .expect("should get host inventory back") - .response - .expect("should have host inventory") - .components; + .into_data() + .expect("should have host inventory"); + let inventory = resp_data.components(); assert_eq!( inventory.len(), 1, @@ -84,17 +82,18 @@ async fn test_commands() { inventory ); assert_eq!( - inventory[0].image_ref, HELLO_IMAGE_REF, + inventory[0].image_ref(), + HELLO_IMAGE_REF, "Should have started the correct component" ); assert_eq!( - inventory[0].max_instances, 2, + inventory[0].max_instances(), + 2, "Should have started the component with correct concurrency" ); assert_eq!( inventory[0] - .annotations - .as_ref() + .annotations() .unwrap() .get(wadm::MANAGED_BY_ANNOTATION) .expect("Should have the managed by annotation"), @@ -103,8 +102,7 @@ async fn test_commands() { ); assert_eq!( inventory[0] - .annotations - .as_ref() + .annotations() .unwrap() .get(wadm::APP_SPEC_ANNOTATION) .expect("Should have the managed by annotation"), @@ -150,13 +148,13 @@ async fn test_commands() { wait_for_event(&mut sub, "health_check_passed").await; // Get the current providers and make sure stuff was started - let inventory = ctl_client + let resp_data = ctl_client .get_host_inventory(&host_id) .await .expect("should get host inventory back") - .response - .expect("should have host inventory") - .providers; + .into_data() + .expect("should have host inventory"); + let inventory = resp_data.providers(); assert_eq!(inventory.len(), 1, "Should only have 1 provider"); assert_eq!( inventory[0].image_ref.as_deref().unwrap(), @@ -211,7 +209,7 @@ async fn test_commands() { .get_links() .await .expect("should get links back") - .response + .into_data() .expect("should have links"); // We could have more than one link due to local testing, so search for the proper link inventory @@ -248,7 +246,7 @@ async fn test_commands() { .get_links() .await .expect("should get links back") - .response + .into_data() .expect("should have links"); // We could have more than one link due to local testing, so search for the proper link assert!( @@ -280,13 +278,13 @@ async fn test_commands() { wait_for_event(&mut sub, "provider_stopped").await; // Get the current providers and make sure stuff was started - let inventory = ctl_client + let resp_data = ctl_client .get_host_inventory(&host_id) .await .expect("should get host inventory back") - .response - .expect("should have host inventory") - .providers; + .into_data() + .expect("should have host inventory"); + let inventory = resp_data.providers(); assert!(inventory.is_empty(), "Should have no providers"); // Stop the component @@ -311,13 +309,13 @@ async fn test_commands() { wait_for_event(&mut sub, "component_scaled").await; // Get the current providers and make sure stuff was started - let inventory = ctl_client + let resp_data = ctl_client .get_host_inventory(&host_id) .await .expect("should get host inventory back") - .response - .expect("should have host inventory") - .components; + .into_data() + .expect("should have host inventory"); + let inventory = resp_data.components(); assert!(inventory.is_empty(), "Should have no components"); } @@ -344,17 +342,14 @@ async fn test_annotation_stop() { .await .unwrap(); - let host_id = ctl_client - .get_hosts() - .await - .unwrap() + let responses = ctl_client.get_hosts().await.unwrap(); + let host_id = responses .first() .expect("Should be able to find hosts") - .response - .as_ref() - .unwrap() - .id - .to_owned(); + .data() + .map(|v| v.id()) + .clone() + .unwrap(); // Start an unmangaged component // NOTE(thomastaylor312): This is a workaround with current behavior where empty annotations @@ -382,7 +377,7 @@ async fn test_annotation_stop() { .publish_command(ScaleComponent { component_id: HELLO_COMPONENT_ID.to_string(), reference: HELLO_IMAGE_REF.to_string(), - host_id: host_id.clone(), + host_id: host_id.into(), count: 2, model_name: "fake".into(), annotations: BTreeMap::from_iter([("fake".to_string(), "wake".to_string())]), @@ -403,18 +398,17 @@ async fn test_annotation_stop() { tokio::time::sleep(std::time::Duration::from_secs(1)).await; // Get the current components and make sure stuff was started - let inventory = ctl_client + let resp_data = ctl_client .get_host_inventory(&host_id) .await .expect("should get host inventory back") - .response - .expect("should have host inventory") - .components; + .into_data() + .expect("should have host inventory"); + let inventory = resp_data.components(); let managed_inventory = inventory .iter() .filter(|c| { - c.annotations - .as_ref() + c.annotations() .is_some_and(|a| a.contains_key(MANAGED_BY_ANNOTATION)) }) .collect::>(); @@ -425,16 +419,17 @@ async fn test_annotation_stop() { "Should only have 1 managed component" ); assert_eq!( - managed_inventory[0].image_ref, HELLO_IMAGE_REF, + managed_inventory[0].image_ref(), + HELLO_IMAGE_REF, "Should have started the correct component" ); assert!(managed_inventory[0] - .annotations - .as_ref() + .annotations() .map(|annotations| annotations.contains_key(MANAGED_BY_ANNOTATION)) .unwrap_or(false)); assert_eq!( - managed_inventory[0].max_instances, 2, + managed_inventory[0].max_instances(), + 2, "Should have started the correct concurrency of components" ); @@ -444,7 +439,7 @@ async fn test_annotation_stop() { component_id: HELLO_COMPONENT_ID.to_owned(), reference: HELLO_IMAGE_REF.to_string(), count: 0, - host_id: host_id.clone(), + host_id: host_id.into(), model_name: "fake".into(), annotations: BTreeMap::from_iter([("fake".to_string(), "wake".to_string())]), config: vec![], @@ -460,20 +455,22 @@ async fn test_annotation_stop() { wait_for_event(&mut sub, "component_scaled").await; // Get the current providers and make sure stuff was started - let inventory = ctl_client + let resp_data = ctl_client .get_host_inventory(&host_id) .await .unwrap() - .response - .unwrap() - .components; + .into_data() + .unwrap(); + let inventory = resp_data.components(); assert_eq!(inventory.len(), 1, "Should only have 1 component"); assert_eq!( - inventory[0].image_ref, HELLO_IMAGE_REF, + inventory[0].image_ref(), + HELLO_IMAGE_REF, "Should have started the correct component" ); assert_eq!( - inventory[0].max_instances, 1, + inventory[0].max_instances(), + 1, "Should have 1 unmanaged component still running" ); } diff --git a/tests/e2e.rs b/tests/e2e.rs index b7c8deae..77517c3f 100644 --- a/tests/e2e.rs +++ b/tests/e2e.rs @@ -242,9 +242,9 @@ impl ClientInfo { .await .expect("Should be able to fetch hosts") .into_iter() - .filter_map(|host| { - host.response - .map(|resp| (self.ctl_client(lattice_prefix).clone(), resp.id)) + .filter_map(|resp| { + resp.data() + .map(|resp| (self.ctl_client(lattice_prefix).clone(), resp.id())) }) .map(|(client, host_id)| async move { let inventory = client