From e18b3a01bb7397ccf908c9bbdc8ae8f37fddcc45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Sat, 14 Aug 2021 21:33:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0SSH=E8=AE=A4=E8=AF=81?= =?UTF-8?q?=E5=BB=BA=E8=AE=AE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/rpc/pb/service_node_grant.pb.go | 336 ++++++++++++++++++------ pkg/rpc/protos/service_node_grant.proto | 13 + 2 files changed, 275 insertions(+), 74 deletions(-) diff --git a/pkg/rpc/pb/service_node_grant.pb.go b/pkg/rpc/pb/service_node_grant.pb.go index 466eb23..d987705 100644 --- a/pkg/rpc/pb/service_node_grant.pb.go +++ b/pkg/rpc/pb/service_node_grant.pb.go @@ -821,6 +821,109 @@ func (x *TestNodeGrantResponse) GetError() string { return "" } +// 查找集群推荐的认证 +type FindSuggestNodeGrantsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeClusterId int64 `protobuf:"varint,1,opt,name=nodeClusterId,proto3" json:"nodeClusterId,omitempty"` // 边缘节点集群 + NsClusterId int64 `protobuf:"varint,2,opt,name=nsClusterId,proto3" json:"nsClusterId,omitempty"` // NS节点集群 +} + +func (x *FindSuggestNodeGrantsRequest) Reset() { + *x = FindSuggestNodeGrantsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_node_grant_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindSuggestNodeGrantsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindSuggestNodeGrantsRequest) ProtoMessage() {} + +func (x *FindSuggestNodeGrantsRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_node_grant_proto_msgTypes[14] + 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 FindSuggestNodeGrantsRequest.ProtoReflect.Descriptor instead. +func (*FindSuggestNodeGrantsRequest) Descriptor() ([]byte, []int) { + return file_service_node_grant_proto_rawDescGZIP(), []int{14} +} + +func (x *FindSuggestNodeGrantsRequest) GetNodeClusterId() int64 { + if x != nil { + return x.NodeClusterId + } + return 0 +} + +func (x *FindSuggestNodeGrantsRequest) GetNsClusterId() int64 { + if x != nil { + return x.NsClusterId + } + return 0 +} + +type FindSuggestNodeGrantsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeGrants []*NodeGrant `protobuf:"bytes,1,rep,name=nodeGrants,proto3" json:"nodeGrants,omitempty"` +} + +func (x *FindSuggestNodeGrantsResponse) Reset() { + *x = FindSuggestNodeGrantsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_node_grant_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindSuggestNodeGrantsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindSuggestNodeGrantsResponse) ProtoMessage() {} + +func (x *FindSuggestNodeGrantsResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_node_grant_proto_msgTypes[15] + 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 FindSuggestNodeGrantsResponse.ProtoReflect.Descriptor instead. +func (*FindSuggestNodeGrantsResponse) Descriptor() ([]byte, []int) { + return file_service_node_grant_proto_rawDescGZIP(), []int{15} +} + +func (x *FindSuggestNodeGrantsResponse) GetNodeGrants() []*NodeGrant { + if x != nil { + return x.NodeGrants + } + return nil +} + var File_service_node_grant_proto protoreflect.FileDescriptor var file_service_node_grant_proto_rawDesc = []byte{ @@ -909,51 +1012,69 @@ var file_service_node_grant_proto_rawDesc = []byte{ 0x54, 0x65, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x32, - 0xab, 0x05, 0x0a, 0x10, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x4a, 0x0a, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, - 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x12, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, - 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x3d, 0x0a, 0x0f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, - 0x61, 0x6e, 0x74, 0x12, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, - 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, - 0x4d, 0x0a, 0x10, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, - 0x61, 0x6e, 0x74, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, - 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, - 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, - 0x0a, 0x19, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x12, 0x24, 0x2e, 0x70, 0x62, - 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, - 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x15, 0x6c, 0x69, 0x73, 0x74, 0x45, - 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, - 0x12, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, - 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x18, 0x66, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, - 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, - 0x73, 0x12, 0x23, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, - 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, - 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x14, - 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x47, - 0x72, 0x61, 0x6e, 0x74, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, - 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x0d, 0x74, 0x65, 0x73, 0x74, 0x4e, - 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x54, 0x65, - 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, - 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06, 0x5a, - 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, + 0x66, 0x0a, 0x1c, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x4e, 0x6f, + 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x24, 0x0a, 0x0d, 0x6e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x6e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, + 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x6e, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, + 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x6e, 0x73, 0x43, 0x6c, + 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x4e, 0x0a, 0x1d, 0x46, 0x69, 0x6e, 0x64, 0x53, + 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, + 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, + 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x0a, 0x6e, 0x6f, 0x64, + 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x32, 0x89, 0x06, 0x0a, 0x10, 0x4e, 0x6f, 0x64, 0x65, + 0x47, 0x72, 0x61, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4a, 0x0a, 0x0f, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x12, + 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x47, + 0x72, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x70, 0x62, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x0f, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x12, 0x1a, 0x2e, 0x70, 0x62, + 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, + 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x4d, 0x0a, 0x10, 0x64, 0x69, 0x73, 0x61, 0x62, + 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x12, 0x1b, 0x2e, 0x70, 0x62, + 0x2e, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x69, + 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x19, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, + 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, + 0x6e, 0x74, 0x73, 0x12, 0x24, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, + 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, + 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x52, + 0x50, 0x43, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x5c, 0x0a, 0x15, 0x6c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, + 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x12, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, + 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x70, 0x62, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x47, + 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, + 0x18, 0x66, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, + 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x12, 0x23, 0x2e, 0x70, 0x62, 0x2e, 0x46, + 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, + 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, + 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x14, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x12, 0x1f, 0x2e, 0x70, + 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, + 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, + 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, + 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x44, 0x0a, 0x0d, 0x74, 0x65, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, + 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, + 0x61, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, + 0x54, 0x65, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x15, 0x66, 0x69, 0x6e, 0x64, 0x53, 0x75, 0x67, + 0x67, 0x65, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x12, 0x20, + 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x4e, + 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x21, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, + 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -968,7 +1089,7 @@ func file_service_node_grant_proto_rawDescGZIP() []byte { return file_service_node_grant_proto_rawDescData } -var file_service_node_grant_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_service_node_grant_proto_msgTypes = make([]protoimpl.MessageInfo, 16) var file_service_node_grant_proto_goTypes = []interface{}{ (*CreateNodeGrantRequest)(nil), // 0: pb.CreateNodeGrantRequest (*CreateNodeGrantResponse)(nil), // 1: pb.CreateNodeGrantResponse @@ -984,35 +1105,40 @@ var file_service_node_grant_proto_goTypes = []interface{}{ (*FindEnabledNodeGrantResponse)(nil), // 11: pb.FindEnabledNodeGrantResponse (*TestNodeGrantRequest)(nil), // 12: pb.TestNodeGrantRequest (*TestNodeGrantResponse)(nil), // 13: pb.TestNodeGrantResponse - (*NodeGrant)(nil), // 14: pb.NodeGrant - (*RPCSuccess)(nil), // 15: pb.RPCSuccess - (*RPCCountResponse)(nil), // 16: pb.RPCCountResponse + (*FindSuggestNodeGrantsRequest)(nil), // 14: pb.FindSuggestNodeGrantsRequest + (*FindSuggestNodeGrantsResponse)(nil), // 15: pb.FindSuggestNodeGrantsResponse + (*NodeGrant)(nil), // 16: pb.NodeGrant + (*RPCSuccess)(nil), // 17: pb.RPCSuccess + (*RPCCountResponse)(nil), // 18: pb.RPCCountResponse } var file_service_node_grant_proto_depIdxs = []int32{ - 14, // 0: pb.ListEnabledNodeGrantsResponse.nodeGrants:type_name -> pb.NodeGrant - 14, // 1: pb.FindAllEnabledNodeGrantsResponse.nodeGrants:type_name -> pb.NodeGrant - 14, // 2: pb.FindEnabledNodeGrantResponse.nodeGrant:type_name -> pb.NodeGrant - 0, // 3: pb.NodeGrantService.createNodeGrant:input_type -> pb.CreateNodeGrantRequest - 2, // 4: pb.NodeGrantService.updateNodeGrant:input_type -> pb.UpdateNodeGrantRequest - 3, // 5: pb.NodeGrantService.disableNodeGrant:input_type -> pb.DisableNodeGrantRequest - 5, // 6: pb.NodeGrantService.countAllEnabledNodeGrants:input_type -> pb.CountAllEnabledNodeGrantsRequest - 6, // 7: pb.NodeGrantService.listEnabledNodeGrants:input_type -> pb.ListEnabledNodeGrantsRequest - 8, // 8: pb.NodeGrantService.findAllEnabledNodeGrants:input_type -> pb.FindAllEnabledNodeGrantsRequest - 10, // 9: pb.NodeGrantService.findEnabledNodeGrant:input_type -> pb.FindEnabledNodeGrantRequest - 12, // 10: pb.NodeGrantService.testNodeGrant:input_type -> pb.TestNodeGrantRequest - 1, // 11: pb.NodeGrantService.createNodeGrant:output_type -> pb.CreateNodeGrantResponse - 15, // 12: pb.NodeGrantService.updateNodeGrant:output_type -> pb.RPCSuccess - 4, // 13: pb.NodeGrantService.disableNodeGrant:output_type -> pb.DisableNodeGrantResponse - 16, // 14: pb.NodeGrantService.countAllEnabledNodeGrants:output_type -> pb.RPCCountResponse - 7, // 15: pb.NodeGrantService.listEnabledNodeGrants:output_type -> pb.ListEnabledNodeGrantsResponse - 9, // 16: pb.NodeGrantService.findAllEnabledNodeGrants:output_type -> pb.FindAllEnabledNodeGrantsResponse - 11, // 17: pb.NodeGrantService.findEnabledNodeGrant:output_type -> pb.FindEnabledNodeGrantResponse - 13, // 18: pb.NodeGrantService.testNodeGrant:output_type -> pb.TestNodeGrantResponse - 11, // [11:19] is the sub-list for method output_type - 3, // [3:11] 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 + 16, // 0: pb.ListEnabledNodeGrantsResponse.nodeGrants:type_name -> pb.NodeGrant + 16, // 1: pb.FindAllEnabledNodeGrantsResponse.nodeGrants:type_name -> pb.NodeGrant + 16, // 2: pb.FindEnabledNodeGrantResponse.nodeGrant:type_name -> pb.NodeGrant + 16, // 3: pb.FindSuggestNodeGrantsResponse.nodeGrants:type_name -> pb.NodeGrant + 0, // 4: pb.NodeGrantService.createNodeGrant:input_type -> pb.CreateNodeGrantRequest + 2, // 5: pb.NodeGrantService.updateNodeGrant:input_type -> pb.UpdateNodeGrantRequest + 3, // 6: pb.NodeGrantService.disableNodeGrant:input_type -> pb.DisableNodeGrantRequest + 5, // 7: pb.NodeGrantService.countAllEnabledNodeGrants:input_type -> pb.CountAllEnabledNodeGrantsRequest + 6, // 8: pb.NodeGrantService.listEnabledNodeGrants:input_type -> pb.ListEnabledNodeGrantsRequest + 8, // 9: pb.NodeGrantService.findAllEnabledNodeGrants:input_type -> pb.FindAllEnabledNodeGrantsRequest + 10, // 10: pb.NodeGrantService.findEnabledNodeGrant:input_type -> pb.FindEnabledNodeGrantRequest + 12, // 11: pb.NodeGrantService.testNodeGrant:input_type -> pb.TestNodeGrantRequest + 14, // 12: pb.NodeGrantService.findSuggestNodeGrants:input_type -> pb.FindSuggestNodeGrantsRequest + 1, // 13: pb.NodeGrantService.createNodeGrant:output_type -> pb.CreateNodeGrantResponse + 17, // 14: pb.NodeGrantService.updateNodeGrant:output_type -> pb.RPCSuccess + 4, // 15: pb.NodeGrantService.disableNodeGrant:output_type -> pb.DisableNodeGrantResponse + 18, // 16: pb.NodeGrantService.countAllEnabledNodeGrants:output_type -> pb.RPCCountResponse + 7, // 17: pb.NodeGrantService.listEnabledNodeGrants:output_type -> pb.ListEnabledNodeGrantsResponse + 9, // 18: pb.NodeGrantService.findAllEnabledNodeGrants:output_type -> pb.FindAllEnabledNodeGrantsResponse + 11, // 19: pb.NodeGrantService.findEnabledNodeGrant:output_type -> pb.FindEnabledNodeGrantResponse + 13, // 20: pb.NodeGrantService.testNodeGrant:output_type -> pb.TestNodeGrantResponse + 15, // 21: pb.NodeGrantService.findSuggestNodeGrants:output_type -> pb.FindSuggestNodeGrantsResponse + 13, // [13:22] is the sub-list for method output_type + 4, // [4:13] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_service_node_grant_proto_init() } @@ -1191,6 +1317,30 @@ func file_service_node_grant_proto_init() { return nil } } + file_service_node_grant_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindSuggestNodeGrantsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_node_grant_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindSuggestNodeGrantsResponse); 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{ @@ -1198,7 +1348,7 @@ func file_service_node_grant_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_service_node_grant_proto_rawDesc, NumEnums: 0, - NumMessages: 14, + NumMessages: 16, NumExtensions: 0, NumServices: 1, }, @@ -1240,6 +1390,8 @@ type NodeGrantServiceClient interface { FindEnabledNodeGrant(ctx context.Context, in *FindEnabledNodeGrantRequest, opts ...grpc.CallOption) (*FindEnabledNodeGrantResponse, error) // 测试连接 TestNodeGrant(ctx context.Context, in *TestNodeGrantRequest, opts ...grpc.CallOption) (*TestNodeGrantResponse, error) + // 查找集群推荐的认证 + FindSuggestNodeGrants(ctx context.Context, in *FindSuggestNodeGrantsRequest, opts ...grpc.CallOption) (*FindSuggestNodeGrantsResponse, error) } type nodeGrantServiceClient struct { @@ -1322,6 +1474,15 @@ func (c *nodeGrantServiceClient) TestNodeGrant(ctx context.Context, in *TestNode return out, nil } +func (c *nodeGrantServiceClient) FindSuggestNodeGrants(ctx context.Context, in *FindSuggestNodeGrantsRequest, opts ...grpc.CallOption) (*FindSuggestNodeGrantsResponse, error) { + out := new(FindSuggestNodeGrantsResponse) + err := c.cc.Invoke(ctx, "/pb.NodeGrantService/findSuggestNodeGrants", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // NodeGrantServiceServer is the server API for NodeGrantService service. type NodeGrantServiceServer interface { // 创建认证 @@ -1340,6 +1501,8 @@ type NodeGrantServiceServer interface { FindEnabledNodeGrant(context.Context, *FindEnabledNodeGrantRequest) (*FindEnabledNodeGrantResponse, error) // 测试连接 TestNodeGrant(context.Context, *TestNodeGrantRequest) (*TestNodeGrantResponse, error) + // 查找集群推荐的认证 + FindSuggestNodeGrants(context.Context, *FindSuggestNodeGrantsRequest) (*FindSuggestNodeGrantsResponse, error) } // UnimplementedNodeGrantServiceServer can be embedded to have forward compatible implementations. @@ -1370,6 +1533,9 @@ func (*UnimplementedNodeGrantServiceServer) FindEnabledNodeGrant(context.Context func (*UnimplementedNodeGrantServiceServer) TestNodeGrant(context.Context, *TestNodeGrantRequest) (*TestNodeGrantResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method TestNodeGrant not implemented") } +func (*UnimplementedNodeGrantServiceServer) FindSuggestNodeGrants(context.Context, *FindSuggestNodeGrantsRequest) (*FindSuggestNodeGrantsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FindSuggestNodeGrants not implemented") +} func RegisterNodeGrantServiceServer(s *grpc.Server, srv NodeGrantServiceServer) { s.RegisterService(&_NodeGrantService_serviceDesc, srv) @@ -1519,6 +1685,24 @@ func _NodeGrantService_TestNodeGrant_Handler(srv interface{}, ctx context.Contex return interceptor(ctx, in, info, handler) } +func _NodeGrantService_FindSuggestNodeGrants_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FindSuggestNodeGrantsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeGrantServiceServer).FindSuggestNodeGrants(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.NodeGrantService/FindSuggestNodeGrants", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeGrantServiceServer).FindSuggestNodeGrants(ctx, req.(*FindSuggestNodeGrantsRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _NodeGrantService_serviceDesc = grpc.ServiceDesc{ ServiceName: "pb.NodeGrantService", HandlerType: (*NodeGrantServiceServer)(nil), @@ -1555,6 +1739,10 @@ var _NodeGrantService_serviceDesc = grpc.ServiceDesc{ MethodName: "testNodeGrant", Handler: _NodeGrantService_TestNodeGrant_Handler, }, + { + MethodName: "findSuggestNodeGrants", + Handler: _NodeGrantService_FindSuggestNodeGrants_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "service_node_grant.proto", diff --git a/pkg/rpc/protos/service_node_grant.proto b/pkg/rpc/protos/service_node_grant.proto index 46e6102..7203234 100644 --- a/pkg/rpc/protos/service_node_grant.proto +++ b/pkg/rpc/protos/service_node_grant.proto @@ -29,6 +29,9 @@ service NodeGrantService { // 测试连接 rpc testNodeGrant (TestNodeGrantRequest) returns (TestNodeGrantResponse); + + // 查找集群推荐的认证 + rpc findSuggestNodeGrants(FindSuggestNodeGrantsRequest) returns (FindSuggestNodeGrantsResponse); } // 创建节点认证 @@ -111,4 +114,14 @@ message TestNodeGrantRequest { message TestNodeGrantResponse { bool isOk = 1; string error = 2; +} + +// 查找集群推荐的认证 +message FindSuggestNodeGrantsRequest { + int64 nodeClusterId = 1; // 边缘节点集群 + int64 nsClusterId = 2; // NS节点集群 +} + +message FindSuggestNodeGrantsResponse { + repeated NodeGrant nodeGrants = 1; } \ No newline at end of file