mirror of
https://github.com/mainflux/mainflux.git
synced 2025-04-26 13:48:53 +08:00
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
|
|
|
|
Sub string `protobuf:"bytes,1,opt,name=sub,proto3" json:"sub,omitempty"`
|
|
Obj string `protobuf:"bytes,2,opt,name=obj,proto3" json:"obj,omitempty"`
|
|
Act string `protobuf:"bytes,3,opt,name=act,proto3" json:"act,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) GetSub() string {
|
|
if x != nil {
|
|
return x.Sub
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *AuthorizeReq) GetObj() string {
|
|
if x != nil {
|
|
return x.Obj
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *AuthorizeReq) GetAct() string {
|
|
if x != nil {
|
|
return x.Act
|
|
}
|
|
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
|
|
}
|
|
|
|
// If a key is not carrying any information itself, the type
|
|
// field can be used to determine how to validate the token.
|
|
// Also, different tokens can be encoded in different ways.
|
|
type Key struct {
|
|
state protoimpl.MessageState
|
|
sizeCache protoimpl.SizeCache
|
|
unknownFields protoimpl.UnknownFields
|
|
|
|
Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
|
|
}
|
|
|
|
func (x *Key) Reset() {
|
|
*x = Key{}
|
|
if protoimpl.UnsafeEnabled {
|
|
mi := &file_things_policies_auth_proto_msgTypes[2]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
}
|
|
|
|
func (x *Key) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*Key) ProtoMessage() {}
|
|
|
|
func (x *Key) 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 Key.ProtoReflect.Descriptor instead.
|
|
func (*Key) Descriptor() ([]byte, []int) {
|
|
return file_things_policies_auth_proto_rawDescGZIP(), []int{2}
|
|
}
|
|
|
|
func (x *Key) GetValue() string {
|
|
if x != nil {
|
|
return x.Value
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type ClientID struct {
|
|
state protoimpl.MessageState
|
|
sizeCache protoimpl.SizeCache
|
|
unknownFields protoimpl.UnknownFields
|
|
|
|
Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
|
|
}
|
|
|
|
func (x *ClientID) Reset() {
|
|
*x = ClientID{}
|
|
if protoimpl.UnsafeEnabled {
|
|
mi := &file_things_policies_auth_proto_msgTypes[3]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
}
|
|
|
|
func (x *ClientID) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*ClientID) ProtoMessage() {}
|
|
|
|
func (x *ClientID) 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 ClientID.ProtoReflect.Descriptor instead.
|
|
func (*ClientID) Descriptor() ([]byte, []int) {
|
|
return file_things_policies_auth_proto_rawDescGZIP(), []int{3}
|
|
}
|
|
|
|
func (x *ClientID) GetValue() string {
|
|
if x != nil {
|
|
return x.Value
|
|
}
|
|
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, 0x64, 0x0a, 0x0c, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72,
|
|
0x69, 0x7a, 0x65, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x75, 0x62, 0x18, 0x01, 0x20,
|
|
0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x75, 0x62, 0x12, 0x10, 0x0a, 0x03, 0x6f, 0x62, 0x6a, 0x18,
|
|
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6f, 0x62, 0x6a, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x63,
|
|
0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x61, 0x63, 0x74, 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, 0x1b, 0x0a, 0x03, 0x4b, 0x65, 0x79, 0x12, 0x14, 0x0a,
|
|
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61,
|
|
0x6c, 0x75, 0x65, 0x22, 0x20, 0x0a, 0x08, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x12,
|
|
0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
|
|
0x76, 0x61, 0x6c, 0x75, 0x65, 0x32, 0xbf, 0x01, 0x0a, 0x0d, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73,
|
|
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, 0x4f, 0x0a, 0x08, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69,
|
|
0x66, 0x79, 0x12, 0x1d, 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, 0x4b, 0x65,
|
|
0x79, 0x1a, 0x22, 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, 0x43, 0x6c, 0x69,
|
|
0x65, 0x6e, 0x74, 0x49, 0x44, 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
|
|
(*Key)(nil), // 2: mainflux.things.policies.Key
|
|
(*ClientID)(nil), // 3: mainflux.things.policies.ClientID
|
|
}
|
|
var file_things_policies_auth_proto_depIdxs = []int32{
|
|
0, // 0: mainflux.things.policies.ThingsService.Authorize:input_type -> mainflux.things.policies.AuthorizeReq
|
|
2, // 1: mainflux.things.policies.ThingsService.Identify:input_type -> mainflux.things.policies.Key
|
|
1, // 2: mainflux.things.policies.ThingsService.Authorize:output_type -> mainflux.things.policies.AuthorizeRes
|
|
3, // 3: mainflux.things.policies.ThingsService.Identify:output_type -> mainflux.things.policies.ClientID
|
|
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.(*Key); 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.(*ClientID); 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
|
|
}
|