add extension point for custom StringMatcher, and lua implementation (#32586)
Risk Level: Low Testing: New tests Signed-off-by: Greg Greenway <ggreenway@apple.com> Mirrored from https://github.com/envoyproxy/envoy @ f9ec5b8e59de6cf5cafdab2a954b03b83b58c64dmain
parent
00f6ad0725
commit
2059357065
6 changed files with 59 additions and 1 deletions
@ -0,0 +1,12 @@ |
||||
# DO NOT EDIT. This file is generated by tools/proto_format/proto_sync.py. |
||||
|
||||
load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") |
||||
|
||||
licenses(["notice"]) # Apache 2 |
||||
|
||||
api_proto_package( |
||||
deps = [ |
||||
"//envoy/config/core/v3:pkg", |
||||
"@com_github_cncf_xds//udpa/annotations:pkg", |
||||
], |
||||
) |
@ -0,0 +1,37 @@ |
||||
syntax = "proto3"; |
||||
|
||||
package envoy.extensions.string_matcher.lua.v3; |
||||
|
||||
import "envoy/config/core/v3/base.proto"; |
||||
|
||||
import "udpa/annotations/status.proto"; |
||||
import "validate/validate.proto"; |
||||
|
||||
option java_package = "io.envoyproxy.envoy.extensions.string_matcher.lua.v3"; |
||||
option java_outer_classname = "LuaProto"; |
||||
option java_multiple_files = true; |
||||
option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/string_matcher/lua/v3;luav3"; |
||||
option (udpa.annotations.file_status).package_version_status = ACTIVE; |
||||
|
||||
// [#protodoc-title: Lua StringMatcher] |
||||
// A Lua StringMatcher allows executing a Lua script to determine if a string is a match. The configured source |
||||
// code must define a function named `envoy_match`. If the function returns true, the string is considered a match. |
||||
// Any other result, including an execution error, is considered a non-match. |
||||
// |
||||
// Example: |
||||
// |
||||
// .. code-block:: yaml |
||||
// |
||||
// source_code: |
||||
// inline_string: | |
||||
// function envoy_match(str) |
||||
// -- Do something. |
||||
// return true |
||||
// end |
||||
// |
||||
// [#extension: envoy.string_matcher.lua] |
||||
|
||||
message Lua { |
||||
// The Lua code that Envoy will execute |
||||
config.core.v3.DataSource source_code = 1 [(validate.rules).message = {required: true}]; |
||||
} |
Loading…
Reference in new issue