// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.8
// 	protoc        v6.32.0
// source: auth/v1/auth.proto

package v1

import (
	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 AuthNReq struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	Token         string                 `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*AuthNReq) ProtoMessage() {}

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

func (x *AuthNReq) GetToken() string {
	if x != nil {
		return x.Token
	}
	return ""
}

type AuthNRes struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	Id            string                 `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`                              // token id
	UserId        string                 `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`        // user id
	UserRole      uint32                 `protobuf:"varint,3,opt,name=user_role,json=userRole,proto3" json:"user_role,omitempty"` // user role
	Verified      bool                   `protobuf:"varint,4,opt,name=verified,proto3" json:"verified,omitempty"`                 // verified user
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*AuthNRes) ProtoMessage() {}

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

func (x *AuthNRes) GetId() string {
	if x != nil {
		return x.Id
	}
	return ""
}

func (x *AuthNRes) GetUserId() string {
	if x != nil {
		return x.UserId
	}
	return ""
}

func (x *AuthNRes) GetUserRole() uint32 {
	if x != nil {
		return x.UserRole
	}
	return 0
}

func (x *AuthNRes) GetVerified() bool {
	if x != nil {
		return x.Verified
	}
	return false
}

type AuthZReq struct {
	state           protoimpl.MessageState `protogen:"open.v1"`
	Domain          string                 `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"`                                          // Domain
	SubjectType     string                 `protobuf:"bytes,2,opt,name=subject_type,json=subjectType,proto3" json:"subject_type,omitempty"`             // Client or User
	SubjectKind     string                 `protobuf:"bytes,3,opt,name=subject_kind,json=subjectKind,proto3" json:"subject_kind,omitempty"`             // ID or Token
	SubjectRelation string                 `protobuf:"bytes,4,opt,name=subject_relation,json=subjectRelation,proto3" json:"subject_relation,omitempty"` // Subject relation
	Subject         string                 `protobuf:"bytes,5,opt,name=subject,proto3" json:"subject,omitempty"`                                        // Subject value (id or token, depending on kind)
	Relation        string                 `protobuf:"bytes,6,opt,name=relation,proto3" json:"relation,omitempty"`                                      // Relation to filter
	Permission      string                 `protobuf:"bytes,7,opt,name=permission,proto3" json:"permission,omitempty"`                                  // Action
	Object          string                 `protobuf:"bytes,8,opt,name=object,proto3" json:"object,omitempty"`                                          // Object ID
	ObjectType      string                 `protobuf:"bytes,9,opt,name=object_type,json=objectType,proto3" json:"object_type,omitempty"`                // Client, User, Group
	unknownFields   protoimpl.UnknownFields
	sizeCache       protoimpl.SizeCache
}

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

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

func (*AuthZReq) ProtoMessage() {}

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

func (x *AuthZReq) GetDomain() string {
	if x != nil {
		return x.Domain
	}
	return ""
}

func (x *AuthZReq) GetSubjectType() string {
	if x != nil {
		return x.SubjectType
	}
	return ""
}

func (x *AuthZReq) GetSubjectKind() string {
	if x != nil {
		return x.SubjectKind
	}
	return ""
}

func (x *AuthZReq) GetSubjectRelation() string {
	if x != nil {
		return x.SubjectRelation
	}
	return ""
}

func (x *AuthZReq) GetSubject() string {
	if x != nil {
		return x.Subject
	}
	return ""
}

func (x *AuthZReq) GetRelation() string {
	if x != nil {
		return x.Relation
	}
	return ""
}

func (x *AuthZReq) GetPermission() string {
	if x != nil {
		return x.Permission
	}
	return ""
}

func (x *AuthZReq) GetObject() string {
	if x != nil {
		return x.Object
	}
	return ""
}

func (x *AuthZReq) GetObjectType() string {
	if x != nil {
		return x.ObjectType
	}
	return ""
}

type AuthZPatReq struct {
	state            protoimpl.MessageState `protogen:"open.v1"`
	UserId           string                 `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`                                 // User id
	PatId            string                 `protobuf:"bytes,2,opt,name=pat_id,json=patId,proto3" json:"pat_id,omitempty"`                                    // Pat id
	EntityType       uint32                 `protobuf:"varint,3,opt,name=entity_type,json=entityType,proto3" json:"entity_type,omitempty"`                    // Entity type
	OptionalDomainId string                 `protobuf:"bytes,4,opt,name=optional_domain_id,json=optionalDomainId,proto3" json:"optional_domain_id,omitempty"` // Optional domain id
	Operation        uint32                 `protobuf:"varint,6,opt,name=operation,proto3" json:"operation,omitempty"`                                        // Operation
	EntityId         string                 `protobuf:"bytes,7,opt,name=entity_id,json=entityId,proto3" json:"entity_id,omitempty"`                           // EntityID
	unknownFields    protoimpl.UnknownFields
	sizeCache        protoimpl.SizeCache
}

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

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

func (*AuthZPatReq) ProtoMessage() {}

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

func (x *AuthZPatReq) GetUserId() string {
	if x != nil {
		return x.UserId
	}
	return ""
}

func (x *AuthZPatReq) GetPatId() string {
	if x != nil {
		return x.PatId
	}
	return ""
}

func (x *AuthZPatReq) GetEntityType() uint32 {
	if x != nil {
		return x.EntityType
	}
	return 0
}

func (x *AuthZPatReq) GetOptionalDomainId() string {
	if x != nil {
		return x.OptionalDomainId
	}
	return ""
}

func (x *AuthZPatReq) GetOperation() uint32 {
	if x != nil {
		return x.Operation
	}
	return 0
}

func (x *AuthZPatReq) GetEntityId() string {
	if x != nil {
		return x.EntityId
	}
	return ""
}

type AuthZRes struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	Authorized    bool                   `protobuf:"varint,1,opt,name=authorized,proto3" json:"authorized,omitempty"`
	Id            string                 `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *AuthZRes) Reset() {
	*x = AuthZRes{}
	mi := &file_auth_v1_auth_proto_msgTypes[4]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

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

func (*AuthZRes) ProtoMessage() {}

func (x *AuthZRes) ProtoReflect() protoreflect.Message {
	mi := &file_auth_v1_auth_proto_msgTypes[4]
	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 AuthZRes.ProtoReflect.Descriptor instead.
func (*AuthZRes) Descriptor() ([]byte, []int) {
	return file_auth_v1_auth_proto_rawDescGZIP(), []int{4}
}

func (x *AuthZRes) GetAuthorized() bool {
	if x != nil {
		return x.Authorized
	}
	return false
}

func (x *AuthZRes) GetId() string {
	if x != nil {
		return x.Id
	}
	return ""
}

var File_auth_v1_auth_proto protoreflect.FileDescriptor

const file_auth_v1_auth_proto_rawDesc = "" +
	"\n" +
	"\x12auth/v1/auth.proto\x12\aauth.v1\" \n" +
	"\bAuthNReq\x12\x14\n" +
	"\x05token\x18\x01 \x01(\tR\x05token\"l\n" +
	"\bAuthNRes\x12\x0e\n" +
	"\x02id\x18\x01 \x01(\tR\x02id\x12\x17\n" +
	"\auser_id\x18\x02 \x01(\tR\x06userId\x12\x1b\n" +
	"\tuser_role\x18\x03 \x01(\rR\buserRole\x12\x1a\n" +
	"\bverified\x18\x04 \x01(\bR\bverified\"\xa2\x02\n" +
	"\bAuthZReq\x12\x16\n" +
	"\x06domain\x18\x01 \x01(\tR\x06domain\x12!\n" +
	"\fsubject_type\x18\x02 \x01(\tR\vsubjectType\x12!\n" +
	"\fsubject_kind\x18\x03 \x01(\tR\vsubjectKind\x12)\n" +
	"\x10subject_relation\x18\x04 \x01(\tR\x0fsubjectRelation\x12\x18\n" +
	"\asubject\x18\x05 \x01(\tR\asubject\x12\x1a\n" +
	"\brelation\x18\x06 \x01(\tR\brelation\x12\x1e\n" +
	"\n" +
	"permission\x18\a \x01(\tR\n" +
	"permission\x12\x16\n" +
	"\x06object\x18\b \x01(\tR\x06object\x12\x1f\n" +
	"\vobject_type\x18\t \x01(\tR\n" +
	"objectType\"\xc7\x01\n" +
	"\vAuthZPatReq\x12\x17\n" +
	"\auser_id\x18\x01 \x01(\tR\x06userId\x12\x15\n" +
	"\x06pat_id\x18\x02 \x01(\tR\x05patId\x12\x1f\n" +
	"\ventity_type\x18\x03 \x01(\rR\n" +
	"entityType\x12,\n" +
	"\x12optional_domain_id\x18\x04 \x01(\tR\x10optionalDomainId\x12\x1c\n" +
	"\toperation\x18\x06 \x01(\rR\toperation\x12\x1b\n" +
	"\tentity_id\x18\a \x01(\tR\bentityId\":\n" +
	"\bAuthZRes\x12\x1e\n" +
	"\n" +
	"authorized\x18\x01 \x01(\bR\n" +
	"authorized\x12\x0e\n" +
	"\x02id\x18\x02 \x01(\tR\x02id2\xf0\x01\n" +
	"\vAuthService\x123\n" +
	"\tAuthorize\x12\x11.auth.v1.AuthZReq\x1a\x11.auth.v1.AuthZRes\"\x00\x129\n" +
	"\fAuthorizePAT\x12\x14.auth.v1.AuthZPatReq\x1a\x11.auth.v1.AuthZRes\"\x00\x126\n" +
	"\fAuthenticate\x12\x11.auth.v1.AuthNReq\x1a\x11.auth.v1.AuthNRes\"\x00\x129\n" +
	"\x0fAuthenticatePAT\x12\x11.auth.v1.AuthNReq\x1a\x11.auth.v1.AuthNRes\"\x00B-Z+github.com/absmach/supermq/api/grpc/auth/v1b\x06proto3"

var (
	file_auth_v1_auth_proto_rawDescOnce sync.Once
	file_auth_v1_auth_proto_rawDescData []byte
)

func file_auth_v1_auth_proto_rawDescGZIP() []byte {
	file_auth_v1_auth_proto_rawDescOnce.Do(func() {
		file_auth_v1_auth_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_auth_v1_auth_proto_rawDesc), len(file_auth_v1_auth_proto_rawDesc)))
	})
	return file_auth_v1_auth_proto_rawDescData
}

var file_auth_v1_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_auth_v1_auth_proto_goTypes = []any{
	(*AuthNReq)(nil),    // 0: auth.v1.AuthNReq
	(*AuthNRes)(nil),    // 1: auth.v1.AuthNRes
	(*AuthZReq)(nil),    // 2: auth.v1.AuthZReq
	(*AuthZPatReq)(nil), // 3: auth.v1.AuthZPatReq
	(*AuthZRes)(nil),    // 4: auth.v1.AuthZRes
}
var file_auth_v1_auth_proto_depIdxs = []int32{
	2, // 0: auth.v1.AuthService.Authorize:input_type -> auth.v1.AuthZReq
	3, // 1: auth.v1.AuthService.AuthorizePAT:input_type -> auth.v1.AuthZPatReq
	0, // 2: auth.v1.AuthService.Authenticate:input_type -> auth.v1.AuthNReq
	0, // 3: auth.v1.AuthService.AuthenticatePAT:input_type -> auth.v1.AuthNReq
	4, // 4: auth.v1.AuthService.Authorize:output_type -> auth.v1.AuthZRes
	4, // 5: auth.v1.AuthService.AuthorizePAT:output_type -> auth.v1.AuthZRes
	1, // 6: auth.v1.AuthService.Authenticate:output_type -> auth.v1.AuthNRes
	1, // 7: auth.v1.AuthService.AuthenticatePAT:output_type -> auth.v1.AuthNRes
	4, // [4:8] is the sub-list for method output_type
	0, // [0:4] is the sub-list for method input_type
	0, // [0:0] is the sub-list for extension type_name
	0, // [0:0] is the sub-list for extension extendee
	0, // [0:0] is the sub-list for field type_name
}

func init() { file_auth_v1_auth_proto_init() }
func file_auth_v1_auth_proto_init() {
	if File_auth_v1_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_v1_auth_proto_rawDesc), len(file_auth_v1_auth_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   5,
			NumExtensions: 0,
			NumServices:   1,
		},
		GoTypes:           file_auth_v1_auth_proto_goTypes,
		DependencyIndexes: file_auth_v1_auth_proto_depIdxs,
		MessageInfos:      file_auth_v1_auth_proto_msgTypes,
	}.Build()
	File_auth_v1_auth_proto = out.File
	file_auth_v1_auth_proto_goTypes = nil
	file_auth_v1_auth_proto_depIdxs = nil
}
