From 8d8e3dcbf2fffc51718bd6222949082dc4cbf14a Mon Sep 17 00:00:00 2001 From: Ruslan Pislari Date: Fri, 22 May 2026 15:56:54 +0300 Subject: [PATCH 1/2] feat: implement CDN proxy-wasm filter to rewrite request properties based on headers --- examples/cdn/request_url/Cargo.toml | 13 ++++ examples/cdn/request_url/README.md | 43 ++++++++++++ examples/cdn/request_url/src/lib.rs | 103 ++++++++++++++++++++++++++++ examples/http/wasi/print/Cargo.toml | 13 ++++ examples/http/wasi/print/README.md | 5 ++ examples/http/wasi/print/src/lib.rs | 28 ++++++++ 6 files changed, 205 insertions(+) create mode 100644 examples/cdn/request_url/Cargo.toml create mode 100644 examples/cdn/request_url/README.md create mode 100644 examples/cdn/request_url/src/lib.rs create mode 100644 examples/http/wasi/print/Cargo.toml create mode 100644 examples/http/wasi/print/README.md create mode 100644 examples/http/wasi/print/src/lib.rs diff --git a/examples/cdn/request_url/Cargo.toml b/examples/cdn/request_url/Cargo.toml new file mode 100644 index 0000000..09c5f02 --- /dev/null +++ b/examples/cdn/request_url/Cargo.toml @@ -0,0 +1,13 @@ + +[package] +name = "cdn_request_url" +version = "0.1.0" +edition = "2024" + +[lib] +crate-type = ["cdylib"] + +[dependencies] +log = "0.4" +proxy-wasm = "0.2" +querystring = "1.1" diff --git a/examples/cdn/request_url/README.md b/examples/cdn/request_url/README.md new file mode 100644 index 0000000..d833a64 --- /dev/null +++ b/examples/cdn/request_url/README.md @@ -0,0 +1,43 @@ +[← Back to examples](../../README.md) + +# Request URL (CDN) + +A CDN proxy-wasm filter that rewrites outbound request properties — URL, host, path, and query string — based on incoming request headers. + +## What it does + +On each incoming HTTP request the filter reads the following special headers and, if present, overwrites the corresponding request property before the request is forwarded to the origin: + +| Header | Property overwritten | +|--------|----------------------| +| `set-url` | `request.url` — full request URL | +| `set-host` | `request.host` — host name | +| `set-path` | `request.path` — URL path | +| `set-query` | `request.query` — query string | + +It also writes a custom Nginx log field `nginx.log_field1` on every request. + +## Use cases + +- Rewrite the upstream URL at the edge without changing client-visible headers. +- Override the request host for multi-tenant routing. +- Strip or replace the path / query string before hitting the origin. + +## Build + +```bash +cargo build --target wasm32-wasip1 --release +``` + +## Example + +Forward a request but override the path and query string: + +```http +GET /original-path HTTP/1.1 +Host: example.com +set-path: /new-path +set-query: page=2&limit=10 +``` + +The filter rewrites `request.path` to `/new-path` and `request.query` to `page=2&limit=10` before the request reaches the origin. diff --git a/examples/cdn/request_url/src/lib.rs b/examples/cdn/request_url/src/lib.rs new file mode 100644 index 0000000..a4f4d8d --- /dev/null +++ b/examples/cdn/request_url/src/lib.rs @@ -0,0 +1,103 @@ +use log::info; +use proxy_wasm::traits::*; +use proxy_wasm::types::*; + +proxy_wasm::main! {{ + proxy_wasm::set_log_level(LogLevel::Trace); + proxy_wasm::set_root_context(|_| -> Box { Box::new(HttpHeadersRoot) }); +}} + +struct HttpHeadersRoot; + +impl Context for HttpHeadersRoot {} + +impl RootContext for HttpHeadersRoot { + fn create_http_context(&self, context_id: u32) -> Option> { + Some(Box::new(HttpHeaders { context_id })) + } + + fn get_type(&self) -> Option { + Some(ContextType::HttpContext) + } +} + +struct HttpHeaders { + context_id: u32, +} + +impl Context for HttpHeaders {} + +pub const REQUEST_URI: &str = "request.url"; +pub const REQUEST_HOST: &str = "request.host"; +pub const REQUEST_PATH: &str = "request.path"; +pub const REQUEST_QUERY: &str = "request.query"; + +impl HttpContext for HttpHeaders { + fn on_http_request_headers(&mut self, _: usize, _: bool) -> Action { + + let Some(uri) = self.get_property(vec![REQUEST_URI]) else { + self.send_http_response(551, vec![], None); + return Action::Pause; + }; + self.add_http_request_header_bytes("request-uri", &uri); + + let Some(host) = self.get_property(vec![REQUEST_HOST]) else { + self.send_http_response(552, vec![], None); + return Action::Pause; + }; + self.add_http_request_header_bytes("request-host", &host); + + let Some(path) = self.get_property(vec![REQUEST_PATH]) else { + self.send_http_response(553, vec![], None); + return Action::Pause; + }; + self.add_http_request_header_bytes("request-path", &path); + + let Some(query) = self.get_property(vec![REQUEST_QUERY]) else { + self.send_http_response(554, vec![], None); + return Action::Pause; + }; + self.add_http_request_header_bytes("request-query", &query); + + if let Some(new_url) = self.get_http_request_header("set-url") { + self.set_property( + vec!["request.url"], + Some(new_url.as_bytes()), + ); + } + + if let Some(new_host) = self.get_http_request_header("set-host") { + self.set_property( + vec!["request.host"], + Some(new_host.as_bytes()), + ); + } + + if let Some(new_path) = self.get_http_request_header("set-path") { + self.set_property( + vec!["request.path"], + Some(new_path.as_bytes()), + ); + } + + if let Some(new_query) = self.get_http_request_header("set-query") { + self.set_property( + vec!["request.query"], + Some(new_query.as_bytes()), + ); + } + + self.set_property( + vec!["nginx.log_field1"], + Some(b"from_wasm nginx.log_field1"), + ); + + Action::Continue + } + + fn on_log(&mut self) { + info!("#{} completed.", self.context_id); + } +} + + diff --git a/examples/http/wasi/print/Cargo.toml b/examples/http/wasi/print/Cargo.toml new file mode 100644 index 0000000..ee8fa74 --- /dev/null +++ b/examples/http/wasi/print/Cargo.toml @@ -0,0 +1,13 @@ + + +[package] +name = "http_wasi_print" +version = "0.1.0" +edition = "2024" + +[lib] +crate-type = ["cdylib"] + +[dependencies] +wstd = "0.6" +anyhow = "1" diff --git a/examples/http/wasi/print/README.md b/examples/http/wasi/print/README.md new file mode 100644 index 0000000..af4978c --- /dev/null +++ b/examples/http/wasi/print/README.md @@ -0,0 +1,5 @@ +[← Back to examples](../../../README.md) + +# Print (WASI) + +Prints the request method, URL, and all headers to the response body. Useful for debugging and inspecting incoming requests. diff --git a/examples/http/wasi/print/src/lib.rs b/examples/http/wasi/print/src/lib.rs new file mode 100644 index 0000000..78f75d0 --- /dev/null +++ b/examples/http/wasi/print/src/lib.rs @@ -0,0 +1,28 @@ +use wstd::http::body::Body; +use wstd::http::{Request, Response, StatusCode}; + +#[wstd::http_server] +async fn main(request: Request) -> anyhow::Result> { + let mut body: String = "Method: ".to_string(); + body.push_str(request.method().as_str()); + + body.push_str("\nURL: "); + body.push_str(request.uri().to_string().as_str()); + + body.push_str("\nHeaders:"); + for (h, v) in request.headers() { + body.push_str("\n "); + body.push_str(h.as_str()); + body.push_str(": "); + match v.to_str() { + Err(_) => body.push_str("not a valid text"), + Ok(a) => body.push_str(a), + } + } + + println!("{}", body); + + Ok(Response::builder() + .status(StatusCode::OK) + .body(Body::from(body))?) +} From 3c42cd93edacbc20664b495dd81a96c737e09cca Mon Sep 17 00:00:00 2001 From: Ruslan Pislari Date: Tue, 26 May 2026 13:16:06 +0300 Subject: [PATCH 2/2] feat: add `local_response` example and update dependencies to `fastedge` v0.4.0 - Introduced a new `local_response` example demonstrating proxy-wasm capabilities. - Updated several examples to reference the local `fastedge` path and upgraded to version `v0.4.0`. - Simplified logic in some CDN examples and addressed redundant checks in `cdn/headers`. --- examples/cdn/api_key/Cargo.lock | 8 +-- examples/cdn/api_key/Cargo.toml | 2 +- examples/cdn/headers/src/lib.rs | 36 +---------- examples/cdn/jwt/Cargo.toml | 2 +- examples/cdn/key_value/Cargo.toml | 2 +- examples/cdn/large_env_variable/Cargo.toml | 2 +- examples/cdn/local_response/Cargo.toml | 12 ++++ examples/cdn/local_response/src/lib.rs | 63 +++++++++++++++++++ examples/cdn/properties/src/lib.rs | 23 +++---- examples/cdn/request_url/Cargo.toml | 3 +- examples/cdn/variables_and_secrets/Cargo.lock | 8 +-- examples/cdn/variables_and_secrets/Cargo.toml | 2 +- examples/http/basic/api_wrapper/Cargo.lock | 8 +-- examples/http/basic/api_wrapper/Cargo.toml | 2 +- examples/http/basic/backend/Cargo.toml | 2 +- examples/http/basic/hello_world/Cargo.lock | 8 +-- examples/http/basic/hello_world/Cargo.toml | 2 +- .../http/basic/markdown_render/Cargo.toml | 2 +- examples/http/basic/outbound_fetch/Cargo.lock | 8 +-- examples/http/basic/outbound_fetch/Cargo.toml | 2 +- examples/http/basic/print/Cargo.toml | 2 +- examples/http/basic/s3upload/Cargo.toml | 2 +- examples/http/basic/secret/Cargo.lock | 8 +-- examples/http/basic/secret/Cargo.toml | 2 +- examples/http/basic/smart_switch/Cargo.toml | 2 +- examples/http/basic/watermark/Cargo.toml | 2 +- examples/http/wasi/cache/Cargo.lock | 4 +- examples/http/wasi/key_value/Cargo.toml | 2 +- .../http/wasi/large_env_variable/Cargo.toml | 2 +- examples/http/wasi/print/Cargo.toml | 4 +- examples/http/wasi/secret_rollover/Cargo.lock | 8 +-- examples/http/wasi/secret_rollover/Cargo.toml | 2 +- .../wasi/variables_and_secrets/Cargo.lock | 8 +-- .../wasi/variables_and_secrets/Cargo.toml | 2 +- 34 files changed, 127 insertions(+), 120 deletions(-) create mode 100644 examples/cdn/local_response/Cargo.toml create mode 100644 examples/cdn/local_response/src/lib.rs diff --git a/examples/cdn/api_key/Cargo.lock b/examples/cdn/api_key/Cargo.lock index 380241c..a405db5 100644 --- a/examples/cdn/api_key/Cargo.lock +++ b/examples/cdn/api_key/Cargo.lock @@ -42,9 +42,7 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "fastedge" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9042fccaffdd2171e8ff481e5c21d22f15b8a4454b37273c2f3f902fb3d375e" +version = "0.4.0" dependencies = [ "bytes", "fastedge-derive", @@ -56,9 +54,7 @@ dependencies = [ [[package]] name = "fastedge-derive" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acacf180f92cbdf6f2fe1a772b7d92301e430ba207fb15b2fc87ccab4e418ff9" +version = "0.4.0" dependencies = [ "proc-macro2", "quote", diff --git a/examples/cdn/api_key/Cargo.toml b/examples/cdn/api_key/Cargo.toml index bb177db..2477ed1 100644 --- a/examples/cdn/api_key/Cargo.toml +++ b/examples/cdn/api_key/Cargo.toml @@ -10,4 +10,4 @@ crate-type = ["cdylib"] [dependencies] proxy-wasm = "0.2" -fastedge = { version = "0.3", features = ["proxywasm"] } +fastedge = { path = "../../../", features = ["proxywasm"] } diff --git a/examples/cdn/headers/src/lib.rs b/examples/cdn/headers/src/lib.rs index f28c47f..71ef824 100644 --- a/examples/cdn/headers/src/lib.rs +++ b/examples/cdn/headers/src/lib.rs @@ -161,22 +161,14 @@ impl HttpContext for HttpHeaders { } // check if the response header is not returned - let Some(value) = self.get_http_response_header("host") else { + if self.get_http_response_header("host").is_some() { self.send_http_response(553, vec![], None); return Action::Pause; }; - if !value.is_empty() { - self.send_http_response(554, vec![], None); - return Action::Pause; - } - let Some(value) = self.get_http_response_header_bytes("host") else { + if self.get_http_response_header_bytes("host").is_some() { self.send_http_response(553, vec![], None); return Action::Pause; }; - if !value.is_empty() { - self.send_http_response(554, vec![], None); - return Action::Pause; - } let response_headers = self.get_http_response_headers(); if response_headers.len() != 1 { @@ -321,30 +313,6 @@ impl HttpContext for HttpHeaders { return Action::Pause; } - // check if the reponse header is not returnd - let Some(value) = self.get_http_response_header("host") else { - self.send_http_response(553, vec![], None); - return Action::Pause; - }; - if !value.is_empty() { - self.send_http_response(554, vec![], None); - return Action::Pause; - } - let Some(value) = self.get_http_response_header_bytes("host") else { - self.send_http_response(553, vec![], None); - return Action::Pause; - }; - if !value.is_empty() { - self.send_http_response(554, vec![], None); - return Action::Pause; - } - - let request_headers = self.get_http_response_headers(); - if request_headers.is_empty() { - self.send_http_response(555, vec![], None); - return Action::Pause; - } - Action::Continue } diff --git a/examples/cdn/jwt/Cargo.toml b/examples/cdn/jwt/Cargo.toml index 73fb756..0439ad0 100644 --- a/examples/cdn/jwt/Cargo.toml +++ b/examples/cdn/jwt/Cargo.toml @@ -10,7 +10,7 @@ crate-type = ["cdylib"] [dependencies] proxy-wasm = "0.2" -fastedge = { version = "0.3", features = ["proxywasm"] } +fastedge = { path = "../../../", features = ["proxywasm"] } jsonwebtoken = "9" serde = { version = "1", features = ["derive"] } headers = "0.4" diff --git a/examples/cdn/key_value/Cargo.toml b/examples/cdn/key_value/Cargo.toml index cf42af4..8f85dc3 100644 --- a/examples/cdn/key_value/Cargo.toml +++ b/examples/cdn/key_value/Cargo.toml @@ -10,6 +10,6 @@ crate-type = ["cdylib"] [dependencies] proxy-wasm = "0.2" -fastedge = { version = "0.3", features = ["proxywasm"] } +fastedge = { path = "../../../", features = ["proxywasm"] } querystring = "1.1" serde_json = "1" diff --git a/examples/cdn/large_env_variable/Cargo.toml b/examples/cdn/large_env_variable/Cargo.toml index 239442e..ae0e008 100644 --- a/examples/cdn/large_env_variable/Cargo.toml +++ b/examples/cdn/large_env_variable/Cargo.toml @@ -10,4 +10,4 @@ crate-type = ["cdylib"] [dependencies] proxy-wasm = "0.2" -fastedge = { version = "0.3", features = ["proxywasm"] } +fastedge = { path = "../../../", features = ["proxywasm"] } diff --git a/examples/cdn/local_response/Cargo.toml b/examples/cdn/local_response/Cargo.toml new file mode 100644 index 0000000..0fc8c6e --- /dev/null +++ b/examples/cdn/local_response/Cargo.toml @@ -0,0 +1,12 @@ +[workspace] + +[package] +name = "local_response" +version = "0.1.0" +edition = "2024" + +[lib] +crate-type = ["cdylib"] + +[dependencies] +proxy-wasm = "0.2" \ No newline at end of file diff --git a/examples/cdn/local_response/src/lib.rs b/examples/cdn/local_response/src/lib.rs new file mode 100644 index 0000000..a3c431b --- /dev/null +++ b/examples/cdn/local_response/src/lib.rs @@ -0,0 +1,63 @@ +use proxy_wasm::traits::*; +use proxy_wasm::types::*; + +proxy_wasm::main! {{ + proxy_wasm::set_log_level(LogLevel::Trace); + proxy_wasm::set_root_context(|_| -> Box { Box::new(HttpHeadersRoot) }); +}} + +struct HttpHeadersRoot; + +impl Context for HttpHeadersRoot {} + +impl RootContext for HttpHeadersRoot { + fn create_http_context(&self, _context_id: u32) -> Option> { + Some(Box::new(HttpHeaders)) + } + + fn get_type(&self) -> Option { + Some(ContextType::HttpContext) + } +} + +struct HttpHeaders; + +impl Context for HttpHeaders {} + +impl HttpContext for HttpHeaders { + fn on_http_request_headers(&mut self, _: usize, _: bool) -> Action { + self.send_http_response( + 251, + vec![("Powered-By", "proxy-wasm"), ("Key", "Value")], // Headers + Some(b"on_http_request_headers response from proxywasm local response example"), + ); + Action::Pause + } + + fn on_http_request_body(&mut self, _body_size: usize, _end_of_stream: bool) -> Action { + self.send_http_response( + 253, + vec![("Powered-By", "proxy-wasm"), ("Key", "Value")], // Headers + Some(b"on_http_request_body response from proxywasm local response example"), + ); + Action::Pause + } + + fn on_http_response_headers(&mut self, _num_headers: usize, _end_of_stream: bool) -> Action { + self.send_http_response( + 252, + vec![("Powered-By", "proxy-wasm"), ("Key", "Value")], // Headers + Some(b"on_http_response_headers response from proxywasm local response example"), + ); + Action::Pause + } + + fn on_http_response_body(&mut self, _body_size: usize, _end_of_stream: bool) -> Action { + self.send_http_response( + 254, + vec![("Powered-By", "proxy-wasm"), ("Key", "Value")], // Headers + Some(b"on_http_response_body response from proxywasm local response example"), + ); + Action::Pause + } +} diff --git a/examples/cdn/properties/src/lib.rs b/examples/cdn/properties/src/lib.rs index 405e199..47dbd8e 100644 --- a/examples/cdn/properties/src/lib.rs +++ b/examples/cdn/properties/src/lib.rs @@ -74,19 +74,14 @@ impl HttpContext for HttpHeaders { println!(" scheme = {} ", String::from_utf8_lossy(&scheme)); self.add_http_response_header_bytes("request-scheme", &scheme); - let Some(extension) = self.get_property(vec![REQUEST_EXTENSION]) else { - self.send_http_response(555, vec![], None); - return Action::Pause; - }; - println!(" extension = {} ", String::from_utf8_lossy(&extension)); - self.add_http_response_header_bytes("request-extension", &extension); - - let Some(query) = self.get_property(vec![REQUEST_QUERY]) else { - self.send_http_response(556, vec![], None); - return Action::Pause; + let query = match self.get_property(vec![REQUEST_QUERY]) { + None => Bytes::new(), + Some(query) => { + println!(" query = {} ", String::from_utf8_lossy(&query)); + self.add_http_response_header_bytes("request-query", &query); + query + } }; - println!(" query = {} ", String::from_utf8_lossy(&query)); - self.add_http_response_header_bytes("request-query", &query); let Some(client_ip) = self.get_property(vec![REQUEST_X_REAL_IP]) else { self.send_http_response(557, vec![], None); @@ -151,9 +146,9 @@ impl HttpContext for HttpHeaders { println!(" continent = {} ", String::from_utf8_lossy(&value)); self.add_http_response_header_bytes("request-continent", &value); - let query = String::from_utf8_lossy(&query); + let query = std::str::from_utf8(&query).unwrap(); println!("query={}", query); - let params = querystring::querify(&query); + let params = querystring::querify(query); if let Some(url) = params.iter().find_map(|(k, v)| { if "url".eq_ignore_ascii_case(k) { diff --git a/examples/cdn/request_url/Cargo.toml b/examples/cdn/request_url/Cargo.toml index 09c5f02..d28e42f 100644 --- a/examples/cdn/request_url/Cargo.toml +++ b/examples/cdn/request_url/Cargo.toml @@ -1,6 +1,7 @@ +[workspace] [package] -name = "cdn_request_url" +name = "request_url" version = "0.1.0" edition = "2024" diff --git a/examples/cdn/variables_and_secrets/Cargo.lock b/examples/cdn/variables_and_secrets/Cargo.lock index a646bb9..dba2ee7 100644 --- a/examples/cdn/variables_and_secrets/Cargo.lock +++ b/examples/cdn/variables_and_secrets/Cargo.lock @@ -34,9 +34,7 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "fastedge" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9042fccaffdd2171e8ff481e5c21d22f15b8a4454b37273c2f3f902fb3d375e" +version = "0.4.0" dependencies = [ "bytes", "fastedge-derive", @@ -48,9 +46,7 @@ dependencies = [ [[package]] name = "fastedge-derive" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acacf180f92cbdf6f2fe1a772b7d92301e430ba207fb15b2fc87ccab4e418ff9" +version = "0.4.0" dependencies = [ "proc-macro2", "quote", diff --git a/examples/cdn/variables_and_secrets/Cargo.toml b/examples/cdn/variables_and_secrets/Cargo.toml index 853a2e1..e258e8b 100644 --- a/examples/cdn/variables_and_secrets/Cargo.toml +++ b/examples/cdn/variables_and_secrets/Cargo.toml @@ -10,4 +10,4 @@ crate-type = ["cdylib"] [dependencies] proxy-wasm = "0.2" -fastedge = { version = "0.3", features = ["proxywasm"] } +fastedge = { path = "../../../", features = ["proxywasm"] } diff --git a/examples/http/basic/api_wrapper/Cargo.lock b/examples/http/basic/api_wrapper/Cargo.lock index 12b387e..28275d7 100644 --- a/examples/http/basic/api_wrapper/Cargo.lock +++ b/examples/http/basic/api_wrapper/Cargo.lock @@ -49,9 +49,7 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "fastedge" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9042fccaffdd2171e8ff481e5c21d22f15b8a4454b37273c2f3f902fb3d375e" +version = "0.4.0" dependencies = [ "bytes", "fastedge-derive", @@ -63,9 +61,7 @@ dependencies = [ [[package]] name = "fastedge-derive" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acacf180f92cbdf6f2fe1a772b7d92301e430ba207fb15b2fc87ccab4e418ff9" +version = "0.4.0" dependencies = [ "proc-macro2", "quote", diff --git a/examples/http/basic/api_wrapper/Cargo.toml b/examples/http/basic/api_wrapper/Cargo.toml index 600ddd7..48d3d85 100644 --- a/examples/http/basic/api_wrapper/Cargo.toml +++ b/examples/http/basic/api_wrapper/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" crate-type = ["cdylib"] [dependencies] -fastedge = "0.3" +fastedge = { path = "../../../../" } serde = "1" serde_json = "1" url = "2.5" diff --git a/examples/http/basic/backend/Cargo.toml b/examples/http/basic/backend/Cargo.toml index bd0151e..5616f44 100644 --- a/examples/http/basic/backend/Cargo.toml +++ b/examples/http/basic/backend/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" crate-type = ["cdylib"] [dependencies] -fastedge = "0.3" +fastedge = { path = "../../../../" } anyhow = "1" querystring = "1.1" urlencoding = "2.1" diff --git a/examples/http/basic/hello_world/Cargo.lock b/examples/http/basic/hello_world/Cargo.lock index 1649c21..04690c7 100644 --- a/examples/http/basic/hello_world/Cargo.lock +++ b/examples/http/basic/hello_world/Cargo.lock @@ -28,9 +28,7 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "fastedge" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9042fccaffdd2171e8ff481e5c21d22f15b8a4454b37273c2f3f902fb3d375e" +version = "0.4.0" dependencies = [ "bytes", "fastedge-derive", @@ -42,9 +40,7 @@ dependencies = [ [[package]] name = "fastedge-derive" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acacf180f92cbdf6f2fe1a772b7d92301e430ba207fb15b2fc87ccab4e418ff9" +version = "0.4.0" dependencies = [ "proc-macro2", "quote", diff --git a/examples/http/basic/hello_world/Cargo.toml b/examples/http/basic/hello_world/Cargo.toml index e19e89b..f7c154e 100644 --- a/examples/http/basic/hello_world/Cargo.toml +++ b/examples/http/basic/hello_world/Cargo.toml @@ -9,5 +9,5 @@ edition = "2021" crate-type = ["cdylib"] [dependencies] -fastedge = "0.3" +fastedge = { path = "../../../../" } anyhow = "1" diff --git a/examples/http/basic/markdown_render/Cargo.toml b/examples/http/basic/markdown_render/Cargo.toml index fab0ee3..5d7b943 100644 --- a/examples/http/basic/markdown_render/Cargo.toml +++ b/examples/http/basic/markdown_render/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" crate-type = ["cdylib"] [dependencies] -fastedge = "0.3" +fastedge = { path = "../../../../" } mime = "0.3" pulldown-cmark = "0.11" url = "2.5" diff --git a/examples/http/basic/outbound_fetch/Cargo.lock b/examples/http/basic/outbound_fetch/Cargo.lock index ced10fe..4926d26 100644 --- a/examples/http/basic/outbound_fetch/Cargo.lock +++ b/examples/http/basic/outbound_fetch/Cargo.lock @@ -28,9 +28,7 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "fastedge" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9042fccaffdd2171e8ff481e5c21d22f15b8a4454b37273c2f3f902fb3d375e" +version = "0.4.0" dependencies = [ "bytes", "fastedge-derive", @@ -42,9 +40,7 @@ dependencies = [ [[package]] name = "fastedge-derive" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acacf180f92cbdf6f2fe1a772b7d92301e430ba207fb15b2fc87ccab4e418ff9" +version = "0.4.0" dependencies = [ "proc-macro2", "quote", diff --git a/examples/http/basic/outbound_fetch/Cargo.toml b/examples/http/basic/outbound_fetch/Cargo.toml index dc9d9ac..f27efb7 100644 --- a/examples/http/basic/outbound_fetch/Cargo.toml +++ b/examples/http/basic/outbound_fetch/Cargo.toml @@ -9,6 +9,6 @@ edition = "2021" crate-type = ["cdylib"] [dependencies] -fastedge = "0.3" +fastedge = { path = "../../../../" } anyhow = "1" serde_json = "1" diff --git a/examples/http/basic/print/Cargo.toml b/examples/http/basic/print/Cargo.toml index 4fd20da..5b1e5e3 100644 --- a/examples/http/basic/print/Cargo.toml +++ b/examples/http/basic/print/Cargo.toml @@ -9,5 +9,5 @@ edition = "2021" crate-type = ["cdylib"] [dependencies] -fastedge = "0.3" +fastedge = { path = "../../../../" } anyhow = "1" diff --git a/examples/http/basic/s3upload/Cargo.toml b/examples/http/basic/s3upload/Cargo.toml index 6cf887c..aa4c00a 100644 --- a/examples/http/basic/s3upload/Cargo.toml +++ b/examples/http/basic/s3upload/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" crate-type = ["cdylib"] [dependencies] -fastedge = "0.3" +fastedge = { path = "../../../../" } url = "2.3" rusty-s3 = "0.5" anyhow = "1" diff --git a/examples/http/basic/secret/Cargo.lock b/examples/http/basic/secret/Cargo.lock index facb041..8e5cf02 100644 --- a/examples/http/basic/secret/Cargo.lock +++ b/examples/http/basic/secret/Cargo.lock @@ -28,9 +28,7 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "fastedge" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9042fccaffdd2171e8ff481e5c21d22f15b8a4454b37273c2f3f902fb3d375e" +version = "0.4.0" dependencies = [ "bytes", "fastedge-derive", @@ -42,9 +40,7 @@ dependencies = [ [[package]] name = "fastedge-derive" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acacf180f92cbdf6f2fe1a772b7d92301e430ba207fb15b2fc87ccab4e418ff9" +version = "0.4.0" dependencies = [ "proc-macro2", "quote", diff --git a/examples/http/basic/secret/Cargo.toml b/examples/http/basic/secret/Cargo.toml index 43eee82..0241f64 100644 --- a/examples/http/basic/secret/Cargo.toml +++ b/examples/http/basic/secret/Cargo.toml @@ -9,5 +9,5 @@ edition = "2021" crate-type = ["cdylib"] [dependencies] -fastedge = "0.3" +fastedge = { path = "../../../../" } anyhow = "1" diff --git a/examples/http/basic/smart_switch/Cargo.toml b/examples/http/basic/smart_switch/Cargo.toml index 2a0668f..ea7bd59 100644 --- a/examples/http/basic/smart_switch/Cargo.toml +++ b/examples/http/basic/smart_switch/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" crate-type = ["cdylib"] [dependencies] -fastedge = "0.3" +fastedge = { path = "../../../../" } serde = "1.0" serde_json = "1.0" url = "2.5" diff --git a/examples/http/basic/watermark/Cargo.toml b/examples/http/basic/watermark/Cargo.toml index cadf9ac..3b0ac97 100644 --- a/examples/http/basic/watermark/Cargo.toml +++ b/examples/http/basic/watermark/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" crate-type = ["cdylib"] [dependencies] -fastedge = "0.3" +fastedge = { path = "../../../../" } url = "2.3" image = "0.24" rusty-s3 = "0.5" diff --git a/examples/http/wasi/cache/Cargo.lock b/examples/http/wasi/cache/Cargo.lock index 0354cbc..27d247b 100644 --- a/examples/http/wasi/cache/Cargo.lock +++ b/examples/http/wasi/cache/Cargo.lock @@ -49,7 +49,7 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "fastedge" -version = "0.3.5" +version = "0.4.0" dependencies = [ "bytes", "fastedge-derive", @@ -61,7 +61,7 @@ dependencies = [ [[package]] name = "fastedge-derive" -version = "0.3.5" +version = "0.4.0" dependencies = [ "proc-macro2", "quote", diff --git a/examples/http/wasi/key_value/Cargo.toml b/examples/http/wasi/key_value/Cargo.toml index 37b1ae0..c476d3f 100644 --- a/examples/http/wasi/key_value/Cargo.toml +++ b/examples/http/wasi/key_value/Cargo.toml @@ -10,7 +10,7 @@ crate-type = ["cdylib"] [dependencies] wstd = "0.6" -fastedge = "0.3" +fastedge = { path = "../../../../" } anyhow = "1" querystring = "1.1" serde_json = "1" diff --git a/examples/http/wasi/large_env_variable/Cargo.toml b/examples/http/wasi/large_env_variable/Cargo.toml index 09c0101..5d1572b 100644 --- a/examples/http/wasi/large_env_variable/Cargo.toml +++ b/examples/http/wasi/large_env_variable/Cargo.toml @@ -10,5 +10,5 @@ crate-type = ["cdylib"] [dependencies] wstd = "0.6" -fastedge = "0.3" +fastedge = { path = "../../../../" } anyhow = "1" diff --git a/examples/http/wasi/print/Cargo.toml b/examples/http/wasi/print/Cargo.toml index ee8fa74..a4e4ff0 100644 --- a/examples/http/wasi/print/Cargo.toml +++ b/examples/http/wasi/print/Cargo.toml @@ -1,7 +1,7 @@ - +[workspace] [package] -name = "http_wasi_print" +name = "wasi-print" version = "0.1.0" edition = "2024" diff --git a/examples/http/wasi/secret_rollover/Cargo.lock b/examples/http/wasi/secret_rollover/Cargo.lock index 083bc3d..77ba4dd 100644 --- a/examples/http/wasi/secret_rollover/Cargo.lock +++ b/examples/http/wasi/secret_rollover/Cargo.lock @@ -40,9 +40,7 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "fastedge" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9042fccaffdd2171e8ff481e5c21d22f15b8a4454b37273c2f3f902fb3d375e" +version = "0.4.0" dependencies = [ "bytes", "fastedge-derive", @@ -54,9 +52,7 @@ dependencies = [ [[package]] name = "fastedge-derive" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acacf180f92cbdf6f2fe1a772b7d92301e430ba207fb15b2fc87ccab4e418ff9" +version = "0.4.0" dependencies = [ "proc-macro2", "quote", diff --git a/examples/http/wasi/secret_rollover/Cargo.toml b/examples/http/wasi/secret_rollover/Cargo.toml index 050ff36..99d06ba 100644 --- a/examples/http/wasi/secret_rollover/Cargo.toml +++ b/examples/http/wasi/secret_rollover/Cargo.toml @@ -10,6 +10,6 @@ crate-type = ["cdylib"] [dependencies] wstd = "0.6" -fastedge = "0.3" +fastedge = { path = "../../../../" } anyhow = "1" serde_json = "1" diff --git a/examples/http/wasi/variables_and_secrets/Cargo.lock b/examples/http/wasi/variables_and_secrets/Cargo.lock index 10fc6f7..182cfb4 100644 --- a/examples/http/wasi/variables_and_secrets/Cargo.lock +++ b/examples/http/wasi/variables_and_secrets/Cargo.lock @@ -40,9 +40,7 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "fastedge" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9042fccaffdd2171e8ff481e5c21d22f15b8a4454b37273c2f3f902fb3d375e" +version = "0.4.0" dependencies = [ "bytes", "fastedge-derive", @@ -54,9 +52,7 @@ dependencies = [ [[package]] name = "fastedge-derive" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acacf180f92cbdf6f2fe1a772b7d92301e430ba207fb15b2fc87ccab4e418ff9" +version = "0.4.0" dependencies = [ "proc-macro2", "quote", diff --git a/examples/http/wasi/variables_and_secrets/Cargo.toml b/examples/http/wasi/variables_and_secrets/Cargo.toml index d23d4e1..51e8d02 100644 --- a/examples/http/wasi/variables_and_secrets/Cargo.toml +++ b/examples/http/wasi/variables_and_secrets/Cargo.toml @@ -10,5 +10,5 @@ crate-type = ["cdylib"] [dependencies] wstd = "0.6" -fastedge = "0.3" +fastedge = { path = "../../../../" } anyhow = "1"