2023-07-21 16:21:39 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
2023-08-21 17:31:54 +00:00
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
2023-07-21 16:21:39 +00:00
|
|
|
|
|
|
|
syntax = "proto3";
|
|
|
|
|
2023-09-22 16:51:15 +00:00
|
|
|
package hashicorp.consul.mesh.v2beta1.pbproxystate;
|
2023-07-21 16:21:39 +00:00
|
|
|
|
|
|
|
// 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;
|
|
|
|
}
|
|
|
|
|
2023-10-13 14:55:58 +00:00
|
|
|
// +kubebuilder:validation:Enum=APPEND_ACTION_APPEND_IF_EXISTS_OR_ADD;APPEND_ACTION_OVERWRITE_IF_EXISTS_OR_ADD
|
|
|
|
// +kubebuilder:validation:Type=string
|
2023-07-21 16:21:39 +00:00
|
|
|
enum AppendAction {
|
|
|
|
// buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX
|
|
|
|
APPEND_ACTION_APPEND_IF_EXISTS_OR_ADD = 0;
|
|
|
|
APPEND_ACTION_OVERWRITE_IF_EXISTS_OR_ADD = 1;
|
|
|
|
}
|