.. _envoy_v3_api_file_envoy/extensions/filters/http/lua/v3/lua.proto: Lua === This documentation is for the Envoy v3 API. As of Envoy v1.18 the v2 API has been removed and is no longer supported. If you are upgrading from v2 API config you may wish to view the v2 API documentation: :ref:`config/filter/http/lua/v2/lua.proto ` .. _extension_envoy.filters.http.lua: This extension may be referenced by the qualified name ``envoy.filters.http.lua`` .. note:: This extension is intended to be robust against untrusted downstream traffic. It assumes that the upstream is trusted. .. tip:: This extension extends and can be used with the following extension category: - :ref:`envoy.filters.http ` Lua :ref:`configuration overview `. .. _envoy_v3_api_msg_extensions.filters.http.lua.v3.Lua: extensions.filters.http.lua.v3.Lua ---------------------------------- :repo:`[extensions.filters.http.lua.v3.Lua proto] ` .. code-block:: json { "inline_code": "...", "source_codes": "{...}" } .. _envoy_v3_api_field_extensions.filters.http.lua.v3.Lua.inline_code: inline_code (`string `_, *REQUIRED*) The Lua code that Envoy will execute. This can be a very small script that further loads code from disk if desired. Note that if JSON configuration is used, the code must be properly escaped. YAML configuration may be easier to read since YAML supports multi-line strings so complex scripts can be easily expressed inline in the configuration. .. _envoy_v3_api_field_extensions.filters.http.lua.v3.Lua.source_codes: source_codes (**repeated** map<`string `_, :ref:`config.core.v3.DataSource `>) Map of named Lua source codes that can be referenced in :ref:`LuaPerRoute `. The Lua source codes can be loaded from inline string or local files. Example: .. code-block:: yaml source_codes: hello.lua: inline_string: | function envoy_on_response(response_handle) -- Do something. end world.lua: filename: /etc/lua/world.lua .. _envoy_v3_api_msg_extensions.filters.http.lua.v3.LuaPerRoute: extensions.filters.http.lua.v3.LuaPerRoute ------------------------------------------ :repo:`[extensions.filters.http.lua.v3.LuaPerRoute proto] ` .. code-block:: json { "disabled": "...", "name": "...", "source_code": "{...}" } .. _envoy_v3_api_field_extensions.filters.http.lua.v3.LuaPerRoute.disabled: disabled (`bool `_) Disable the Lua filter for this particular vhost or route. If disabled is specified in multiple per-filter-configs, the most specific one will be used. Precisely one of :ref:`disabled `, :ref:`name `, :ref:`source_code ` must be set. .. _envoy_v3_api_field_extensions.filters.http.lua.v3.LuaPerRoute.name: name (`string `_) A name of a Lua source code stored in :ref:`Lua.source_codes `. Precisely one of :ref:`disabled `, :ref:`name `, :ref:`source_code ` must be set. .. _envoy_v3_api_field_extensions.filters.http.lua.v3.LuaPerRoute.source_code: source_code (:ref:`config.core.v3.DataSource `) A configured per-route Lua source code that can be served by RDS or provided inline. Precisely one of :ref:`disabled `, :ref:`name `, :ref:`source_code ` must be set.