// 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/basic_auth/v3/basic_auth.proto

package basic_authv3

import (
	_ "github.com/cncf/xds/go/udpa/annotations"
	v3 "github.com/envoyproxy/go-control-plane/envoy/config/core/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)
)

// Basic HTTP authentication.
//
// Example:
//
// .. code-block:: yaml
//
//	users:
//	  inline_string: |-
//	    user1:{SHA}hashed_user1_password
//	    user2:{SHA}hashed_user2_password
//
// [#next-free-field: 6]
type BasicAuth struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Username-password pairs used to verify user credentials in the "Authorization" header.
	// The value needs to be the htpasswd format.
	// Reference to https://httpd.apache.org/docs/2.4/programs/htpasswd.html
	Users *v3.DataSource `protobuf:"bytes,1,opt,name=users,proto3" json:"users,omitempty"`
	// This field specifies the header name to forward a successfully authenticated user to
	// the backend. The header will be added to the request with the username as the value.
	//
	// If it is not specified, the username will not be forwarded.
	ForwardUsernameHeader string `protobuf:"bytes,2,opt,name=forward_username_header,json=forwardUsernameHeader,proto3" json:"forward_username_header,omitempty"`
	// This field specifies the request header to load the basic credential from.
	//
	// If it is not specified, the filter loads the credential from  the "Authorization" header.
	AuthenticationHeader string `protobuf:"bytes,3,opt,name=authentication_header,json=authenticationHeader,proto3" json:"authentication_header,omitempty"`
	// If set to true, requests without Basic credentials (missing “Authorization“ header, or
	// “Authorization“ header with a non-“Basic“ scheme such as “Bearer“) are allowed to pass through
	// without authentication. Requests that present “Basic“ credentials are still fully validated.
	//
	// This is useful when combining BasicAuth with other authentication methods (e.g. JWT) to
	// achieve OR semantics: a request is accepted if any one configured auth method succeeds.
	// When “allow_missing“ is “true“ on all auth filters, pair it with an RBAC filter that checks
	// the dynamic metadata emitted by this filter (see “emit_dynamic_metadata“) to ensure at
	// least one method authenticated the request. Requires “emit_dynamic_metadata“ to be set to
	// “true“.
	AllowMissing bool `protobuf:"varint,4,opt,name=allow_missing,json=allowMissing,proto3" json:"allow_missing,omitempty"`
	// If set to “true“, the filter emits dynamic metadata on successful authentication with key
	// “username“ set to the authenticated username. The metadata is emitted under the namespace
	// corresponding to the name of this basic_auth filter as configured in the “http_filters“
	// chain (e.g. if the filter is configured with name “envoy.filters.http.basic_auth“, that is
	// the namespace that will be used).
	//
	// This is typically enabled together with “allow_missing“ when combining BasicAuth with
	// other authentication methods (e.g. JWT) and using a downstream RBAC filter to enforce
	// OR semantics.
	EmitDynamicMetadata bool `protobuf:"varint,5,opt,name=emit_dynamic_metadata,json=emitDynamicMetadata,proto3" json:"emit_dynamic_metadata,omitempty"`
	unknownFields       protoimpl.UnknownFields
	sizeCache           protoimpl.SizeCache
}

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

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

func (*BasicAuth) ProtoMessage() {}

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

func (x *BasicAuth) GetUsers() *v3.DataSource {
	if x != nil {
		return x.Users
	}
	return nil
}

func (x *BasicAuth) GetForwardUsernameHeader() string {
	if x != nil {
		return x.ForwardUsernameHeader
	}
	return ""
}

func (x *BasicAuth) GetAuthenticationHeader() string {
	if x != nil {
		return x.AuthenticationHeader
	}
	return ""
}

func (x *BasicAuth) GetAllowMissing() bool {
	if x != nil {
		return x.AllowMissing
	}
	return false
}

func (x *BasicAuth) GetEmitDynamicMetadata() bool {
	if x != nil {
		return x.EmitDynamicMetadata
	}
	return false
}

// Extra settings that may be added to per-route configuration for
// a virtual host or a cluster.
type BasicAuthPerRoute struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Username-password pairs for this route.
	Users         *v3.DataSource `protobuf:"bytes,1,opt,name=users,proto3" json:"users,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*BasicAuthPerRoute) ProtoMessage() {}

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

func (x *BasicAuthPerRoute) GetUsers() *v3.DataSource {
	if x != nil {
		return x.Users
	}
	return nil
}

var File_envoy_extensions_filters_http_basic_auth_v3_basic_auth_proto protoreflect.FileDescriptor

const file_envoy_extensions_filters_http_basic_auth_v3_basic_auth_proto_rawDesc = "" +
	"\n" +
	"<envoy/extensions/filters/http/basic_auth/v3/basic_auth.proto\x12+envoy.extensions.filters.http.basic_auth.v3\x1a\x1fenvoy/config/core/v3/base.proto\x1a udpa/annotations/sensitive.proto\x1a\x1dudpa/annotations/status.proto\x1a\x17validate/validate.proto\"\xab\x02\n" +
	"\tBasicAuth\x12>\n" +
	"\x05users\x18\x01 \x01(\v2 .envoy.config.core.v3.DataSourceB\x06\xb8\xb7\x8b\xa4\x02\x01R\x05users\x12C\n" +
	"\x17forward_username_header\x18\x02 \x01(\tB\v\xfaB\br\x06\xc8\x01\x00\xc0\x01\x01R\x15forwardUsernameHeader\x12@\n" +
	"\x15authentication_header\x18\x03 \x01(\tB\v\xfaB\br\x06\xc8\x01\x00\xc0\x01\x01R\x14authenticationHeader\x12#\n" +
	"\rallow_missing\x18\x04 \x01(\bR\fallowMissing\x122\n" +
	"\x15emit_dynamic_metadata\x18\x05 \x01(\bR\x13emitDynamicMetadata\"[\n" +
	"\x11BasicAuthPerRoute\x12F\n" +
	"\x05users\x18\x01 \x01(\v2 .envoy.config.core.v3.DataSourceB\x0e\xfaB\x05\x8a\x01\x02\x10\x01\xb8\xb7\x8b\xa4\x02\x01R\x05usersB\xb6\x01\xba\x80\xc8\xd1\x06\x02\x10\x02\n" +
	"9io.envoyproxy.envoy.extensions.filters.http.basic_auth.v3B\x0eBasicAuthProtoP\x01Z_github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/basic_auth/v3;basic_authv3b\x06proto3"

var (
	file_envoy_extensions_filters_http_basic_auth_v3_basic_auth_proto_rawDescOnce sync.Once
	file_envoy_extensions_filters_http_basic_auth_v3_basic_auth_proto_rawDescData []byte
)

func file_envoy_extensions_filters_http_basic_auth_v3_basic_auth_proto_rawDescGZIP() []byte {
	file_envoy_extensions_filters_http_basic_auth_v3_basic_auth_proto_rawDescOnce.Do(func() {
		file_envoy_extensions_filters_http_basic_auth_v3_basic_auth_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_envoy_extensions_filters_http_basic_auth_v3_basic_auth_proto_rawDesc), len(file_envoy_extensions_filters_http_basic_auth_v3_basic_auth_proto_rawDesc)))
	})
	return file_envoy_extensions_filters_http_basic_auth_v3_basic_auth_proto_rawDescData
}

var file_envoy_extensions_filters_http_basic_auth_v3_basic_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_envoy_extensions_filters_http_basic_auth_v3_basic_auth_proto_goTypes = []any{
	(*BasicAuth)(nil),         // 0: envoy.extensions.filters.http.basic_auth.v3.BasicAuth
	(*BasicAuthPerRoute)(nil), // 1: envoy.extensions.filters.http.basic_auth.v3.BasicAuthPerRoute
	(*v3.DataSource)(nil),     // 2: envoy.config.core.v3.DataSource
}
var file_envoy_extensions_filters_http_basic_auth_v3_basic_auth_proto_depIdxs = []int32{
	2, // 0: envoy.extensions.filters.http.basic_auth.v3.BasicAuth.users:type_name -> envoy.config.core.v3.DataSource
	2, // 1: envoy.extensions.filters.http.basic_auth.v3.BasicAuthPerRoute.users:type_name -> envoy.config.core.v3.DataSource
	2, // [2:2] is the sub-list for method output_type
	2, // [2:2] is the sub-list for method input_type
	2, // [2:2] is the sub-list for extension type_name
	2, // [2:2] is the sub-list for extension extendee
	0, // [0:2] is the sub-list for field type_name
}

func init() { file_envoy_extensions_filters_http_basic_auth_v3_basic_auth_proto_init() }
func file_envoy_extensions_filters_http_basic_auth_v3_basic_auth_proto_init() {
	if File_envoy_extensions_filters_http_basic_auth_v3_basic_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_basic_auth_v3_basic_auth_proto_rawDesc), len(file_envoy_extensions_filters_http_basic_auth_v3_basic_auth_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   2,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_envoy_extensions_filters_http_basic_auth_v3_basic_auth_proto_goTypes,
		DependencyIndexes: file_envoy_extensions_filters_http_basic_auth_v3_basic_auth_proto_depIdxs,
		MessageInfos:      file_envoy_extensions_filters_http_basic_auth_v3_basic_auth_proto_msgTypes,
	}.Build()
	File_envoy_extensions_filters_http_basic_auth_v3_basic_auth_proto = out.File
	file_envoy_extensions_filters_http_basic_auth_v3_basic_auth_proto_goTypes = nil
	file_envoy_extensions_filters_http_basic_auth_v3_basic_auth_proto_depIdxs = nil
}
