I want to make a redis call inside the lua script in the Envoy Filter by using a lua redis client (https://github.com/noma4i/lua-api-client ) to translate a custom token to JWT token.
Since the code of Envoy Filter have to be inlined into the configuration how can I load a external lua module?
1 Like
It’s the standard Envoy Lua filter that is invoked.
https://www.envoyproxy.io/docs/envoy/latest/configuration/http_filters/lua_filter
If you’re having difficulty using it, the Envoy community might be more helpful than us.
1 Like
As far as I can tell (I haven’t done this), you’ll need to compile a custom version of envoy. See the note on lua rocks here:
# Building Envoy with Bazel
## Production environments
To build Envoy with Bazel in a production environment, where the [Envoy
dependencies](https://www.envoyproxy.io/docs/envoy/latest/install/building.html#requirements) are typically
independently sourced, the following steps should be followed:
1. Install the latest version of [Bazel](https://bazel.build/versions/master/docs/install.html) in your environment.
2. Configure, build and/or install the [Envoy dependencies](https://www.envoyproxy.io/docs/envoy/latest/install/building.html#requirements).
3. Configure a Bazel [WORKSPACE](https://bazel.build/versions/master/docs/be/workspace.html)
to point Bazel at the Envoy dependencies. An example is provided in the CI Docker image
[WORKSPACE](https://github.com/envoyproxy/envoy/blob/master/ci/WORKSPACE) and corresponding
[BUILD](https://github.com/envoyproxy/envoy/blob/master/ci/prebuilt/BUILD) files.
4. `bazel build --package_path %workspace%:<path to Envoy source tree> //source/exe:envoy-static`
from the directory containing your WORKSPACE.
## Quick start Bazel build for developers
As a developer convenience, a [WORKSPACE](https://github.com/envoyproxy/envoy/blob/master/WORKSPACE) and
This file has been truncated. show original
Then, you’ll need to get Istio to use your version of envoy.
1 Like