// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.11
// 	protoc        v3.20.3
// source: auth.proto

package authpb

import (
	reflect "reflect"
	sync "sync"
	unsafe "unsafe"

	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
)

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 Permission_Type int32

const (
	Permission_READ      Permission_Type = 0
	Permission_WRITE     Permission_Type = 1
	Permission_READWRITE Permission_Type = 2
)

// Enum value maps for Permission_Type.
var (
	Permission_Type_name = map[int32]string{
		0: "READ",
		1: "WRITE",
		2: "READWRITE",
	}
	Permission_Type_value = map[string]int32{
		"READ":      0,
		"WRITE":     1,
		"READWRITE": 2,
	}
)

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

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

func (Permission_Type) Descriptor() protoreflect.EnumDescriptor {
	return file_auth_proto_enumTypes[0].Descriptor()
}

func (Permission_Type) Type() protoreflect.EnumType {
	return &file_auth_proto_enumTypes[0]
}

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

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

type UserAddOptions struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	NoPassword    bool                   `protobuf:"varint,1,opt,name=no_password,json=noPassword,proto3" json:"no_password,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*UserAddOptions) ProtoMessage() {}

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

func (x *UserAddOptions) GetNoPassword() bool {
	if x != nil {
		return x.NoPassword
	}
	return false
}

// User is a single entry in the bucket authUsers
type User struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	Name          []byte                 `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Password      []byte                 `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
	Roles         []string               `protobuf:"bytes,3,rep,name=roles,proto3" json:"roles,omitempty"`
	Options       *UserAddOptions        `protobuf:"bytes,4,opt,name=options,proto3" json:"options,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*User) ProtoMessage() {}

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

func (x *User) GetName() []byte {
	if x != nil {
		return x.Name
	}
	return nil
}

func (x *User) GetPassword() []byte {
	if x != nil {
		return x.Password
	}
	return nil
}

func (x *User) GetRoles() []string {
	if x != nil {
		return x.Roles
	}
	return nil
}

func (x *User) GetOptions() *UserAddOptions {
	if x != nil {
		return x.Options
	}
	return nil
}

// Permission is a single entity
type Permission struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	PermType      Permission_Type        `protobuf:"varint,1,opt,name=permType,proto3,enum=authpb.Permission_Type" json:"permType,omitempty"`
	Key           []byte                 `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	RangeEnd      []byte                 `protobuf:"bytes,3,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*Permission) ProtoMessage() {}

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

func (x *Permission) GetPermType() Permission_Type {
	if x != nil {
		return x.PermType
	}
	return Permission_READ
}

func (x *Permission) GetKey() []byte {
	if x != nil {
		return x.Key
	}
	return nil
}

func (x *Permission) GetRangeEnd() []byte {
	if x != nil {
		return x.RangeEnd
	}
	return nil
}

// Role is a single entry in the bucket authRoles
type Role struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	Name          []byte                 `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	KeyPermission []*Permission          `protobuf:"bytes,2,rep,name=keyPermission,proto3" json:"keyPermission,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*Role) ProtoMessage() {}

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

func (x *Role) GetName() []byte {
	if x != nil {
		return x.Name
	}
	return nil
}

func (x *Role) GetKeyPermission() []*Permission {
	if x != nil {
		return x.KeyPermission
	}
	return nil
}

var File_auth_proto protoreflect.FileDescriptor

const file_auth_proto_rawDesc = "" +
	"\n" +
	"\n" +
	"auth.proto\x12\x06authpb\"1\n" +
	"\x0eUserAddOptions\x12\x1f\n" +
	"\vno_password\x18\x01 \x01(\bR\n" +
	"noPassword\"~\n" +
	"\x04User\x12\x12\n" +
	"\x04name\x18\x01 \x01(\fR\x04name\x12\x1a\n" +
	"\bpassword\x18\x02 \x01(\fR\bpassword\x12\x14\n" +
	"\x05roles\x18\x03 \x03(\tR\x05roles\x120\n" +
	"\aoptions\x18\x04 \x01(\v2\x16.authpb.UserAddOptionsR\aoptions\"\x9c\x01\n" +
	"\n" +
	"Permission\x123\n" +
	"\bpermType\x18\x01 \x01(\x0e2\x17.authpb.Permission.TypeR\bpermType\x12\x10\n" +
	"\x03key\x18\x02 \x01(\fR\x03key\x12\x1b\n" +
	"\trange_end\x18\x03 \x01(\fR\brangeEnd\"*\n" +
	"\x04Type\x12\b\n" +
	"\x04READ\x10\x00\x12\t\n" +
	"\x05WRITE\x10\x01\x12\r\n" +
	"\tREADWRITE\x10\x02\"T\n" +
	"\x04Role\x12\x12\n" +
	"\x04name\x18\x01 \x01(\fR\x04name\x128\n" +
	"\rkeyPermission\x18\x02 \x03(\v2\x12.authpb.PermissionR\rkeyPermissionB\x1fZ\x1dgo.etcd.io/etcd/api/v3/authpbb\x06proto3"

var (
	file_auth_proto_rawDescOnce sync.Once
	file_auth_proto_rawDescData []byte
)

func file_auth_proto_rawDescGZIP() []byte {
	file_auth_proto_rawDescOnce.Do(func() {
		file_auth_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_auth_proto_rawDesc), len(file_auth_proto_rawDesc)))
	})
	return file_auth_proto_rawDescData
}

var file_auth_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_auth_proto_goTypes = []any{
	(Permission_Type)(0),   // 0: authpb.Permission.Type
	(*UserAddOptions)(nil), // 1: authpb.UserAddOptions
	(*User)(nil),           // 2: authpb.User
	(*Permission)(nil),     // 3: authpb.Permission
	(*Role)(nil),           // 4: authpb.Role
}
var file_auth_proto_depIdxs = []int32{
	1, // 0: authpb.User.options:type_name -> authpb.UserAddOptions
	0, // 1: authpb.Permission.permType:type_name -> authpb.Permission.Type
	3, // 2: authpb.Role.keyPermission:type_name -> authpb.Permission
	3, // [3:3] is the sub-list for method output_type
	3, // [3:3] is the sub-list for method input_type
	3, // [3:3] is the sub-list for extension type_name
	3, // [3:3] is the sub-list for extension extendee
	0, // [0:3] is the sub-list for field type_name
}

func init() { file_auth_proto_init() }
func file_auth_proto_init() {
	if File_auth_proto != nil {
		return
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_auth_proto_rawDesc), len(file_auth_proto_rawDesc)),
			NumEnums:      1,
			NumMessages:   4,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_auth_proto_goTypes,
		DependencyIndexes: file_auth_proto_depIdxs,
		EnumInfos:         file_auth_proto_enumTypes,
		MessageInfos:      file_auth_proto_msgTypes,
	}.Build()
	File_auth_proto = out.File
	file_auth_proto_goTypes = nil
	file_auth_proto_depIdxs = nil
}
