dynamic_modules: scaffolds config API & HTTP Filter (#36448)
Commit Message: dynamic_modules: scaffolds config API & HTTP Filter Additional Description: This scaffolds the configuration API marked as work-in-progress, and the skeleton HTTP filter implementation based on the configuration. The real implementations will follow after this commit. Risk Level: low Testing: done Docs Changes: n/a Release Notes: n/a (not enabled yet) Platform Specific Features: [Optional Runtime guard:] [Optional Fixes #Issue] [Optional Fixes commit #PR or SHA] [Optional Deprecated:] [Optional [API Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):] --------- Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com> Mirrored from https://github.com/envoyproxy/envoy @ 0e6450aac2d0010555c82eb1ff513cf234ab5817main
parent
82f7eaa7eb
commit
b4ce674b0a
6 changed files with 124 additions and 0 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 = [ |
||||
"@com_github_cncf_xds//udpa/annotations:pkg", |
||||
"@com_github_cncf_xds//xds/annotations/v3:pkg", |
||||
], |
||||
) |
@ -0,0 +1,49 @@ |
||||
syntax = "proto3"; |
||||
|
||||
package envoy.extensions.dynamic_modules.v3; |
||||
|
||||
import "xds/annotations/v3/status.proto"; |
||||
|
||||
import "udpa/annotations/status.proto"; |
||||
import "validate/validate.proto"; |
||||
|
||||
option java_package = "io.envoyproxy.envoy.extensions.dynamic_modules.v3"; |
||||
option java_outer_classname = "DynamicModulesProto"; |
||||
option java_multiple_files = true; |
||||
option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/dynamic_modules/v3;dynamic_modulesv3"; |
||||
option (udpa.annotations.file_status).package_version_status = ACTIVE; |
||||
option (xds.annotations.v3.file_status).work_in_progress = true; |
||||
|
||||
// [#protodoc-title: Dynamic Modules common configuration] |
||||
|
||||
// Configuration of a dynamic module. A dynamic module is a shared object file that can be loaded via dlopen |
||||
// by various Envoy extension points. Currently, only HTTP filter (envoy.filters.http.dynamic_modules) is supported. |
||||
// |
||||
// How a module is loaded is determined by the extension point that uses it. For example, the HTTP filter |
||||
// loads the module with dlopen when Envoy receives a configuration that references the module at load time. |
||||
// If loading the module fails, the configuration will be rejected. |
||||
// |
||||
// Whether or not the shared object is the same is determined by the file path as well as the file's inode depending |
||||
// on the platform. Notably, if the file path and the content of the file are the same, the shared object will be reused. |
||||
// |
||||
// A module must be compatible with the ABI specified in :repo:`abi.h <source/extensions/dynamic_modules/abi.h>`. |
||||
// Currently, compatibility is only guaranteed by an exact version match between the Envoy |
||||
// codebase and the dynamic module SDKs. In the future, after the ABI is stabilized, we will revisit |
||||
// this restriction and hopefully provide a wider compatibility guarantee. Until then, Envoy |
||||
// checks the hash of the ABI header files to ensure that the dynamic modules are built against the |
||||
// same version of the ABI. |
||||
// |
||||
// Currently, the implementation is work in progress and not usable. |
||||
message DynamicModuleConfig { |
||||
// The name of the dynamic module. The client is expected to have some configuration indicating where to search for the module. |
||||
// In Envoy, the search path can only be configured via the environment variable ``ENVOY_DYNAMIC_MODULES_SEARCH_PATH``. |
||||
// The actual search path is ``${ENVOY_DYNAMIC_MODULES_SEARCH_PATH}/lib${name}.so``. TODO: make the search path configurable via |
||||
// command line options. |
||||
string name = 1 [(validate.rules).string = {min_len: 1}]; |
||||
|
||||
// Set true to prevent the module from being unloaded with dlclose. |
||||
// This is useful for modules that have global state that should not be unloaded. |
||||
// A module is closed when no more references to it exist in the process. For example, |
||||
// no HTTP filters are using the module (e.g. after configuration update). |
||||
bool do_not_close = 3; |
||||
} |
@ -0,0 +1,13 @@ |
||||
# 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/extensions/dynamic_modules/v3:pkg", |
||||
"@com_github_cncf_xds//udpa/annotations:pkg", |
||||
"@com_github_cncf_xds//xds/annotations/v3:pkg", |
||||
], |
||||
) |
@ -0,0 +1,46 @@ |
||||
syntax = "proto3"; |
||||
|
||||
package envoy.extensions.filters.http.dynamic_modules.v3; |
||||
|
||||
import "envoy/extensions/dynamic_modules/v3/dynamic_modules.proto"; |
||||
|
||||
import "xds/annotations/v3/status.proto"; |
||||
|
||||
import "udpa/annotations/status.proto"; |
||||
|
||||
option java_package = "io.envoyproxy.envoy.extensions.filters.http.dynamic_modules.v3"; |
||||
option java_outer_classname = "DynamicModulesProto"; |
||||
option java_multiple_files = true; |
||||
option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/dynamic_modules/v3;dynamic_modulesv3"; |
||||
option (udpa.annotations.file_status).package_version_status = ACTIVE; |
||||
option (xds.annotations.v3.file_status).work_in_progress = true; |
||||
|
||||
// [#protodoc-title: HTTP filter for dynamic modules] |
||||
|
||||
// Configuration of the HTTP filter for dynamic modules. This filter allows loading shared object files |
||||
// that can be loaded via dlopen by the HTTP filter. |
||||
// |
||||
// A module can be loaded by multiple HTTP filters, hence the program can be structured in a way that |
||||
// the module is loaded only once and shared across multiple filters providing multiple functionalities. |
||||
// |
||||
// Currently, the implementation is work in progress and not usable. |
||||
message DynamicModuleFilter { |
||||
// Specifies the shared-object level configuration. |
||||
envoy.extensions.dynamic_modules.v3.DynamicModuleConfig dynamic_module_config = 1; |
||||
|
||||
// The name for this filter configuration. This can be used to distinguish between different filter implementations |
||||
// inside a dynamic module. For example, a module can have completely different filter implementations. |
||||
// When Envoy receives this configuration, it passes the filter_name to the dynamic module's HTTP filter config init function |
||||
// together with the filter_config. |
||||
// That way a module can decide which in-module filter implementation to use based on the name at load time. |
||||
string filter_name = 2; |
||||
|
||||
// The configuration for the filter chosen by filter_name. This is passed to the module's HTTP filter initialization function. |
||||
// Together with the filter_name, the module can decide which in-module filter implementation to use and |
||||
// fine-tune the behavior of the filter. |
||||
// |
||||
// For example, if a module has two filter implementations, one for logging and one for header manipulation, |
||||
// filter_name is used to choose either logging or header manipulation. The filter_config can be used to |
||||
// configure the logging level or the header manipulation behavior. |
||||
string filter_config = 3; |
||||
} |
Loading…
Reference in new issue