consul/proto-public/pbmesh/v2beta1/pbproxystate/header_mutations.proto
John Murret 7a410d7c5b
NET-6945 - Replace usage of deprecated Envoy field envoy.config.core.v3.HeaderValueOption.append (#20078)
* NET-6945 - Replace usage of deprecated Envoy field envoy.config.core.v3.HeaderValueOption.append

* update proto for v2 and then update xds v2 logic

* add changelog

* Update 20078.txt to be consistent with existing changelog entries

* swap enum values tomatch envoy.
2024-01-04 00:36:25 +00:00

51 lines
1.3 KiB
Protocol Buffer

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
syntax = "proto3";
package hashicorp.consul.mesh.v2beta1.pbproxystate;
// Note: it's nice to have this list of header mutations as opposed to configuration similar to Envoy because it
// translates more nicely from GAMMA HTTPRoute, and our existing service router config. Then xds code can handle turning
// it into envoy xds.
message HeaderMutation {
oneof action {
RequestHeaderAdd request_header_add = 1;
RequestHeaderRemove request_header_remove = 2;
ResponseHeaderAdd response_header_add = 3;
ResponseHeaderRemove response_header_remove = 4;
}
}
message RequestHeaderAdd {
Header header = 1;
AppendAction append_action = 2;
}
message RequestHeaderRemove {
repeated string header_keys = 1;
}
message ResponseHeaderAdd {
Header header = 1;
AppendAction append_action = 2;
}
message ResponseHeaderRemove {
repeated string header_keys = 1;
}
message Header {
string key = 1;
string value = 2;
}
// +kubebuilder:validation:Enum=APPEND_ACTION_APPEND_IF_EXISTS_OR_ADD;APPEND_ACTION_OVERWRITE_IF_EXISTS_OR_ADD
// +kubebuilder:validation:Type=string
enum AppendAction {
// buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX
APPEND_ACTION_APPEND_IF_EXISTS_OR_ADD = 0;
APPEND_ACTION_ADD_IF_ABSENT = 1;
APPEND_ACTION_OVERWRITE_IF_EXISTS_OR_ADD = 2;
}