https://github.com/peterj/api-aggregation-wasm
API aggregation with Envoy & WASM
https://github.com/peterj/api-aggregation-wasm
Last synced: 14 days ago
JSON representation
API aggregation with Envoy & WASM
- Host: GitHub
- URL: https://github.com/peterj/api-aggregation-wasm
- Owner: peterj
- Created: 2024-05-31T00:05:23.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-31T18:51:56.000Z (about 2 years ago)
- Last Synced: 2025-03-19T21:43:01.750Z (about 1 year ago)
- Language: Go
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# API Aggregation with Envoy & WASM
I'll try to build a simple API aggregation plugin for Envoy using WebAssembly (Wasm) as the extension mechanism.
- Live stream: https://www.youtube.com/watch?v=Tbdj5Sw6HI0
## What are we building?
If I make a request to `/hello` on the proxy, I want the proxy (or the extension) to make a call to:
- GET host1 `/one`
- GET host2 `/two`
Combine (or aggregate) the responses from those two endpoints and then return that response.
We make request to `/hello` --> Proxy makes requests to `/one` and `/two` --> Proxy aggregates the responses and returns it to the client.
```
GET /hello --> [{ "value": "one" }, { "value": "two"}]
/one --> { "value": "one" }
/two --> { "value": "two" }
```
## Configuration
```json
[{
"path": "/",
"upstreams": [
{
"clusterName": "httpbin",
"path": "/ip"
},
{
"clusterName": "httpbin",
"path": "/headers"
}
],
}]
```
## TODOs
- [x] Scaffold the basic Wasm extension project
- [x] Create (aka re-use) the Makefile for building the Wasm extension
- [x] Implement calling multiple upstream services from the Wasm extension & aggregating the responses in some way
- [x] Make the extension configurable with the upstream services to call and the aggregation strategy
- [ ] Add authority and method to the configuration
- [ ] Properly aggregate the responses