391 lines
13 KiB
Go
391 lines
13 KiB
Go
// Copyright (c) Mainflux
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// versions:
|
|
// protoc-gen-go v1.31.0
|
|
// protoc v4.23.3
|
|
// source: things/policies/auth.proto
|
|
|
|
package policies
|
|
|
|
import (
|
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
|
reflect "reflect"
|
|
sync "sync"
|
|
)
|
|
|
|
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 AuthorizeReq struct {
|
|
state protoimpl.MessageState
|
|
sizeCache protoimpl.SizeCache
|
|
unknownFields protoimpl.UnknownFields
|
|
|
|
Subject string `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"`
|
|
Object string `protobuf:"bytes,2,opt,name=object,proto3" json:"object,omitempty"`
|
|
Action string `protobuf:"bytes,3,opt,name=action,proto3" json:"action,omitempty"`
|
|
EntityType string `protobuf:"bytes,4,opt,name=entityType,proto3" json:"entityType,omitempty"`
|
|
}
|
|
|
|
func (x *AuthorizeReq) Reset() {
|
|
*x = AuthorizeReq{}
|
|
if protoimpl.UnsafeEnabled {
|
|
mi := &file_things_policies_auth_proto_msgTypes[0]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
}
|
|
|
|
func (x *AuthorizeReq) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*AuthorizeReq) ProtoMessage() {}
|
|
|
|
func (x *AuthorizeReq) ProtoReflect() protoreflect.Message {
|
|
mi := &file_things_policies_auth_proto_msgTypes[0]
|
|
if protoimpl.UnsafeEnabled && x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use AuthorizeReq.ProtoReflect.Descriptor instead.
|
|
func (*AuthorizeReq) Descriptor() ([]byte, []int) {
|
|
return file_things_policies_auth_proto_rawDescGZIP(), []int{0}
|
|
}
|
|
|
|
func (x *AuthorizeReq) GetSubject() string {
|
|
if x != nil {
|
|
return x.Subject
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *AuthorizeReq) GetObject() string {
|
|
if x != nil {
|
|
return x.Object
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *AuthorizeReq) GetAction() string {
|
|
if x != nil {
|
|
return x.Action
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *AuthorizeReq) GetEntityType() string {
|
|
if x != nil {
|
|
return x.EntityType
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type AuthorizeRes struct {
|
|
state protoimpl.MessageState
|
|
sizeCache protoimpl.SizeCache
|
|
unknownFields protoimpl.UnknownFields
|
|
|
|
ThingID string `protobuf:"bytes,1,opt,name=thingID,proto3" json:"thingID,omitempty"`
|
|
Authorized bool `protobuf:"varint,2,opt,name=authorized,proto3" json:"authorized,omitempty"`
|
|
}
|
|
|
|
func (x *AuthorizeRes) Reset() {
|
|
*x = AuthorizeRes{}
|
|
if protoimpl.UnsafeEnabled {
|
|
mi := &file_things_policies_auth_proto_msgTypes[1]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
}
|
|
|
|
func (x *AuthorizeRes) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*AuthorizeRes) ProtoMessage() {}
|
|
|
|
func (x *AuthorizeRes) ProtoReflect() protoreflect.Message {
|
|
mi := &file_things_policies_auth_proto_msgTypes[1]
|
|
if protoimpl.UnsafeEnabled && x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use AuthorizeRes.ProtoReflect.Descriptor instead.
|
|
func (*AuthorizeRes) Descriptor() ([]byte, []int) {
|
|
return file_things_policies_auth_proto_rawDescGZIP(), []int{1}
|
|
}
|
|
|
|
func (x *AuthorizeRes) GetThingID() string {
|
|
if x != nil {
|
|
return x.ThingID
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *AuthorizeRes) GetAuthorized() bool {
|
|
if x != nil {
|
|
return x.Authorized
|
|
}
|
|
return false
|
|
}
|
|
|
|
type IdentifyReq struct {
|
|
state protoimpl.MessageState
|
|
sizeCache protoimpl.SizeCache
|
|
unknownFields protoimpl.UnknownFields
|
|
|
|
Secret string `protobuf:"bytes,1,opt,name=secret,proto3" json:"secret,omitempty"`
|
|
}
|
|
|
|
func (x *IdentifyReq) Reset() {
|
|
*x = IdentifyReq{}
|
|
if protoimpl.UnsafeEnabled {
|
|
mi := &file_things_policies_auth_proto_msgTypes[2]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
}
|
|
|
|
func (x *IdentifyReq) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*IdentifyReq) ProtoMessage() {}
|
|
|
|
func (x *IdentifyReq) ProtoReflect() protoreflect.Message {
|
|
mi := &file_things_policies_auth_proto_msgTypes[2]
|
|
if protoimpl.UnsafeEnabled && x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use IdentifyReq.ProtoReflect.Descriptor instead.
|
|
func (*IdentifyReq) Descriptor() ([]byte, []int) {
|
|
return file_things_policies_auth_proto_rawDescGZIP(), []int{2}
|
|
}
|
|
|
|
func (x *IdentifyReq) GetSecret() string {
|
|
if x != nil {
|
|
return x.Secret
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type IdentifyRes struct {
|
|
state protoimpl.MessageState
|
|
sizeCache protoimpl.SizeCache
|
|
unknownFields protoimpl.UnknownFields
|
|
|
|
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
|
}
|
|
|
|
func (x *IdentifyRes) Reset() {
|
|
*x = IdentifyRes{}
|
|
if protoimpl.UnsafeEnabled {
|
|
mi := &file_things_policies_auth_proto_msgTypes[3]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
}
|
|
|
|
func (x *IdentifyRes) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*IdentifyRes) ProtoMessage() {}
|
|
|
|
func (x *IdentifyRes) ProtoReflect() protoreflect.Message {
|
|
mi := &file_things_policies_auth_proto_msgTypes[3]
|
|
if protoimpl.UnsafeEnabled && x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use IdentifyRes.ProtoReflect.Descriptor instead.
|
|
func (*IdentifyRes) Descriptor() ([]byte, []int) {
|
|
return file_things_policies_auth_proto_rawDescGZIP(), []int{3}
|
|
}
|
|
|
|
func (x *IdentifyRes) GetId() string {
|
|
if x != nil {
|
|
return x.Id
|
|
}
|
|
return ""
|
|
}
|
|
|
|
var File_things_policies_auth_proto protoreflect.FileDescriptor
|
|
|
|
var file_things_policies_auth_proto_rawDesc = []byte{
|
|
0x0a, 0x1a, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65,
|
|
0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x18, 0x6d, 0x61,
|
|
0x69, 0x6e, 0x66, 0x6c, 0x75, 0x78, 0x2e, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x70, 0x6f,
|
|
0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x22, 0x78, 0x0a, 0x0c, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72,
|
|
0x69, 0x7a, 0x65, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63,
|
|
0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74,
|
|
0x12, 0x16, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
|
|
0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69,
|
|
0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,
|
|
0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x54, 0x79, 0x70, 0x65, 0x18, 0x04,
|
|
0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x54, 0x79, 0x70, 0x65,
|
|
0x22, 0x48, 0x0a, 0x0c, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x73,
|
|
0x12, 0x18, 0x0a, 0x07, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28,
|
|
0x09, 0x52, 0x07, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x75,
|
|
0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a,
|
|
0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x22, 0x25, 0x0a, 0x0b, 0x49, 0x64,
|
|
0x65, 0x6e, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63,
|
|
0x72, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65,
|
|
0x74, 0x22, 0x1d, 0x0a, 0x0b, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73,
|
|
0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64,
|
|
0x32, 0xc8, 0x01, 0x0a, 0x0b, 0x41, 0x75, 0x74, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
|
0x12, 0x5d, 0x0a, 0x09, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x12, 0x26, 0x2e,
|
|
0x6d, 0x61, 0x69, 0x6e, 0x66, 0x6c, 0x75, 0x78, 0x2e, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e,
|
|
0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69,
|
|
0x7a, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x26, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x66, 0x6c, 0x75, 0x78,
|
|
0x2e, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73,
|
|
0x2e, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12,
|
|
0x5a, 0x0a, 0x08, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x79, 0x12, 0x25, 0x2e, 0x6d, 0x61,
|
|
0x69, 0x6e, 0x66, 0x6c, 0x75, 0x78, 0x2e, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x70, 0x6f,
|
|
0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x79, 0x52,
|
|
0x65, 0x71, 0x1a, 0x25, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x66, 0x6c, 0x75, 0x78, 0x2e, 0x74, 0x68,
|
|
0x69, 0x6e, 0x67, 0x73, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2e, 0x49, 0x64,
|
|
0x65, 0x6e, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x22, 0x00, 0x42, 0x0c, 0x5a, 0x0a, 0x2e,
|
|
0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
|
0x33,
|
|
}
|
|
|
|
var (
|
|
file_things_policies_auth_proto_rawDescOnce sync.Once
|
|
file_things_policies_auth_proto_rawDescData = file_things_policies_auth_proto_rawDesc
|
|
)
|
|
|
|
func file_things_policies_auth_proto_rawDescGZIP() []byte {
|
|
file_things_policies_auth_proto_rawDescOnce.Do(func() {
|
|
file_things_policies_auth_proto_rawDescData = protoimpl.X.CompressGZIP(file_things_policies_auth_proto_rawDescData)
|
|
})
|
|
return file_things_policies_auth_proto_rawDescData
|
|
}
|
|
|
|
var file_things_policies_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
|
var file_things_policies_auth_proto_goTypes = []interface{}{
|
|
(*AuthorizeReq)(nil), // 0: mainflux.things.policies.AuthorizeReq
|
|
(*AuthorizeRes)(nil), // 1: mainflux.things.policies.AuthorizeRes
|
|
(*IdentifyReq)(nil), // 2: mainflux.things.policies.IdentifyReq
|
|
(*IdentifyRes)(nil), // 3: mainflux.things.policies.IdentifyRes
|
|
}
|
|
var file_things_policies_auth_proto_depIdxs = []int32{
|
|
0, // 0: mainflux.things.policies.AuthService.Authorize:input_type -> mainflux.things.policies.AuthorizeReq
|
|
2, // 1: mainflux.things.policies.AuthService.Identify:input_type -> mainflux.things.policies.IdentifyReq
|
|
1, // 2: mainflux.things.policies.AuthService.Authorize:output_type -> mainflux.things.policies.AuthorizeRes
|
|
3, // 3: mainflux.things.policies.AuthService.Identify:output_type -> mainflux.things.policies.IdentifyRes
|
|
2, // [2:4] is the sub-list for method output_type
|
|
0, // [0:2] 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_things_policies_auth_proto_init() }
|
|
func file_things_policies_auth_proto_init() {
|
|
if File_things_policies_auth_proto != nil {
|
|
return
|
|
}
|
|
if !protoimpl.UnsafeEnabled {
|
|
file_things_policies_auth_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
|
switch v := v.(*AuthorizeReq); i {
|
|
case 0:
|
|
return &v.state
|
|
case 1:
|
|
return &v.sizeCache
|
|
case 2:
|
|
return &v.unknownFields
|
|
default:
|
|
return nil
|
|
}
|
|
}
|
|
file_things_policies_auth_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
|
switch v := v.(*AuthorizeRes); i {
|
|
case 0:
|
|
return &v.state
|
|
case 1:
|
|
return &v.sizeCache
|
|
case 2:
|
|
return &v.unknownFields
|
|
default:
|
|
return nil
|
|
}
|
|
}
|
|
file_things_policies_auth_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
|
switch v := v.(*IdentifyReq); i {
|
|
case 0:
|
|
return &v.state
|
|
case 1:
|
|
return &v.sizeCache
|
|
case 2:
|
|
return &v.unknownFields
|
|
default:
|
|
return nil
|
|
}
|
|
}
|
|
file_things_policies_auth_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
|
switch v := v.(*IdentifyRes); i {
|
|
case 0:
|
|
return &v.state
|
|
case 1:
|
|
return &v.sizeCache
|
|
case 2:
|
|
return &v.unknownFields
|
|
default:
|
|
return nil
|
|
}
|
|
}
|
|
}
|
|
type x struct{}
|
|
out := protoimpl.TypeBuilder{
|
|
File: protoimpl.DescBuilder{
|
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
|
RawDescriptor: file_things_policies_auth_proto_rawDesc,
|
|
NumEnums: 0,
|
|
NumMessages: 4,
|
|
NumExtensions: 0,
|
|
NumServices: 1,
|
|
},
|
|
GoTypes: file_things_policies_auth_proto_goTypes,
|
|
DependencyIndexes: file_things_policies_auth_proto_depIdxs,
|
|
MessageInfos: file_things_policies_auth_proto_msgTypes,
|
|
}.Build()
|
|
File_things_policies_auth_proto = out.File
|
|
file_things_policies_auth_proto_rawDesc = nil
|
|
file_things_policies_auth_proto_goTypes = nil
|
|
file_things_policies_auth_proto_depIdxs = nil
|
|
}
|