-
Notifications
You must be signed in to change notification settings - Fork 4.6k
/
lua.proto
98 lines (84 loc) · 3.94 KB
/
lua.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
syntax = "proto3";
package envoy.extensions.filters.http.lua.v3;
import "envoy/config/core/v3/base.proto";
import "envoy/annotations/deprecation.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option java_package = "io.envoyproxy.envoy.extensions.filters.http.lua.v3";
option java_outer_classname = "LuaProto";
option java_multiple_files = true;
option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/lua/v3;luav3";
option (udpa.annotations.file_status).package_version_status = ACTIVE;
// [#protodoc-title: Lua]
// Lua :ref:`configuration overview <config_http_filters_lua>`.
// [#extension: envoy.filters.http.lua]
message Lua {
option (udpa.annotations.versioning).previous_message_type =
"envoy.config.filter.http.lua.v2.Lua";
// 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.
//
// This field is deprecated. Please use
// :ref:`default_source_code <envoy_v3_api_field_extensions.filters.http.lua.v3.Lua.default_source_code>`.
// Only one of :ref:`inline_code <envoy_v3_api_field_extensions.filters.http.lua.v3.Lua.inline_code>`
// or :ref:`default_source_code <envoy_v3_api_field_extensions.filters.http.lua.v3.Lua.default_source_code>`
// can be set for the Lua filter.
string inline_code = 1
[deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];
// Map of named Lua source codes that can be referenced in :ref:`LuaPerRoute
// <envoy_v3_api_msg_extensions.filters.http.lua.v3.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
//
map<string, config.core.v3.DataSource> source_codes = 2;
// The default Lua code that Envoy will execute. If no per route config is provided
// for the request, this Lua code will be applied.
config.core.v3.DataSource default_source_code = 3;
// Optional additional prefix to use when emitting statistics. By default
// metrics are emitted in *.lua.* namespace. If multiple lua filters are
// configured in a filter chain, the stats from each filter instance can
// be emitted using custom stat prefix to distinguish emitted
// statistics. For example:
//
// .. code-block:: yaml
//
// http_filters:
// - name: envoy.filters.http.lua
// typed_config:
// "@type": type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua
// stat_prefix: foo_script # This emits lua.foo_script.errors etc.
// - name: envoy.filters.http.lua
// typed_config:
// "@type": type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua
// stat_prefix: bar_script # This emits lua.bar_script.errors etc.
//
string stat_prefix = 4;
}
message LuaPerRoute {
oneof override {
option (validate.required) = true;
// 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.
bool disabled = 1 [(validate.rules).bool = {const: true}];
// A name of a Lua source code stored in
// :ref:`Lua.source_codes <envoy_v3_api_field_extensions.filters.http.lua.v3.Lua.source_codes>`.
string name = 2 [(validate.rules).string = {min_len: 1}];
// A configured per-route Lua source code that can be served by RDS or provided inline.
config.core.v3.DataSource source_code = 3;
}
}