Skip to content

Commit

Permalink
set_metadata: allow setting typed metadata (#31244)
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Bohanon <[email protected]>

Mirrored from https://github.com/envoyproxy/envoy @ 483ecb2d4055b42a806f0a1003243ba62c86cf3a
  • Loading branch information
update-envoy[bot] committed Dec 19, 2023
1 parent 661bb01 commit 1c319c5
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
5 changes: 4 additions & 1 deletion envoy/extensions/filters/http/set_metadata/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@ 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"],
deps = [
"//envoy/annotations:pkg",
"@com_github_cncf_xds//udpa/annotations:pkg",
],
)
36 changes: 33 additions & 3 deletions envoy/extensions/filters/http/set_metadata/v3/set_metadata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ syntax = "proto3";

package envoy.extensions.filters.http.set_metadata.v3;

import "google/protobuf/any.proto";
import "google/protobuf/struct.proto";

import "envoy/annotations/deprecation.proto";
import "udpa/annotations/status.proto";
import "validate/validate.proto";

Expand All @@ -19,13 +21,41 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE;
//
// [#extension: envoy.filters.http.set_metadata]

message Config {
message Metadata {
// The metadata namespace.
string metadata_namespace = 1 [(validate.rules).string = {min_len: 1}];

// The value to update the namespace with. See
// Allow the filter to overwrite or merge with an existing value in the namespace.
bool allow_overwrite = 2;

// The value to place at the namespace. If ``allow_overwrite``, this will
// overwrite or merge with any existing values in that namespace. See
// :ref:`the filter documentation <config_http_filters_set_metadata>` for
// more information on how this value is merged with potentially existing
// ones if ``allow_overwrite`` is configured. Only one of ``value`` and
// ``typed_value`` may be set.
google.protobuf.Struct value = 3;

// The value to place at the namespace. If ``allow_overwrite``, this will
// overwrite any existing values in that namespace. Only one of ``value`` and
// ``typed_value`` may be set.
google.protobuf.Any typed_value = 4;
}

message Config {
// The metadata namespace.
// This field is deprecated; please use ``metadata`` as replacement.
string metadata_namespace = 1
[deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];

// The untyped value to update the dynamic metadata namespace with. See
// :ref:`the filter documentation <config_http_filters_set_metadata>` for
// more information on how this value is merged with potentially existing
// ones.
google.protobuf.Struct value = 2;
// This field is deprecated; please use ``metadata`` as replacement.
google.protobuf.Struct value = 2
[deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];

// Defines changes to be made to dynamic metadata.
repeated Metadata metadata = 3;
}

0 comments on commit 1c319c5

Please sign in to comment.