emissary-ingress / emissary

open source Kubernetes-native API gateway for microservices built on the Envoy Proxy
https://www.getambassador.io
Apache License 2.0
4.34k stars 682 forks source link

Lua-Scripting Capabilities at Mapping level #4681

Open anshjain18 opened 1 year ago

anshjain18 commented 1 year ago

Hi Team, I have recently started using Emissary-Ingress for my org and have some per-domain (or per host) use cases which can be easliy solved using Lua Scripts. The problem currently is Lua Scripting can only be achieved at Module level i.e it will run for every request irrespective of domain (host) etc. Can we have the capabiltiy to implement lua scripts for a particular domain or host or route (probably at Mapping level).

Some of my use cases:

  1. For some particular hosts I want to add some query params to the request URL. For ex -> if the incoming request is www.example.com/path?key1=val1, I would like to make it: /path?key1=val1&key2=val2, before sending it to upstream.
  2. Need to change request method to POST for requests coming from some particular domains.
wangsoft commented 4 months ago

is this ready now ?