Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proto: add a new field called append_action in the HeaderValueOption #18246

Merged
merged 7 commits into from Sep 24, 2021
21 changes: 21 additions & 0 deletions api/envoy/config/core/v3/base.proto
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
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
Contributor 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