// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.10
// 	protoc        v7.35.1
// source: envoy/service/auth/v2/external_auth.proto

package authv2

import (
	_ "github.com/cncf/xds/go/udpa/annotations"
	core "github.com/envoyproxy/go-control-plane/envoy/api/v2/core"
	_type "github.com/envoyproxy/go-control-plane/envoy/type"
	_ "github.com/envoyproxy/protoc-gen-validate/validate"
	status "google.golang.org/genproto/googleapis/rpc/status"
	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)
)

type CheckRequest struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// The request attributes.
	Attributes    *AttributeContext `protobuf:"bytes,1,opt,name=attributes,proto3" json:"attributes,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*CheckRequest) ProtoMessage() {}

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

func (x *CheckRequest) GetAttributes() *AttributeContext {
	if x != nil {
		return x.Attributes
	}
	return nil
}

// HTTP attributes for a denied response.
type DeniedHttpResponse struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// This field allows the authorization service to send a HTTP response status
	// code to the downstream client other than 403 (Forbidden).
	Status *_type.HttpStatus `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
	// This field allows the authorization service to send HTTP response headers
	// to the downstream client. Note that the `append` field in `HeaderValueOption` defaults to
	// false when used in this message.
	Headers []*core.HeaderValueOption `protobuf:"bytes,2,rep,name=headers,proto3" json:"headers,omitempty"`
	// This field allows the authorization service to send a response body data
	// to the downstream client.
	Body          string `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*DeniedHttpResponse) ProtoMessage() {}

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

func (x *DeniedHttpResponse) GetStatus() *_type.HttpStatus {
	if x != nil {
		return x.Status
	}
	return nil
}

func (x *DeniedHttpResponse) GetHeaders() []*core.HeaderValueOption {
	if x != nil {
		return x.Headers
	}
	return nil
}

func (x *DeniedHttpResponse) GetBody() string {
	if x != nil {
		return x.Body
	}
	return ""
}

// HTTP attributes for an ok response.
type OkHttpResponse struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// HTTP entity headers in addition to the original request headers. This allows the authorization
	// service to append, to add or to override headers from the original request before
	// dispatching it to the upstream. Note that the `append` field in `HeaderValueOption` defaults to
	// false when used in this message. By setting the `append` field to `true`,
	// the filter will append the correspondent header value to the matched request header.
	// By leaving `append` as false, the filter will either add a new header, or override an existing
	// one if there is a match.
	Headers       []*core.HeaderValueOption `protobuf:"bytes,2,rep,name=headers,proto3" json:"headers,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*OkHttpResponse) ProtoMessage() {}

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

func (x *OkHttpResponse) GetHeaders() []*core.HeaderValueOption {
	if x != nil {
		return x.Headers
	}
	return nil
}

// Intended for gRPC and Network Authorization servers `only`.
type CheckResponse struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Status `OK` allows the request. Any other status indicates the request should be denied.
	Status *status.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
	// An message that contains HTTP response attributes. This message is
	// used when the authorization service needs to send custom responses to the
	// downstream client or, to modify/add request headers being dispatched to the upstream.
	//
	// Types that are valid to be assigned to HttpResponse:
	//
	//	*CheckResponse_DeniedResponse
	//	*CheckResponse_OkResponse
	HttpResponse  isCheckResponse_HttpResponse `protobuf_oneof:"http_response"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*CheckResponse) ProtoMessage() {}

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

func (x *CheckResponse) GetStatus() *status.Status {
	if x != nil {
		return x.Status
	}
	return nil
}

func (x *CheckResponse) GetHttpResponse() isCheckResponse_HttpResponse {
	if x != nil {
		return x.HttpResponse
	}
	return nil
}

func (x *CheckResponse) GetDeniedResponse() *DeniedHttpResponse {
	if x != nil {
		if x, ok := x.HttpResponse.(*CheckResponse_DeniedResponse); ok {
			return x.DeniedResponse
		}
	}
	return nil
}

func (x *CheckResponse) GetOkResponse() *OkHttpResponse {
	if x != nil {
		if x, ok := x.HttpResponse.(*CheckResponse_OkResponse); ok {
			return x.OkResponse
		}
	}
	return nil
}

type isCheckResponse_HttpResponse interface {
	isCheckResponse_HttpResponse()
}

type CheckResponse_DeniedResponse struct {
	// Supplies http attributes for a denied response.
	DeniedResponse *DeniedHttpResponse `protobuf:"bytes,2,opt,name=denied_response,json=deniedResponse,proto3,oneof"`
}

type CheckResponse_OkResponse struct {
	// Supplies http attributes for an ok response.
	OkResponse *OkHttpResponse `protobuf:"bytes,3,opt,name=ok_response,json=okResponse,proto3,oneof"`
}

func (*CheckResponse_DeniedResponse) isCheckResponse_HttpResponse() {}

func (*CheckResponse_OkResponse) isCheckResponse_HttpResponse() {}

var File_envoy_service_auth_v2_external_auth_proto protoreflect.FileDescriptor

const file_envoy_service_auth_v2_external_auth_proto_rawDesc = "" +
	"\n" +
	")envoy/service/auth/v2/external_auth.proto\x12\x15envoy.service.auth.v2\x1a\x1cenvoy/api/v2/core/base.proto\x1a-envoy/service/auth/v2/attribute_context.proto\x1a\x1cenvoy/type/http_status.proto\x1a\x17google/rpc/status.proto\x1a\x1dudpa/annotations/status.proto\x1a\x17validate/validate.proto\"W\n" +
	"\fCheckRequest\x12G\n" +
	"\n" +
	"attributes\x18\x01 \x01(\v2'.envoy.service.auth.v2.AttributeContextR\n" +
	"attributes\"\xa2\x01\n" +
	"\x12DeniedHttpResponse\x128\n" +
	"\x06status\x18\x01 \x01(\v2\x16.envoy.type.HttpStatusB\b\xfaB\x05\x8a\x01\x02\x10\x01R\x06status\x12>\n" +
	"\aheaders\x18\x02 \x03(\v2$.envoy.api.v2.core.HeaderValueOptionR\aheaders\x12\x12\n" +
	"\x04body\x18\x03 \x01(\tR\x04body\"P\n" +
	"\x0eOkHttpResponse\x12>\n" +
	"\aheaders\x18\x02 \x03(\v2$.envoy.api.v2.core.HeaderValueOptionR\aheaders\"\xec\x01\n" +
	"\rCheckResponse\x12*\n" +
	"\x06status\x18\x01 \x01(\v2\x12.google.rpc.StatusR\x06status\x12T\n" +
	"\x0fdenied_response\x18\x02 \x01(\v2).envoy.service.auth.v2.DeniedHttpResponseH\x00R\x0edeniedResponse\x12H\n" +
	"\vok_response\x18\x03 \x01(\v2%.envoy.service.auth.v2.OkHttpResponseH\x00R\n" +
	"okResponseB\x0f\n" +
	"\rhttp_response2e\n" +
	"\rAuthorization\x12T\n" +
	"\x05Check\x12#.envoy.service.auth.v2.CheckRequest\x1a$.envoy.service.auth.v2.CheckResponse\"\x00B\x87\x01\xba\x80\xc8\xd1\x06\x02\x10\x01\n" +
	"#io.envoyproxy.envoy.service.auth.v2B\x11ExternalAuthProtoP\x01ZCgithub.com/envoyproxy/go-control-plane/envoy/service/auth/v2;authv2b\x06proto3"

var (
	file_envoy_service_auth_v2_external_auth_proto_rawDescOnce sync.Once
	file_envoy_service_auth_v2_external_auth_proto_rawDescData []byte
)

func file_envoy_service_auth_v2_external_auth_proto_rawDescGZIP() []byte {
	file_envoy_service_auth_v2_external_auth_proto_rawDescOnce.Do(func() {
		file_envoy_service_auth_v2_external_auth_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_envoy_service_auth_v2_external_auth_proto_rawDesc), len(file_envoy_service_auth_v2_external_auth_proto_rawDesc)))
	})
	return file_envoy_service_auth_v2_external_auth_proto_rawDescData
}

var file_envoy_service_auth_v2_external_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_envoy_service_auth_v2_external_auth_proto_goTypes = []any{
	(*CheckRequest)(nil),           // 0: envoy.service.auth.v2.CheckRequest
	(*DeniedHttpResponse)(nil),     // 1: envoy.service.auth.v2.DeniedHttpResponse
	(*OkHttpResponse)(nil),         // 2: envoy.service.auth.v2.OkHttpResponse
	(*CheckResponse)(nil),          // 3: envoy.service.auth.v2.CheckResponse
	(*AttributeContext)(nil),       // 4: envoy.service.auth.v2.AttributeContext
	(*_type.HttpStatus)(nil),       // 5: envoy.type.HttpStatus
	(*core.HeaderValueOption)(nil), // 6: envoy.api.v2.core.HeaderValueOption
	(*status.Status)(nil),          // 7: google.rpc.Status
}
var file_envoy_service_auth_v2_external_auth_proto_depIdxs = []int32{
	4, // 0: envoy.service.auth.v2.CheckRequest.attributes:type_name -> envoy.service.auth.v2.AttributeContext
	5, // 1: envoy.service.auth.v2.DeniedHttpResponse.status:type_name -> envoy.type.HttpStatus
	6, // 2: envoy.service.auth.v2.DeniedHttpResponse.headers:type_name -> envoy.api.v2.core.HeaderValueOption
	6, // 3: envoy.service.auth.v2.OkHttpResponse.headers:type_name -> envoy.api.v2.core.HeaderValueOption
	7, // 4: envoy.service.auth.v2.CheckResponse.status:type_name -> google.rpc.Status
	1, // 5: envoy.service.auth.v2.CheckResponse.denied_response:type_name -> envoy.service.auth.v2.DeniedHttpResponse
	2, // 6: envoy.service.auth.v2.CheckResponse.ok_response:type_name -> envoy.service.auth.v2.OkHttpResponse
	0, // 7: envoy.service.auth.v2.Authorization.Check:input_type -> envoy.service.auth.v2.CheckRequest
	3, // 8: envoy.service.auth.v2.Authorization.Check:output_type -> envoy.service.auth.v2.CheckResponse
	8, // [8:9] is the sub-list for method output_type
	7, // [7:8] is the sub-list for method input_type
	7, // [7:7] is the sub-list for extension type_name
	7, // [7:7] is the sub-list for extension extendee
	0, // [0:7] is the sub-list for field type_name
}

func init() { file_envoy_service_auth_v2_external_auth_proto_init() }
func file_envoy_service_auth_v2_external_auth_proto_init() {
	if File_envoy_service_auth_v2_external_auth_proto != nil {
		return
	}
	file_envoy_service_auth_v2_attribute_context_proto_init()
	file_envoy_service_auth_v2_external_auth_proto_msgTypes[3].OneofWrappers = []any{
		(*CheckResponse_DeniedResponse)(nil),
		(*CheckResponse_OkResponse)(nil),
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_envoy_service_auth_v2_external_auth_proto_rawDesc), len(file_envoy_service_auth_v2_external_auth_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   4,
			NumExtensions: 0,
			NumServices:   1,
		},
		GoTypes:           file_envoy_service_auth_v2_external_auth_proto_goTypes,
		DependencyIndexes: file_envoy_service_auth_v2_external_auth_proto_depIdxs,
		MessageInfos:      file_envoy_service_auth_v2_external_auth_proto_msgTypes,
	}.Build()
	File_envoy_service_auth_v2_external_auth_proto = out.File
	file_envoy_service_auth_v2_external_auth_proto_goTypes = nil
	file_envoy_service_auth_v2_external_auth_proto_depIdxs = nil
}
