// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.10
// 	protoc        v6.33.2
// source: envoy/extensions/filters/http/api_key_auth/v3/api_key_auth.proto

package api_key_authv3

import (
	_ "github.com/cncf/xds/go/udpa/annotations"
	_ "github.com/cncf/xds/go/xds/annotations/v3"
	_ "github.com/envoyproxy/protoc-gen-validate/validate"
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	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)
)

// API Key HTTP authentication.
//
// For example, the following configuration configures the filter to authenticate the clients using
// the API key from the header “X-API-KEY“. And only the clients with the key “real-key“ are
// considered as authenticated. The client information is configured to be forwarded
// in the header “x-client-id“.
//
// .. code-block:: yaml
//
//	credentials:
//	- key: real-key
//	  client: user
//	key_sources:
//	 - header: "X-API-KEY"
//	forwarding:
//	  header: "x-client-id"
//	  hide_credentials: false
type ApiKeyAuth struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// The credentials that are used to authenticate the clients.
	Credentials []*Credential `protobuf:"bytes,1,rep,name=credentials,proto3" json:"credentials,omitempty"`
	// The key sources to fetch the key from the coming request.
	KeySources []*KeySource `protobuf:"bytes,2,rep,name=key_sources,json=keySources,proto3" json:"key_sources,omitempty"`
	// Optional configuration to control what information should be propagated to upstream services.
	Forwarding    *Forwarding `protobuf:"bytes,3,opt,name=forwarding,proto3" json:"forwarding,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*ApiKeyAuth) ProtoMessage() {}

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

func (x *ApiKeyAuth) GetCredentials() []*Credential {
	if x != nil {
		return x.Credentials
	}
	return nil
}

func (x *ApiKeyAuth) GetKeySources() []*KeySource {
	if x != nil {
		return x.KeySources
	}
	return nil
}

func (x *ApiKeyAuth) GetForwarding() *Forwarding {
	if x != nil {
		return x.Forwarding
	}
	return nil
}

// API key auth configuration of per route or per virtual host or per route configuration.
type ApiKeyAuthPerRoute struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// The credentials that are used to authenticate the clients. If this field is non-empty, then the
	// credentials in the filter level configuration will be ignored and the credentials in this
	// configuration will be used.
	Credentials []*Credential `protobuf:"bytes,1,rep,name=credentials,proto3" json:"credentials,omitempty"`
	// The key sources to fetch the key from the coming request. If this field is non-empty, then the
	// key sources in the filter level configuration will be ignored and the key sources in this
	// configuration will be used.
	KeySources []*KeySource `protobuf:"bytes,2,rep,name=key_sources,json=keySources,proto3" json:"key_sources,omitempty"`
	// A list of clients that are allowed to access the route or vhost. The clients listed here
	// should be subset of the clients listed in the “credentials“ to provide authorization control
	// after the authentication is successful. If the list is empty, then all authenticated clients
	// are allowed. This provides very limited but simple authorization. If more complex authorization
	// is required, then use the :ref:`HTTP RBAC filter <config_http_filters_rbac>` instead.
	//
	// .. note::
	//
	//	Setting this field and ``credentials`` at the same configuration entry is not an error but
	//	also makes no much sense because they provide similar functionality. Please only use
	//	one of them at same configuration entry except for the case that you want to share the same
	//	credentials list across multiple routes but still use different allowed clients for each
	//	route.
	AllowedClients []string `protobuf:"bytes,3,rep,name=allowed_clients,json=allowedClients,proto3" json:"allowed_clients,omitempty"`
	// Optional configuration to control what information should be propagated to upstream services.
	// If this field is non-empty, then the forwarding information in the filter level configuration
	// will be ignored and the forwarding in this configuration will be used.
	Forwarding    *Forwarding `protobuf:"bytes,4,opt,name=forwarding,proto3" json:"forwarding,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*ApiKeyAuthPerRoute) ProtoMessage() {}

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

func (x *ApiKeyAuthPerRoute) GetCredentials() []*Credential {
	if x != nil {
		return x.Credentials
	}
	return nil
}

func (x *ApiKeyAuthPerRoute) GetKeySources() []*KeySource {
	if x != nil {
		return x.KeySources
	}
	return nil
}

func (x *ApiKeyAuthPerRoute) GetAllowedClients() []string {
	if x != nil {
		return x.AllowedClients
	}
	return nil
}

func (x *ApiKeyAuthPerRoute) GetForwarding() *Forwarding {
	if x != nil {
		return x.Forwarding
	}
	return nil
}

// Single credential entry that contains the API key and the related client id.
type Credential struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// The value of the unique API key.
	Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// The unique id or identity that used to identify the client or consumer.
	Client        string `protobuf:"bytes,2,opt,name=client,proto3" json:"client,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*Credential) ProtoMessage() {}

func (x *Credential) ProtoReflect() protoreflect.Message {
	mi := &file_envoy_extensions_filters_http_api_key_auth_v3_api_key_auth_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 Credential.ProtoReflect.Descriptor instead.
func (*Credential) Descriptor() ([]byte, []int) {
	return file_envoy_extensions_filters_http_api_key_auth_v3_api_key_auth_proto_rawDescGZIP(), []int{2}
}

func (x *Credential) GetKey() string {
	if x != nil {
		return x.Key
	}
	return ""
}

func (x *Credential) GetClient() string {
	if x != nil {
		return x.Client
	}
	return ""
}

type KeySource struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// The header name to fetch the key. If multiple header values are present, the first one will be
	// used. If the header value starts with 'Bearer ', this prefix will be stripped to get the
	// key value.
	//
	// If set, takes precedence over “query“ and “cookie“.
	Header string `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
	// The query parameter name to fetch the key. If multiple query values are present, the first one
	// will be used.
	//
	// The field will be used if “header“ is not set. If set, takes precedence over “cookie“.
	Query string `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"`
	// The cookie name to fetch the key.
	//
	// The field will be used if the “header“ and “query“ are not set.
	Cookie        string `protobuf:"bytes,3,opt,name=cookie,proto3" json:"cookie,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *KeySource) Reset() {
	*x = KeySource{}
	mi := &file_envoy_extensions_filters_http_api_key_auth_v3_api_key_auth_proto_msgTypes[3]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

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

func (*KeySource) ProtoMessage() {}

func (x *KeySource) ProtoReflect() protoreflect.Message {
	mi := &file_envoy_extensions_filters_http_api_key_auth_v3_api_key_auth_proto_msgTypes[3]
	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 KeySource.ProtoReflect.Descriptor instead.
func (*KeySource) Descriptor() ([]byte, []int) {
	return file_envoy_extensions_filters_http_api_key_auth_v3_api_key_auth_proto_rawDescGZIP(), []int{3}
}

func (x *KeySource) GetHeader() string {
	if x != nil {
		return x.Header
	}
	return ""
}

func (x *KeySource) GetQuery() string {
	if x != nil {
		return x.Query
	}
	return ""
}

func (x *KeySource) GetCookie() string {
	if x != nil {
		return x.Cookie
	}
	return ""
}

type Forwarding struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// The header name in which to store the client information. If this field is non-empty,
	// the client string associated with the matched credential will be injected into
	// the request before forwarding upstream.
	Header string `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
	// If true, remove the API key from the request before forwarding upstream.
	//
	// This applies to all configured key sources: “header“, “query“, and “cookie“.
	HideCredentials bool `protobuf:"varint,2,opt,name=hide_credentials,json=hideCredentials,proto3" json:"hide_credentials,omitempty"`
	unknownFields   protoimpl.UnknownFields
	sizeCache       protoimpl.SizeCache
}

func (x *Forwarding) Reset() {
	*x = Forwarding{}
	mi := &file_envoy_extensions_filters_http_api_key_auth_v3_api_key_auth_proto_msgTypes[4]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

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

func (*Forwarding) ProtoMessage() {}

func (x *Forwarding) ProtoReflect() protoreflect.Message {
	mi := &file_envoy_extensions_filters_http_api_key_auth_v3_api_key_auth_proto_msgTypes[4]
	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 Forwarding.ProtoReflect.Descriptor instead.
func (*Forwarding) Descriptor() ([]byte, []int) {
	return file_envoy_extensions_filters_http_api_key_auth_v3_api_key_auth_proto_rawDescGZIP(), []int{4}
}

func (x *Forwarding) GetHeader() string {
	if x != nil {
		return x.Header
	}
	return ""
}

func (x *Forwarding) GetHideCredentials() bool {
	if x != nil {
		return x.HideCredentials
	}
	return false
}

var File_envoy_extensions_filters_http_api_key_auth_v3_api_key_auth_proto protoreflect.FileDescriptor

const file_envoy_extensions_filters_http_api_key_auth_v3_api_key_auth_proto_rawDesc = "" +
	"\n" +
	"@envoy/extensions/filters/http/api_key_auth/v3/api_key_auth.proto\x12-envoy.extensions.filters.http.api_key_auth.v3\x1a\x1fxds/annotations/v3/status.proto\x1a udpa/annotations/sensitive.proto\x1a\x1dudpa/annotations/status.proto\x1a\x17validate/validate.proto\"\xa7\x02\n" +
	"\n" +
	"ApiKeyAuth\x12c\n" +
	"\vcredentials\x18\x01 \x03(\v29.envoy.extensions.filters.http.api_key_auth.v3.CredentialB\x06\xb8\xb7\x8b\xa4\x02\x01R\vcredentials\x12Y\n" +
	"\vkey_sources\x18\x02 \x03(\v28.envoy.extensions.filters.http.api_key_auth.v3.KeySourceR\n" +
	"keySources\x12Y\n" +
	"\n" +
	"forwarding\x18\x03 \x01(\v29.envoy.extensions.filters.http.api_key_auth.v3.ForwardingR\n" +
	"forwarding\"\xd8\x02\n" +
	"\x12ApiKeyAuthPerRoute\x12c\n" +
	"\vcredentials\x18\x01 \x03(\v29.envoy.extensions.filters.http.api_key_auth.v3.CredentialB\x06\xb8\xb7\x8b\xa4\x02\x01R\vcredentials\x12Y\n" +
	"\vkey_sources\x18\x02 \x03(\v28.envoy.extensions.filters.http.api_key_auth.v3.KeySourceR\n" +
	"keySources\x12'\n" +
	"\x0fallowed_clients\x18\x03 \x03(\tR\x0eallowedClients\x12Y\n" +
	"\n" +
	"forwarding\x18\x04 \x01(\v29.envoy.extensions.filters.http.api_key_auth.v3.ForwardingR\n" +
	"forwarding\"H\n" +
	"\n" +
	"Credential\x12\x19\n" +
	"\x03key\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x03key\x12\x1f\n" +
	"\x06client\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x06client\"\x81\x01\n" +
	"\tKeySource\x12)\n" +
	"\x06header\x18\x01 \x01(\tB\x11\xfaB\x0er\f\x18\x80\b\xc8\x01\x00\xd0\x01\x01\xc0\x01\x01R\x06header\x12\x1e\n" +
	"\x05query\x18\x02 \x01(\tB\b\xfaB\x05r\x03\x18\x80\bR\x05query\x12)\n" +
	"\x06cookie\x18\x03 \x01(\tB\x11\xfaB\x0er\f\x18\x80\b\xc8\x01\x00\xd0\x01\x01\xc0\x01\x01R\x06cookie\"_\n" +
	"\n" +
	"Forwarding\x12&\n" +
	"\x06header\x18\x01 \x01(\tB\x0e\xfaB\vr\t\x18\x80\b\xc8\x01\x00\xc0\x01\x01R\x06header\x12)\n" +
	"\x10hide_credentials\x18\x02 \x01(\bR\x0fhideCredentialsB\xc5\x01\xba\x80\xc8\xd1\x06\x02\x10\x02\xd2Ƥ\xe1\x06\x02\b\x01\n" +
	";io.envoyproxy.envoy.extensions.filters.http.api_key_auth.v3B\x0fApiKeyAuthProtoP\x01Zcgithub.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/api_key_auth/v3;api_key_authv3b\x06proto3"

var (
	file_envoy_extensions_filters_http_api_key_auth_v3_api_key_auth_proto_rawDescOnce sync.Once
	file_envoy_extensions_filters_http_api_key_auth_v3_api_key_auth_proto_rawDescData []byte
)

func file_envoy_extensions_filters_http_api_key_auth_v3_api_key_auth_proto_rawDescGZIP() []byte {
	file_envoy_extensions_filters_http_api_key_auth_v3_api_key_auth_proto_rawDescOnce.Do(func() {
		file_envoy_extensions_filters_http_api_key_auth_v3_api_key_auth_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_envoy_extensions_filters_http_api_key_auth_v3_api_key_auth_proto_rawDesc), len(file_envoy_extensions_filters_http_api_key_auth_v3_api_key_auth_proto_rawDesc)))
	})
	return file_envoy_extensions_filters_http_api_key_auth_v3_api_key_auth_proto_rawDescData
}

var file_envoy_extensions_filters_http_api_key_auth_v3_api_key_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_envoy_extensions_filters_http_api_key_auth_v3_api_key_auth_proto_goTypes = []any{
	(*ApiKeyAuth)(nil),         // 0: envoy.extensions.filters.http.api_key_auth.v3.ApiKeyAuth
	(*ApiKeyAuthPerRoute)(nil), // 1: envoy.extensions.filters.http.api_key_auth.v3.ApiKeyAuthPerRoute
	(*Credential)(nil),         // 2: envoy.extensions.filters.http.api_key_auth.v3.Credential
	(*KeySource)(nil),          // 3: envoy.extensions.filters.http.api_key_auth.v3.KeySource
	(*Forwarding)(nil),         // 4: envoy.extensions.filters.http.api_key_auth.v3.Forwarding
}
var file_envoy_extensions_filters_http_api_key_auth_v3_api_key_auth_proto_depIdxs = []int32{
	2, // 0: envoy.extensions.filters.http.api_key_auth.v3.ApiKeyAuth.credentials:type_name -> envoy.extensions.filters.http.api_key_auth.v3.Credential
	3, // 1: envoy.extensions.filters.http.api_key_auth.v3.ApiKeyAuth.key_sources:type_name -> envoy.extensions.filters.http.api_key_auth.v3.KeySource
	4, // 2: envoy.extensions.filters.http.api_key_auth.v3.ApiKeyAuth.forwarding:type_name -> envoy.extensions.filters.http.api_key_auth.v3.Forwarding
	2, // 3: envoy.extensions.filters.http.api_key_auth.v3.ApiKeyAuthPerRoute.credentials:type_name -> envoy.extensions.filters.http.api_key_auth.v3.Credential
	3, // 4: envoy.extensions.filters.http.api_key_auth.v3.ApiKeyAuthPerRoute.key_sources:type_name -> envoy.extensions.filters.http.api_key_auth.v3.KeySource
	4, // 5: envoy.extensions.filters.http.api_key_auth.v3.ApiKeyAuthPerRoute.forwarding:type_name -> envoy.extensions.filters.http.api_key_auth.v3.Forwarding
	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_api_key_auth_v3_api_key_auth_proto_init() }
func file_envoy_extensions_filters_http_api_key_auth_v3_api_key_auth_proto_init() {
	if File_envoy_extensions_filters_http_api_key_auth_v3_api_key_auth_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_api_key_auth_v3_api_key_auth_proto_rawDesc), len(file_envoy_extensions_filters_http_api_key_auth_v3_api_key_auth_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   5,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_envoy_extensions_filters_http_api_key_auth_v3_api_key_auth_proto_goTypes,
		DependencyIndexes: file_envoy_extensions_filters_http_api_key_auth_v3_api_key_auth_proto_depIdxs,
		MessageInfos:      file_envoy_extensions_filters_http_api_key_auth_v3_api_key_auth_proto_msgTypes,
	}.Build()
	File_envoy_extensions_filters_http_api_key_auth_v3_api_key_auth_proto = out.File
	file_envoy_extensions_filters_http_api_key_auth_v3_api_key_auth_proto_goTypes = nil
	file_envoy_extensions_filters_http_api_key_auth_v3_api_key_auth_proto_depIdxs = nil
}
