// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.10
// 	protoc        v6.33.2
// source: envoy/config/common/mutation_rules/v3/mutation_rules.proto

package mutation_rulesv3

import (
	_ "github.com/cncf/xds/go/udpa/annotations"
	v31 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
	v3 "github.com/envoyproxy/go-control-plane/envoy/type/matcher/v3"
	_ "github.com/envoyproxy/protoc-gen-validate/validate"
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
	reflect "reflect"
	sync "sync"
	unsafe "unsafe"
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

// The HeaderMutationRules structure specifies what headers may be
// manipulated by a processing filter. This set of rules makes it
// possible to control which modifications a filter may make.
//
// By default, an external processing server may add, modify, or remove
// any header except for an "Envoy internal" header (which is typically
// denoted by an x-envoy prefix) or specific headers that may affect
// further filter processing:
//
// * “host“
// * “:authority“
// * “:scheme“
// * “:method“
//
// Every attempt to add, change, append, or remove a header will be
// tested against the rules here. Disallowed header mutations will be
// ignored unless “disallow_is_error“ is set to true.
//
// Attempts to remove headers are further constrained -- regardless of the
// settings, system-defined headers (that start with “:“) and the “host“
// header may never be removed.
//
// In addition, a counter will be incremented whenever a mutation is
// rejected. In the ext_proc filter, that counter is named
// “rejected_header_mutations“.
// [#next-free-field: 8]
type HeaderMutationRules struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// By default, certain headers that could affect processing of subsequent
	// filters or request routing cannot be modified. These headers are
	// “host“, “:authority“, “:scheme“, and “:method“. Setting this parameter
	// to true allows these headers to be modified as well.
	AllowAllRouting *wrapperspb.BoolValue `protobuf:"bytes,1,opt,name=allow_all_routing,json=allowAllRouting,proto3" json:"allow_all_routing,omitempty"`
	// If true, allow modification of envoy internal headers. By default, these
	// start with “x-envoy“ but this may be overridden in the “Bootstrap“
	// configuration using the
	// :ref:`header_prefix <envoy_v3_api_field_config.bootstrap.v3.Bootstrap.header_prefix>`
	// field. Default is false.
	AllowEnvoy *wrapperspb.BoolValue `protobuf:"bytes,2,opt,name=allow_envoy,json=allowEnvoy,proto3" json:"allow_envoy,omitempty"`
	// If true, prevent modification of any system header, defined as a header
	// that starts with a “:“ character, regardless of any other settings.
	// A processing server may still override the “:status“ of an HTTP response
	// using an “ImmediateResponse“ message. Default is false.
	DisallowSystem *wrapperspb.BoolValue `protobuf:"bytes,3,opt,name=disallow_system,json=disallowSystem,proto3" json:"disallow_system,omitempty"`
	// If true, prevent modifications of all header values, regardless of any
	// other settings. A processing server may still override the “:status“
	// of an HTTP response using an “ImmediateResponse“ message. Default is false.
	DisallowAll *wrapperspb.BoolValue `protobuf:"bytes,4,opt,name=disallow_all,json=disallowAll,proto3" json:"disallow_all,omitempty"`
	// If set, specifically allow any header that matches this regular
	// expression. This overrides all other settings except for
	// “disallow_expression“.
	AllowExpression *v3.RegexMatcher `protobuf:"bytes,5,opt,name=allow_expression,json=allowExpression,proto3" json:"allow_expression,omitempty"`
	// If set, specifically disallow any header that matches this regular
	// expression regardless of any other settings.
	DisallowExpression *v3.RegexMatcher `protobuf:"bytes,6,opt,name=disallow_expression,json=disallowExpression,proto3" json:"disallow_expression,omitempty"`
	// If true, and if the rules in this list cause a header mutation to be
	// disallowed, then the filter using this configuration will terminate the
	// request with a 500 error. In addition, regardless of the setting of this
	// parameter, any attempt to set, add, or modify a disallowed header will
	// cause the “rejected_header_mutations“ counter to be incremented.
	// Default is false.
	DisallowIsError *wrapperspb.BoolValue `protobuf:"bytes,7,opt,name=disallow_is_error,json=disallowIsError,proto3" json:"disallow_is_error,omitempty"`
	unknownFields   protoimpl.UnknownFields
	sizeCache       protoimpl.SizeCache
}

func (x *HeaderMutationRules) Reset() {
	*x = HeaderMutationRules{}
	mi := &file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_msgTypes[0]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *HeaderMutationRules) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*HeaderMutationRules) ProtoMessage() {}

func (x *HeaderMutationRules) ProtoReflect() protoreflect.Message {
	mi := &file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_msgTypes[0]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use HeaderMutationRules.ProtoReflect.Descriptor instead.
func (*HeaderMutationRules) Descriptor() ([]byte, []int) {
	return file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_rawDescGZIP(), []int{0}
}

func (x *HeaderMutationRules) GetAllowAllRouting() *wrapperspb.BoolValue {
	if x != nil {
		return x.AllowAllRouting
	}
	return nil
}

func (x *HeaderMutationRules) GetAllowEnvoy() *wrapperspb.BoolValue {
	if x != nil {
		return x.AllowEnvoy
	}
	return nil
}

func (x *HeaderMutationRules) GetDisallowSystem() *wrapperspb.BoolValue {
	if x != nil {
		return x.DisallowSystem
	}
	return nil
}

func (x *HeaderMutationRules) GetDisallowAll() *wrapperspb.BoolValue {
	if x != nil {
		return x.DisallowAll
	}
	return nil
}

func (x *HeaderMutationRules) GetAllowExpression() *v3.RegexMatcher {
	if x != nil {
		return x.AllowExpression
	}
	return nil
}

func (x *HeaderMutationRules) GetDisallowExpression() *v3.RegexMatcher {
	if x != nil {
		return x.DisallowExpression
	}
	return nil
}

func (x *HeaderMutationRules) GetDisallowIsError() *wrapperspb.BoolValue {
	if x != nil {
		return x.DisallowIsError
	}
	return nil
}

// The HeaderMutation structure specifies an action that may be taken on HTTP
// headers.
type HeaderMutation struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Types that are valid to be assigned to Action:
	//
	//	*HeaderMutation_Remove
	//	*HeaderMutation_Append
	//	*HeaderMutation_RemoveOnMatch_
	Action        isHeaderMutation_Action `protobuf_oneof:"action"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *HeaderMutation) Reset() {
	*x = HeaderMutation{}
	mi := &file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_msgTypes[1]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *HeaderMutation) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*HeaderMutation) ProtoMessage() {}

func (x *HeaderMutation) ProtoReflect() protoreflect.Message {
	mi := &file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_msgTypes[1]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use HeaderMutation.ProtoReflect.Descriptor instead.
func (*HeaderMutation) Descriptor() ([]byte, []int) {
	return file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_rawDescGZIP(), []int{1}
}

func (x *HeaderMutation) GetAction() isHeaderMutation_Action {
	if x != nil {
		return x.Action
	}
	return nil
}

func (x *HeaderMutation) GetRemove() string {
	if x != nil {
		if x, ok := x.Action.(*HeaderMutation_Remove); ok {
			return x.Remove
		}
	}
	return ""
}

func (x *HeaderMutation) GetAppend() *v31.HeaderValueOption {
	if x != nil {
		if x, ok := x.Action.(*HeaderMutation_Append); ok {
			return x.Append
		}
	}
	return nil
}

func (x *HeaderMutation) GetRemoveOnMatch() *HeaderMutation_RemoveOnMatch {
	if x != nil {
		if x, ok := x.Action.(*HeaderMutation_RemoveOnMatch_); ok {
			return x.RemoveOnMatch
		}
	}
	return nil
}

type isHeaderMutation_Action interface {
	isHeaderMutation_Action()
}

type HeaderMutation_Remove struct {
	// Remove the specified header if it exists.
	Remove string `protobuf:"bytes,1,opt,name=remove,proto3,oneof"`
}

type HeaderMutation_Append struct {
	// Append new header by the specified HeaderValueOption.
	Append *v31.HeaderValueOption `protobuf:"bytes,2,opt,name=append,proto3,oneof"`
}

type HeaderMutation_RemoveOnMatch_ struct {
	// Remove the header if the key matches the specified string matcher.
	RemoveOnMatch *HeaderMutation_RemoveOnMatch `protobuf:"bytes,3,opt,name=remove_on_match,json=removeOnMatch,proto3,oneof"`
}

func (*HeaderMutation_Remove) isHeaderMutation_Action() {}

func (*HeaderMutation_Append) isHeaderMutation_Action() {}

func (*HeaderMutation_RemoveOnMatch_) isHeaderMutation_Action() {}

type HeaderMutation_RemoveOnMatch struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// A string matcher that will be applied to the header key. If the header key
	// matches, the header will be removed.
	KeyMatcher    *v3.StringMatcher `protobuf:"bytes,1,opt,name=key_matcher,json=keyMatcher,proto3" json:"key_matcher,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *HeaderMutation_RemoveOnMatch) Reset() {
	*x = HeaderMutation_RemoveOnMatch{}
	mi := &file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_msgTypes[2]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *HeaderMutation_RemoveOnMatch) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*HeaderMutation_RemoveOnMatch) ProtoMessage() {}

func (x *HeaderMutation_RemoveOnMatch) ProtoReflect() protoreflect.Message {
	mi := &file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_msgTypes[2]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use HeaderMutation_RemoveOnMatch.ProtoReflect.Descriptor instead.
func (*HeaderMutation_RemoveOnMatch) Descriptor() ([]byte, []int) {
	return file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_rawDescGZIP(), []int{1, 0}
}

func (x *HeaderMutation_RemoveOnMatch) GetKeyMatcher() *v3.StringMatcher {
	if x != nil {
		return x.KeyMatcher
	}
	return nil
}

var File_envoy_config_common_mutation_rules_v3_mutation_rules_proto protoreflect.FileDescriptor

const file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_rawDesc = "" +
	"\n" +
	":envoy/config/common/mutation_rules/v3/mutation_rules.proto\x12%envoy.config.common.mutation_rules.v3\x1a\x1fenvoy/config/core/v3/base.proto\x1a!envoy/type/matcher/v3/regex.proto\x1a\"envoy/type/matcher/v3/string.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x1dudpa/annotations/status.proto\x1a\x17validate/validate.proto\"\x8c\x04\n" +
	"\x13HeaderMutationRules\x12F\n" +
	"\x11allow_all_routing\x18\x01 \x01(\v2\x1a.google.protobuf.BoolValueR\x0fallowAllRouting\x12;\n" +
	"\vallow_envoy\x18\x02 \x01(\v2\x1a.google.protobuf.BoolValueR\n" +
	"allowEnvoy\x12C\n" +
	"\x0fdisallow_system\x18\x03 \x01(\v2\x1a.google.protobuf.BoolValueR\x0edisallowSystem\x12=\n" +
	"\fdisallow_all\x18\x04 \x01(\v2\x1a.google.protobuf.BoolValueR\vdisallowAll\x12N\n" +
	"\x10allow_expression\x18\x05 \x01(\v2#.envoy.type.matcher.v3.RegexMatcherR\x0fallowExpression\x12T\n" +
	"\x13disallow_expression\x18\x06 \x01(\v2#.envoy.type.matcher.v3.RegexMatcherR\x12disallowExpression\x12F\n" +
	"\x11disallow_is_error\x18\a \x01(\v2\x1a.google.protobuf.BoolValueR\x0fdisallowIsError\"\xda\x02\n" +
	"\x0eHeaderMutation\x12%\n" +
	"\x06remove\x18\x01 \x01(\tB\v\xfaB\br\x06\xc8\x01\x00\xc0\x01\x02H\x00R\x06remove\x12A\n" +
	"\x06append\x18\x02 \x01(\v2'.envoy.config.core.v3.HeaderValueOptionH\x00R\x06append\x12m\n" +
	"\x0fremove_on_match\x18\x03 \x01(\v2C.envoy.config.common.mutation_rules.v3.HeaderMutation.RemoveOnMatchH\x00R\rremoveOnMatch\x1a`\n" +
	"\rRemoveOnMatch\x12O\n" +
	"\vkey_matcher\x18\x01 \x01(\v2$.envoy.type.matcher.v3.StringMatcherB\b\xfaB\x05\x8a\x01\x02\x10\x01R\n" +
	"keyMatcherB\r\n" +
	"\x06action\x12\x03\xf8B\x01B\xb2\x01\xba\x80\xc8\xd1\x06\x02\x10\x02\n" +
	"3io.envoyproxy.envoy.config.common.mutation_rules.v3B\x12MutationRulesProtoP\x01Z]github.com/envoyproxy/go-control-plane/envoy/config/common/mutation_rules/v3;mutation_rulesv3b\x06proto3"

var (
	file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_rawDescOnce sync.Once
	file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_rawDescData []byte
)

func file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_rawDescGZIP() []byte {
	file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_rawDescOnce.Do(func() {
		file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_rawDesc), len(file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_rawDesc)))
	})
	return file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_rawDescData
}

var file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_goTypes = []any{
	(*HeaderMutationRules)(nil),          // 0: envoy.config.common.mutation_rules.v3.HeaderMutationRules
	(*HeaderMutation)(nil),               // 1: envoy.config.common.mutation_rules.v3.HeaderMutation
	(*HeaderMutation_RemoveOnMatch)(nil), // 2: envoy.config.common.mutation_rules.v3.HeaderMutation.RemoveOnMatch
	(*wrapperspb.BoolValue)(nil),         // 3: google.protobuf.BoolValue
	(*v3.RegexMatcher)(nil),              // 4: envoy.type.matcher.v3.RegexMatcher
	(*v31.HeaderValueOption)(nil),        // 5: envoy.config.core.v3.HeaderValueOption
	(*v3.StringMatcher)(nil),             // 6: envoy.type.matcher.v3.StringMatcher
}
var file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_depIdxs = []int32{
	3,  // 0: envoy.config.common.mutation_rules.v3.HeaderMutationRules.allow_all_routing:type_name -> google.protobuf.BoolValue
	3,  // 1: envoy.config.common.mutation_rules.v3.HeaderMutationRules.allow_envoy:type_name -> google.protobuf.BoolValue
	3,  // 2: envoy.config.common.mutation_rules.v3.HeaderMutationRules.disallow_system:type_name -> google.protobuf.BoolValue
	3,  // 3: envoy.config.common.mutation_rules.v3.HeaderMutationRules.disallow_all:type_name -> google.protobuf.BoolValue
	4,  // 4: envoy.config.common.mutation_rules.v3.HeaderMutationRules.allow_expression:type_name -> envoy.type.matcher.v3.RegexMatcher
	4,  // 5: envoy.config.common.mutation_rules.v3.HeaderMutationRules.disallow_expression:type_name -> envoy.type.matcher.v3.RegexMatcher
	3,  // 6: envoy.config.common.mutation_rules.v3.HeaderMutationRules.disallow_is_error:type_name -> google.protobuf.BoolValue
	5,  // 7: envoy.config.common.mutation_rules.v3.HeaderMutation.append:type_name -> envoy.config.core.v3.HeaderValueOption
	2,  // 8: envoy.config.common.mutation_rules.v3.HeaderMutation.remove_on_match:type_name -> envoy.config.common.mutation_rules.v3.HeaderMutation.RemoveOnMatch
	6,  // 9: envoy.config.common.mutation_rules.v3.HeaderMutation.RemoveOnMatch.key_matcher:type_name -> envoy.type.matcher.v3.StringMatcher
	10, // [10:10] is the sub-list for method output_type
	10, // [10:10] is the sub-list for method input_type
	10, // [10:10] is the sub-list for extension type_name
	10, // [10:10] is the sub-list for extension extendee
	0,  // [0:10] is the sub-list for field type_name
}

func init() { file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_init() }
func file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_init() {
	if File_envoy_config_common_mutation_rules_v3_mutation_rules_proto != nil {
		return
	}
	file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_msgTypes[1].OneofWrappers = []any{
		(*HeaderMutation_Remove)(nil),
		(*HeaderMutation_Append)(nil),
		(*HeaderMutation_RemoveOnMatch_)(nil),
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_rawDesc), len(file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   3,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_goTypes,
		DependencyIndexes: file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_depIdxs,
		MessageInfos:      file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_msgTypes,
	}.Build()
	File_envoy_config_common_mutation_rules_v3_mutation_rules_proto = out.File
	file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_goTypes = nil
	file_envoy_config_common_mutation_rules_v3_mutation_rules_proto_depIdxs = nil
}
