set_filter_state extension (#29844)

Commit Message: Adds a new extension to set the filter state
Risk Level: low
Testing: done
Docs Changes: yes
Release Notes: yes
Issue: #29813
Signed-off-by: Kuat Yessenov <kuat@google.com>

Mirrored from https://github.com/envoyproxy/envoy @ 025d49f78410841e6caa26c1e42465c17f168e91
main
update-envoy[bot] 1 year ago
parent 2ecfd9f58e
commit 53964a429f
  1. 3
      BUILD
  2. 12
      envoy/extensions/filters/common/set_filter_state/v3/BUILD
  3. 60
      envoy/extensions/filters/common/set_filter_state/v3/value.proto
  4. 12
      envoy/extensions/filters/http/set_filter_state/v3/BUILD
  5. 27
      envoy/extensions/filters/http/set_filter_state/v3/set_filter_state.proto
  6. 12
      envoy/extensions/filters/network/set_filter_state/v3/BUILD
  7. 27
      envoy/extensions/filters/network/set_filter_state/v3/set_filter_state.proto
  8. 3
      versioning/BUILD

@ -156,6 +156,7 @@ proto_library(
"//envoy/extensions/filters/common/dependency/v3:pkg",
"//envoy/extensions/filters/common/fault/v3:pkg",
"//envoy/extensions/filters/common/matcher/action/v3:pkg",
"//envoy/extensions/filters/common/set_filter_state/v3:pkg",
"//envoy/extensions/filters/http/adaptive_concurrency/v3:pkg",
"//envoy/extensions/filters/http/admission_control/v3:pkg",
"//envoy/extensions/filters/http/alternate_protocols_cache/v3:pkg",
@ -202,6 +203,7 @@ proto_library(
"//envoy/extensions/filters/http/ratelimit/v3:pkg",
"//envoy/extensions/filters/http/rbac/v3:pkg",
"//envoy/extensions/filters/http/router/v3:pkg",
"//envoy/extensions/filters/http/set_filter_state/v3:pkg",
"//envoy/extensions/filters/http/set_metadata/v3:pkg",
"//envoy/extensions/filters/http/stateful_session/v3:pkg",
"//envoy/extensions/filters/http/tap/v3:pkg",
@ -225,6 +227,7 @@ proto_library(
"//envoy/extensions/filters/network/ratelimit/v3:pkg",
"//envoy/extensions/filters/network/rbac/v3:pkg",
"//envoy/extensions/filters/network/redis_proxy/v3:pkg",
"//envoy/extensions/filters/network/set_filter_state/v3:pkg",
"//envoy/extensions/filters/network/sni_cluster/v3:pkg",
"//envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3:pkg",
"//envoy/extensions/filters/network/tcp_proxy/v3:pkg",

@ -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_udpa//udpa/annotations:pkg",
],
)

@ -0,0 +1,60 @@
syntax = "proto3";
package envoy.extensions.filters.common.set_filter_state.v3;
import "envoy/config/core/v3/substitution_format_string.proto";
import "udpa/annotations/status.proto";
import "validate/validate.proto";
option java_package = "io.envoyproxy.envoy.extensions.filters.common.set_filter_state.v3";
option java_outer_classname = "ValueProto";
option java_multiple_files = true;
option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/common/set_filter_state/v3;set_filter_statev3";
option (udpa.annotations.file_status).package_version_status = ACTIVE;
// [#protodoc-title: Set-Filter-State filter state value]
// A filter state key and value pair.
// [#next-free-field: 6]
message FilterStateValue {
enum SharedWithUpstream {
// Object is not shared with the upstream internal connections.
NONE = 0;
// Object is shared with the upstream internal connection.
ONCE = 1;
// Object is shared with the upstream internal connection and any internal connection upstream from it.
TRANSITIVE = 2;
}
oneof key {
option (validate.required) = true;
// Filter state object key. The key is expected to be registered via an object factory, see
// :ref:`the well-known filter state keys <well_known_filter_state>`.
string object_key = 1 [(validate.rules).string = {min_len: 1}];
}
oneof value {
option (validate.required) = true;
// Uses the :ref:`format string <config_access_log_format_strings>` to
// instantiate the filter state object value.
config.core.v3.SubstitutionFormatString format_string = 2;
}
// If marked as read-only, the filter state key value is locked, and cannot
// be overridden by any filter, including this filter.
bool read_only = 3;
// Configures the object to be shared with the upstream internal connections. See :ref:`internal upstream
// transport <config_internal_upstream_transport>` for more details on the filter state sharing with
// the internal connections.
SharedWithUpstream shared_with_upstream = 4;
// Skip the update if the value evaluates to an empty string.
// This option can be used to supply multiple alternatives for the same filter state object key.
bool skip_if_empty = 5;
}

@ -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/extensions/filters/common/set_filter_state/v3:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
)

@ -0,0 +1,27 @@
syntax = "proto3";
package envoy.extensions.filters.http.set_filter_state.v3;
import "envoy/extensions/filters/common/set_filter_state/v3/value.proto";
import "udpa/annotations/status.proto";
option java_package = "io.envoyproxy.envoy.extensions.filters.http.set_filter_state.v3";
option java_outer_classname = "SetFilterStateProto";
option java_multiple_files = true;
option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/set_filter_state/v3;set_filter_statev3";
option (udpa.annotations.file_status).package_version_status = ACTIVE;
// [#protodoc-title: Set-Filter-State Filter]
//
// This filter sets or updates the dynamic filter state. See :ref:`the filter
// documentation <config_http_filters_set_filter_state>` for more information on
// how this filter should be used.
//
// [#extension: envoy.filters.http.set_filter_state]
message Config {
// A sequence of the filter state values to apply in the specified order
// when a new request is received.
repeated common.set_filter_state.v3.FilterStateValue on_request_headers = 1;
}

@ -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/extensions/filters/common/set_filter_state/v3:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
)

@ -0,0 +1,27 @@
syntax = "proto3";
package envoy.extensions.filters.network.set_filter_state.v3;
import "envoy/extensions/filters/common/set_filter_state/v3/value.proto";
import "udpa/annotations/status.proto";
option java_package = "io.envoyproxy.envoy.extensions.filters.network.set_filter_state.v3";
option java_outer_classname = "SetFilterStateProto";
option java_multiple_files = true;
option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/set_filter_state/v3;set_filter_statev3";
option (udpa.annotations.file_status).package_version_status = ACTIVE;
// [#protodoc-title: Set-Filter-State Filter]
//
// This filter sets or updates the dynamic filter state. See :ref:`the filter
// documentation <config_network_filters_set_filter_state>` for more
// information on how this filter should be used.
//
// [#extension: envoy.filters.network.set_filter_state]
message Config {
// A sequence of the filter state values to apply in the specified order
// when a new connection is received.
repeated common.set_filter_state.v3.FilterStateValue on_new_connection = 1;
}

@ -94,6 +94,7 @@ proto_library(
"//envoy/extensions/filters/common/dependency/v3:pkg",
"//envoy/extensions/filters/common/fault/v3:pkg",
"//envoy/extensions/filters/common/matcher/action/v3:pkg",
"//envoy/extensions/filters/common/set_filter_state/v3:pkg",
"//envoy/extensions/filters/http/adaptive_concurrency/v3:pkg",
"//envoy/extensions/filters/http/admission_control/v3:pkg",
"//envoy/extensions/filters/http/alternate_protocols_cache/v3:pkg",
@ -140,6 +141,7 @@ proto_library(
"//envoy/extensions/filters/http/ratelimit/v3:pkg",
"//envoy/extensions/filters/http/rbac/v3:pkg",
"//envoy/extensions/filters/http/router/v3:pkg",
"//envoy/extensions/filters/http/set_filter_state/v3:pkg",
"//envoy/extensions/filters/http/set_metadata/v3:pkg",
"//envoy/extensions/filters/http/stateful_session/v3:pkg",
"//envoy/extensions/filters/http/tap/v3:pkg",
@ -163,6 +165,7 @@ proto_library(
"//envoy/extensions/filters/network/ratelimit/v3:pkg",
"//envoy/extensions/filters/network/rbac/v3:pkg",
"//envoy/extensions/filters/network/redis_proxy/v3:pkg",
"//envoy/extensions/filters/network/set_filter_state/v3:pkg",
"//envoy/extensions/filters/network/sni_cluster/v3:pkg",
"//envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3:pkg",
"//envoy/extensions/filters/network/tcp_proxy/v3:pkg",

Loading…
Cancel
Save