// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.10
// 	protoc        v7.35.1
// source: envoy/extensions/filters/http/cors/v3/cors.proto

package corsv3

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"
	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)
)

// Cors filter config. Set this in
// :ref:`http_filters <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.http_filters>`
// to enable the CORS filter.
//
// Please note that the :ref:`CorsPolicy <envoy_v3_api_msg_extensions.filters.http.cors.v3.CorsPolicy>`
// must be configured in the “RouteConfiguration“ as “typed_per_filter_config“ at some level to make the filter work.
type Cors struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*Cors) ProtoMessage() {}

func (x *Cors) ProtoReflect() protoreflect.Message {
	mi := &file_envoy_extensions_filters_http_cors_v3_cors_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 Cors.ProtoReflect.Descriptor instead.
func (*Cors) Descriptor() ([]byte, []int) {
	return file_envoy_extensions_filters_http_cors_v3_cors_proto_rawDescGZIP(), []int{0}
}

// Per route configuration for the CORS filter. This configuration should be configured in the “RouteConfiguration“ as “typed_per_filter_config“ at some level to
// make the filter work.
// [#next-free-field: 11]
type CorsPolicy struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Specifies string patterns that match allowed origins. An origin is allowed if any of the
	// string matchers match.
	AllowOriginStringMatch []*v3.StringMatcher `protobuf:"bytes,1,rep,name=allow_origin_string_match,json=allowOriginStringMatch,proto3" json:"allow_origin_string_match,omitempty"`
	// Specifies the content for the “access-control-allow-methods“ header.
	AllowMethods string `protobuf:"bytes,2,opt,name=allow_methods,json=allowMethods,proto3" json:"allow_methods,omitempty"`
	// Specifies the content for the “access-control-allow-headers“ header.
	AllowHeaders string `protobuf:"bytes,3,opt,name=allow_headers,json=allowHeaders,proto3" json:"allow_headers,omitempty"`
	// Specifies the content for the “access-control-expose-headers“ header.
	ExposeHeaders string `protobuf:"bytes,4,opt,name=expose_headers,json=exposeHeaders,proto3" json:"expose_headers,omitempty"`
	// Specifies the content for the “access-control-max-age“ header.
	MaxAge string `protobuf:"bytes,5,opt,name=max_age,json=maxAge,proto3" json:"max_age,omitempty"`
	// Specifies whether the resource allows credentials.
	AllowCredentials *wrapperspb.BoolValue `protobuf:"bytes,6,opt,name=allow_credentials,json=allowCredentials,proto3" json:"allow_credentials,omitempty"`
	// Specifies the % of requests for which the CORS filter is enabled.
	//
	// If neither “filter_enabled“, nor “shadow_enabled“ are specified, the CORS
	// filter will be enabled for 100% of the requests.
	//
	// If :ref:`runtime_key <envoy_v3_api_field_config.core.v3.RuntimeFractionalPercent.runtime_key>` is
	// specified, Envoy will lookup the runtime key to get the percentage of requests to filter.
	FilterEnabled *v31.RuntimeFractionalPercent `protobuf:"bytes,7,opt,name=filter_enabled,json=filterEnabled,proto3" json:"filter_enabled,omitempty"`
	// Specifies the % of requests for which the CORS policies will be evaluated and tracked, but not
	// enforced.
	//
	// This field is intended to be used when “filter_enabled“ is off. That field have to explicitly disable
	// the filter in order for this setting to take effect.
	//
	// If :ref:`runtime_key <envoy_v3_api_field_config.core.v3.RuntimeFractionalPercent.runtime_key>` is specified,
	// Envoy will lookup the runtime key to get the percentage of requests for which it will evaluate
	// and track the request's “Origin“ to determine if it's valid but will not enforce any policies.
	ShadowEnabled *v31.RuntimeFractionalPercent `protobuf:"bytes,8,opt,name=shadow_enabled,json=shadowEnabled,proto3" json:"shadow_enabled,omitempty"`
	// Specify whether allow requests whose target server's IP address is more private than that from
	// which the request initiator was fetched.
	//
	// More details refer to https://developer.chrome.com/blog/private-network-access-preflight.
	AllowPrivateNetworkAccess *wrapperspb.BoolValue `protobuf:"bytes,9,opt,name=allow_private_network_access,json=allowPrivateNetworkAccess,proto3" json:"allow_private_network_access,omitempty"`
	// Specifies if preflight requests not matching the configured allowed origin should be forwarded
	// to the upstream. Default is true.
	ForwardNotMatchingPreflights *wrapperspb.BoolValue `protobuf:"bytes,10,opt,name=forward_not_matching_preflights,json=forwardNotMatchingPreflights,proto3" json:"forward_not_matching_preflights,omitempty"`
	unknownFields                protoimpl.UnknownFields
	sizeCache                    protoimpl.SizeCache
}

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

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

func (*CorsPolicy) ProtoMessage() {}

func (x *CorsPolicy) ProtoReflect() protoreflect.Message {
	mi := &file_envoy_extensions_filters_http_cors_v3_cors_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 CorsPolicy.ProtoReflect.Descriptor instead.
func (*CorsPolicy) Descriptor() ([]byte, []int) {
	return file_envoy_extensions_filters_http_cors_v3_cors_proto_rawDescGZIP(), []int{1}
}

func (x *CorsPolicy) GetAllowOriginStringMatch() []*v3.StringMatcher {
	if x != nil {
		return x.AllowOriginStringMatch
	}
	return nil
}

func (x *CorsPolicy) GetAllowMethods() string {
	if x != nil {
		return x.AllowMethods
	}
	return ""
}

func (x *CorsPolicy) GetAllowHeaders() string {
	if x != nil {
		return x.AllowHeaders
	}
	return ""
}

func (x *CorsPolicy) GetExposeHeaders() string {
	if x != nil {
		return x.ExposeHeaders
	}
	return ""
}

func (x *CorsPolicy) GetMaxAge() string {
	if x != nil {
		return x.MaxAge
	}
	return ""
}

func (x *CorsPolicy) GetAllowCredentials() *wrapperspb.BoolValue {
	if x != nil {
		return x.AllowCredentials
	}
	return nil
}

func (x *CorsPolicy) GetFilterEnabled() *v31.RuntimeFractionalPercent {
	if x != nil {
		return x.FilterEnabled
	}
	return nil
}

func (x *CorsPolicy) GetShadowEnabled() *v31.RuntimeFractionalPercent {
	if x != nil {
		return x.ShadowEnabled
	}
	return nil
}

func (x *CorsPolicy) GetAllowPrivateNetworkAccess() *wrapperspb.BoolValue {
	if x != nil {
		return x.AllowPrivateNetworkAccess
	}
	return nil
}

func (x *CorsPolicy) GetForwardNotMatchingPreflights() *wrapperspb.BoolValue {
	if x != nil {
		return x.ForwardNotMatchingPreflights
	}
	return nil
}

var File_envoy_extensions_filters_http_cors_v3_cors_proto protoreflect.FileDescriptor

const file_envoy_extensions_filters_http_cors_v3_cors_proto_rawDesc = "" +
	"\n" +
	"0envoy/extensions/filters/http/cors/v3/cors.proto\x12%envoy.extensions.filters.http.cors.v3\x1a\x1fenvoy/config/core/v3/base.proto\x1a\"envoy/type/matcher/v3/string.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x1dudpa/annotations/status.proto\x1a!udpa/annotations/versioning.proto\"4\n" +
	"\x04Cors:,\x9aň\x1e'\n" +
	"%envoy.config.filter.http.cors.v2.Cors\"\xae\x05\n" +
	"\n" +
	"CorsPolicy\x12_\n" +
	"\x19allow_origin_string_match\x18\x01 \x03(\v2$.envoy.type.matcher.v3.StringMatcherR\x16allowOriginStringMatch\x12#\n" +
	"\rallow_methods\x18\x02 \x01(\tR\fallowMethods\x12#\n" +
	"\rallow_headers\x18\x03 \x01(\tR\fallowHeaders\x12%\n" +
	"\x0eexpose_headers\x18\x04 \x01(\tR\rexposeHeaders\x12\x17\n" +
	"\amax_age\x18\x05 \x01(\tR\x06maxAge\x12G\n" +
	"\x11allow_credentials\x18\x06 \x01(\v2\x1a.google.protobuf.BoolValueR\x10allowCredentials\x12U\n" +
	"\x0efilter_enabled\x18\a \x01(\v2..envoy.config.core.v3.RuntimeFractionalPercentR\rfilterEnabled\x12U\n" +
	"\x0eshadow_enabled\x18\b \x01(\v2..envoy.config.core.v3.RuntimeFractionalPercentR\rshadowEnabled\x12[\n" +
	"\x1callow_private_network_access\x18\t \x01(\v2\x1a.google.protobuf.BoolValueR\x19allowPrivateNetworkAccess\x12a\n" +
	"\x1fforward_not_matching_preflights\x18\n" +
	" \x01(\v2\x1a.google.protobuf.BoolValueR\x1cforwardNotMatchingPreflightsB\x9f\x01\xba\x80\xc8\xd1\x06\x02\x10\x02\n" +
	"3io.envoyproxy.envoy.extensions.filters.http.cors.v3B\tCorsProtoP\x01ZSgithub.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/cors/v3;corsv3b\x06proto3"

var (
	file_envoy_extensions_filters_http_cors_v3_cors_proto_rawDescOnce sync.Once
	file_envoy_extensions_filters_http_cors_v3_cors_proto_rawDescData []byte
)

func file_envoy_extensions_filters_http_cors_v3_cors_proto_rawDescGZIP() []byte {
	file_envoy_extensions_filters_http_cors_v3_cors_proto_rawDescOnce.Do(func() {
		file_envoy_extensions_filters_http_cors_v3_cors_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_envoy_extensions_filters_http_cors_v3_cors_proto_rawDesc), len(file_envoy_extensions_filters_http_cors_v3_cors_proto_rawDesc)))
	})
	return file_envoy_extensions_filters_http_cors_v3_cors_proto_rawDescData
}

var file_envoy_extensions_filters_http_cors_v3_cors_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_envoy_extensions_filters_http_cors_v3_cors_proto_goTypes = []any{
	(*Cors)(nil),                         // 0: envoy.extensions.filters.http.cors.v3.Cors
	(*CorsPolicy)(nil),                   // 1: envoy.extensions.filters.http.cors.v3.CorsPolicy
	(*v3.StringMatcher)(nil),             // 2: envoy.type.matcher.v3.StringMatcher
	(*wrapperspb.BoolValue)(nil),         // 3: google.protobuf.BoolValue
	(*v31.RuntimeFractionalPercent)(nil), // 4: envoy.config.core.v3.RuntimeFractionalPercent
}
var file_envoy_extensions_filters_http_cors_v3_cors_proto_depIdxs = []int32{
	2, // 0: envoy.extensions.filters.http.cors.v3.CorsPolicy.allow_origin_string_match:type_name -> envoy.type.matcher.v3.StringMatcher
	3, // 1: envoy.extensions.filters.http.cors.v3.CorsPolicy.allow_credentials:type_name -> google.protobuf.BoolValue
	4, // 2: envoy.extensions.filters.http.cors.v3.CorsPolicy.filter_enabled:type_name -> envoy.config.core.v3.RuntimeFractionalPercent
	4, // 3: envoy.extensions.filters.http.cors.v3.CorsPolicy.shadow_enabled:type_name -> envoy.config.core.v3.RuntimeFractionalPercent
	3, // 4: envoy.extensions.filters.http.cors.v3.CorsPolicy.allow_private_network_access:type_name -> google.protobuf.BoolValue
	3, // 5: envoy.extensions.filters.http.cors.v3.CorsPolicy.forward_not_matching_preflights:type_name -> google.protobuf.BoolValue
	6, // [6:6] is the sub-list for method output_type
	6, // [6:6] is the sub-list for method input_type
	6, // [6:6] is the sub-list for extension type_name
	6, // [6:6] is the sub-list for extension extendee
	0, // [0:6] is the sub-list for field type_name
}

func init() { file_envoy_extensions_filters_http_cors_v3_cors_proto_init() }
func file_envoy_extensions_filters_http_cors_v3_cors_proto_init() {
	if File_envoy_extensions_filters_http_cors_v3_cors_proto != nil {
		return
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_envoy_extensions_filters_http_cors_v3_cors_proto_rawDesc), len(file_envoy_extensions_filters_http_cors_v3_cors_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   2,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_envoy_extensions_filters_http_cors_v3_cors_proto_goTypes,
		DependencyIndexes: file_envoy_extensions_filters_http_cors_v3_cors_proto_depIdxs,
		MessageInfos:      file_envoy_extensions_filters_http_cors_v3_cors_proto_msgTypes,
	}.Build()
	File_envoy_extensions_filters_http_cors_v3_cors_proto = out.File
	file_envoy_extensions_filters_http_cors_v3_cors_proto_goTypes = nil
	file_envoy_extensions_filters_http_cors_v3_cors_proto_depIdxs = nil
}
