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

package oauth2v3

import (
	_ "github.com/cncf/xds/go/udpa/annotations"
	_ "github.com/cncf/xds/go/xds/annotations/v3"
	v3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
	v31 "github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/tls/v3"
	_ "github.com/envoyproxy/protoc-gen-validate/validate"
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	durationpb "google.golang.org/protobuf/types/known/durationpb"
	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 OAuth2_AuthType int32

const (
	// The “client_id“ and “client_secret“ will be sent using HTTP Basic authentication scheme.
	OAuth2_BASIC_AUTH OAuth2_AuthType = 0
	// The “client_id“ and “client_secret“ will be sent in the URL encoded request body.
	// This type should only be used when Auth server does not support Basic authentication.
	OAuth2_URL_ENCODED_BODY OAuth2_AuthType = 1
)

// Enum value maps for OAuth2_AuthType.
var (
	OAuth2_AuthType_name = map[int32]string{
		0: "BASIC_AUTH",
		1: "URL_ENCODED_BODY",
	}
	OAuth2_AuthType_value = map[string]int32{
		"BASIC_AUTH":       0,
		"URL_ENCODED_BODY": 1,
	}
)

func (x OAuth2_AuthType) Enum() *OAuth2_AuthType {
	p := new(OAuth2_AuthType)
	*p = x
	return p
}

func (x OAuth2_AuthType) String() string {
	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}

func (OAuth2_AuthType) Descriptor() protoreflect.EnumDescriptor {
	return file_envoy_extensions_http_injected_credentials_oauth2_v3_oauth2_proto_enumTypes[0].Descriptor()
}

func (OAuth2_AuthType) Type() protoreflect.EnumType {
	return &file_envoy_extensions_http_injected_credentials_oauth2_v3_oauth2_proto_enumTypes[0]
}

func (x OAuth2_AuthType) Number() protoreflect.EnumNumber {
	return protoreflect.EnumNumber(x)
}

// Deprecated: Use OAuth2_AuthType.Descriptor instead.
func (OAuth2_AuthType) EnumDescriptor() ([]byte, []int) {
	return file_envoy_extensions_http_injected_credentials_oauth2_v3_oauth2_proto_rawDescGZIP(), []int{0, 0}
}

// OAuth2 extension can be used to retrieve an OAuth2 access token from an authorization server and inject it into the
// proxied requests.
// Currently, only the Client Credentials Grant flow is supported.
// The access token will be injected into the request headers using the “Authorization“ header as a bearer token.
// [#next-free-field: 6]
type OAuth2 struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Endpoint on the authorization server to retrieve the access token from.
	// Refer to [RFC 6749: The OAuth 2.0 Authorization Framework](https://www.rfc-editor.org/rfc/rfc6749#section-3.2) for details.
	TokenEndpoint *v3.HttpUri `protobuf:"bytes,1,opt,name=token_endpoint,json=tokenEndpoint,proto3" json:"token_endpoint,omitempty"`
	// Optional list of OAuth scopes to be claimed in the authorization request.
	// Refer to [RFC 6749: The OAuth 2.0 Authorization Framework](https://www.rfc-editor.org/rfc/rfc6749#section-4.4.2) for details.
	Scopes []string `protobuf:"bytes,2,rep,name=scopes,proto3" json:"scopes,omitempty"`
	// Types that are valid to be assigned to FlowType:
	//
	//	*OAuth2_ClientCredentials_
	FlowType isOAuth2_FlowType `protobuf_oneof:"flow_type"`
	// The interval between two successive retries to fetch token from Identity Provider. Default is 2 secs.
	// The interval must be at least 1 second.
	TokenFetchRetryInterval *durationpb.Duration `protobuf:"bytes,4,opt,name=token_fetch_retry_interval,json=tokenFetchRetryInterval,proto3" json:"token_fetch_retry_interval,omitempty"`
	// Optional list of additional parameters to send to the token endpoint.
	// These parameters will be URL-encoded and included in the token request body.
	EndpointParams []*OAuth2_EndpointParameter `protobuf:"bytes,5,rep,name=endpoint_params,json=endpointParams,proto3" json:"endpoint_params,omitempty"`
	unknownFields  protoimpl.UnknownFields
	sizeCache      protoimpl.SizeCache
}

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

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

func (*OAuth2) ProtoMessage() {}

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

func (x *OAuth2) GetTokenEndpoint() *v3.HttpUri {
	if x != nil {
		return x.TokenEndpoint
	}
	return nil
}

func (x *OAuth2) GetScopes() []string {
	if x != nil {
		return x.Scopes
	}
	return nil
}

func (x *OAuth2) GetFlowType() isOAuth2_FlowType {
	if x != nil {
		return x.FlowType
	}
	return nil
}

func (x *OAuth2) GetClientCredentials() *OAuth2_ClientCredentials {
	if x != nil {
		if x, ok := x.FlowType.(*OAuth2_ClientCredentials_); ok {
			return x.ClientCredentials
		}
	}
	return nil
}

func (x *OAuth2) GetTokenFetchRetryInterval() *durationpb.Duration {
	if x != nil {
		return x.TokenFetchRetryInterval
	}
	return nil
}

func (x *OAuth2) GetEndpointParams() []*OAuth2_EndpointParameter {
	if x != nil {
		return x.EndpointParams
	}
	return nil
}

type isOAuth2_FlowType interface {
	isOAuth2_FlowType()
}

type OAuth2_ClientCredentials_ struct {
	// Client Credentials Grant.
	// Refer to [RFC 6749: The OAuth 2.0 Authorization Framework](https://www.rfc-editor.org/rfc/rfc6749#section-4.4) for details.
	ClientCredentials *OAuth2_ClientCredentials `protobuf:"bytes,3,opt,name=client_credentials,json=clientCredentials,proto3,oneof"`
}

func (*OAuth2_ClientCredentials_) isOAuth2_FlowType() {}

// Credentials to authenticate client to the authorization server.
// Refer to [RFC 6749: The OAuth 2.0 Authorization Framework](https://www.rfc-editor.org/rfc/rfc6749#section-2.3) for details.
type OAuth2_ClientCredentials struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Client ID.
	// Refer to [RFC 6749: The OAuth 2.0 Authorization Framework](https://www.rfc-editor.org/rfc/rfc6749#section-2.3.1) for details.
	ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
	// Client secret.
	// Refer to [RFC 6749: The OAuth 2.0 Authorization Framework](https://www.rfc-editor.org/rfc/rfc6749#section-2.3.1) for details.
	ClientSecret *v31.SdsSecretConfig `protobuf:"bytes,2,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret,omitempty"`
	// The method to use when sending credentials to the authorization server.
	// Refer to [RFC 6749: The OAuth 2.0 Authorization Framework](https://www.rfc-editor.org/rfc/rfc6749#section-2.3.1) for details.
	AuthType      OAuth2_AuthType `protobuf:"varint,3,opt,name=auth_type,json=authType,proto3,enum=envoy.extensions.http.injected_credentials.oauth2.v3.OAuth2_AuthType" json:"auth_type,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*OAuth2_ClientCredentials) ProtoMessage() {}

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

func (x *OAuth2_ClientCredentials) GetClientId() string {
	if x != nil {
		return x.ClientId
	}
	return ""
}

func (x *OAuth2_ClientCredentials) GetClientSecret() *v31.SdsSecretConfig {
	if x != nil {
		return x.ClientSecret
	}
	return nil
}

func (x *OAuth2_ClientCredentials) GetAuthType() OAuth2_AuthType {
	if x != nil {
		return x.AuthType
	}
	return OAuth2_BASIC_AUTH
}

// Optional additional parameters to include in the token endpoint request body.
// These parameters will be URL-encoded and added to the request body along with the standard OAuth2 parameters.
// Refer to your authorization server's documentation for supported parameters.
type OAuth2_EndpointParameter struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Parameter name.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Parameter value.
	Value         string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*OAuth2_EndpointParameter) ProtoMessage() {}

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

func (x *OAuth2_EndpointParameter) GetName() string {
	if x != nil {
		return x.Name
	}
	return ""
}

func (x *OAuth2_EndpointParameter) GetValue() string {
	if x != nil {
		return x.Value
	}
	return ""
}

var File_envoy_extensions_http_injected_credentials_oauth2_v3_oauth2_proto protoreflect.FileDescriptor

const file_envoy_extensions_http_injected_credentials_oauth2_v3_oauth2_proto_rawDesc = "" +
	"\n" +
	"Aenvoy/extensions/http/injected_credentials/oauth2/v3/oauth2.proto\x124envoy.extensions.http.injected_credentials.oauth2.v3\x1a#envoy/config/core/v3/http_uri.proto\x1a6envoy/extensions/transport_sockets/tls/v3/secret.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fxds/annotations/v3/status.proto\x1a\x1dudpa/annotations/status.proto\x1a\x17validate/validate.proto\"\xe5\x06\n" +
	"\x06OAuth2\x12N\n" +
	"\x0etoken_endpoint\x18\x01 \x01(\v2\x1d.envoy.config.core.v3.HttpUriB\b\xfaB\x05\x8a\x01\x02\x10\x01R\rtokenEndpoint\x12\x16\n" +
	"\x06scopes\x18\x02 \x03(\tR\x06scopes\x12\x7f\n" +
	"\x12client_credentials\x18\x03 \x01(\v2N.envoy.extensions.http.injected_credentials.oauth2.v3.OAuth2.ClientCredentialsH\x00R\x11clientCredentials\x12b\n" +
	"\x1atoken_fetch_retry_interval\x18\x04 \x01(\v2\x19.google.protobuf.DurationB\n" +
	"\xfaB\a\xaa\x01\x042\x02\b\x01R\x17tokenFetchRetryInterval\x12w\n" +
	"\x0fendpoint_params\x18\x05 \x03(\v2N.envoy.extensions.http.injected_credentials.oauth2.v3.OAuth2.EndpointParameterR\x0eendpointParams\x1a\x88\x02\n" +
	"\x11ClientCredentials\x12$\n" +
	"\tclient_id\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\bclientId\x12i\n" +
	"\rclient_secret\x18\x02 \x01(\v2:.envoy.extensions.transport_sockets.tls.v3.SdsSecretConfigB\b\xfaB\x05\x8a\x01\x02\x10\x01R\fclientSecret\x12b\n" +
	"\tauth_type\x18\x03 \x01(\x0e2E.envoy.extensions.http.injected_credentials.oauth2.v3.OAuth2.AuthTypeR\bauthType\x1aF\n" +
	"\x11EndpointParameter\x12\x1b\n" +
	"\x04name\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x04name\x12\x14\n" +
	"\x05value\x18\x02 \x01(\tR\x05value\"0\n" +
	"\bAuthType\x12\x0e\n" +
	"\n" +
	"BASIC_AUTH\x10\x00\x12\x14\n" +
	"\x10URL_ENCODED_BODY\x10\x01B\x10\n" +
	"\tflow_type\x12\x03\xf8B\x01B\xc9\x01\xba\x80\xc8\xd1\x06\x02\x10\x02\xd2Ƥ\xe1\x06\x02\b\x01\n" +
	"Bio.envoyproxy.envoy.extensions.http.injected_credentials.oauth2.v3B\vOauth2ProtoP\x01Zdgithub.com/envoyproxy/go-control-plane/envoy/extensions/http/injected_credentials/oauth2/v3;oauth2v3b\x06proto3"

var (
	file_envoy_extensions_http_injected_credentials_oauth2_v3_oauth2_proto_rawDescOnce sync.Once
	file_envoy_extensions_http_injected_credentials_oauth2_v3_oauth2_proto_rawDescData []byte
)

func file_envoy_extensions_http_injected_credentials_oauth2_v3_oauth2_proto_rawDescGZIP() []byte {
	file_envoy_extensions_http_injected_credentials_oauth2_v3_oauth2_proto_rawDescOnce.Do(func() {
		file_envoy_extensions_http_injected_credentials_oauth2_v3_oauth2_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_envoy_extensions_http_injected_credentials_oauth2_v3_oauth2_proto_rawDesc), len(file_envoy_extensions_http_injected_credentials_oauth2_v3_oauth2_proto_rawDesc)))
	})
	return file_envoy_extensions_http_injected_credentials_oauth2_v3_oauth2_proto_rawDescData
}

var file_envoy_extensions_http_injected_credentials_oauth2_v3_oauth2_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_envoy_extensions_http_injected_credentials_oauth2_v3_oauth2_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_envoy_extensions_http_injected_credentials_oauth2_v3_oauth2_proto_goTypes = []any{
	(OAuth2_AuthType)(0),             // 0: envoy.extensions.http.injected_credentials.oauth2.v3.OAuth2.AuthType
	(*OAuth2)(nil),                   // 1: envoy.extensions.http.injected_credentials.oauth2.v3.OAuth2
	(*OAuth2_ClientCredentials)(nil), // 2: envoy.extensions.http.injected_credentials.oauth2.v3.OAuth2.ClientCredentials
	(*OAuth2_EndpointParameter)(nil), // 3: envoy.extensions.http.injected_credentials.oauth2.v3.OAuth2.EndpointParameter
	(*v3.HttpUri)(nil),               // 4: envoy.config.core.v3.HttpUri
	(*durationpb.Duration)(nil),      // 5: google.protobuf.Duration
	(*v31.SdsSecretConfig)(nil),      // 6: envoy.extensions.transport_sockets.tls.v3.SdsSecretConfig
}
var file_envoy_extensions_http_injected_credentials_oauth2_v3_oauth2_proto_depIdxs = []int32{
	4, // 0: envoy.extensions.http.injected_credentials.oauth2.v3.OAuth2.token_endpoint:type_name -> envoy.config.core.v3.HttpUri
	2, // 1: envoy.extensions.http.injected_credentials.oauth2.v3.OAuth2.client_credentials:type_name -> envoy.extensions.http.injected_credentials.oauth2.v3.OAuth2.ClientCredentials
	5, // 2: envoy.extensions.http.injected_credentials.oauth2.v3.OAuth2.token_fetch_retry_interval:type_name -> google.protobuf.Duration
	3, // 3: envoy.extensions.http.injected_credentials.oauth2.v3.OAuth2.endpoint_params:type_name -> envoy.extensions.http.injected_credentials.oauth2.v3.OAuth2.EndpointParameter
	6, // 4: envoy.extensions.http.injected_credentials.oauth2.v3.OAuth2.ClientCredentials.client_secret:type_name -> envoy.extensions.transport_sockets.tls.v3.SdsSecretConfig
	0, // 5: envoy.extensions.http.injected_credentials.oauth2.v3.OAuth2.ClientCredentials.auth_type:type_name -> envoy.extensions.http.injected_credentials.oauth2.v3.OAuth2.AuthType
	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_http_injected_credentials_oauth2_v3_oauth2_proto_init() }
func file_envoy_extensions_http_injected_credentials_oauth2_v3_oauth2_proto_init() {
	if File_envoy_extensions_http_injected_credentials_oauth2_v3_oauth2_proto != nil {
		return
	}
	file_envoy_extensions_http_injected_credentials_oauth2_v3_oauth2_proto_msgTypes[0].OneofWrappers = []any{
		(*OAuth2_ClientCredentials_)(nil),
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_envoy_extensions_http_injected_credentials_oauth2_v3_oauth2_proto_rawDesc), len(file_envoy_extensions_http_injected_credentials_oauth2_v3_oauth2_proto_rawDesc)),
			NumEnums:      1,
			NumMessages:   3,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_envoy_extensions_http_injected_credentials_oauth2_v3_oauth2_proto_goTypes,
		DependencyIndexes: file_envoy_extensions_http_injected_credentials_oauth2_v3_oauth2_proto_depIdxs,
		EnumInfos:         file_envoy_extensions_http_injected_credentials_oauth2_v3_oauth2_proto_enumTypes,
		MessageInfos:      file_envoy_extensions_http_injected_credentials_oauth2_v3_oauth2_proto_msgTypes,
	}.Build()
	File_envoy_extensions_http_injected_credentials_oauth2_v3_oauth2_proto = out.File
	file_envoy_extensions_http_injected_credentials_oauth2_v3_oauth2_proto_goTypes = nil
	file_envoy_extensions_http_injected_credentials_oauth2_v3_oauth2_proto_depIdxs = nil
}
