proxy-wasm-rust-sdk
proxy-wasm-rust-sdk copied to clipboard
Move examples into seperate folders
Migrate examples to separate folders.
TODO:
- [x] migrate hello_world
- [x] migrate http_auth_random
- [x] migrate http_headers
- [x] migrate http_body
- [x] migrate http_config
- [x] Build each example as part of CICD ~(and perhaps run?)~
- [x]
cargo auditeachcargo.tomlfor examples - [x] Define documentation on how to build and run each example (per example or general?)
Earlier draft PR discussion
- Single docker-compose that uses and environment variable to load the matching example. Upside: re-use of docker compose config. Downside: tiny bit of magic to newcomers and newer examples might require more elaborate docker compose config for them to make sense/work.
- Do we want a separate
Cargo.tomlfiles for each example or go with Rust standard approach? It sounds like co-locating (dev-)dependencies was preferred to "avoid" the rustsec vuln fromchronofrom the main Crate? It would likely require more extensive changes and transition to a workspace. - To what extend does
razeneed to be involved? For devs coming from a mostly Rust background that could be tooling they are unfamiliar with.
fixes #140
fixes #35 by showing how dispatch_http_call works
I think this would be fine to land after 0.2, just so we don't block the WASM reactor change going out. Will allow us to iterate a bit and land on a solid implementation we are all happy with. In addition, would enable you to bring in your uncommitted examples.
edit: having an rustsec ignore on a devDependency of an example is not the worst.
I'd prefer a separate Cargo.toml and src/lib.rs (since it has to be a cdylib for now), so that each example is a self-contained crate that users can copy as a base and evolve into their own plugins.
I'll start from this perspective and migrate each example. Having an envoy.yaml with static config is preferred IMHO over something that is generated through some Makefile/script. I agree examples should just be copy paste. This will likely also give clear understanding of docker compose complexity (if any).