Skip to content
21 changes: 21 additions & 0 deletions api/envoy/config/core/v3/base.proto
Original file line number Diff line number Diff line change
Expand Up @@ -320,12 +320,33 @@ message HeaderValueOption {
option (udpa.annotations.versioning).previous_message_type =
"envoy.api.v2.core.HeaderValueOption";

// Describes the supported actions types for header append action.
enum HeaderAppendAction {
// This action will append the specified value to the existing values if the header
// already exists. If the header doesn't exist then this will add the header with
// specified key and value.
APPEND_IF_EXISTS_OR_ADD = 0;

// This action will add the header if it doesn't already exist. If the header
// already exists then this will be a no-op.
ADD_IF_ABSENT = 1;

// This action will overwrite the specified value by discarding any existing values if
// the header already exists. If the header doesn't exist then this will add the header
// with specified key and value.
OVERWRITE_IF_EXISTS_OR_ADD = 2;
}

// Header name/value pair that this option applies to.
HeaderValue header = 1 [(validate.rules).message = {required: true}];

// Should the value be appended? If true (default), the value is appended to
// existing values. Otherwise it replaces any existing values.
google.protobuf.BoolValue append = 2;

// [#not-implemented-hide:] Describes the action taken to append/overwrite the given value for an existing header
// or to only add this header if it's absent. Value defaults to :ref:`APPEND_IF_EXISTS_OR_ADD<envoy_v3_api_enum_value_config.core.v3.HeaderValueOption.HeaderAppendAction.APPEND_IF_EXISTS_OR_ADD>`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you mark this [#not-implemented-hide] just in case it takes a bit for the other PR to land? Thank you.

/wait

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

HeaderAppendAction append_action = 3 [(validate.rules).enum = {defined_only: true}];
}

// Wrapper for a set of headers.
Expand Down