diff --git a/proto/services/localrpc/localrpc.pb.go b/proto/services/localrpc/localrpc.pb.go index 39add78..32b509e 100644 --- a/proto/services/localrpc/localrpc.pb.go +++ b/proto/services/localrpc/localrpc.pb.go @@ -1,8 +1,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.12 -// source: services/localrpc/localrpc.proto +// protoc-gen-go v1.36.11 +// protoc (unknown) +// source: localrpc.proto package localrpc @@ -11,6 +11,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -20,31 +21,19 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// ExecuteCommandRequest contains the command to execute and optional session context type ExecuteCommandRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Command string `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"` + SessionId string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` unknownFields protoimpl.UnknownFields - - // The command to execute, exactly as you would type it in the console - // Examples: - // - "session --all" - List all sessions - // - "use " - Switch to a session - // - "whoami" - Execute whoami in current session (requires active session) - // - "ls" - List files in current directory (requires active session) - Command string `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"` - // Optional session ID to set as active context before execution - // If not provided, uses the current active session - SessionId string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ExecuteCommandRequest) Reset() { *x = ExecuteCommandRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_services_localrpc_localrpc_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_localrpc_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ExecuteCommandRequest) String() string { @@ -54,8 +43,8 @@ func (x *ExecuteCommandRequest) String() string { func (*ExecuteCommandRequest) ProtoMessage() {} func (x *ExecuteCommandRequest) ProtoReflect() protoreflect.Message { - mi := &file_services_localrpc_localrpc_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_localrpc_proto_msgTypes[0] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -67,7 +56,7 @@ func (x *ExecuteCommandRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecuteCommandRequest.ProtoReflect.Descriptor instead. func (*ExecuteCommandRequest) Descriptor() ([]byte, []int) { - return file_services_localrpc_localrpc_proto_rawDescGZIP(), []int{0} + return file_localrpc_proto_rawDescGZIP(), []int{0} } func (x *ExecuteCommandRequest) GetCommand() string { @@ -84,27 +73,20 @@ func (x *ExecuteCommandRequest) GetSessionId() string { return "" } -// ExecuteCommandResponse contains the result of command execution type ExecuteCommandResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Output string `protobuf:"bytes,1,opt,name=output,proto3" json:"output,omitempty"` + Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` + Success bool `protobuf:"varint,3,opt,name=success,proto3" json:"success,omitempty"` unknownFields protoimpl.UnknownFields - - // The output from the command execution - Output string `protobuf:"bytes,1,opt,name=output,proto3" json:"output,omitempty"` - // Error message if the command failed - Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` - // Whether the command executed successfully - Success bool `protobuf:"varint,3,opt,name=success,proto3" json:"success,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ExecuteCommandResponse) Reset() { *x = ExecuteCommandResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_services_localrpc_localrpc_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_localrpc_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ExecuteCommandResponse) String() string { @@ -114,8 +96,8 @@ func (x *ExecuteCommandResponse) String() string { func (*ExecuteCommandResponse) ProtoMessage() {} func (x *ExecuteCommandResponse) ProtoReflect() protoreflect.Message { - mi := &file_services_localrpc_localrpc_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_localrpc_proto_msgTypes[1] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -127,7 +109,7 @@ func (x *ExecuteCommandResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecuteCommandResponse.ProtoReflect.Descriptor instead. func (*ExecuteCommandResponse) Descriptor() ([]byte, []int) { - return file_services_localrpc_localrpc_proto_rawDescGZIP(), []int{1} + return file_localrpc_proto_rawDescGZIP(), []int{1} } func (x *ExecuteCommandResponse) GetOutput() string { @@ -151,32 +133,19 @@ func (x *ExecuteCommandResponse) GetSuccess() bool { return false } -// ExecuteLuaRequest contains the Lua script to execute and optional session context type ExecuteLuaRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Script string `protobuf:"bytes,1,opt,name=script,proto3" json:"script,omitempty"` + SessionId string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` unknownFields protoimpl.UnknownFields - - // Lua script code to execute - // The script has access to: - // - session: current session object - // - session_id: current session ID - // - console: console object - // - All registered internal functions - Script string `protobuf:"bytes,1,opt,name=script,proto3" json:"script,omitempty"` - // Optional session ID to set as active context before execution - // If provided, the session context will be switched before script execution - // and restored after execution completes - SessionId string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ExecuteLuaRequest) Reset() { *x = ExecuteLuaRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_services_localrpc_localrpc_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_localrpc_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ExecuteLuaRequest) String() string { @@ -186,8 +155,8 @@ func (x *ExecuteLuaRequest) String() string { func (*ExecuteLuaRequest) ProtoMessage() {} func (x *ExecuteLuaRequest) ProtoReflect() protoreflect.Message { - mi := &file_services_localrpc_localrpc_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_localrpc_proto_msgTypes[2] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -199,7 +168,7 @@ func (x *ExecuteLuaRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecuteLuaRequest.ProtoReflect.Descriptor instead. func (*ExecuteLuaRequest) Descriptor() ([]byte, []int) { - return file_services_localrpc_localrpc_proto_rawDescGZIP(), []int{2} + return file_localrpc_proto_rawDescGZIP(), []int{2} } func (x *ExecuteLuaRequest) GetScript() string { @@ -216,27 +185,20 @@ func (x *ExecuteLuaRequest) GetSessionId() string { return "" } -// ExecuteLuaResponse contains the result of Lua script execution type ExecuteLuaResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Output string `protobuf:"bytes,1,opt,name=output,proto3" json:"output,omitempty"` + Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` + Success bool `protobuf:"varint,3,opt,name=success,proto3" json:"success,omitempty"` unknownFields protoimpl.UnknownFields - - // The output/return value from the Lua script execution - Output string `protobuf:"bytes,1,opt,name=output,proto3" json:"output,omitempty"` - // Error message if the script failed - Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` - // Whether the script executed successfully - Success bool `protobuf:"varint,3,opt,name=success,proto3" json:"success,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ExecuteLuaResponse) Reset() { *x = ExecuteLuaResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_services_localrpc_localrpc_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_localrpc_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ExecuteLuaResponse) String() string { @@ -246,8 +208,8 @@ func (x *ExecuteLuaResponse) String() string { func (*ExecuteLuaResponse) ProtoMessage() {} func (x *ExecuteLuaResponse) ProtoReflect() protoreflect.Message { - mi := &file_services_localrpc_localrpc_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_localrpc_proto_msgTypes[3] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -259,7 +221,7 @@ func (x *ExecuteLuaResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecuteLuaResponse.ProtoReflect.Descriptor instead. func (*ExecuteLuaResponse) Descriptor() ([]byte, []int) { - return file_services_localrpc_localrpc_proto_rawDescGZIP(), []int{3} + return file_localrpc_proto_rawDescGZIP(), []int{3} } func (x *ExecuteLuaResponse) GetOutput() string { @@ -283,25 +245,19 @@ func (x *ExecuteLuaResponse) GetSuccess() bool { return false } -// GetHistoryRequest contains the task ID to query type GetHistoryRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + TaskId uint32 `protobuf:"varint,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` + SessionId string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` unknownFields protoimpl.UnknownFields - - // Task ID to retrieve history for - TaskId uint32 `protobuf:"varint,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` - // Session ID context - SessionId string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetHistoryRequest) Reset() { *x = GetHistoryRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_services_localrpc_localrpc_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_localrpc_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetHistoryRequest) String() string { @@ -311,8 +267,8 @@ func (x *GetHistoryRequest) String() string { func (*GetHistoryRequest) ProtoMessage() {} func (x *GetHistoryRequest) ProtoReflect() protoreflect.Message { - mi := &file_services_localrpc_localrpc_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_localrpc_proto_msgTypes[4] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -324,7 +280,7 @@ func (x *GetHistoryRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetHistoryRequest.ProtoReflect.Descriptor instead. func (*GetHistoryRequest) Descriptor() ([]byte, []int) { - return file_services_localrpc_localrpc_proto_rawDescGZIP(), []int{4} + return file_localrpc_proto_rawDescGZIP(), []int{4} } func (x *GetHistoryRequest) GetTaskId() uint32 { @@ -341,27 +297,20 @@ func (x *GetHistoryRequest) GetSessionId() string { return "" } -// GetHistoryResponse contains the rendered history data type GetHistoryResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Output string `protobuf:"bytes,1,opt,name=output,proto3" json:"output,omitempty"` + Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` + Success bool `protobuf:"varint,3,opt,name=success,proto3" json:"success,omitempty"` unknownFields protoimpl.UnknownFields - - // Rendered output for the task - Output string `protobuf:"bytes,1,opt,name=output,proto3" json:"output,omitempty"` - // Error message if retrieval failed - Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` - // Whether the operation was successful - Success bool `protobuf:"varint,3,opt,name=success,proto3" json:"success,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetHistoryResponse) Reset() { *x = GetHistoryResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_services_localrpc_localrpc_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_localrpc_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetHistoryResponse) String() string { @@ -371,8 +320,8 @@ func (x *GetHistoryResponse) String() string { func (*GetHistoryResponse) ProtoMessage() {} func (x *GetHistoryResponse) ProtoReflect() protoreflect.Message { - mi := &file_services_localrpc_localrpc_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_localrpc_proto_msgTypes[5] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -384,7 +333,7 @@ func (x *GetHistoryResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetHistoryResponse.ProtoReflect.Descriptor instead. func (*GetHistoryResponse) Descriptor() ([]byte, []int) { - return file_services_localrpc_localrpc_proto_rawDescGZIP(), []int{5} + return file_localrpc_proto_rawDescGZIP(), []int{5} } func (x *GetHistoryResponse) GetOutput() string { @@ -408,25 +357,18 @@ func (x *GetHistoryResponse) GetSuccess() bool { return false } -// GetSchemasRequest contains the cobra group to query type GetSchemasRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Group string `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` unknownFields protoimpl.UnknownFields - - // Cobra command group to retrieve schemas for - // Examples: "implant", "execute", "sys", "file", "pivot" - // Required field - Group string `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetSchemasRequest) Reset() { *x = GetSchemasRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_services_localrpc_localrpc_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_localrpc_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetSchemasRequest) String() string { @@ -436,8 +378,8 @@ func (x *GetSchemasRequest) String() string { func (*GetSchemasRequest) ProtoMessage() {} func (x *GetSchemasRequest) ProtoReflect() protoreflect.Message { - mi := &file_services_localrpc_localrpc_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_localrpc_proto_msgTypes[6] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -449,7 +391,7 @@ func (x *GetSchemasRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetSchemasRequest.ProtoReflect.Descriptor instead. func (*GetSchemasRequest) Descriptor() ([]byte, []int) { - return file_services_localrpc_localrpc_proto_rawDescGZIP(), []int{6} + return file_localrpc_proto_rawDescGZIP(), []int{6} } func (x *GetSchemasRequest) GetGroup() string { @@ -459,28 +401,20 @@ func (x *GetSchemasRequest) GetGroup() string { return "" } -// GetSchemasResponse contains the JSON schemas for commands type GetSchemasResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + SchemasJson string `protobuf:"bytes,1,opt,name=schemas_json,json=schemasJson,proto3" json:"schemas_json,omitempty"` + Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` + Success bool `protobuf:"varint,3,opt,name=success,proto3" json:"success,omitempty"` unknownFields protoimpl.UnknownFields - - // JSON string containing schemas for commands in the specified group - // Format: { "group_name": { "command_name": schema } } - SchemasJson string `protobuf:"bytes,1,opt,name=schemas_json,json=schemasJson,proto3" json:"schemas_json,omitempty"` - // Error message if retrieval failed - Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` - // Whether the operation was successful - Success bool `protobuf:"varint,3,opt,name=success,proto3" json:"success,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetSchemasResponse) Reset() { *x = GetSchemasResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_services_localrpc_localrpc_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_localrpc_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetSchemasResponse) String() string { @@ -490,8 +424,8 @@ func (x *GetSchemasResponse) String() string { func (*GetSchemasResponse) ProtoMessage() {} func (x *GetSchemasResponse) ProtoReflect() protoreflect.Message { - mi := &file_services_localrpc_localrpc_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_localrpc_proto_msgTypes[7] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -503,7 +437,7 @@ func (x *GetSchemasResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetSchemasResponse.ProtoReflect.Descriptor instead. func (*GetSchemasResponse) Descriptor() ([]byte, []int) { - return file_services_localrpc_localrpc_proto_rawDescGZIP(), []int{7} + return file_localrpc_proto_rawDescGZIP(), []int{7} } func (x *GetSchemasResponse) GetSchemasJson() string { @@ -527,20 +461,17 @@ func (x *GetSchemasResponse) GetSuccess() bool { return false } -// GetGroupsRequest contains the request for getting all groups type GetGroupsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *GetGroupsRequest) Reset() { *x = GetGroupsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_services_localrpc_localrpc_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_localrpc_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetGroupsRequest) String() string { @@ -550,8 +481,8 @@ func (x *GetGroupsRequest) String() string { func (*GetGroupsRequest) ProtoMessage() {} func (x *GetGroupsRequest) ProtoReflect() protoreflect.Message { - mi := &file_services_localrpc_localrpc_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_localrpc_proto_msgTypes[8] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -563,31 +494,23 @@ func (x *GetGroupsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetGroupsRequest.ProtoReflect.Descriptor instead. func (*GetGroupsRequest) Descriptor() ([]byte, []int) { - return file_services_localrpc_localrpc_proto_rawDescGZIP(), []int{8} + return file_localrpc_proto_rawDescGZIP(), []int{8} } -// GetGroupsResponse contains information about all available groups type GetGroupsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Groups map[string]string `protobuf:"bytes,1,rep,name=groups,proto3" json:"groups,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` + Success bool `protobuf:"varint,3,opt,name=success,proto3" json:"success,omitempty"` unknownFields protoimpl.UnknownFields - - // Map of group ID to group title - // Format: { "execute": "Execute", "sys": "System", "file": "File", ... } - Groups map[string]string `protobuf:"bytes,1,rep,name=groups,proto3" json:"groups,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // Error message if retrieval failed - Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` - // Whether the operation was successful - Success bool `protobuf:"varint,3,opt,name=success,proto3" json:"success,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetGroupsResponse) Reset() { *x = GetGroupsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_services_localrpc_localrpc_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_localrpc_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetGroupsResponse) String() string { @@ -597,8 +520,8 @@ func (x *GetGroupsResponse) String() string { func (*GetGroupsResponse) ProtoMessage() {} func (x *GetGroupsResponse) ProtoReflect() protoreflect.Message { - mi := &file_services_localrpc_localrpc_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_localrpc_proto_msgTypes[9] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -610,7 +533,7 @@ func (x *GetGroupsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetGroupsResponse.ProtoReflect.Descriptor instead. func (*GetGroupsResponse) Descriptor() ([]byte, []int) { - return file_services_localrpc_localrpc_proto_rawDescGZIP(), []int{9} + return file_localrpc_proto_rawDescGZIP(), []int{9} } func (x *GetGroupsResponse) GetGroups() map[string]string { @@ -634,119 +557,304 @@ func (x *GetGroupsResponse) GetSuccess() bool { return false } -var File_services_localrpc_localrpc_proto protoreflect.FileDescriptor - -var file_services_localrpc_localrpc_proto_rawDesc = []byte{ - 0x0a, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, - 0x72, 0x70, 0x63, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x72, 0x70, 0x63, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x11, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x6c, 0x6f, 0x63, - 0x61, 0x6c, 0x72, 0x70, 0x63, 0x22, 0x50, 0x0a, 0x15, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, - 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, - 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x60, 0x0a, 0x16, 0x45, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, - 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x4a, 0x0a, 0x11, 0x45, 0x78, 0x65, - 0x63, 0x75, 0x74, 0x65, 0x4c, 0x75, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, - 0x0a, 0x06, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x5c, 0x0a, 0x12, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, - 0x4c, 0x75, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, - 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x75, 0x74, - 0x70, 0x75, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x22, 0x4b, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, - 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, - 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, - 0x22, 0x5c, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x14, - 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, - 0x72, 0x72, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x29, - 0x0a, 0x11, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x67, 0x0a, 0x12, 0x47, 0x65, 0x74, - 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x21, 0x0a, 0x0c, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x4a, 0x73, - 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, - 0x73, 0x73, 0x22, 0x12, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xc8, 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x47, 0x72, - 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x06, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x72, 0x70, 0x63, - 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, - 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, - 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x32, 0xe0, 0x03, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x65, 0x0a, 0x0e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x43, - 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x28, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x29, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x61, - 0x6c, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, - 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x0a, 0x45, - 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x4c, 0x75, 0x61, 0x12, 0x24, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x65, 0x4c, 0x75, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x25, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, - 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x4c, 0x75, 0x61, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x48, 0x69, 0x73, - 0x74, 0x6f, 0x72, 0x79, 0x12, 0x24, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, - 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x48, 0x69, 0x73, 0x74, - 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x72, 0x70, 0x63, 0x2e, 0x47, - 0x65, 0x74, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x59, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x12, - 0x24, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, - 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, - 0x65, 0x6d, 0x61, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x09, - 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x23, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, - 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x72, - 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x73, - 0x2f, 0x49, 0x6f, 0x4d, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x72, 0x70, 0x63, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +type CommandInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Group string `protobuf:"bytes,2,opt,name=group,proto3" json:"group,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Usage string `protobuf:"bytes,4,opt,name=usage,proto3" json:"usage,omitempty"` + Ttp string `protobuf:"bytes,5,opt,name=ttp,proto3" json:"ttp,omitempty"` + Opsec int32 `protobuf:"varint,6,opt,name=opsec,proto3" json:"opsec,omitempty"` + Subcommands []string `protobuf:"bytes,7,rep,name=subcommands,proto3" json:"subcommands,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CommandInfo) Reset() { + *x = CommandInfo{} + mi := &file_localrpc_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CommandInfo) String() string { + return protoimpl.X.MessageStringOf(x) } +func (*CommandInfo) ProtoMessage() {} + +func (x *CommandInfo) ProtoReflect() protoreflect.Message { + mi := &file_localrpc_proto_msgTypes[10] + 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 CommandInfo.ProtoReflect.Descriptor instead. +func (*CommandInfo) Descriptor() ([]byte, []int) { + return file_localrpc_proto_rawDescGZIP(), []int{10} +} + +func (x *CommandInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CommandInfo) GetGroup() string { + if x != nil { + return x.Group + } + return "" +} + +func (x *CommandInfo) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *CommandInfo) GetUsage() string { + if x != nil { + return x.Usage + } + return "" +} + +func (x *CommandInfo) GetTtp() string { + if x != nil { + return x.Ttp + } + return "" +} + +func (x *CommandInfo) GetOpsec() int32 { + if x != nil { + return x.Opsec + } + return 0 +} + +func (x *CommandInfo) GetSubcommands() []string { + if x != nil { + return x.Subcommands + } + return nil +} + +type SearchCommandsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` + Group string `protobuf:"bytes,2,opt,name=group,proto3" json:"group,omitempty"` + SessionId string `protobuf:"bytes,3,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SearchCommandsRequest) Reset() { + *x = SearchCommandsRequest{} + mi := &file_localrpc_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SearchCommandsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchCommandsRequest) ProtoMessage() {} + +func (x *SearchCommandsRequest) ProtoReflect() protoreflect.Message { + mi := &file_localrpc_proto_msgTypes[11] + 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 SearchCommandsRequest.ProtoReflect.Descriptor instead. +func (*SearchCommandsRequest) Descriptor() ([]byte, []int) { + return file_localrpc_proto_rawDescGZIP(), []int{11} +} + +func (x *SearchCommandsRequest) GetQuery() string { + if x != nil { + return x.Query + } + return "" +} + +func (x *SearchCommandsRequest) GetGroup() string { + if x != nil { + return x.Group + } + return "" +} + +func (x *SearchCommandsRequest) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +type SearchCommandsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Commands []*CommandInfo `protobuf:"bytes,1,rep,name=commands,proto3" json:"commands,omitempty"` + Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` + Success bool `protobuf:"varint,3,opt,name=success,proto3" json:"success,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SearchCommandsResponse) Reset() { + *x = SearchCommandsResponse{} + mi := &file_localrpc_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SearchCommandsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchCommandsResponse) ProtoMessage() {} + +func (x *SearchCommandsResponse) ProtoReflect() protoreflect.Message { + mi := &file_localrpc_proto_msgTypes[12] + 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 SearchCommandsResponse.ProtoReflect.Descriptor instead. +func (*SearchCommandsResponse) Descriptor() ([]byte, []int) { + return file_localrpc_proto_rawDescGZIP(), []int{12} +} + +func (x *SearchCommandsResponse) GetCommands() []*CommandInfo { + if x != nil { + return x.Commands + } + return nil +} + +func (x *SearchCommandsResponse) GetError() string { + if x != nil { + return x.Error + } + return "" +} + +func (x *SearchCommandsResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +var File_localrpc_proto protoreflect.FileDescriptor + +const file_localrpc_proto_rawDesc = "" + + "\n" + + "\x0elocalrpc.proto\x12\x11services.localrpc\"P\n" + + "\x15ExecuteCommandRequest\x12\x18\n" + + "\acommand\x18\x01 \x01(\tR\acommand\x12\x1d\n" + + "\n" + + "session_id\x18\x02 \x01(\tR\tsessionId\"`\n" + + "\x16ExecuteCommandResponse\x12\x16\n" + + "\x06output\x18\x01 \x01(\tR\x06output\x12\x14\n" + + "\x05error\x18\x02 \x01(\tR\x05error\x12\x18\n" + + "\asuccess\x18\x03 \x01(\bR\asuccess\"J\n" + + "\x11ExecuteLuaRequest\x12\x16\n" + + "\x06script\x18\x01 \x01(\tR\x06script\x12\x1d\n" + + "\n" + + "session_id\x18\x02 \x01(\tR\tsessionId\"\\\n" + + "\x12ExecuteLuaResponse\x12\x16\n" + + "\x06output\x18\x01 \x01(\tR\x06output\x12\x14\n" + + "\x05error\x18\x02 \x01(\tR\x05error\x12\x18\n" + + "\asuccess\x18\x03 \x01(\bR\asuccess\"K\n" + + "\x11GetHistoryRequest\x12\x17\n" + + "\atask_id\x18\x01 \x01(\rR\x06taskId\x12\x1d\n" + + "\n" + + "session_id\x18\x02 \x01(\tR\tsessionId\"\\\n" + + "\x12GetHistoryResponse\x12\x16\n" + + "\x06output\x18\x01 \x01(\tR\x06output\x12\x14\n" + + "\x05error\x18\x02 \x01(\tR\x05error\x12\x18\n" + + "\asuccess\x18\x03 \x01(\bR\asuccess\")\n" + + "\x11GetSchemasRequest\x12\x14\n" + + "\x05group\x18\x01 \x01(\tR\x05group\"g\n" + + "\x12GetSchemasResponse\x12!\n" + + "\fschemas_json\x18\x01 \x01(\tR\vschemasJson\x12\x14\n" + + "\x05error\x18\x02 \x01(\tR\x05error\x12\x18\n" + + "\asuccess\x18\x03 \x01(\bR\asuccess\"\x12\n" + + "\x10GetGroupsRequest\"\xc8\x01\n" + + "\x11GetGroupsResponse\x12H\n" + + "\x06groups\x18\x01 \x03(\v20.services.localrpc.GetGroupsResponse.GroupsEntryR\x06groups\x12\x14\n" + + "\x05error\x18\x02 \x01(\tR\x05error\x12\x18\n" + + "\asuccess\x18\x03 \x01(\bR\asuccess\x1a9\n" + + "\vGroupsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xb9\x01\n" + + "\vCommandInfo\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" + + "\x05group\x18\x02 \x01(\tR\x05group\x12 \n" + + "\vdescription\x18\x03 \x01(\tR\vdescription\x12\x14\n" + + "\x05usage\x18\x04 \x01(\tR\x05usage\x12\x10\n" + + "\x03ttp\x18\x05 \x01(\tR\x03ttp\x12\x14\n" + + "\x05opsec\x18\x06 \x01(\x05R\x05opsec\x12 \n" + + "\vsubcommands\x18\a \x03(\tR\vsubcommands\"b\n" + + "\x15SearchCommandsRequest\x12\x14\n" + + "\x05query\x18\x01 \x01(\tR\x05query\x12\x14\n" + + "\x05group\x18\x02 \x01(\tR\x05group\x12\x1d\n" + + "\n" + + "session_id\x18\x03 \x01(\tR\tsessionId\"\x84\x01\n" + + "\x16SearchCommandsResponse\x12:\n" + + "\bcommands\x18\x01 \x03(\v2\x1e.services.localrpc.CommandInfoR\bcommands\x12\x14\n" + + "\x05error\x18\x02 \x01(\tR\x05error\x12\x18\n" + + "\asuccess\x18\x03 \x01(\bR\asuccess2\xaf\x05\n" + + "\x0eCommandService\x12e\n" + + "\x0eExecuteCommand\x12(.services.localrpc.ExecuteCommandRequest\x1a).services.localrpc.ExecuteCommandResponse\x12f\n" + + "\rStreamCommand\x12(.services.localrpc.ExecuteCommandRequest\x1a).services.localrpc.ExecuteCommandResponse0\x01\x12Y\n" + + "\n" + + "ExecuteLua\x12$.services.localrpc.ExecuteLuaRequest\x1a%.services.localrpc.ExecuteLuaResponse\x12Y\n" + + "\n" + + "GetHistory\x12$.services.localrpc.GetHistoryRequest\x1a%.services.localrpc.GetHistoryResponse\x12Y\n" + + "\n" + + "GetSchemas\x12$.services.localrpc.GetSchemasRequest\x1a%.services.localrpc.GetSchemasResponse\x12V\n" + + "\tGetGroups\x12#.services.localrpc.GetGroupsRequest\x1a$.services.localrpc.GetGroupsResponse\x12e\n" + + "\x0eSearchCommands\x12(.services.localrpc.SearchCommandsRequest\x1a).services.localrpc.SearchCommandsResponseBBZ@github.com/chainreactors/IoM-go/proto/services/localrpc;localrpcb\x06proto3" + var ( - file_services_localrpc_localrpc_proto_rawDescOnce sync.Once - file_services_localrpc_localrpc_proto_rawDescData = file_services_localrpc_localrpc_proto_rawDesc + file_localrpc_proto_rawDescOnce sync.Once + file_localrpc_proto_rawDescData []byte ) -func file_services_localrpc_localrpc_proto_rawDescGZIP() []byte { - file_services_localrpc_localrpc_proto_rawDescOnce.Do(func() { - file_services_localrpc_localrpc_proto_rawDescData = protoimpl.X.CompressGZIP(file_services_localrpc_localrpc_proto_rawDescData) +func file_localrpc_proto_rawDescGZIP() []byte { + file_localrpc_proto_rawDescOnce.Do(func() { + file_localrpc_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_localrpc_proto_rawDesc), len(file_localrpc_proto_rawDesc))) }) - return file_services_localrpc_localrpc_proto_rawDescData + return file_localrpc_proto_rawDescData } -var file_services_localrpc_localrpc_proto_msgTypes = make([]protoimpl.MessageInfo, 11) -var file_services_localrpc_localrpc_proto_goTypes = []interface{}{ +var file_localrpc_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_localrpc_proto_goTypes = []any{ (*ExecuteCommandRequest)(nil), // 0: services.localrpc.ExecuteCommandRequest (*ExecuteCommandResponse)(nil), // 1: services.localrpc.ExecuteCommandResponse (*ExecuteLuaRequest)(nil), // 2: services.localrpc.ExecuteLuaRequest @@ -757,170 +865,55 @@ var file_services_localrpc_localrpc_proto_goTypes = []interface{}{ (*GetSchemasResponse)(nil), // 7: services.localrpc.GetSchemasResponse (*GetGroupsRequest)(nil), // 8: services.localrpc.GetGroupsRequest (*GetGroupsResponse)(nil), // 9: services.localrpc.GetGroupsResponse - nil, // 10: services.localrpc.GetGroupsResponse.GroupsEntry -} -var file_services_localrpc_localrpc_proto_depIdxs = []int32{ - 10, // 0: services.localrpc.GetGroupsResponse.groups:type_name -> services.localrpc.GetGroupsResponse.GroupsEntry - 0, // 1: services.localrpc.CommandService.ExecuteCommand:input_type -> services.localrpc.ExecuteCommandRequest - 2, // 2: services.localrpc.CommandService.ExecuteLua:input_type -> services.localrpc.ExecuteLuaRequest - 4, // 3: services.localrpc.CommandService.GetHistory:input_type -> services.localrpc.GetHistoryRequest - 6, // 4: services.localrpc.CommandService.GetSchemas:input_type -> services.localrpc.GetSchemasRequest - 8, // 5: services.localrpc.CommandService.GetGroups:input_type -> services.localrpc.GetGroupsRequest - 1, // 6: services.localrpc.CommandService.ExecuteCommand:output_type -> services.localrpc.ExecuteCommandResponse - 3, // 7: services.localrpc.CommandService.ExecuteLua:output_type -> services.localrpc.ExecuteLuaResponse - 5, // 8: services.localrpc.CommandService.GetHistory:output_type -> services.localrpc.GetHistoryResponse - 7, // 9: services.localrpc.CommandService.GetSchemas:output_type -> services.localrpc.GetSchemasResponse - 9, // 10: services.localrpc.CommandService.GetGroups:output_type -> services.localrpc.GetGroupsResponse - 6, // [6:11] is the sub-list for method output_type - 1, // [1:6] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_services_localrpc_localrpc_proto_init() } -func file_services_localrpc_localrpc_proto_init() { - if File_services_localrpc_localrpc_proto != nil { + (*CommandInfo)(nil), // 10: services.localrpc.CommandInfo + (*SearchCommandsRequest)(nil), // 11: services.localrpc.SearchCommandsRequest + (*SearchCommandsResponse)(nil), // 12: services.localrpc.SearchCommandsResponse + nil, // 13: services.localrpc.GetGroupsResponse.GroupsEntry +} +var file_localrpc_proto_depIdxs = []int32{ + 13, // 0: services.localrpc.GetGroupsResponse.groups:type_name -> services.localrpc.GetGroupsResponse.GroupsEntry + 10, // 1: services.localrpc.SearchCommandsResponse.commands:type_name -> services.localrpc.CommandInfo + 0, // 2: services.localrpc.CommandService.ExecuteCommand:input_type -> services.localrpc.ExecuteCommandRequest + 0, // 3: services.localrpc.CommandService.StreamCommand:input_type -> services.localrpc.ExecuteCommandRequest + 2, // 4: services.localrpc.CommandService.ExecuteLua:input_type -> services.localrpc.ExecuteLuaRequest + 4, // 5: services.localrpc.CommandService.GetHistory:input_type -> services.localrpc.GetHistoryRequest + 6, // 6: services.localrpc.CommandService.GetSchemas:input_type -> services.localrpc.GetSchemasRequest + 8, // 7: services.localrpc.CommandService.GetGroups:input_type -> services.localrpc.GetGroupsRequest + 11, // 8: services.localrpc.CommandService.SearchCommands:input_type -> services.localrpc.SearchCommandsRequest + 1, // 9: services.localrpc.CommandService.ExecuteCommand:output_type -> services.localrpc.ExecuteCommandResponse + 1, // 10: services.localrpc.CommandService.StreamCommand:output_type -> services.localrpc.ExecuteCommandResponse + 3, // 11: services.localrpc.CommandService.ExecuteLua:output_type -> services.localrpc.ExecuteLuaResponse + 5, // 12: services.localrpc.CommandService.GetHistory:output_type -> services.localrpc.GetHistoryResponse + 7, // 13: services.localrpc.CommandService.GetSchemas:output_type -> services.localrpc.GetSchemasResponse + 9, // 14: services.localrpc.CommandService.GetGroups:output_type -> services.localrpc.GetGroupsResponse + 12, // 15: services.localrpc.CommandService.SearchCommands:output_type -> services.localrpc.SearchCommandsResponse + 9, // [9:16] is the sub-list for method output_type + 2, // [2:9] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_localrpc_proto_init() } +func file_localrpc_proto_init() { + if File_localrpc_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_services_localrpc_localrpc_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecuteCommandRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_services_localrpc_localrpc_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecuteCommandResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_services_localrpc_localrpc_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecuteLuaRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_services_localrpc_localrpc_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecuteLuaResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_services_localrpc_localrpc_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetHistoryRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_services_localrpc_localrpc_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetHistoryResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_services_localrpc_localrpc_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSchemasRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_services_localrpc_localrpc_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSchemasResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_services_localrpc_localrpc_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetGroupsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_services_localrpc_localrpc_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetGroupsResponse); 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_services_localrpc_localrpc_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_localrpc_proto_rawDesc), len(file_localrpc_proto_rawDesc)), NumEnums: 0, - NumMessages: 11, + NumMessages: 14, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_services_localrpc_localrpc_proto_goTypes, - DependencyIndexes: file_services_localrpc_localrpc_proto_depIdxs, - MessageInfos: file_services_localrpc_localrpc_proto_msgTypes, + GoTypes: file_localrpc_proto_goTypes, + DependencyIndexes: file_localrpc_proto_depIdxs, + MessageInfos: file_localrpc_proto_msgTypes, }.Build() - File_services_localrpc_localrpc_proto = out.File - file_services_localrpc_localrpc_proto_rawDesc = nil - file_services_localrpc_localrpc_proto_goTypes = nil - file_services_localrpc_localrpc_proto_depIdxs = nil + File_localrpc_proto = out.File + file_localrpc_proto_goTypes = nil + file_localrpc_proto_depIdxs = nil } diff --git a/proto/services/localrpc/localrpc_grpc.pb.go b/proto/services/localrpc/localrpc_grpc.pb.go index 92d6814..2cd326c 100644 --- a/proto/services/localrpc/localrpc_grpc.pb.go +++ b/proto/services/localrpc/localrpc_grpc.pb.go @@ -1,8 +1,8 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.12 -// source: services/localrpc/localrpc.proto +// - protoc-gen-go-grpc v1.5.1 +// - protoc (unknown) +// source: localrpc.proto package localrpc @@ -15,27 +15,30 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + CommandService_ExecuteCommand_FullMethodName = "/services.localrpc.CommandService/ExecuteCommand" + CommandService_StreamCommand_FullMethodName = "/services.localrpc.CommandService/StreamCommand" + CommandService_ExecuteLua_FullMethodName = "/services.localrpc.CommandService/ExecuteLua" + CommandService_GetHistory_FullMethodName = "/services.localrpc.CommandService/GetHistory" + CommandService_GetSchemas_FullMethodName = "/services.localrpc.CommandService/GetSchemas" + CommandService_GetGroups_FullMethodName = "/services.localrpc.CommandService/GetGroups" + CommandService_SearchCommands_FullMethodName = "/services.localrpc.CommandService/SearchCommands" +) // CommandServiceClient is the client API for CommandService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type CommandServiceClient interface { - // ExecuteCommand executes a client command in the specified session context - // Commands are automatically routed to client menu or implant menu based on - // whether there's an active session ExecuteCommand(ctx context.Context, in *ExecuteCommandRequest, opts ...grpc.CallOption) (*ExecuteCommandResponse, error) - // ExecuteLua executes a Lua script with access to internal functions and - // the current session context + StreamCommand(ctx context.Context, in *ExecuteCommandRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ExecuteCommandResponse], error) ExecuteLua(ctx context.Context, in *ExecuteLuaRequest, opts ...grpc.CallOption) (*ExecuteLuaResponse, error) - // GetHistory retrieves rendered history data for a specific task GetHistory(ctx context.Context, in *GetHistoryRequest, opts ...grpc.CallOption) (*GetHistoryResponse, error) - // GetSchemas retrieves JSON schemas for commands in specified cobra group - // Returns schemas suitable for react-jsonschema-form rendering GetSchemas(ctx context.Context, in *GetSchemasRequest, opts ...grpc.CallOption) (*GetSchemasResponse, error) - // GetGroups retrieves information about all available command groups GetGroups(ctx context.Context, in *GetGroupsRequest, opts ...grpc.CallOption) (*GetGroupsResponse, error) + SearchCommands(ctx context.Context, in *SearchCommandsRequest, opts ...grpc.CallOption) (*SearchCommandsResponse, error) } type commandServiceClient struct { @@ -47,17 +50,38 @@ func NewCommandServiceClient(cc grpc.ClientConnInterface) CommandServiceClient { } func (c *commandServiceClient) ExecuteCommand(ctx context.Context, in *ExecuteCommandRequest, opts ...grpc.CallOption) (*ExecuteCommandResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ExecuteCommandResponse) - err := c.cc.Invoke(ctx, "/services.localrpc.CommandService/ExecuteCommand", in, out, opts...) + err := c.cc.Invoke(ctx, CommandService_ExecuteCommand_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } +func (c *commandServiceClient) StreamCommand(ctx context.Context, in *ExecuteCommandRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ExecuteCommandResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &CommandService_ServiceDesc.Streams[0], CommandService_StreamCommand_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[ExecuteCommandRequest, ExecuteCommandResponse]{ClientStream: stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type CommandService_StreamCommandClient = grpc.ServerStreamingClient[ExecuteCommandResponse] + func (c *commandServiceClient) ExecuteLua(ctx context.Context, in *ExecuteLuaRequest, opts ...grpc.CallOption) (*ExecuteLuaResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ExecuteLuaResponse) - err := c.cc.Invoke(ctx, "/services.localrpc.CommandService/ExecuteLua", in, out, opts...) + err := c.cc.Invoke(ctx, CommandService_ExecuteLua_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -65,8 +89,9 @@ func (c *commandServiceClient) ExecuteLua(ctx context.Context, in *ExecuteLuaReq } func (c *commandServiceClient) GetHistory(ctx context.Context, in *GetHistoryRequest, opts ...grpc.CallOption) (*GetHistoryResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetHistoryResponse) - err := c.cc.Invoke(ctx, "/services.localrpc.CommandService/GetHistory", in, out, opts...) + err := c.cc.Invoke(ctx, CommandService_GetHistory_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -74,8 +99,9 @@ func (c *commandServiceClient) GetHistory(ctx context.Context, in *GetHistoryReq } func (c *commandServiceClient) GetSchemas(ctx context.Context, in *GetSchemasRequest, opts ...grpc.CallOption) (*GetSchemasResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetSchemasResponse) - err := c.cc.Invoke(ctx, "/services.localrpc.CommandService/GetSchemas", in, out, opts...) + err := c.cc.Invoke(ctx, CommandService_GetSchemas_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -83,8 +109,19 @@ func (c *commandServiceClient) GetSchemas(ctx context.Context, in *GetSchemasReq } func (c *commandServiceClient) GetGroups(ctx context.Context, in *GetGroupsRequest, opts ...grpc.CallOption) (*GetGroupsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetGroupsResponse) - err := c.cc.Invoke(ctx, "/services.localrpc.CommandService/GetGroups", in, out, opts...) + err := c.cc.Invoke(ctx, CommandService_GetGroups_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *commandServiceClient) SearchCommands(ctx context.Context, in *SearchCommandsRequest, opts ...grpc.CallOption) (*SearchCommandsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(SearchCommandsResponse) + err := c.cc.Invoke(ctx, CommandService_SearchCommands_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -93,32 +130,31 @@ func (c *commandServiceClient) GetGroups(ctx context.Context, in *GetGroupsReque // CommandServiceServer is the server API for CommandService service. // All implementations must embed UnimplementedCommandServiceServer -// for forward compatibility +// for forward compatibility. type CommandServiceServer interface { - // ExecuteCommand executes a client command in the specified session context - // Commands are automatically routed to client menu or implant menu based on - // whether there's an active session ExecuteCommand(context.Context, *ExecuteCommandRequest) (*ExecuteCommandResponse, error) - // ExecuteLua executes a Lua script with access to internal functions and - // the current session context + StreamCommand(*ExecuteCommandRequest, grpc.ServerStreamingServer[ExecuteCommandResponse]) error ExecuteLua(context.Context, *ExecuteLuaRequest) (*ExecuteLuaResponse, error) - // GetHistory retrieves rendered history data for a specific task GetHistory(context.Context, *GetHistoryRequest) (*GetHistoryResponse, error) - // GetSchemas retrieves JSON schemas for commands in specified cobra group - // Returns schemas suitable for react-jsonschema-form rendering GetSchemas(context.Context, *GetSchemasRequest) (*GetSchemasResponse, error) - // GetGroups retrieves information about all available command groups GetGroups(context.Context, *GetGroupsRequest) (*GetGroupsResponse, error) + SearchCommands(context.Context, *SearchCommandsRequest) (*SearchCommandsResponse, error) mustEmbedUnimplementedCommandServiceServer() } -// UnimplementedCommandServiceServer must be embedded to have forward compatible implementations. -type UnimplementedCommandServiceServer struct { -} +// UnimplementedCommandServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedCommandServiceServer struct{} func (UnimplementedCommandServiceServer) ExecuteCommand(context.Context, *ExecuteCommandRequest) (*ExecuteCommandResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ExecuteCommand not implemented") } +func (UnimplementedCommandServiceServer) StreamCommand(*ExecuteCommandRequest, grpc.ServerStreamingServer[ExecuteCommandResponse]) error { + return status.Errorf(codes.Unimplemented, "method StreamCommand not implemented") +} func (UnimplementedCommandServiceServer) ExecuteLua(context.Context, *ExecuteLuaRequest) (*ExecuteLuaResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ExecuteLua not implemented") } @@ -131,7 +167,11 @@ func (UnimplementedCommandServiceServer) GetSchemas(context.Context, *GetSchemas func (UnimplementedCommandServiceServer) GetGroups(context.Context, *GetGroupsRequest) (*GetGroupsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetGroups not implemented") } +func (UnimplementedCommandServiceServer) SearchCommands(context.Context, *SearchCommandsRequest) (*SearchCommandsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SearchCommands not implemented") +} func (UnimplementedCommandServiceServer) mustEmbedUnimplementedCommandServiceServer() {} +func (UnimplementedCommandServiceServer) testEmbeddedByValue() {} // UnsafeCommandServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to CommandServiceServer will @@ -141,6 +181,13 @@ type UnsafeCommandServiceServer interface { } func RegisterCommandServiceServer(s grpc.ServiceRegistrar, srv CommandServiceServer) { + // If the following call pancis, it indicates UnimplementedCommandServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&CommandService_ServiceDesc, srv) } @@ -154,7 +201,7 @@ func _CommandService_ExecuteCommand_Handler(srv interface{}, ctx context.Context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/services.localrpc.CommandService/ExecuteCommand", + FullMethod: CommandService_ExecuteCommand_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(CommandServiceServer).ExecuteCommand(ctx, req.(*ExecuteCommandRequest)) @@ -162,6 +209,17 @@ func _CommandService_ExecuteCommand_Handler(srv interface{}, ctx context.Context return interceptor(ctx, in, info, handler) } +func _CommandService_StreamCommand_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(ExecuteCommandRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(CommandServiceServer).StreamCommand(m, &grpc.GenericServerStream[ExecuteCommandRequest, ExecuteCommandResponse]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type CommandService_StreamCommandServer = grpc.ServerStreamingServer[ExecuteCommandResponse] + func _CommandService_ExecuteLua_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ExecuteLuaRequest) if err := dec(in); err != nil { @@ -172,7 +230,7 @@ func _CommandService_ExecuteLua_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/services.localrpc.CommandService/ExecuteLua", + FullMethod: CommandService_ExecuteLua_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(CommandServiceServer).ExecuteLua(ctx, req.(*ExecuteLuaRequest)) @@ -190,7 +248,7 @@ func _CommandService_GetHistory_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/services.localrpc.CommandService/GetHistory", + FullMethod: CommandService_GetHistory_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(CommandServiceServer).GetHistory(ctx, req.(*GetHistoryRequest)) @@ -208,7 +266,7 @@ func _CommandService_GetSchemas_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/services.localrpc.CommandService/GetSchemas", + FullMethod: CommandService_GetSchemas_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(CommandServiceServer).GetSchemas(ctx, req.(*GetSchemasRequest)) @@ -226,7 +284,7 @@ func _CommandService_GetGroups_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/services.localrpc.CommandService/GetGroups", + FullMethod: CommandService_GetGroups_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(CommandServiceServer).GetGroups(ctx, req.(*GetGroupsRequest)) @@ -234,6 +292,24 @@ func _CommandService_GetGroups_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _CommandService_SearchCommands_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SearchCommandsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CommandServiceServer).SearchCommands(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: CommandService_SearchCommands_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CommandServiceServer).SearchCommands(ctx, req.(*SearchCommandsRequest)) + } + return interceptor(ctx, in, info, handler) +} + // CommandService_ServiceDesc is the grpc.ServiceDesc for CommandService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -261,7 +337,17 @@ var CommandService_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetGroups", Handler: _CommandService_GetGroups_Handler, }, + { + MethodName: "SearchCommands", + Handler: _CommandService_SearchCommands_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "StreamCommand", + Handler: _CommandService_StreamCommand_Handler, + ServerStreams: true, + }, }, - Streams: []grpc.StreamDesc{}, - Metadata: "services/localrpc/localrpc.proto", + Metadata: "localrpc.proto", }