From 0609cb5731d9af8bdb181ad316f675c42ff9be90 Mon Sep 17 00:00:00 2001 From: Alex Snaps Date: Mon, 5 Jun 2023 13:11:18 -0400 Subject: [PATCH 01/14] First test --- .gitmodules | 4 + Cargo.lock | 1277 +++++++++++++++++++++++++++++++++++- Cargo.toml | 3 + tests/rate_limited.rs | 16 + vendor-test/test-framework | 1 + 5 files changed, 1283 insertions(+), 18 deletions(-) create mode 100644 tests/rate_limited.rs create mode 160000 vendor-test/test-framework diff --git a/.gitmodules b/.gitmodules index e69de29..11b0fd7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "vendor-test/test-framework"] + path = vendor-test/test-framework + url = https://github.com/alexsnaps/test-framework.git + branch = kuadrant diff --git a/Cargo.lock b/Cargo.lock index d53b5da..84cf0ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,13 +2,28 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "addr2line" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" +dependencies = [ + "gimli 0.27.2", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + [[package]] name = "ahash" version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom", + "getrandom 0.2.7", "once_cell", "version_check", ] @@ -22,30 +37,315 @@ dependencies = [ "memchr", ] +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + [[package]] name = "anyhow" version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9a8f622bcf6ff3df478e9deba3e03e4e04b300f8e6a139e192c05fa3490afc7" +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "backtrace" +version = "0.3.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" +dependencies = [ + "addr2line", + "cc", + "cfg-if 1.0.0", + "libc", + "miniz_oxide", + "object 0.30.3", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + [[package]] name = "bitflags" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "block-buffer" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" +dependencies = [ + "block-padding", + "byte-tools", + "byteorder", + "generic-array", +] + +[[package]] +name = "block-padding" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +dependencies = [ + "byte-tools", +] + +[[package]] +name = "byte-tools" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + [[package]] name = "bytes" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" +[[package]] +name = "cc" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +dependencies = [ + "jobserver", +] + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "clap" +version = "2.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +dependencies = [ + "ansi_term", + "atty", + "bitflags", + "strsim", + "textwrap", + "unicode-width", + "vec_map", +] + +[[package]] +name = "cranelift-bforest" +version = "0.66.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=2482bd80c24a6b23ac1a259df77c61d5cc9c93a9#2482bd80c24a6b23ac1a259df77c61d5cc9c93a9" +dependencies = [ + "cranelift-entity", +] + +[[package]] +name = "cranelift-codegen" +version = "0.66.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=2482bd80c24a6b23ac1a259df77c61d5cc9c93a9#2482bd80c24a6b23ac1a259df77c61d5cc9c93a9" +dependencies = [ + "byteorder", + "cranelift-bforest", + "cranelift-codegen-meta", + "cranelift-codegen-shared", + "cranelift-entity", + "gimli 0.21.0", + "log", + "regalloc", + "serde", + "smallvec", + "target-lexicon", + "thiserror", +] + +[[package]] +name = "cranelift-codegen-meta" +version = "0.66.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=2482bd80c24a6b23ac1a259df77c61d5cc9c93a9#2482bd80c24a6b23ac1a259df77c61d5cc9c93a9" +dependencies = [ + "cranelift-codegen-shared", + "cranelift-entity", +] + +[[package]] +name = "cranelift-codegen-shared" +version = "0.66.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=2482bd80c24a6b23ac1a259df77c61d5cc9c93a9#2482bd80c24a6b23ac1a259df77c61d5cc9c93a9" + +[[package]] +name = "cranelift-entity" +version = "0.66.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=2482bd80c24a6b23ac1a259df77c61d5cc9c93a9#2482bd80c24a6b23ac1a259df77c61d5cc9c93a9" +dependencies = [ + "serde", +] + +[[package]] +name = "cranelift-frontend" +version = "0.66.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=2482bd80c24a6b23ac1a259df77c61d5cc9c93a9#2482bd80c24a6b23ac1a259df77c61d5cc9c93a9" +dependencies = [ + "cranelift-codegen", + "log", + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cranelift-native" +version = "0.66.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=2482bd80c24a6b23ac1a259df77c61d5cc9c93a9#2482bd80c24a6b23ac1a259df77c61d5cc9c93a9" +dependencies = [ + "cranelift-codegen", + "raw-cpuid", + "target-lexicon", +] + +[[package]] +name = "cranelift-wasm" +version = "0.66.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=2482bd80c24a6b23ac1a259df77c61d5cc9c93a9#2482bd80c24a6b23ac1a259df77c61d5cc9c93a9" +dependencies = [ + "cranelift-codegen", + "cranelift-entity", + "cranelift-frontend", + "log", + "serde", + "thiserror", + "wasmparser 0.59.0", +] + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46bd5f3f85273295a9d14aedfb86f6aadbff6d8f5295c4a9edb08e819dcf5695" +dependencies = [ + "autocfg", + "cfg-if 1.0.0", + "crossbeam-utils", + "memoffset 0.8.0", + "scopeguard", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +dependencies = [ + "generic-array", +] + +[[package]] +name = "directories" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "551a778172a450d7fc12e629ca3b0428d00f6afa9a43da1b630d54604e97371c" +dependencies = [ + "cfg-if 0.1.10", + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + [[package]] name = "either" version = "1.8.0" @@ -58,6 +358,63 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" +[[package]] +name = "env_logger" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" +dependencies = [ + "humantime", + "is-terminal", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "errno" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +dependencies = [ + "errno-dragonfly", + "libc", + "winapi", +] + +[[package]] +name = "errno" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "fake-simd" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" + +[[package]] +name = "fallible-iterator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" + [[package]] name = "fastrand" version = "1.8.0" @@ -67,17 +424,70 @@ dependencies = [ "instant", ] +[[package]] +name = "file-per-thread-logger" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84f2e425d9790201ba4af4630191feac6dcc98765b118d4d18e91d23c2353866" +dependencies = [ + "env_logger", + "log", +] + +[[package]] +name = "generic-array" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" +dependencies = [ + "typenum", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + [[package]] name = "getrandom" version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", ] +[[package]] +name = "gimli" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcc8e0c9bce37868955864dbecd2b1ab2bdf967e6f28066d65aaac620444b65c" +dependencies = [ + "fallible-iterator", + "indexmap", + "stable_deref_trait", +] + +[[package]] +name = "gimli" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + [[package]] name = "hashbrown" version = "0.12.3" @@ -87,13 +497,95 @@ dependencies = [ "ahash", ] +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown", + "serde", +] + [[package]] name = "instant" version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi 0.3.1", + "libc", + "windows-sys", +] + +[[package]] +name = "is-terminal" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" +dependencies = [ + "hermit-abi 0.3.1", + "io-lifetimes", + "rustix", + "windows-sys", +] + +[[package]] +name = "itertools" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" +dependencies = [ + "either", ] [[package]] @@ -111,11 +603,38 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" +[[package]] +name = "jobserver" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +dependencies = [ + "libc", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "leb128" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" + [[package]] name = "libc" -version = "0.2.132" +version = "0.2.145" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc86cde3ff845662b8f4ef6cb50ea0e20c524eb3d29ae048287e06a1b3fa6a81" + +[[package]] +name = "linux-raw-sys" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "log" @@ -123,7 +642,16 @@ version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", +] + +[[package]] +name = "mach" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +dependencies = [ + "libc", ] [[package]] @@ -132,6 +660,39 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +[[package]] +name = "memoffset" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" +dependencies = [ + "autocfg", +] + +[[package]] +name = "memoffset" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +dependencies = [ + "autocfg", +] + +[[package]] +name = "miniz_oxide" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +dependencies = [ + "adler", +] + +[[package]] +name = "more-asserts" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" + [[package]] name = "nibble_vec" version = "0.1.0" @@ -141,12 +702,84 @@ dependencies = [ "smallvec", ] +[[package]] +name = "num_cpus" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +dependencies = [ + "hermit-abi 0.2.6", + "libc", +] + +[[package]] +name = "object" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cbca9424c482ee628fa549d9c812e2cd22f1180b9222c9200fdfa6eb31aecb2" + +[[package]] +name = "object" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5" +dependencies = [ + "crc32fast", + "indexmap", + "wasmparser 0.57.0", +] + +[[package]] +name = "object" +version = "0.30.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2f7254b99e31cad77da24b08ebf628882739a608578bb1bcdfc1f9c21260d7c0" +[[package]] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + [[package]] name = "proc-macro2" version = "1.0.43" @@ -173,7 +806,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7345d5f0e08c0536d7ac7229952590239e77abf0a0100a1b1d890add6ea96364" dependencies = [ "anyhow", - "itertools", + "itertools 0.10.3", "proc-macro2", "quote", "syn", @@ -240,6 +873,18 @@ dependencies = [ "log", ] +[[package]] +name = "proxy-wasm-test-framework" +version = "0.1.0" +dependencies = [ + "anyhow", + "lazy_static", + "more-asserts", + "rand", + "structopt", + "wasmtime", +] + [[package]] name = "quote" version = "1.0.21" @@ -250,22 +895,118 @@ dependencies = [ ] [[package]] -name = "radix_trie" -version = "0.2.1" +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha", + "rand_core", + "rand_hc", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core", +] + +[[package]] +name = "raw-cpuid" +version = "7.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "beb71f708fe39b2c5e98076204c3cc094ee5a4c12c4cdb119a2b72dc34164f41" +dependencies = [ + "bitflags", + "cc", + "rustc_version", +] + +[[package]] +name = "rayon" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "num_cpus", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ - "endian-type", - "nibble_vec", + "getrandom 0.2.7", + "redox_syscall", + "thiserror", ] [[package]] -name = "redox_syscall" -version = "0.2.16" +name = "regalloc" +version = "0.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +checksum = "3598bed0895fe0f72a9e0b00ef9e3a3c8af978a8401b2f2046dec5927de6364a" dependencies = [ - "bitflags", + "log", + "rustc-hash", + "smallvec", ] [[package]] @@ -285,6 +1026,18 @@ version = "0.6.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" +[[package]] +name = "region" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877e54ea2adcd70d80e9179344c97f93ef0dffd6b03e1f4529e6e83ab2fa9ae0" +dependencies = [ + "bitflags", + "libc", + "mach", + "winapi", +] + [[package]] name = "remove_dir_all" version = "0.5.3" @@ -294,12 +1047,88 @@ dependencies = [ "winapi", ] +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.37.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" +dependencies = [ + "bitflags", + "errno 0.3.1", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys", +] + [[package]] name = "ryu" version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "scroll" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fda28d4b4830b807a8b43f7b0e6b5df875311b3e7621d84577188c175b6ec1ec" +dependencies = [ + "scroll_derive", +] + +[[package]] +name = "scroll_derive" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aaaae8f38bb311444cfb7f1979af0bc9240d95795f75f9ceddf6a59b79ceffa0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + [[package]] name = "serde" version = "1.0.144" @@ -341,12 +1170,60 @@ dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" +dependencies = [ + "block-buffer", + "digest", + "fake-simd", + "opaque-debug", +] + [[package]] name = "smallvec" version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "strsim" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" + +[[package]] +name = "structopt" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c6b5c64445ba8094a6ab0c3cd2ad323e07171012d9c98b0b15651daf1787a10" +dependencies = [ + "clap", + "lazy_static", + "structopt-derive", +] + +[[package]] +name = "structopt-derive" +version = "0.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcb5ae327f9cc13b68763b5749770cb9e048a99bd9dfdfa58d0cf05d5f64afe0" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "syn" version = "1.0.99" @@ -358,13 +1235,19 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "target-lexicon" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab0e7238dcc7b40a7be719a25365910f6807bd864f4cce6b2e6b873658e2b19d" + [[package]] name = "tempfile" version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "fastrand", "libc", "redox_syscall", @@ -372,6 +1255,24 @@ dependencies = [ "winapi", ] +[[package]] +name = "termcolor" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +dependencies = [ + "unicode-width", +] + [[package]] name = "thiserror" version = "1.0.34" @@ -392,24 +1293,72 @@ dependencies = [ "syn", ] +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + [[package]] name = "unicode-ident" version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" +[[package]] +name = "unicode-segmentation" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" + +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + +[[package]] +name = "vec_map" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" + [[package]] name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasm-encoder" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18c41dbd92eaebf3612a39be316540b8377c871cb9bde6b064af962984912881" +dependencies = [ + "leb128", +] + [[package]] name = "wasm-shim" version = "0.1.0" @@ -420,6 +1369,7 @@ dependencies = [ "protobuf", "protoc-rust", "proxy-wasm", + "proxy-wasm-test-framework", "radix_trie", "regex", "serde", @@ -428,6 +1378,191 @@ dependencies = [ "thiserror", ] +[[package]] +name = "wasmparser" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32fddd575d477c6e9702484139cf9f23dcd554b06d185ed0f56c857dd3a47aa6" + +[[package]] +name = "wasmparser" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a950e6a618f62147fd514ff445b2a0b53120d382751960797f85f058c7eda9b9" + +[[package]] +name = "wasmtime" +version = "0.19.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=2482bd80c24a6b23ac1a259df77c61d5cc9c93a9#2482bd80c24a6b23ac1a259df77c61d5cc9c93a9" +dependencies = [ + "anyhow", + "backtrace", + "bincode", + "cfg-if 0.1.10", + "lazy_static", + "libc", + "log", + "region", + "rustc-demangle", + "serde", + "smallvec", + "target-lexicon", + "wasmparser 0.59.0", + "wasmtime-environ", + "wasmtime-jit", + "wasmtime-profiling", + "wasmtime-runtime", + "wat", + "winapi", +] + +[[package]] +name = "wasmtime-debug" +version = "0.19.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=2482bd80c24a6b23ac1a259df77c61d5cc9c93a9#2482bd80c24a6b23ac1a259df77c61d5cc9c93a9" +dependencies = [ + "anyhow", + "gimli 0.21.0", + "more-asserts", + "object 0.20.0", + "target-lexicon", + "thiserror", + "wasmparser 0.59.0", + "wasmtime-environ", +] + +[[package]] +name = "wasmtime-environ" +version = "0.19.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=2482bd80c24a6b23ac1a259df77c61d5cc9c93a9#2482bd80c24a6b23ac1a259df77c61d5cc9c93a9" +dependencies = [ + "anyhow", + "base64", + "bincode", + "cfg-if 0.1.10", + "cranelift-codegen", + "cranelift-entity", + "cranelift-frontend", + "cranelift-wasm", + "directories", + "errno 0.2.8", + "file-per-thread-logger", + "gimli 0.21.0", + "indexmap", + "libc", + "log", + "more-asserts", + "serde", + "sha2", + "thiserror", + "toml", + "wasmparser 0.59.0", + "winapi", + "zstd", +] + +[[package]] +name = "wasmtime-jit" +version = "0.19.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=2482bd80c24a6b23ac1a259df77c61d5cc9c93a9#2482bd80c24a6b23ac1a259df77c61d5cc9c93a9" +dependencies = [ + "anyhow", + "cfg-if 0.1.10", + "cranelift-codegen", + "cranelift-entity", + "cranelift-frontend", + "cranelift-native", + "cranelift-wasm", + "gimli 0.21.0", + "log", + "more-asserts", + "object 0.20.0", + "rayon", + "region", + "serde", + "target-lexicon", + "thiserror", + "wasmparser 0.59.0", + "wasmtime-debug", + "wasmtime-environ", + "wasmtime-obj", + "wasmtime-profiling", + "wasmtime-runtime", + "winapi", +] + +[[package]] +name = "wasmtime-obj" +version = "0.19.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=2482bd80c24a6b23ac1a259df77c61d5cc9c93a9#2482bd80c24a6b23ac1a259df77c61d5cc9c93a9" +dependencies = [ + "anyhow", + "more-asserts", + "object 0.20.0", + "target-lexicon", + "wasmtime-debug", + "wasmtime-environ", +] + +[[package]] +name = "wasmtime-profiling" +version = "0.19.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=2482bd80c24a6b23ac1a259df77c61d5cc9c93a9#2482bd80c24a6b23ac1a259df77c61d5cc9c93a9" +dependencies = [ + "anyhow", + "cfg-if 0.1.10", + "gimli 0.21.0", + "lazy_static", + "libc", + "object 0.19.0", + "scroll", + "serde", + "target-lexicon", + "wasmtime-environ", + "wasmtime-runtime", +] + +[[package]] +name = "wasmtime-runtime" +version = "0.19.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=2482bd80c24a6b23ac1a259df77c61d5cc9c93a9#2482bd80c24a6b23ac1a259df77c61d5cc9c93a9" +dependencies = [ + "backtrace", + "cc", + "cfg-if 0.1.10", + "indexmap", + "lazy_static", + "libc", + "log", + "memoffset 0.5.6", + "more-asserts", + "region", + "thiserror", + "wasmtime-environ", + "winapi", +] + +[[package]] +name = "wast" +version = "60.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd06cc744b536e30387e72a48fdd492105b9c938bb4f415c39c616a7a0a697ad" +dependencies = [ + "leb128", + "memchr", + "unicode-width", + "wasm-encoder", +] + +[[package]] +name = "wat" +version = "1.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5abe520f0ab205366e9ac7d3e6b2fc71de44e32a2b58f2ec871b6b575bdcea3b" +dependencies = [ + "wast", +] + [[package]] name = "which" version = "4.3.0" @@ -455,8 +1590,114 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + +[[package]] +name = "zstd" +version = "0.5.4+zstd.1.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69996ebdb1ba8b1517f61387a883857818a66c8a295f487b1ffd8fd9d2c82910" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "2.0.6+zstd.1.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98aa931fb69ecee256d44589d19754e61851ae4769bf963b385119b1cc37a49e" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "1.4.18+zstd.1.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1e6e8778706838f43f771d80d37787cb2fe06dafe89dd3aebaf6721b9eaec81" +dependencies = [ + "cc", + "glob", + "itertools 0.9.0", + "libc", +] diff --git a/Cargo.toml b/Cargo.toml index ca77b35..96436ec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,5 +26,8 @@ regex = "1" serde_regex = "1.1.0" radix_trie = "0.2.1" +[dev-dependencies] +proxy-wasm-test-framework = { path = "vendor-test/test-framework", version = "0.1.0" } + [build-dependencies] protoc-rust = "2.27" diff --git a/tests/rate_limited.rs b/tests/rate_limited.rs new file mode 100644 index 0000000..b6314d4 --- /dev/null +++ b/tests/rate_limited.rs @@ -0,0 +1,16 @@ +use proxy_wasm_test_framework::tester; +use proxy_wasm_test_framework::types::ReturnType; + +#[test] +fn it_works() { + let args = tester::MockSettings { + wasm_path: "target/wasm32-unknown-unknown/release/wasm_shim.wasm".to_string(), + quiet: false, + allow_unexpected: false, + }; + let mut hello_world_test = tester::mock(args)?; + + hello_world_test + .call_start() + .execute_and_expect(ReturnType::None)?; +} \ No newline at end of file diff --git a/vendor-test/test-framework b/vendor-test/test-framework new file mode 160000 index 0000000..3ce2442 --- /dev/null +++ b/vendor-test/test-framework @@ -0,0 +1 @@ +Subproject commit 3ce2442332f5e88010715f6317446913711a61af From 80abf8098887260b0704e4473559d3f3ffe7f43b Mon Sep 17 00:00:00 2001 From: Alex Snaps Date: Mon, 5 Jun 2023 13:17:04 -0400 Subject: [PATCH 02/14] remove test fw --- .gitmodules | 4 ---- vendor-test/test-framework | 1 - 2 files changed, 5 deletions(-) delete mode 160000 vendor-test/test-framework diff --git a/.gitmodules b/.gitmodules index 11b0fd7..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +0,0 @@ -[submodule "vendor-test/test-framework"] - path = vendor-test/test-framework - url = https://github.com/alexsnaps/test-framework.git - branch = kuadrant diff --git a/vendor-test/test-framework b/vendor-test/test-framework deleted file mode 160000 index 3ce2442..0000000 --- a/vendor-test/test-framework +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3ce2442332f5e88010715f6317446913711a61af From 3fdbc12e40d1438eaf23fd9de38b9dfc77cc284c Mon Sep 17 00:00:00 2001 From: Alex Snaps Date: Mon, 5 Jun 2023 13:26:21 -0400 Subject: [PATCH 03/14] WAT --- .gitmodules | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index e69de29..0000000 From c57b820d8554244be0d33d5f3b95060de9e9468f Mon Sep 17 00:00:00 2001 From: Alex Snaps Date: Tue, 13 Jun 2023 15:27:44 -0400 Subject: [PATCH 04/14] wip --- .gitignore | 1 + .gitmodules | 4 + Cargo.lock | 989 +++++++++++++++++++++++-------------- tests/rate_limited.rs | 57 ++- vendor-test/test-framework | 1 + 5 files changed, 684 insertions(+), 368 deletions(-) create mode 100644 .gitmodules create mode 160000 vendor-test/test-framework diff --git a/.gitignore b/.gitignore index db51f58..9496c60 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,6 @@ /src/envoy/* !/src/envoy/mod.rs .vscode/* +vendor-protobufs /bin diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..e777d9a --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "vendor-test/test-framework"] + path = vendor-test/test-framework + url = https://github.com/alexsnaps/test-framework.git + branch = kuadrant diff --git a/Cargo.lock b/Cargo.lock index 84cf0ba..cf0a0a8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,15 +8,9 @@ version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" dependencies = [ - "gimli 0.27.2", + "gimli", ] -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - [[package]] name = "ahash" version = "0.7.6" @@ -28,6 +22,17 @@ dependencies = [ "version_check", ] +[[package]] +name = "ahash" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", +] + [[package]] name = "aho-corasick" version = "0.7.19" @@ -52,6 +57,23 @@ version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9a8f622bcf6ff3df478e9deba3e03e4e04b300f8e6a139e192c05fa3490afc7" +[[package]] +name = "arbitrary" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2d098ff73c1ca148721f37baad5ea6a465a13f9573aba8641fbbbae8164a54e" + +[[package]] +name = "async-trait" +version = "0.1.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.18", +] + [[package]] name = "atty" version = "0.2.14" @@ -69,26 +91,11 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" -[[package]] -name = "backtrace" -version = "0.3.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" -dependencies = [ - "addr2line", - "cc", - "cfg-if 1.0.0", - "libc", - "miniz_oxide", - "object 0.30.3", - "rustc-demangle", -] - [[package]] name = "base64" -version = "0.12.3" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" [[package]] name = "bincode" @@ -106,31 +113,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] -name = "block-buffer" -version = "0.7.3" +name = "bitflags" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" -dependencies = [ - "block-padding", - "byte-tools", - "byteorder", - "generic-array", -] +checksum = "6776fc96284a0bb647b615056fc496d1fe1644a7ab01829818a6d91cae888b84" [[package]] -name = "block-padding" -version = "0.1.5" +name = "block-buffer" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "byte-tools", + "generic-array", ] [[package]] -name = "byte-tools" -version = "0.3.1" +name = "bumpalo" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" [[package]] name = "byteorder" @@ -153,12 +154,6 @@ dependencies = [ "jobserver", ] -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -173,66 +168,99 @@ checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" dependencies = [ "ansi_term", "atty", - "bitflags", + "bitflags 1.3.2", "strsim", "textwrap", "unicode-width", "vec_map", ] +[[package]] +name = "cpp_demangle" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eeaa953eaad386a53111e47172c2fedba671e5684c8dd601a5f474f4f118710f" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "cpufeatures" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" +dependencies = [ + "libc", +] + [[package]] name = "cranelift-bforest" -version = "0.66.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=2482bd80c24a6b23ac1a259df77c61d5cc9c93a9#2482bd80c24a6b23ac1a259df77c61d5cc9c93a9" +version = "0.96.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c064a534a914eb6709d198525321a386dad50627aecfaf64053f369993a3e5a" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.66.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=2482bd80c24a6b23ac1a259df77c61d5cc9c93a9#2482bd80c24a6b23ac1a259df77c61d5cc9c93a9" +version = "0.96.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "619ed4d24acef0bd58b16a1be39077c0b36c65782e6c933892439af5e799110e" dependencies = [ - "byteorder", + "bumpalo", "cranelift-bforest", "cranelift-codegen-meta", "cranelift-codegen-shared", + "cranelift-control", "cranelift-entity", - "gimli 0.21.0", + "cranelift-isle", + "gimli", + "hashbrown 0.13.2", "log", - "regalloc", - "serde", + "regalloc2", "smallvec", "target-lexicon", - "thiserror", ] [[package]] name = "cranelift-codegen-meta" -version = "0.66.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=2482bd80c24a6b23ac1a259df77c61d5cc9c93a9#2482bd80c24a6b23ac1a259df77c61d5cc9c93a9" +version = "0.96.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c777ce22678ae1869f990b2f31e0cd7ca109049213bfc0baf3e2205a18b21ebb" dependencies = [ "cranelift-codegen-shared", - "cranelift-entity", ] [[package]] name = "cranelift-codegen-shared" -version = "0.66.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=2482bd80c24a6b23ac1a259df77c61d5cc9c93a9#2482bd80c24a6b23ac1a259df77c61d5cc9c93a9" +version = "0.96.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb65884d17a1fa55990dd851c43c140afb4c06c3312cf42cfa1222c3b23f9561" + +[[package]] +name = "cranelift-control" +version = "0.96.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a0cea8abc90934d0a7ee189a29fd35fecd5c40f59ae7e6aab1805e8ab1a535e" +dependencies = [ + "arbitrary", +] [[package]] name = "cranelift-entity" -version = "0.66.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=2482bd80c24a6b23ac1a259df77c61d5cc9c93a9#2482bd80c24a6b23ac1a259df77c61d5cc9c93a9" +version = "0.96.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2e50bebc05f2401a1320169314b62f91ad811ef20163cac00151d78e0684d4c" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.66.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=2482bd80c24a6b23ac1a259df77c61d5cc9c93a9#2482bd80c24a6b23ac1a259df77c61d5cc9c93a9" +version = "0.96.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b82ccfe704d53f669791399d417928410785132d809ec46f5e2ce069e9d17c8" dependencies = [ "cranelift-codegen", "log", @@ -240,28 +268,37 @@ dependencies = [ "target-lexicon", ] +[[package]] +name = "cranelift-isle" +version = "0.96.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2515d8e7836f9198b160b2c80aaa1f586d7749d57d6065af86223fb65b7e2c3" + [[package]] name = "cranelift-native" -version = "0.66.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=2482bd80c24a6b23ac1a259df77c61d5cc9c93a9#2482bd80c24a6b23ac1a259df77c61d5cc9c93a9" +version = "0.96.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcb47ffdcdac7e9fed6e4a618939773a4dc4a412fa7da9e701ae667431a10af3" dependencies = [ "cranelift-codegen", - "raw-cpuid", + "libc", "target-lexicon", ] [[package]] name = "cranelift-wasm" -version = "0.66.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=2482bd80c24a6b23ac1a259df77c61d5cc9c93a9#2482bd80c24a6b23ac1a259df77c61d5cc9c93a9" +version = "0.96.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "852390f92c3eaa457e42be44d174ff5abbbcd10062d5963bda8ffb2505e73a71" dependencies = [ "cranelift-codegen", "cranelift-entity", "cranelift-frontend", + "itertools", "log", - "serde", - "thiserror", - "wasmparser 0.59.0", + "smallvec", + "wasmparser", + "wasmtime-types", ] [[package]] @@ -270,7 +307,7 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -279,7 +316,7 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", ] @@ -289,7 +326,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] @@ -301,9 +338,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46bd5f3f85273295a9d14aedfb86f6aadbff6d8f5295c4a9edb08e819dcf5695" dependencies = [ "autocfg", - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", - "memoffset 0.8.0", + "memoffset", "scopeguard", ] @@ -313,33 +350,53 @@ version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] -name = "digest" -version = "0.8.1" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array", + "typenum", +] + +[[package]] +name = "debugid" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" +dependencies = [ + "uuid", ] [[package]] -name = "directories" -version = "2.0.2" +name = "digest" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "551a778172a450d7fc12e629ca3b0428d00f6afa9a43da1b630d54604e97371c" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "cfg-if 0.1.10", - "dirs-sys", + "block-buffer", + "crypto-common", ] [[package]] -name = "dirs-sys" -version = "0.3.7" +name = "directories-next" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" dependencies = [ "libc", "redox_users", @@ -371,17 +428,6 @@ dependencies = [ "termcolor", ] -[[package]] -name = "errno" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" -dependencies = [ - "errno-dragonfly", - "libc", - "winapi", -] - [[package]] name = "errno" version = "0.3.1" @@ -403,12 +449,6 @@ dependencies = [ "libc", ] -[[package]] -name = "fake-simd" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" - [[package]] name = "fallible-iterator" version = "0.2.0" @@ -434,13 +474,45 @@ dependencies = [ "log", ] +[[package]] +name = "form_urlencoded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "fxprof-processed-profile" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27d12c0aed7f1e24276a241aadc4cb8ea9f83000f34bc062b7cc2d51e3b0fabd" +dependencies = [ + "bitflags 2.3.1", + "debugid", + "fxhash", + "serde", + "serde_json", +] + [[package]] name = "generic-array" -version = "0.12.4" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", + "version_check", ] [[package]] @@ -449,7 +521,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi 0.9.0+wasi-snapshot-preview1", ] @@ -460,16 +532,16 @@ version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi 0.11.0+wasi-snapshot-preview1", ] [[package]] name = "gimli" -version = "0.21.0" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc8e0c9bce37868955864dbecd2b1ab2bdf967e6f28066d65aaac620444b65c" +checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" dependencies = [ "fallible-iterator", "indexmap", @@ -477,24 +549,21 @@ dependencies = [ ] [[package]] -name = "gimli" -version = "0.27.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" - -[[package]] -name = "glob" -version = "0.3.1" +name = "hashbrown" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash 0.7.6", +] [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash", + "ahash 0.8.3", ] [[package]] @@ -506,6 +575,12 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + [[package]] name = "hermit-abi" version = "0.1.19" @@ -536,6 +611,22 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" +[[package]] +name = "id-arena" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" + +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "indexmap" version = "1.9.3" @@ -543,7 +634,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", "serde", ] @@ -553,7 +644,7 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -579,15 +670,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "itertools" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.10.3" @@ -603,6 +685,26 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" +[[package]] +name = "ittapi" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e648c437172ce7d3ac35ca11a068755072054826fa455a916b43524fa4a62a7" +dependencies = [ + "anyhow", + "ittapi-sys", + "log", +] + +[[package]] +name = "ittapi-sys" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9b32a4d23f72548178dde54f3c12c6b6a08598e25575c0d0fa5bd861e0dc1a5" +dependencies = [ + "cc", +] + [[package]] name = "jobserver" version = "0.1.26" @@ -642,7 +744,7 @@ version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -661,12 +763,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] -name = "memoffset" -version = "0.5.6" +name = "memfd" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" +checksum = "ffc89ccdc6e10d6907450f753537ebc5c5d3460d2e4e62ea74bd571db62c0f9e" dependencies = [ - "autocfg", + "rustix", ] [[package]] @@ -678,15 +780,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "miniz_oxide" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" -dependencies = [ - "adler", -] - [[package]] name = "more-asserts" version = "0.2.2" @@ -712,29 +805,15 @@ dependencies = [ "libc", ] -[[package]] -name = "object" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cbca9424c482ee628fa549d9c812e2cd22f1180b9222c9200fdfa6eb31aecb2" - -[[package]] -name = "object" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5" -dependencies = [ - "crc32fast", - "indexmap", - "wasmparser 0.57.0", -] - [[package]] name = "object" version = "0.30.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" dependencies = [ + "crc32fast", + "hashbrown 0.13.2", + "indexmap", "memchr", ] @@ -745,10 +824,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2f7254b99e31cad77da24b08ebf628882739a608578bb1bcdfc1f9c21260d7c0" [[package]] -name = "opaque-debug" -version = "0.2.3" +name = "paste" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" +checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" + +[[package]] +name = "percent-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" + +[[package]] +name = "pkg-config" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "ppv-lite86" @@ -765,7 +856,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.99", "version_check", ] @@ -782,9 +873,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.43" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" +checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b" dependencies = [ "unicode-ident", ] @@ -806,10 +897,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7345d5f0e08c0536d7ac7229952590239e77abf0a0100a1b1d890add6ea96364" dependencies = [ "anyhow", - "itertools 0.10.3", + "itertools", "proc-macro2", "quote", - "syn", + "syn 1.0.99", ] [[package]] @@ -869,7 +960,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3927081c2674366adadef4d5c5d34c4d849ab764a17bfe4ff2bd04436efb593d" dependencies = [ - "hashbrown", + "hashbrown 0.12.3", "log", ] @@ -880,16 +971,36 @@ dependencies = [ "anyhow", "lazy_static", "more-asserts", - "rand", + "rand 0.7.3", "structopt", "wasmtime", ] +[[package]] +name = "psm" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +dependencies = [ + "cc", +] + +[[package]] +name = "pulldown-cmark" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffade02495f22453cd593159ea2f59827aae7f53fa8323f756799b670881dcf8" +dependencies = [ + "bitflags 1.3.2", + "memchr", + "unicase", +] + [[package]] name = "quote" -version = "1.0.21" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" dependencies = [ "proc-macro2", ] @@ -912,11 +1023,22 @@ checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ "getrandom 0.1.16", "libc", - "rand_chacha", - "rand_core", + "rand_chacha 0.2.2", + "rand_core 0.5.1", "rand_hc", ] +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + [[package]] name = "rand_chacha" version = "0.2.2" @@ -924,7 +1046,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", ] [[package]] @@ -937,23 +1069,21 @@ dependencies = [ ] [[package]] -name = "rand_hc" -version = "0.2.0" +name = "rand_core" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "rand_core", + "getrandom 0.2.7", ] [[package]] -name = "raw-cpuid" -version = "7.0.4" +name = "rand_hc" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "beb71f708fe39b2c5e98076204c3cc094ee5a4c12c4cdb119a2b72dc34164f41" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" dependencies = [ - "bitflags", - "cc", - "rustc_version", + "rand_core 0.5.1", ] [[package]] @@ -984,7 +1114,7 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -999,13 +1129,15 @@ dependencies = [ ] [[package]] -name = "regalloc" -version = "0.0.28" +name = "regalloc2" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3598bed0895fe0f72a9e0b00ef9e3a3c8af978a8401b2f2046dec5927de6364a" +checksum = "d4a52e724646c6c0800fc456ec43b4165d2f91fba88ceaca06d9e0b400023478" dependencies = [ + "hashbrown 0.13.2", "log", "rustc-hash", + "slice-group-by", "smallvec", ] @@ -1026,18 +1158,6 @@ version = "0.6.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" -[[package]] -name = "region" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877e54ea2adcd70d80e9179344c97f93ef0dffd6b03e1f4529e6e83ab2fa9ae0" -dependencies = [ - "bitflags", - "libc", - "mach", - "winapi", -] - [[package]] name = "remove_dir_all" version = "0.5.3" @@ -1059,23 +1179,14 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver", -] - [[package]] name = "rustix" version = "0.37.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" dependencies = [ - "bitflags", - "errno 0.3.1", + "bitflags 1.3.2", + "errno", "io-lifetimes", "libc", "linux-raw-sys", @@ -1094,41 +1205,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" -[[package]] -name = "scroll" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda28d4b4830b807a8b43f7b0e6b5df875311b3e7621d84577188c175b6ec1ec" -dependencies = [ - "scroll_derive", -] - -[[package]] -name = "scroll_derive" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaaae8f38bb311444cfb7f1979af0bc9240d95795f75f9ceddf6a59b79ceffa0" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - [[package]] name = "serde" version = "1.0.144" @@ -1146,7 +1222,7 @@ checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.99", ] [[package]] @@ -1172,16 +1248,21 @@ dependencies = [ [[package]] name = "sha2" -version = "0.8.2" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ - "block-buffer", + "cfg-if", + "cpufeatures", "digest", - "fake-simd", - "opaque-debug", ] +[[package]] +name = "slice-group-by" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" + [[package]] name = "smallvec" version = "1.9.0" @@ -1217,11 +1298,11 @@ version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcb5ae327f9cc13b68763b5749770cb9e048a99bd9dfdfa58d0cf05d5f64afe0" dependencies = [ - "heck", + "heck 0.3.3", "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.99", ] [[package]] @@ -1235,11 +1316,22 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "target-lexicon" -version = "0.10.0" +version = "0.12.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab0e7238dcc7b40a7be719a25365910f6807bd864f4cce6b2e6b873658e2b19d" +checksum = "fd1ba337640d60c3e96bc6f0638a939b9c9a7f2c316a1598c279828b3d1dc8c5" [[package]] name = "tempfile" @@ -1247,7 +1339,7 @@ version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "fastrand", "libc", "redox_syscall", @@ -1290,9 +1382,24 @@ checksum = "e8f2591983642de85c921015f3f070c665a197ed69e417af436115e3a1407487" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.99", ] +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + [[package]] name = "toml" version = "0.5.11" @@ -1308,12 +1415,36 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +[[package]] +name = "unicase" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +dependencies = [ + "version_check", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + [[package]] name = "unicode-ident" version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + [[package]] name = "unicode-segmentation" version = "1.10.1" @@ -1326,6 +1457,29 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "url" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "uuid" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "345444e32442451b267fc254ae85a209c64be56d2890e601a0c37ff0c3c5ecd2" + [[package]] name = "vec_map" version = "0.8.2" @@ -1380,166 +1534,263 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.57.0" +version = "0.103.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32fddd575d477c6e9702484139cf9f23dcd554b06d185ed0f56c857dd3a47aa6" - -[[package]] -name = "wasmparser" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a950e6a618f62147fd514ff445b2a0b53120d382751960797f85f058c7eda9b9" +checksum = "2c437373cac5ea84f1113d648d51f71751ffbe3d90c00ae67618cf20d0b5ee7b" +dependencies = [ + "indexmap", + "url", +] [[package]] name = "wasmtime" -version = "0.19.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=2482bd80c24a6b23ac1a259df77c61d5cc9c93a9#2482bd80c24a6b23ac1a259df77c61d5cc9c93a9" +version = "9.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa0f72886c3264eb639f50188d1eb98b975564130292fea8deb4facf91ca7258" dependencies = [ "anyhow", - "backtrace", + "async-trait", "bincode", - "cfg-if 0.1.10", - "lazy_static", + "bumpalo", + "cfg-if", + "fxprof-processed-profile", + "indexmap", "libc", "log", - "region", - "rustc-demangle", + "object", + "once_cell", + "paste", + "psm", + "rayon", "serde", - "smallvec", + "serde_json", "target-lexicon", - "wasmparser 0.59.0", + "wasmparser", + "wasmtime-cache", + "wasmtime-component-macro", + "wasmtime-cranelift", "wasmtime-environ", + "wasmtime-fiber", "wasmtime-jit", - "wasmtime-profiling", "wasmtime-runtime", "wat", - "winapi", + "windows-sys", ] [[package]] -name = "wasmtime-debug" -version = "0.19.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=2482bd80c24a6b23ac1a259df77c61d5cc9c93a9#2482bd80c24a6b23ac1a259df77c61d5cc9c93a9" +name = "wasmtime-asm-macros" +version = "9.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a18391ed41ca957eecdbe64c51879b75419cbc52e2d8663fe82945b28b4f19da" dependencies = [ - "anyhow", - "gimli 0.21.0", - "more-asserts", - "object 0.20.0", - "target-lexicon", - "thiserror", - "wasmparser 0.59.0", - "wasmtime-environ", + "cfg-if", ] [[package]] -name = "wasmtime-environ" -version = "0.19.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=2482bd80c24a6b23ac1a259df77c61d5cc9c93a9#2482bd80c24a6b23ac1a259df77c61d5cc9c93a9" +name = "wasmtime-cache" +version = "9.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfd5ef82889a6a35b3790025b3fd33e6ee4902a5408c09f716c771a38c47cd10" dependencies = [ "anyhow", "base64", "bincode", - "cfg-if 0.1.10", - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", - "cranelift-wasm", - "directories", - "errno 0.2.8", + "directories-next", "file-per-thread-logger", - "gimli 0.21.0", - "indexmap", - "libc", "log", - "more-asserts", + "rustix", "serde", "sha2", - "thiserror", "toml", - "wasmparser 0.59.0", - "winapi", + "windows-sys", "zstd", ] [[package]] -name = "wasmtime-jit" -version = "0.19.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=2482bd80c24a6b23ac1a259df77c61d5cc9c93a9#2482bd80c24a6b23ac1a259df77c61d5cc9c93a9" +name = "wasmtime-component-macro" +version = "9.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b31baf908d484e93b18fd31f47af5072aa812d3af5ee4d8323295b48240a9ada" +dependencies = [ + "anyhow", + "proc-macro2", + "quote", + "syn 1.0.99", + "wasmtime-component-util", + "wasmtime-wit-bindgen", + "wit-parser", +] + +[[package]] +name = "wasmtime-component-util" +version = "9.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daff76cac73c9a1bd0bc201d5304e20dc0724b2c34c029b0c91e10e44c1f47a1" + +[[package]] +name = "wasmtime-cranelift" +version = "9.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2495036d05eb1e79ecf22e092eeacd279dcf24b4fcab77fb4cf8ef9bd42c3ea" dependencies = [ "anyhow", - "cfg-if 0.1.10", "cranelift-codegen", + "cranelift-control", "cranelift-entity", "cranelift-frontend", "cranelift-native", "cranelift-wasm", - "gimli 0.21.0", + "gimli", "log", - "more-asserts", - "object 0.20.0", - "rayon", - "region", - "serde", + "object", "target-lexicon", "thiserror", - "wasmparser 0.59.0", - "wasmtime-debug", + "wasmparser", + "wasmtime-cranelift-shared", "wasmtime-environ", - "wasmtime-obj", - "wasmtime-profiling", - "wasmtime-runtime", - "winapi", ] [[package]] -name = "wasmtime-obj" -version = "0.19.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=2482bd80c24a6b23ac1a259df77c61d5cc9c93a9#2482bd80c24a6b23ac1a259df77c61d5cc9c93a9" +name = "wasmtime-cranelift-shared" +version = "9.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef677f7b0d3f3b73275675486d791f1e85e7c24afe8dd367c6b9950028906330" dependencies = [ "anyhow", - "more-asserts", - "object 0.20.0", + "cranelift-codegen", + "cranelift-control", + "cranelift-native", + "gimli", + "object", "target-lexicon", - "wasmtime-debug", "wasmtime-environ", ] [[package]] -name = "wasmtime-profiling" -version = "0.19.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=2482bd80c24a6b23ac1a259df77c61d5cc9c93a9#2482bd80c24a6b23ac1a259df77c61d5cc9c93a9" +name = "wasmtime-environ" +version = "9.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d03356374ffafa881c5f972529d2bb11ce48fe2736285e2b0ad72c6d554257b" dependencies = [ "anyhow", - "cfg-if 0.1.10", - "gimli 0.21.0", - "lazy_static", - "libc", - "object 0.19.0", - "scroll", + "cranelift-entity", + "gimli", + "indexmap", + "log", + "object", + "serde", + "target-lexicon", + "thiserror", + "wasmparser", + "wasmtime-types", +] + +[[package]] +name = "wasmtime-fiber" +version = "9.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ecb992732d5fc99c14e3752f6b9110ec5ace88da15d843f2b80f2b789b182ea" +dependencies = [ + "cc", + "cfg-if", + "rustix", + "wasmtime-asm-macros", + "windows-sys", +] + +[[package]] +name = "wasmtime-jit" +version = "9.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5374f0d2ee0069391dd9348f148802846b2b3e0af650385f9c56b3012d3c5d1" +dependencies = [ + "addr2line", + "anyhow", + "bincode", + "cfg-if", + "cpp_demangle", + "gimli", + "ittapi", + "log", + "object", + "rustc-demangle", "serde", "target-lexicon", "wasmtime-environ", + "wasmtime-jit-debug", + "wasmtime-jit-icache-coherence", "wasmtime-runtime", + "windows-sys", +] + +[[package]] +name = "wasmtime-jit-debug" +version = "9.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "102653b177225bfdd2da41cc385965d4bf6bc10cf14ec7b306bc9b015fb01c22" +dependencies = [ + "object", + "once_cell", + "rustix", +] + +[[package]] +name = "wasmtime-jit-icache-coherence" +version = "9.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "374ff63b3eb41db57c56682a9ef7737d2c9efa801f5dbf9da93941c9dd436a06" +dependencies = [ + "cfg-if", + "libc", + "windows-sys", ] [[package]] name = "wasmtime-runtime" -version = "0.19.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=2482bd80c24a6b23ac1a259df77c61d5cc9c93a9#2482bd80c24a6b23ac1a259df77c61d5cc9c93a9" +version = "9.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b1b832f19099066ebd26e683121d331f12cf98f158eac0f889972854413b46f" dependencies = [ - "backtrace", + "anyhow", "cc", - "cfg-if 0.1.10", + "cfg-if", "indexmap", - "lazy_static", "libc", "log", - "memoffset 0.5.6", - "more-asserts", - "region", - "thiserror", + "mach", + "memfd", + "memoffset", + "paste", + "rand 0.8.5", + "rustix", + "wasmtime-asm-macros", "wasmtime-environ", - "winapi", + "wasmtime-fiber", + "wasmtime-jit-debug", + "windows-sys", +] + +[[package]] +name = "wasmtime-types" +version = "9.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c574221440e05bbb04efa09786d049401be2eb10081ecf43eb72fbd637bd12f" +dependencies = [ + "cranelift-entity", + "serde", + "thiserror", + "wasmparser", +] + +[[package]] +name = "wasmtime-wit-bindgen" +version = "9.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5afee5e7c290e9b32280160226dadbb5e1a4d6ba7c9b79f440b70cc790aabc1e" +dependencies = [ + "anyhow", + "heck 0.4.1", + "wit-parser", ] [[package]] @@ -1671,20 +1922,35 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +[[package]] +name = "wit-parser" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca2581061573ef6d1754983d7a9b3ed5871ef859d52708ea9a0f5af32919172" +dependencies = [ + "anyhow", + "id-arena", + "indexmap", + "log", + "pulldown-cmark", + "unicode-xid", + "url", +] + [[package]] name = "zstd" -version = "0.5.4+zstd.1.4.7" +version = "0.11.2+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69996ebdb1ba8b1517f61387a883857818a66c8a295f487b1ffd8fd9d2c82910" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "2.0.6+zstd.1.4.7" +version = "5.0.2+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98aa931fb69ecee256d44589d19754e61851ae4769bf963b385119b1cc37a49e" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" dependencies = [ "libc", "zstd-sys", @@ -1692,12 +1958,11 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "1.4.18+zstd.1.4.7" +version = "2.0.8+zstd.1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e6e8778706838f43f771d80d37787cb2fe06dafe89dd3aebaf6721b9eaec81" +checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" dependencies = [ "cc", - "glob", - "itertools 0.9.0", "libc", + "pkg-config", ] diff --git a/tests/rate_limited.rs b/tests/rate_limited.rs index b6314d4..2ed7795 100644 --- a/tests/rate_limited.rs +++ b/tests/rate_limited.rs @@ -1,16 +1,61 @@ use proxy_wasm_test_framework::tester; -use proxy_wasm_test_framework::types::ReturnType; +use proxy_wasm_test_framework::types::{Action, BufferType, LogLevel, MapType, ReturnType}; #[test] -fn it_works() { +fn it_loads() { let args = tester::MockSettings { wasm_path: "target/wasm32-unknown-unknown/release/wasm_shim.wasm".to_string(), quiet: false, allow_unexpected: false, }; - let mut hello_world_test = tester::mock(args)?; + let mut module = tester::mock(args).unwrap(); - hello_world_test + module .call_start() - .execute_and_expect(ReturnType::None)?; -} \ No newline at end of file + .execute_and_expect(ReturnType::None) + .unwrap(); + + let root_context = 1; + let cfg = r#"{ + "failure_mode_deny": true, + "rate_limit_policies": [] + }"#; + + module + .call_proxy_on_context_create(root_context, 0) + .expect_log(Some(LogLevel::Info), Some("set_root_context #1")) + .execute_and_expect(ReturnType::None) + .unwrap(); + module + .call_proxy_on_configure(root_context, 0) + .expect_log(Some(LogLevel::Info), Some("on_configure #1")) + .expect_get_buffer_bytes(Some(BufferType::PluginConfiguration)) + .returning(Some(cfg)) + .expect_log(Some(LogLevel::Info), Some("plugin config parsed: PluginConfiguration { rate_limit_policies: [], failure_mode_deny: true }")) + .execute_and_expect(ReturnType::Bool(true)) + .unwrap(); + + let http_context = 2; + module + .call_proxy_on_context_create(http_context, root_context) + .expect_log(Some(LogLevel::Info), Some("create_http_context #2")) + .execute_and_expect(ReturnType::None) + .unwrap(); + + module + .call_proxy_on_request_headers(http_context, 0, false) + .expect_log(Some(LogLevel::Info), Some("on_http_request_headers #2")) + .expect_get_header_map_value(Some(MapType::HttpRequestHeaders), Some(":authority")) + .returning(None) + .expect_log( + Some(LogLevel::Info), + Some("context #2: Allowing request to pass because zero descriptors generated"), + ) + .execute_and_expect(ReturnType::Action(Action::Continue)) + .unwrap(); + + module + .call_proxy_on_response_headers(http_context, 0, false) + .execute_and_expect(ReturnType::Action(Action::Continue)) + .unwrap(); +} diff --git a/vendor-test/test-framework b/vendor-test/test-framework new file mode 160000 index 0000000..fdc37f6 --- /dev/null +++ b/vendor-test/test-framework @@ -0,0 +1 @@ +Subproject commit fdc37f6c8ef93493f57c803c2708670c5dbef1a8 From 08e9b26d0ecd541820fdcfed5b260a819d2f96f8 Mon Sep 17 00:00:00 2001 From: Alex Snaps Date: Wed, 14 Jun 2023 14:17:36 -0400 Subject: [PATCH 05/14] Passes most of the time? --- Cargo.toml | 1 + build.rs | 35 +----- src/envoy/mod.rs | 1 + src/lib.rs | 25 ++++ tests/rate_limited.rs | 226 ++++++++++++++++++++++++++++++++++++- vendor-test/test-framework | 2 +- 6 files changed, 254 insertions(+), 36 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 96436ec..cec76e8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,6 +28,7 @@ radix_trie = "0.2.1" [dev-dependencies] proxy-wasm-test-framework = { path = "vendor-test/test-framework", version = "0.1.0" } +protoc-rust = "2.27" [build-dependencies] protoc-rust = "2.27" diff --git a/build.rs b/build.rs index bd0a966..597c24b 100644 --- a/build.rs +++ b/build.rs @@ -10,41 +10,10 @@ fn generate_protobuf() -> Result<(), Box> { ..Default::default() }; protoc_rust::Codegen::new() + .protoc_path("bin/protoc") .out_dir("src/envoy") .customize(custom) - .inputs([ - "vendor-protobufs/data-plane-api/envoy/service/auth/v3/external_auth.proto", - "vendor-protobufs/data-plane-api/envoy/service/ratelimit/v3/rls.proto", - "vendor-protobufs/data-plane-api/envoy/service/auth/v3/attribute_context.proto", - "vendor-protobufs/data-plane-api/envoy/config/core/v3/address.proto", - "vendor-protobufs/googleapis/google/protobuf/timestamp.proto", - "vendor-protobufs/data-plane-api/envoy/config/core/v3/base.proto", - "vendor-protobufs/data-plane-api/envoy/config/core/v3/socket_option.proto", - "vendor-protobufs/data-plane-api/envoy/config/core/v3/http_uri.proto", - "vendor-protobufs/data-plane-api/envoy/config/core/v3/backoff.proto", - "vendor-protobufs/data-plane-api/envoy/type/v3/http_status.proto", - "vendor-protobufs/data-plane-api/envoy/type/v3/semantic_version.proto", - "vendor-protobufs/data-plane-api/envoy/type/v3/percent.proto", - "vendor-protobufs/udpa/xds/core/v3/context_params.proto", - "vendor-protobufs/googleapis/google/rpc/status.proto", - "vendor-protobufs/data-plane-api/envoy/config/route/v3/route_components.proto", - "vendor-protobufs/data-plane-api/envoy/extensions/common/ratelimit/v3/ratelimit.proto", - "vendor-protobufs/data-plane-api/envoy/type/v3/ratelimit_unit.proto", - "vendor-protobufs/data-plane-api/envoy/type/v3/range.proto", - "vendor-protobufs/data-plane-api/envoy/type/v3/token_bucket.proto", - "vendor-protobufs/data-plane-api/envoy/config/common/matcher/v3/matcher.proto", - "vendor-protobufs/data-plane-api/envoy/config/core/v3/extension.proto", - "vendor-protobufs/data-plane-api/envoy/type/matcher/v3/string.proto", - "vendor-protobufs/data-plane-api/envoy/type/matcher/v3/number.proto", - "vendor-protobufs/data-plane-api/envoy/type/matcher/v3/regex.proto", - "vendor-protobufs/data-plane-api/envoy/type/matcher/v3/metadata.proto", - "vendor-protobufs/data-plane-api/envoy/type/matcher/v3/value.proto", - "vendor-protobufs/data-plane-api/envoy/config/core/v3/config_source.proto", - "vendor-protobufs/data-plane-api/envoy/config/core/v3/grpc_service.proto", - "vendor-protobufs/data-plane-api/envoy/config/core/v3/proxy_protocol.proto", - "vendor-protobufs/udpa/xds/core/v3/authority.proto", - "vendor-protobufs/data-plane-api/envoy/type/tracing/v3/custom_tag.proto", - ]) + .inputs(["vendor-protobufs/data-plane-api/envoy/service/ratelimit/v3/rls.proto"]) .includes([ "vendor-protobufs/data-plane-api/", "vendor-protobufs/protoc-gen-validate/", diff --git a/src/envoy/mod.rs b/src/envoy/mod.rs index 4377652..7be7ea5 100644 --- a/src/envoy/mod.rs +++ b/src/envoy/mod.rs @@ -39,6 +39,7 @@ pub use { AttributeContext, AttributeContext_HttpRequest, AttributeContext_Peer, AttributeContext_Request, }, + base::HeaderValue, base::Metadata, external_auth::{CheckRequest, CheckResponse}, ratelimit::{RateLimitDescriptor, RateLimitDescriptor_Entry}, diff --git a/src/lib.rs b/src/lib.rs index b949b4b..3e6648b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,3 +4,28 @@ mod filter; mod glob; mod policy_index; mod utils; + +#[cfg(test)] +mod tests { + use crate::envoy::{HeaderValue, RateLimitResponse, RateLimitResponse_Code}; + use protobuf::Message; + + #[test] + fn grpc() { + let mut resp = RateLimitResponse::new(); + resp.overall_code = RateLimitResponse_Code::OK; + resp.response_headers_to_add + .push(header("test", "some value")); + resp.response_headers_to_add + .push(header("other", "header value")); + let buffer = resp.write_to_bytes().unwrap(); + // assert_eq!(b"", buffer.as_slice()) + } + + fn header(key: &str, value: &str) -> HeaderValue { + let mut header = HeaderValue::new(); + header.key = key.to_string(); + header.value = value.to_string(); + header + } +} diff --git a/tests/rate_limited.rs b/tests/rate_limited.rs index 2ed7795..47accb7 100644 --- a/tests/rate_limited.rs +++ b/tests/rate_limited.rs @@ -30,7 +30,7 @@ fn it_loads() { .call_proxy_on_configure(root_context, 0) .expect_log(Some(LogLevel::Info), Some("on_configure #1")) .expect_get_buffer_bytes(Some(BufferType::PluginConfiguration)) - .returning(Some(cfg)) + .returning(Some(cfg.as_bytes())) .expect_log(Some(LogLevel::Info), Some("plugin config parsed: PluginConfiguration { rate_limit_policies: [], failure_mode_deny: true }")) .execute_and_expect(ReturnType::Bool(true)) .unwrap(); @@ -46,7 +46,7 @@ fn it_loads() { .call_proxy_on_request_headers(http_context, 0, false) .expect_log(Some(LogLevel::Info), Some("on_http_request_headers #2")) .expect_get_header_map_value(Some(MapType::HttpRequestHeaders), Some(":authority")) - .returning(None) + .returning(Some("cars.toystore.com")) .expect_log( Some(LogLevel::Info), Some("context #2: Allowing request to pass because zero descriptors generated"), @@ -59,3 +59,225 @@ fn it_loads() { .execute_and_expect(ReturnType::Action(Action::Continue)) .unwrap(); } + +#[test] +fn it_limits() { + let args = tester::MockSettings { + wasm_path: "target/wasm32-unknown-unknown/release/wasm_shim.wasm".to_string(), + quiet: false, + allow_unexpected: false, + }; + let mut module = tester::mock(args).unwrap(); + + module + .call_start() + .execute_and_expect(ReturnType::None) + .unwrap(); + + let root_context = 1; + let cfg = r#"{ + "failure_mode_deny": true, + "rate_limit_policies": [ + { + "name": "some-name", + "rate_limit_domain": "RLS-domain", + "upstream_cluster": "limitador-cluster", + "hostnames": ["*.toystore.com", "example.com"], + "gateway_actions": [ + { + "rules": [ + { + "paths": ["/admin/toy"], + "hosts": ["cars.toystore.com"], + "methods": ["POST"] + }], + "configurations": [ + { + "actions": [ + { + "generic_key": { + "descriptor_key": "admin", + "descriptor_value": "1" + } + } + ] + } + ] + } + ] + } + ] + }"#; + + module + .call_proxy_on_context_create(root_context, 0) + .expect_log(Some(LogLevel::Info), Some("set_root_context #1")) + .execute_and_expect(ReturnType::None) + .unwrap(); + module + .call_proxy_on_configure(root_context, 0) + .expect_log(Some(LogLevel::Info), Some("on_configure #1")) + .expect_get_buffer_bytes(Some(BufferType::PluginConfiguration)) + .returning(Some(cfg.as_bytes())) + .expect_log(Some(LogLevel::Info), Some("plugin config parsed: PluginConfiguration { rate_limit_policies: [RateLimitPolicy { name: \"some-name\", rate_limit_domain: \"RLS-domain\", upstream_cluster: \"limitador-cluster\", hostnames: [\"*.toystore.com\", \"example.com\"], gateway_actions: [GatewayAction { rules: [Rule { paths: [\"/admin/toy\"], hosts: [\"cars.toystore.com\"], methods: [\"POST\"] }], configurations: [Configuration { actions: [generic_key(descriptor_value: \"1\" descriptor_key: \"admin\")] }] }] }], failure_mode_deny: true }")) + .execute_and_expect(ReturnType::Bool(true)) + .unwrap(); + + let http_context = 2; + module + .call_proxy_on_context_create(http_context, root_context) + .expect_log(Some(LogLevel::Info), Some("create_http_context #2")) + .execute_and_expect(ReturnType::None) + .unwrap(); + + module + .call_proxy_on_request_headers(http_context, 0, false) + .expect_log(Some(LogLevel::Info), Some("on_http_request_headers #2")) + .expect_get_header_map_value(Some(MapType::HttpRequestHeaders), Some(":authority")) + .returning(Some("cars.toystore.com")) + .expect_get_header_map_value(Some(MapType::HttpRequestHeaders), Some(":path")) + .returning(Some("/admin/toy")) + .expect_get_header_map_value(Some(MapType::HttpRequestHeaders), Some(":method")) + .returning(Some("POST")) + .expect_get_header_map_value(Some(MapType::HttpRequestHeaders), Some(":authority")) + .returning(Some("cars.toystore.com")) + .expect_grpc_call(Some(""), Some(""), Some(""), Some(""), Some(""), Some(42)) + .returning(Some(42)) + .expect_log( + Some(LogLevel::Info), + Some("Initiated gRPC call (id# 42) to Limitador"), + ) + .execute_and_expect(ReturnType::Action(Action::Pause)) + .unwrap(); + + let grpc_response: [u8; 2] = [8, 1]; + module + .call_proxy_on_grpc_receive(http_context, 42, grpc_response.len() as i32) + .expect_log( + Some(LogLevel::Info), + Some("received gRPC call response: token: 42, status: 0"), + ) + .expect_get_buffer_bytes(Some(BufferType::GrpcReceiveBuffer)) + .returning(Some(&grpc_response)) + .execute_and_expect(ReturnType::None) + .unwrap(); + + module + .call_proxy_on_response_headers(http_context, 0, false) + .execute_and_expect(ReturnType::Action(Action::Continue)) + .unwrap(); +} + +#[test] +fn it_passes_additional_headers() { + let args = tester::MockSettings { + wasm_path: "target/wasm32-unknown-unknown/release/wasm_shim.wasm".to_string(), + quiet: false, + allow_unexpected: false, + }; + let mut module = tester::mock(args).unwrap(); + + module + .call_start() + .execute_and_expect(ReturnType::None) + .unwrap(); + + let root_context = 1; + let cfg = r#"{ + "failure_mode_deny": true, + "rate_limit_policies": [ + { + "name": "some-name", + "rate_limit_domain": "RLS-domain", + "upstream_cluster": "limitador-cluster", + "hostnames": ["*.toystore.com", "example.com"], + "gateway_actions": [ + { + "rules": [ + { + "paths": ["/admin/toy"], + "hosts": ["cars.toystore.com"], + "methods": ["POST"] + }], + "configurations": [ + { + "actions": [ + { + "generic_key": { + "descriptor_key": "admin", + "descriptor_value": "1" + } + } + ] + } + ] + } + ] + } + ] + }"#; + + module + .call_proxy_on_context_create(root_context, 0) + .expect_log(Some(LogLevel::Info), Some("set_root_context #1")) + .execute_and_expect(ReturnType::None) + .unwrap(); + module + .call_proxy_on_configure(root_context, 0) + .expect_log(Some(LogLevel::Info), Some("on_configure #1")) + .expect_get_buffer_bytes(Some(BufferType::PluginConfiguration)) + .returning(Some(cfg.as_bytes())) + .expect_log(Some(LogLevel::Info), Some("plugin config parsed: PluginConfiguration { rate_limit_policies: [RateLimitPolicy { name: \"some-name\", rate_limit_domain: \"RLS-domain\", upstream_cluster: \"limitador-cluster\", hostnames: [\"*.toystore.com\", \"example.com\"], gateway_actions: [GatewayAction { rules: [Rule { paths: [\"/admin/toy\"], hosts: [\"cars.toystore.com\"], methods: [\"POST\"] }], configurations: [Configuration { actions: [generic_key(descriptor_value: \"1\" descriptor_key: \"admin\")] }] }] }], failure_mode_deny: true }")) + .execute_and_expect(ReturnType::Bool(true)) + .unwrap(); + + let http_context = 2; + module + .call_proxy_on_context_create(http_context, root_context) + .expect_log(Some(LogLevel::Info), Some("create_http_context #2")) + .execute_and_expect(ReturnType::None) + .unwrap(); + + module + .call_proxy_on_request_headers(http_context, 0, false) + .expect_log(Some(LogLevel::Info), Some("on_http_request_headers #2")) + .expect_get_header_map_value(Some(MapType::HttpRequestHeaders), Some(":authority")) + .returning(Some("cars.toystore.com")) + .expect_get_header_map_value(Some(MapType::HttpRequestHeaders), Some(":path")) + .returning(Some("/admin/toy")) + .expect_get_header_map_value(Some(MapType::HttpRequestHeaders), Some(":method")) + .returning(Some("POST")) + .expect_get_header_map_value(Some(MapType::HttpRequestHeaders), Some(":authority")) + .returning(Some("cars.toystore.com")) + .expect_grpc_call(Some(""), Some(""), Some(""), Some(""), Some(""), Some(42)) + .returning(Some(42)) + .expect_log( + Some(LogLevel::Info), + Some("Initiated gRPC call (id# 42) to Limitador"), + ) + .execute_and_expect(ReturnType::Action(Action::Pause)) + .unwrap(); + + let grpc_response: [u8; 45] = [ + 8, 1, 26, 18, 10, 4, 116, 101, 115, 116, 18, 10, 115, 111, 109, 101, 32, 118, 97, 108, 117, + 101, 26, 21, 10, 5, 111, 116, 104, 101, 114, 18, 12, 104, 101, 97, 100, 101, 114, 32, 118, + 97, 108, 117, 101, + ]; + module + .call_proxy_on_grpc_receive(http_context, 42, grpc_response.len() as i32) + .expect_log( + Some(LogLevel::Info), + Some("received gRPC call response: token: 42, status: 0"), + ) + .expect_get_buffer_bytes(Some(BufferType::GrpcReceiveBuffer)) + .returning(Some(&grpc_response)) + .execute_and_expect(ReturnType::None) + .unwrap(); + + module + .call_proxy_on_response_headers(http_context, 0, false) + .expect_add_header_map_value(Some(MapType::HttpResponseHeaders), Some("test"), Some("some value")) + .expect_add_header_map_value(Some(MapType::HttpResponseHeaders), Some("other"), Some("header value")) + .execute_and_expect(ReturnType::Action(Action::Continue)) + .unwrap(); +} diff --git a/vendor-test/test-framework b/vendor-test/test-framework index fdc37f6..0b6190a 160000 --- a/vendor-test/test-framework +++ b/vendor-test/test-framework @@ -1 +1 @@ -Subproject commit fdc37f6c8ef93493f57c803c2708670c5dbef1a8 +Subproject commit 0b6190a3e544d1af5b84ba739a43586b418d9225 From 6a69b831fb07e1dd63a64323f3e73b93fca21ae5 Mon Sep 17 00:00:00 2001 From: Alex Snaps Date: Wed, 14 Jun 2023 14:21:23 -0400 Subject: [PATCH 06/14] Test for serialized format and e2e test --- src/lib.rs | 7 ++++++- tests/rate_limited.rs | 12 ++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 3e6648b..f9cfa6c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -19,7 +19,12 @@ mod tests { resp.response_headers_to_add .push(header("other", "header value")); let buffer = resp.write_to_bytes().unwrap(); - // assert_eq!(b"", buffer.as_slice()) + let expected: [u8; 45] = [ + 8, 1, 26, 18, 10, 4, 116, 101, 115, 116, 18, 10, 115, 111, 109, 101, 32, 118, 97, 108, + 117, 101, 26, 21, 10, 5, 111, 116, 104, 101, 114, 18, 12, 104, 101, 97, 100, 101, 114, + 32, 118, 97, 108, 117, 101, + ]; + assert_eq!(expected, buffer.as_slice()) } fn header(key: &str, value: &str) -> HeaderValue { diff --git a/tests/rate_limited.rs b/tests/rate_limited.rs index 47accb7..2542258 100644 --- a/tests/rate_limited.rs +++ b/tests/rate_limited.rs @@ -276,8 +276,16 @@ fn it_passes_additional_headers() { module .call_proxy_on_response_headers(http_context, 0, false) - .expect_add_header_map_value(Some(MapType::HttpResponseHeaders), Some("test"), Some("some value")) - .expect_add_header_map_value(Some(MapType::HttpResponseHeaders), Some("other"), Some("header value")) + .expect_add_header_map_value( + Some(MapType::HttpResponseHeaders), + Some("test"), + Some("some value"), + ) + .expect_add_header_map_value( + Some(MapType::HttpResponseHeaders), + Some("other"), + Some("header value"), + ) .execute_and_expect(ReturnType::Action(Action::Continue)) .unwrap(); } From 4a92650f6ac4cb439f2b19058dcdffc4eb204739 Mon Sep 17 00:00:00 2001 From: Alex Snaps Date: Wed, 14 Jun 2023 14:21:59 -0400 Subject: [PATCH 07/14] Deps --- vendor-test/test-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor-test/test-framework b/vendor-test/test-framework index 0b6190a..d019c93 160000 --- a/vendor-test/test-framework +++ b/vendor-test/test-framework @@ -1 +1 @@ -Subproject commit 0b6190a3e544d1af5b84ba739a43586b418d9225 +Subproject commit d019c9343595662a454dd5562c52d2097b28651b From e945f2ffd3b7f750330d28f89fa2a0e8149cc5cb Mon Sep 17 00:00:00 2001 From: Alex Snaps Date: Wed, 14 Jun 2023 14:34:39 -0400 Subject: [PATCH 08/14] Can't run test in parallel, with mutated shared state --- Cargo.lock | 183 +++++++++++++++++++++++++++++++++++++++++- Cargo.toml | 1 + tests/rate_limited.rs | 4 + 3 files changed, 186 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cf0a0a8..01cdbd7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -363,6 +363,19 @@ dependencies = [ "typenum", ] +[[package]] +name = "dashmap" +version = "5.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc" +dependencies = [ + "cfg-if", + "hashbrown 0.12.3", + "lock_api", + "once_cell", + "parking_lot_core", +] + [[package]] name = "debugid" version = "0.8.0" @@ -483,6 +496,83 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "futures" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" + +[[package]] +name = "futures-executor" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" + +[[package]] +name = "futures-sink" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" + +[[package]] +name = "futures-task" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" + +[[package]] +name = "futures-util" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + [[package]] name = "fxhash" version = "0.2.1" @@ -738,6 +828,16 @@ version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" +[[package]] +name = "lock_api" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +dependencies = [ + "autocfg", + "scopeguard", +] + [[package]] name = "log" version = "0.4.17" @@ -823,6 +923,29 @@ version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2f7254b99e31cad77da24b08ebf628882739a608578bb1bcdfc1f9c21260d7c0" +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.3.5", + "smallvec", + "windows-targets", +] + [[package]] name = "paste" version = "1.0.12" @@ -835,6 +958,18 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + [[package]] name = "pkg-config" version = "0.3.27" @@ -1117,6 +1252,15 @@ dependencies = [ "bitflags 1.3.2", ] +[[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_users" version = "0.4.3" @@ -1124,7 +1268,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ "getrandom 0.2.7", - "redox_syscall", + "redox_syscall 0.2.16", "thiserror", ] @@ -1246,6 +1390,31 @@ dependencies = [ "serde", ] +[[package]] +name = "serial_test" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e56dd856803e253c8f298af3f4d7eb0ae5e23a737252cd90bb4f3b435033b2d" +dependencies = [ + "dashmap", + "futures", + "lazy_static", + "log", + "parking_lot", + "serial_test_derive", +] + +[[package]] +name = "serial_test_derive" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.18", +] + [[package]] name = "sha2" version = "0.10.6" @@ -1257,6 +1426,15 @@ dependencies = [ "digest", ] +[[package]] +name = "slab" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +dependencies = [ + "autocfg", +] + [[package]] name = "slice-group-by" version = "0.3.1" @@ -1342,7 +1520,7 @@ dependencies = [ "cfg-if", "fastrand", "libc", - "redox_syscall", + "redox_syscall 0.2.16", "remove_dir_all", "winapi", ] @@ -1529,6 +1707,7 @@ dependencies = [ "serde", "serde_json", "serde_regex", + "serial_test", "thiserror", ] diff --git a/Cargo.toml b/Cargo.toml index cec76e8..1cb850c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,6 +29,7 @@ radix_trie = "0.2.1" [dev-dependencies] proxy-wasm-test-framework = { path = "vendor-test/test-framework", version = "0.1.0" } protoc-rust = "2.27" +serial_test = "2.0.0" [build-dependencies] protoc-rust = "2.27" diff --git a/tests/rate_limited.rs b/tests/rate_limited.rs index 2542258..288f45c 100644 --- a/tests/rate_limited.rs +++ b/tests/rate_limited.rs @@ -1,7 +1,9 @@ use proxy_wasm_test_framework::tester; use proxy_wasm_test_framework::types::{Action, BufferType, LogLevel, MapType, ReturnType}; +use serial_test::serial; #[test] +#[serial] fn it_loads() { let args = tester::MockSettings { wasm_path: "target/wasm32-unknown-unknown/release/wasm_shim.wasm".to_string(), @@ -61,6 +63,7 @@ fn it_loads() { } #[test] +#[serial] fn it_limits() { let args = tester::MockSettings { wasm_path: "target/wasm32-unknown-unknown/release/wasm_shim.wasm".to_string(), @@ -169,6 +172,7 @@ fn it_limits() { } #[test] +#[serial] fn it_passes_additional_headers() { let args = tester::MockSettings { wasm_path: "target/wasm32-unknown-unknown/release/wasm_shim.wasm".to_string(), From 98fc53d18edf524860192fc1936c209e83a81c71 Mon Sep 17 00:00:00 2001 From: Alex Snaps Date: Wed, 14 Jun 2023 20:27:06 -0400 Subject: [PATCH 09/14] All the asserts --- tests/rate_limited.rs | 24 ++++++++++++++++++++++-- vendor-test/test-framework | 2 +- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/tests/rate_limited.rs b/tests/rate_limited.rs index 288f45c..8082bc1 100644 --- a/tests/rate_limited.rs +++ b/tests/rate_limited.rs @@ -144,7 +144,17 @@ fn it_limits() { .returning(Some("POST")) .expect_get_header_map_value(Some(MapType::HttpRequestHeaders), Some(":authority")) .returning(Some("cars.toystore.com")) - .expect_grpc_call(Some(""), Some(""), Some(""), Some(""), Some(""), Some(42)) + .expect_grpc_call( + Some("limitador-cluster"), + Some("envoy.service.ratelimit.v3.RateLimitService"), + Some("ShouldRateLimit"), + Some(&[0, 0, 0, 0]), + Some(&[ + 10, 10, 82, 76, 83, 45, 100, 111, 109, 97, 105, 110, 18, 12, 10, 10, 10, 5, 97, + 100, 109, 105, 110, 18, 1, 49, 24, 1, + ]), + Some(5000), + ) .returning(Some(42)) .expect_log( Some(LogLevel::Info), @@ -253,7 +263,17 @@ fn it_passes_additional_headers() { .returning(Some("POST")) .expect_get_header_map_value(Some(MapType::HttpRequestHeaders), Some(":authority")) .returning(Some("cars.toystore.com")) - .expect_grpc_call(Some(""), Some(""), Some(""), Some(""), Some(""), Some(42)) + .expect_grpc_call( + Some("limitador-cluster"), + Some("envoy.service.ratelimit.v3.RateLimitService"), + Some("ShouldRateLimit"), + Some(&[0, 0, 0, 0]), + Some(&[ + 10, 10, 82, 76, 83, 45, 100, 111, 109, 97, 105, 110, 18, 12, 10, 10, 10, 5, 97, + 100, 109, 105, 110, 18, 1, 49, 24, 1, + ]), + Some(5000), + ) .returning(Some(42)) .expect_log( Some(LogLevel::Info), diff --git a/vendor-test/test-framework b/vendor-test/test-framework index d019c93..f47ff3a 160000 --- a/vendor-test/test-framework +++ b/vendor-test/test-framework @@ -1 +1 @@ -Subproject commit d019c9343595662a454dd5562c52d2097b28651b +Subproject commit f47ff3a3a4e1588525d9d07c2a009ae17e163189 From 7b8509dcd8fe0b1509518a274bbc93e6665ee28d Mon Sep 17 00:00:00 2001 From: Alex Snaps Date: Wed, 14 Jun 2023 20:29:06 -0400 Subject: [PATCH 10/14] No need to assert the config parsed --- tests/rate_limited.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/rate_limited.rs b/tests/rate_limited.rs index 8082bc1..53c1e09 100644 --- a/tests/rate_limited.rs +++ b/tests/rate_limited.rs @@ -33,7 +33,7 @@ fn it_loads() { .expect_log(Some(LogLevel::Info), Some("on_configure #1")) .expect_get_buffer_bytes(Some(BufferType::PluginConfiguration)) .returning(Some(cfg.as_bytes())) - .expect_log(Some(LogLevel::Info), Some("plugin config parsed: PluginConfiguration { rate_limit_policies: [], failure_mode_deny: true }")) + .expect_log(Some(LogLevel::Info), None) .execute_and_expect(ReturnType::Bool(true)) .unwrap(); @@ -122,7 +122,7 @@ fn it_limits() { .expect_log(Some(LogLevel::Info), Some("on_configure #1")) .expect_get_buffer_bytes(Some(BufferType::PluginConfiguration)) .returning(Some(cfg.as_bytes())) - .expect_log(Some(LogLevel::Info), Some("plugin config parsed: PluginConfiguration { rate_limit_policies: [RateLimitPolicy { name: \"some-name\", rate_limit_domain: \"RLS-domain\", upstream_cluster: \"limitador-cluster\", hostnames: [\"*.toystore.com\", \"example.com\"], gateway_actions: [GatewayAction { rules: [Rule { paths: [\"/admin/toy\"], hosts: [\"cars.toystore.com\"], methods: [\"POST\"] }], configurations: [Configuration { actions: [generic_key(descriptor_value: \"1\" descriptor_key: \"admin\")] }] }] }], failure_mode_deny: true }")) + .expect_log(Some(LogLevel::Info), None) .execute_and_expect(ReturnType::Bool(true)) .unwrap(); @@ -241,7 +241,7 @@ fn it_passes_additional_headers() { .expect_log(Some(LogLevel::Info), Some("on_configure #1")) .expect_get_buffer_bytes(Some(BufferType::PluginConfiguration)) .returning(Some(cfg.as_bytes())) - .expect_log(Some(LogLevel::Info), Some("plugin config parsed: PluginConfiguration { rate_limit_policies: [RateLimitPolicy { name: \"some-name\", rate_limit_domain: \"RLS-domain\", upstream_cluster: \"limitador-cluster\", hostnames: [\"*.toystore.com\", \"example.com\"], gateway_actions: [GatewayAction { rules: [Rule { paths: [\"/admin/toy\"], hosts: [\"cars.toystore.com\"], methods: [\"POST\"] }], configurations: [Configuration { actions: [generic_key(descriptor_value: \"1\" descriptor_key: \"admin\")] }] }] }], failure_mode_deny: true }")) + .expect_log(Some(LogLevel::Info), None) .execute_and_expect(ReturnType::Bool(true)) .unwrap(); From 354bcbfede3054fb1d5768fbe47e84f7f88fe332 Mon Sep 17 00:00:00 2001 From: Alex Snaps Date: Wed, 14 Jun 2023 20:47:34 -0400 Subject: [PATCH 11/14] Test for wasm module to be there --- tests/rate_limited.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tests/rate_limited.rs b/tests/rate_limited.rs index 53c1e09..2d340e9 100644 --- a/tests/rate_limited.rs +++ b/tests/rate_limited.rs @@ -1,12 +1,22 @@ use proxy_wasm_test_framework::tester; use proxy_wasm_test_framework::types::{Action, BufferType, LogLevel, MapType, ReturnType}; use serial_test::serial; +use std::path::Path; + +fn wasm_module() -> String { + let wasm_file = Path::new("target/wasm32-unknown-unknown/release/wasm_shim.wasm"); + assert!( + wasm_file.exists(), + "Run `cargo build --release --target=wasm32-unknown-unknown` first" + ); + wasm_file.to_str().unwrap().to_string() +} #[test] #[serial] fn it_loads() { let args = tester::MockSettings { - wasm_path: "target/wasm32-unknown-unknown/release/wasm_shim.wasm".to_string(), + wasm_path: wasm_module(), quiet: false, allow_unexpected: false, }; @@ -66,7 +76,7 @@ fn it_loads() { #[serial] fn it_limits() { let args = tester::MockSettings { - wasm_path: "target/wasm32-unknown-unknown/release/wasm_shim.wasm".to_string(), + wasm_path: wasm_module(), quiet: false, allow_unexpected: false, }; @@ -185,7 +195,7 @@ fn it_limits() { #[serial] fn it_passes_additional_headers() { let args = tester::MockSettings { - wasm_path: "target/wasm32-unknown-unknown/release/wasm_shim.wasm".to_string(), + wasm_path: wasm_module(), quiet: false, allow_unexpected: false, }; From 9358a3d4a2d0cd5371dd6db757dd98147f03660b Mon Sep 17 00:00:00 2001 From: Alex Snaps Date: Wed, 14 Jun 2023 21:07:49 -0400 Subject: [PATCH 12/14] github action fixes --- .github/workflows/build-image.yaml | 2 ++ .github/workflows/rust.yaml | 14 +++++++++++- Cargo.toml | 1 - Dockerfile | 3 ++- build.rs | 35 ++++++++++++++++++++++++++++-- vendor-test/test-framework | 2 +- 6 files changed, 51 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-image.yaml b/.github/workflows/build-image.yaml index 8013e2a..8f3b242 100644 --- a/.github/workflows/build-image.yaml +++ b/.github/workflows/build-image.yaml @@ -19,6 +19,8 @@ jobs: steps: - name: Check out code uses: actions/checkout@v2 + with: + submodules: recursive - name: Add latest tag if: ${{ github.ref_name == env.MAIN_BRANCH_NAME }} id: add-latest-tag diff --git a/.github/workflows/rust.yaml b/.github/workflows/rust.yaml index 217fa88..a7625f6 100644 --- a/.github/workflows/rust.yaml +++ b/.github/workflows/rust.yaml @@ -17,6 +17,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + submodules: recursive - uses: actions-rs/toolchain@v1 with: profile: minimal @@ -35,23 +37,31 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + submodules: recursive - uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: stable override: true + target: wasm32-unknown-unknown - uses: arduino/setup-protoc@v1 with: version: '3.x' + - uses: actions-rs/cargo@v1 + with: + command: build + args: --release --target wasm32-unknown-unknown - uses: actions-rs/cargo@v1 with: command: test - args: --all-features fmt: name: Rustfmt runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + submodules: recursive - uses: actions-rs/toolchain@v1 with: profile: minimal @@ -75,6 +85,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + submodules: recursive - uses: actions-rs/toolchain@v1 with: profile: minimal diff --git a/Cargo.toml b/Cargo.toml index 1cb850c..e1f2e32 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,6 @@ radix_trie = "0.2.1" [dev-dependencies] proxy-wasm-test-framework = { path = "vendor-test/test-framework", version = "0.1.0" } -protoc-rust = "2.27" serial_test = "2.0.0" [build-dependencies] diff --git a/Dockerfile b/Dockerfile index c6d9981..bd95bb1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ FROM alpine:3.16 as wasm-shim-build -ARG RUSTC_VERSION=1.58.1 +ARG RUSTC_VERSION=1.69.0 RUN apk update \ && apk upgrade \ && apk add build-base binutils-gold openssl3-dev protoc curl \ @@ -20,6 +20,7 @@ COPY ./Cargo.toml ./Cargo.toml COPY src src COPY build.rs build.rs COPY vendor-protobufs vendor-protobufs +COPY vendor-test vendor-test RUN source $HOME/.cargo/env \ && cargo build --target=wasm32-unknown-unknown --release diff --git a/build.rs b/build.rs index 597c24b..bd0a966 100644 --- a/build.rs +++ b/build.rs @@ -10,10 +10,41 @@ fn generate_protobuf() -> Result<(), Box> { ..Default::default() }; protoc_rust::Codegen::new() - .protoc_path("bin/protoc") .out_dir("src/envoy") .customize(custom) - .inputs(["vendor-protobufs/data-plane-api/envoy/service/ratelimit/v3/rls.proto"]) + .inputs([ + "vendor-protobufs/data-plane-api/envoy/service/auth/v3/external_auth.proto", + "vendor-protobufs/data-plane-api/envoy/service/ratelimit/v3/rls.proto", + "vendor-protobufs/data-plane-api/envoy/service/auth/v3/attribute_context.proto", + "vendor-protobufs/data-plane-api/envoy/config/core/v3/address.proto", + "vendor-protobufs/googleapis/google/protobuf/timestamp.proto", + "vendor-protobufs/data-plane-api/envoy/config/core/v3/base.proto", + "vendor-protobufs/data-plane-api/envoy/config/core/v3/socket_option.proto", + "vendor-protobufs/data-plane-api/envoy/config/core/v3/http_uri.proto", + "vendor-protobufs/data-plane-api/envoy/config/core/v3/backoff.proto", + "vendor-protobufs/data-plane-api/envoy/type/v3/http_status.proto", + "vendor-protobufs/data-plane-api/envoy/type/v3/semantic_version.proto", + "vendor-protobufs/data-plane-api/envoy/type/v3/percent.proto", + "vendor-protobufs/udpa/xds/core/v3/context_params.proto", + "vendor-protobufs/googleapis/google/rpc/status.proto", + "vendor-protobufs/data-plane-api/envoy/config/route/v3/route_components.proto", + "vendor-protobufs/data-plane-api/envoy/extensions/common/ratelimit/v3/ratelimit.proto", + "vendor-protobufs/data-plane-api/envoy/type/v3/ratelimit_unit.proto", + "vendor-protobufs/data-plane-api/envoy/type/v3/range.proto", + "vendor-protobufs/data-plane-api/envoy/type/v3/token_bucket.proto", + "vendor-protobufs/data-plane-api/envoy/config/common/matcher/v3/matcher.proto", + "vendor-protobufs/data-plane-api/envoy/config/core/v3/extension.proto", + "vendor-protobufs/data-plane-api/envoy/type/matcher/v3/string.proto", + "vendor-protobufs/data-plane-api/envoy/type/matcher/v3/number.proto", + "vendor-protobufs/data-plane-api/envoy/type/matcher/v3/regex.proto", + "vendor-protobufs/data-plane-api/envoy/type/matcher/v3/metadata.proto", + "vendor-protobufs/data-plane-api/envoy/type/matcher/v3/value.proto", + "vendor-protobufs/data-plane-api/envoy/config/core/v3/config_source.proto", + "vendor-protobufs/data-plane-api/envoy/config/core/v3/grpc_service.proto", + "vendor-protobufs/data-plane-api/envoy/config/core/v3/proxy_protocol.proto", + "vendor-protobufs/udpa/xds/core/v3/authority.proto", + "vendor-protobufs/data-plane-api/envoy/type/tracing/v3/custom_tag.proto", + ]) .includes([ "vendor-protobufs/data-plane-api/", "vendor-protobufs/protoc-gen-validate/", diff --git a/vendor-test/test-framework b/vendor-test/test-framework index f47ff3a..904904c 160000 --- a/vendor-test/test-framework +++ b/vendor-test/test-framework @@ -1 +1 @@ -Subproject commit f47ff3a3a4e1588525d9d07c2a009ae17e163189 +Subproject commit 904904c6f5232cdb02c7310d4254b715aa524699 From c3bfb58b1a0905bb3af70f518c112909af011029 Mon Sep 17 00:00:00 2001 From: Alex Snaps Date: Thu, 15 Jun 2023 10:29:38 -0400 Subject: [PATCH 13/14] Use our fork of the proxy-wasm test framework --- .github/workflows/build-image.yaml | 2 -- .github/workflows/rust.yaml | 8 -------- .gitmodules | 4 ---- Cargo.lock | 1 + Cargo.toml | 2 +- Dockerfile | 1 - vendor-test/test-framework | 1 - 7 files changed, 2 insertions(+), 17 deletions(-) delete mode 160000 vendor-test/test-framework diff --git a/.github/workflows/build-image.yaml b/.github/workflows/build-image.yaml index 8f3b242..8013e2a 100644 --- a/.github/workflows/build-image.yaml +++ b/.github/workflows/build-image.yaml @@ -19,8 +19,6 @@ jobs: steps: - name: Check out code uses: actions/checkout@v2 - with: - submodules: recursive - name: Add latest tag if: ${{ github.ref_name == env.MAIN_BRANCH_NAME }} id: add-latest-tag diff --git a/.github/workflows/rust.yaml b/.github/workflows/rust.yaml index a7625f6..065ac37 100644 --- a/.github/workflows/rust.yaml +++ b/.github/workflows/rust.yaml @@ -17,8 +17,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - with: - submodules: recursive - uses: actions-rs/toolchain@v1 with: profile: minimal @@ -37,8 +35,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - with: - submodules: recursive - uses: actions-rs/toolchain@v1 with: profile: minimal @@ -60,8 +56,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - with: - submodules: recursive - uses: actions-rs/toolchain@v1 with: profile: minimal @@ -85,8 +79,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - with: - submodules: recursive - uses: actions-rs/toolchain@v1 with: profile: minimal diff --git a/.gitmodules b/.gitmodules index e777d9a..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +0,0 @@ -[submodule "vendor-test/test-framework"] - path = vendor-test/test-framework - url = https://github.com/alexsnaps/test-framework.git - branch = kuadrant diff --git a/Cargo.lock b/Cargo.lock index 01cdbd7..814cf69 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1102,6 +1102,7 @@ dependencies = [ [[package]] name = "proxy-wasm-test-framework" version = "0.1.0" +source = "git+https://github.com/Kuadrant/wasm-test-framework.git?branch=kuadrant#904904c6f5232cdb02c7310d4254b715aa524699" dependencies = [ "anyhow", "lazy_static", diff --git a/Cargo.toml b/Cargo.toml index e1f2e32..fe1be27 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,7 @@ serde_regex = "1.1.0" radix_trie = "0.2.1" [dev-dependencies] -proxy-wasm-test-framework = { path = "vendor-test/test-framework", version = "0.1.0" } +proxy-wasm-test-framework = { git = "https://github.com/Kuadrant/wasm-test-framework.git", branch = "kuadrant" } serial_test = "2.0.0" [build-dependencies] diff --git a/Dockerfile b/Dockerfile index bd95bb1..16efc07 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,6 @@ COPY ./Cargo.toml ./Cargo.toml COPY src src COPY build.rs build.rs COPY vendor-protobufs vendor-protobufs -COPY vendor-test vendor-test RUN source $HOME/.cargo/env \ && cargo build --target=wasm32-unknown-unknown --release diff --git a/vendor-test/test-framework b/vendor-test/test-framework deleted file mode 160000 index 904904c..0000000 --- a/vendor-test/test-framework +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 904904c6f5232cdb02c7310d4254b715aa524699 From 8441787992ef5045a3cce41fdd19c1846f018eef Mon Sep 17 00:00:00 2001 From: Alex Snaps Date: Thu, 15 Jun 2023 11:04:43 -0400 Subject: [PATCH 14/14] Fix --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9496c60..db51f58 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,5 @@ /src/envoy/* !/src/envoy/mod.rs .vscode/* -vendor-protobufs /bin