// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.10
// 	protoc        (unknown)
// source: tars/auth/v1/auth_options.proto

package authv1

import (
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	descriptorpb "google.golang.org/protobuf/types/descriptorpb"
	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)
)

// AuthType defines the type of authentication mechanism.
type AuthType int32

const (
	AuthType_AUTH_TYPE_UNSPECIFIED     AuthType = 0
	AuthType_AUTH_TYPE_API_KEY         AuthType = 1
	AuthType_AUTH_TYPE_SERVICE_ACCOUNT AuthType = 2
	AuthType_AUTH_TYPE_USER_TOKEN      AuthType = 3
)

// Enum value maps for AuthType.
var (
	AuthType_name = map[int32]string{
		0: "AUTH_TYPE_UNSPECIFIED",
		1: "AUTH_TYPE_API_KEY",
		2: "AUTH_TYPE_SERVICE_ACCOUNT",
		3: "AUTH_TYPE_USER_TOKEN",
	}
	AuthType_value = map[string]int32{
		"AUTH_TYPE_UNSPECIFIED":     0,
		"AUTH_TYPE_API_KEY":         1,
		"AUTH_TYPE_SERVICE_ACCOUNT": 2,
		"AUTH_TYPE_USER_TOKEN":      3,
	}
)

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

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

func (AuthType) Descriptor() protoreflect.EnumDescriptor {
	return file_tars_auth_v1_auth_options_proto_enumTypes[0].Descriptor()
}

func (AuthType) Type() protoreflect.EnumType {
	return &file_tars_auth_v1_auth_options_proto_enumTypes[0]
}

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

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

// AuthOptions defines authentication requirements for an RPC method.
// If this annotation is not present on a method, the method is public (no auth required).
// If present with empty auth_types, any valid authentication is accepted.
// If present with auth_types specified, only those auth types are accepted.
type AuthOptions struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// The types of authentication accepted for this method.
	// If empty, any valid authentication is accepted.
	// If specified, only the listed authentication types are accepted.
	AuthTypes []AuthType `protobuf:"varint,1,rep,packed,name=auth_types,json=authTypes,proto3,enum=tars.auth.v1.AuthType" json:"auth_types,omitempty"`
	// Additional scopes or permissions required. The caller must satisfy ALL
	// listed scopes.
	//
	// Persona ladder (admin > project_owner > user):
	//   - "admin": platform admins (authn.user.role in admin/super_admin).
	//     Satisfies every lower tier as well.
	//   - "project_owner": the owner of the project the request targets, i.e. a
	//     user with project_members.role = "admin" on that project. This is NOT
	//     a static claim scope -- the interceptor resolves it per-request by
	//     extracting the target (customer_id, project_id) from the message (see
	//     project_id_field / customer_id_field below) and checking membership.
	//     A platform "admin" also satisfies it.
	//   - "read"/"write": any authenticated caller (the "user" tier).
	//
	// Examples: "admin", "project_owner", "read", "write"
	Scopes        []string `protobuf:"bytes,2,rep,name=scopes,proto3" json:"scopes,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*AuthOptions) ProtoMessage() {}

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

func (x *AuthOptions) GetAuthTypes() []AuthType {
	if x != nil {
		return x.AuthTypes
	}
	return nil
}

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

var file_tars_auth_v1_auth_options_proto_extTypes = []protoimpl.ExtensionInfo{
	{
		ExtendedType:  (*descriptorpb.MethodOptions)(nil),
		ExtensionType: (*AuthOptions)(nil),
		Field:         50001,
		Name:          "tars.auth.v1.auth",
		Tag:           "bytes,50001,opt,name=auth",
		Filename:      "tars/auth/v1/auth_options.proto",
	},
	{
		ExtendedType:  (*descriptorpb.FieldOptions)(nil),
		ExtensionType: (*bool)(nil),
		Field:         50007,
		Name:          "tars.auth.v1.project_id_field",
		Tag:           "varint,50007,opt,name=project_id_field",
		Filename:      "tars/auth/v1/auth_options.proto",
	},
	{
		ExtendedType:  (*descriptorpb.FieldOptions)(nil),
		ExtensionType: (*bool)(nil),
		Field:         50008,
		Name:          "tars.auth.v1.customer_id_field",
		Tag:           "varint,50008,opt,name=customer_id_field",
		Filename:      "tars/auth/v1/auth_options.proto",
	},
}

// Extension fields to descriptorpb.MethodOptions.
var (
	// optional tars.auth.v1.AuthOptions auth = 50001;
	E_Auth = &file_tars_auth_v1_auth_options_proto_extTypes[0]
)

// Extension fields to descriptorpb.FieldOptions.
var (
	// Marks the field that holds the target project id.
	//
	// optional bool project_id_field = 50007;
	E_ProjectIdField = &file_tars_auth_v1_auth_options_proto_extTypes[1]
	// Marks the field that holds the target customer id.
	//
	// optional bool customer_id_field = 50008;
	E_CustomerIdField = &file_tars_auth_v1_auth_options_proto_extTypes[2]
)

var File_tars_auth_v1_auth_options_proto protoreflect.FileDescriptor

const file_tars_auth_v1_auth_options_proto_rawDesc = "" +
	"\n" +
	"\x1ftars/auth/v1/auth_options.proto\x12\ftars.auth.v1\x1a google/protobuf/descriptor.proto\"\\\n" +
	"\vAuthOptions\x125\n" +
	"\n" +
	"auth_types\x18\x01 \x03(\x0e2\x16.tars.auth.v1.AuthTypeR\tauthTypes\x12\x16\n" +
	"\x06scopes\x18\x02 \x03(\tR\x06scopes*u\n" +
	"\bAuthType\x12\x19\n" +
	"\x15AUTH_TYPE_UNSPECIFIED\x10\x00\x12\x15\n" +
	"\x11AUTH_TYPE_API_KEY\x10\x01\x12\x1d\n" +
	"\x19AUTH_TYPE_SERVICE_ACCOUNT\x10\x02\x12\x18\n" +
	"\x14AUTH_TYPE_USER_TOKEN\x10\x03:O\n" +
	"\x04auth\x12\x1e.google.protobuf.MethodOptions\x18ц\x03 \x01(\v2\x19.tars.auth.v1.AuthOptionsR\x04auth:I\n" +
	"\x10project_id_field\x12\x1d.google.protobuf.FieldOptions\x18׆\x03 \x01(\bR\x0eprojectIdField:K\n" +
	"\x11customer_id_field\x12\x1d.google.protobuf.FieldOptions\x18؆\x03 \x01(\bR\x0fcustomerIdFieldB\xab\x01\n" +
	"\x10com.tars.auth.v1B\x10AuthOptionsProtoP\x01Z3github.com/tetrateio/fraser/api/tars/auth/v1;authv1\xa2\x02\x03TAX\xaa\x02\fTars.Auth.V1\xca\x02\fTars\\Auth\\V1\xe2\x02\x18Tars\\Auth\\V1\\GPBMetadata\xea\x02\x0eTars::Auth::V1b\x06proto3"

var (
	file_tars_auth_v1_auth_options_proto_rawDescOnce sync.Once
	file_tars_auth_v1_auth_options_proto_rawDescData []byte
)

func file_tars_auth_v1_auth_options_proto_rawDescGZIP() []byte {
	file_tars_auth_v1_auth_options_proto_rawDescOnce.Do(func() {
		file_tars_auth_v1_auth_options_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_tars_auth_v1_auth_options_proto_rawDesc), len(file_tars_auth_v1_auth_options_proto_rawDesc)))
	})
	return file_tars_auth_v1_auth_options_proto_rawDescData
}

var file_tars_auth_v1_auth_options_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_tars_auth_v1_auth_options_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_tars_auth_v1_auth_options_proto_goTypes = []any{
	(AuthType)(0),                      // 0: tars.auth.v1.AuthType
	(*AuthOptions)(nil),                // 1: tars.auth.v1.AuthOptions
	(*descriptorpb.MethodOptions)(nil), // 2: google.protobuf.MethodOptions
	(*descriptorpb.FieldOptions)(nil),  // 3: google.protobuf.FieldOptions
}
var file_tars_auth_v1_auth_options_proto_depIdxs = []int32{
	0, // 0: tars.auth.v1.AuthOptions.auth_types:type_name -> tars.auth.v1.AuthType
	2, // 1: tars.auth.v1.auth:extendee -> google.protobuf.MethodOptions
	3, // 2: tars.auth.v1.project_id_field:extendee -> google.protobuf.FieldOptions
	3, // 3: tars.auth.v1.customer_id_field:extendee -> google.protobuf.FieldOptions
	1, // 4: tars.auth.v1.auth:type_name -> tars.auth.v1.AuthOptions
	5, // [5:5] is the sub-list for method output_type
	5, // [5:5] is the sub-list for method input_type
	4, // [4:5] is the sub-list for extension type_name
	1, // [1:4] is the sub-list for extension extendee
	0, // [0:1] is the sub-list for field type_name
}

func init() { file_tars_auth_v1_auth_options_proto_init() }
func file_tars_auth_v1_auth_options_proto_init() {
	if File_tars_auth_v1_auth_options_proto != nil {
		return
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_tars_auth_v1_auth_options_proto_rawDesc), len(file_tars_auth_v1_auth_options_proto_rawDesc)),
			NumEnums:      1,
			NumMessages:   1,
			NumExtensions: 3,
			NumServices:   0,
		},
		GoTypes:           file_tars_auth_v1_auth_options_proto_goTypes,
		DependencyIndexes: file_tars_auth_v1_auth_options_proto_depIdxs,
		EnumInfos:         file_tars_auth_v1_auth_options_proto_enumTypes,
		MessageInfos:      file_tars_auth_v1_auth_options_proto_msgTypes,
		ExtensionInfos:    file_tars_auth_v1_auth_options_proto_extTypes,
	}.Build()
	File_tars_auth_v1_auth_options_proto = out.File
	file_tars_auth_v1_auth_options_proto_goTypes = nil
	file_tars_auth_v1_auth_options_proto_depIdxs = nil
}
