From 913367d98e18b6797b377337064aa5c217d285f8 Mon Sep 17 00:00:00 2001 From: Mike Cohen Date: Thu, 7 Mar 2024 00:11:57 +1000 Subject: [PATCH] Added vql functions to manipulate notebooks (#3325) This allows for automations around creating custom notebooks. Also added tests and refactored notebook code: - Notebooks uploads have been moved to the cells so they can be versioned. - Notebook attachments are not versions and exist in the notebook top level. --- api/api.go | 15 +- api/clients.go | 53 +- api/notebooks.go | 167 +----- api/proto/notebooks.pb.go | 329 +++++----- api/proto/notebooks.proto | 5 + api/server_monitoring.go | 52 -- api/status.go | 8 +- api/tables/table.go | 39 +- .../server/notebooks/N.CG74N2JSSV75S.json.db | 2 +- .../server/testcases/notebook.out.yaml | 2 +- config/proto/config.pb.go | 562 +++++++++--------- config/proto/config.proto | 4 + constants/constants.go | 36 +- datastore/memcache.go | 22 +- docs/wix/velociraptor_amd64.xml | 1 + docs/wix/velociraptor_x86.xml | 1 + file_store/memory/memory.go | 5 +- .../src/components/flows/flow-notebook.jsx | 2 +- .../src/components/flows/flows-list.jsx | 15 - .../src/components/hunts/hunt-list.jsx | 18 - .../src/components/hunts/hunt-notebook.jsx | 2 +- .../components/notebooks/export-notebook.jsx | 2 +- .../notebooks/notebook-cell-renderer.jsx | 40 +- .../components/notebooks/notebook-uploads.jsx | 12 +- .../src/components/notebooks/notebook.jsx | 2 +- paths/notebooks.go | 34 +- paths/notebooks_test.go | 4 +- reporting/gui.go | 6 +- reporting/logging.go | 21 +- reporting/paths.go | 9 +- services/notebook.go | 5 + services/notebook/calculate.go | 19 + services/notebook/downloads.go | 58 +- services/notebook/initial.go | 1 + services/notebook/notebook.go | 39 +- services/notebook/storage.go | 18 +- services/notebook/worker.go | 7 +- .../TestNotebookMinionScheduler.golden | 1 - services/scheduler/minion_test.go | 2 + services/scheduler/scheduler.go | 54 +- utils/errors.go | 5 +- vql/functions/time.go | 3 +- vql/json.go | 3 +- vql/server/notebooks/create.go | 100 ++++ vql/server/notebooks/download.go | 11 +- .../server/notebooks/export.go | 462 ++++++++++---- vql/server/notebooks/get.go | 107 ++++ vql/server/notebooks/notebooks_test.go | 272 +++++++++ vql/server/notebooks/update.go | 241 ++++++++ 49 files changed, 1959 insertions(+), 919 deletions(-) delete mode 100644 api/server_monitoring.go create mode 100644 vql/server/notebooks/create.go rename reporting/notebooks.go => vql/server/notebooks/export.go (54%) create mode 100644 vql/server/notebooks/get.go create mode 100644 vql/server/notebooks/notebooks_test.go create mode 100644 vql/server/notebooks/update.go diff --git a/api/api.go b/api/api.go index 68f86674ef2..ec6ad8a8e3e 100644 --- a/api/api.go +++ b/api/api.go @@ -880,8 +880,12 @@ func (self *ApiServer) GetServerMonitoringState( fmt.Sprintf("User is not allowed to read results (%v).", permissions)) } - result, err := getServerMonitoringState(org_config_obj) - return result, Status(self.verbose, err) + server_event_manager, err := services.GetServerEventManager(org_config_obj) + if err != nil { + return nil, Status(self.verbose, err) + } + + return server_event_manager.Get(), nil } func (self *ApiServer) SetServerMonitoringState( @@ -907,7 +911,12 @@ func (self *ApiServer) SetServerMonitoringState( fmt.Sprintf("User is not allowed to modify artifacts (%v).", permissions)) } - err = setServerMonitoringState(ctx, org_config_obj, principal, in) + server_event_manager, err := services.GetServerEventManager(org_config_obj) + if err != nil { + return nil, Status(self.verbose, err) + } + + err = server_event_manager.Update(ctx, org_config_obj, principal, in) return in, Status(self.verbose, err) } diff --git a/api/clients.go b/api/clients.go index c1ac4bd1e75..6b4cb1dcc4a 100644 --- a/api/clients.go +++ b/api/clients.go @@ -1,19 +1,19 @@ /* - Velociraptor - Dig Deeper - Copyright (C) 2019-2024 Rapid7 Inc. +Velociraptor - Dig Deeper +Copyright (C) 2019-2024 Rapid7 Inc. - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published +by the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . */ package api @@ -27,8 +27,6 @@ import ( "google.golang.org/protobuf/types/known/emptypb" "www.velocidex.com/golang/velociraptor/acls" api_proto "www.velocidex.com/golang/velociraptor/api/proto" - "www.velocidex.com/golang/velociraptor/datastore" - "www.velocidex.com/golang/velociraptor/paths" "www.velocidex.com/golang/velociraptor/services" ) @@ -54,19 +52,36 @@ func (self *ApiServer) GetClientMetadata( "User is not allowed to view clients.") } - client_path_manager := paths.NewClientPathManager(in.ClientId) - db, err := datastore.GetDB(org_config_obj) + client_info_manager, err := services.GetClientInfoManager(org_config_obj) if err != nil { return nil, Status(self.verbose, err) } - result := &api_proto.ClientMetadata{} - err = db.GetSubject(org_config_obj, client_path_manager.Metadata(), result) + result := &api_proto.ClientMetadata{ + ClientId: in.ClientId, + } + + client_metadata, err := client_info_manager.GetMetadata(ctx, in.ClientId) if errors.Is(err, os.ErrNotExist) { // Metadata not set, start with empty set. err = nil } - return result, err + if err != nil { + return nil, Status(self.verbose, err) + } + + for _, k := range client_metadata.Keys() { + v, _ := client_metadata.GetString(k) + if v != "" { + result.Items = append(result.Items, + &api_proto.ClientMetadataItem{ + Key: k, + Value: v, + }) + } + } + + return result, nil } func (self *ApiServer) SetClientMetadata( diff --git a/api/notebooks.go b/api/notebooks.go index bb1803f25fa..e41d4237e09 100644 --- a/api/notebooks.go +++ b/api/notebooks.go @@ -1,9 +1,6 @@ package api import ( - "crypto/md5" - "crypto/sha256" - "encoding/hex" "os" "strings" "sync" @@ -11,20 +8,13 @@ import ( "github.com/Velocidex/ordereddict" errors "github.com/go-errors/errors" - "github.com/sirupsen/logrus" context "golang.org/x/net/context" "google.golang.org/protobuf/types/known/emptypb" "www.velocidex.com/golang/velociraptor/acls" api_proto "www.velocidex.com/golang/velociraptor/api/proto" - config_proto "www.velocidex.com/golang/velociraptor/config/proto" - "www.velocidex.com/golang/velociraptor/datastore" - file_store "www.velocidex.com/golang/velociraptor/file_store" - "www.velocidex.com/golang/velociraptor/file_store/path_specs" "www.velocidex.com/golang/velociraptor/logging" - "www.velocidex.com/golang/velociraptor/paths" - "www.velocidex.com/golang/velociraptor/reporting" "www.velocidex.com/golang/velociraptor/services" - "www.velocidex.com/golang/velociraptor/utils" + "www.velocidex.com/golang/velociraptor/vql/server/notebooks" ) const ( @@ -62,7 +52,8 @@ func (self *ApiServer) GetNotebooks( // We want a single notebook metadata. if in.NotebookId != "" { - notebook_metadata, err := notebook_manager.GetNotebook(ctx, in.NotebookId, in.IncludeUploads) + notebook_metadata, err := notebook_manager.GetNotebook( + ctx, in.NotebookId, in.IncludeUploads) // Handle the EOF especially: it means there is no such // notebook and return an empty result set. if errors.Is(err, os.ErrNotExist) || @@ -430,7 +421,13 @@ func (self *ApiServer) UploadNotebookAttachment( if err != nil { return nil, Status(self.verbose, err) } - return notebook_manager.UploadNotebookAttachment(ctx, in) + res, err := notebook_manager.UploadNotebookAttachment(ctx, in) + if err != nil { + return nil, Status(self.verbose, err) + } + + res.MimeType = detectMime([]byte(in.Data), true) + return res, nil } func (self *ApiServer) CreateNotebookDownloadFile( @@ -453,144 +450,22 @@ func (self *ApiServer) CreateNotebookDownloadFile( "User is not allowed to export notebooks.") } + wg := &sync.WaitGroup{} + switch in.Type { case "zip": - return &emptypb.Empty{}, exportZipNotebook( - org_config_obj, in.NotebookId, principal) - default: - return &emptypb.Empty{}, exportHTMLNotebook( - org_config_obj, in.NotebookId, principal) - } -} + _, err := notebooks.ExportNotebookToZip(ctx, + org_config_obj, wg, in.NotebookId, + principal, in.PreferredName) -// Create a portable notebook into a zip file. -func exportZipNotebook( - config_obj *config_proto.Config, - notebook_id, principal string) error { - db, err := datastore.GetDB(config_obj) - if err != nil { - return err - } + return &emptypb.Empty{}, Status(self.verbose, err) - notebook := &api_proto.NotebookMetadata{} - notebook_path_manager := paths.NewNotebookPathManager(notebook_id) - err = db.GetSubject(config_obj, notebook_path_manager.Path(), notebook) - if err != nil { - return err - } - - notebook_manager, err := services.GetNotebookManager(config_obj) - if err != nil { - return err - } - if !notebook_manager.CheckNotebookAccess(notebook, principal) { - return InvalidStatus("Notebook is not shared with user.") - } - - filename := notebook_path_manager.ZipExport() - - // Allow 1 hour to export the notebook. - sub_ctx, cancel := context.WithTimeout(context.Background(), time.Hour) - - go func() { - defer cancel() - - wg := &sync.WaitGroup{} - - err := reporting.ExportNotebookToZip( - sub_ctx, config_obj, wg, notebook_path_manager) - if err != nil { - logger := logging.GetLogger(config_obj, &logging.GUIComponent) - logger.WithFields(logrus.Fields{ - "notebook_id": notebook.NotebookId, - "export_file": filename, - "error": err.Error(), - }).Error("CreateNotebookDownloadFile") - return - } - - // Wait for the export to finish before we return. - wg.Wait() - }() - - return nil -} - -func exportHTMLNotebook(config_obj *config_proto.Config, - notebook_id, principal string) error { - db, err := datastore.GetDB(config_obj) - if err != nil { - return err - } - - notebook := &api_proto.NotebookMetadata{} - notebook_path_manager := paths.NewNotebookPathManager(notebook_id) - err = db.GetSubject(config_obj, notebook_path_manager.Path(), notebook) - if err != nil { - return err - } - - notebook_manager, err := services.GetNotebookManager(config_obj) - if err != nil { - return err - } - - if !notebook_manager.CheckNotebookAccess(notebook, principal) { - return InvalidStatus("Notebook is not shared with user.") - } - - file_store_factory := file_store.GetFileStore(config_obj) - filename := notebook_path_manager.HtmlExport() - - writer, err := file_store_factory.WriteFile(filename) - if err != nil { - return err - } - - sha_sum := sha256.New() - md5_sum := md5.New() - tee_writer := utils.NewTee(writer, sha_sum, md5_sum) - - stats := &api_proto.ContainerStats{ - Timestamp: uint64(time.Now().Unix()), - Type: "html", - Components: path_specs.AsGenericComponentList(filename), - } - stats_path := notebook_path_manager.PathStats(filename) - - err = db.SetSubject(config_obj, stats_path, stats) - if err != nil { - return err + default: + _, err := notebooks.ExportNotebookToHTML( + org_config_obj, wg, in.NotebookId, + principal, in.PreferredName) + return &emptypb.Empty{}, Status(self.verbose, err) } - - // Allow 1 hour to export the notebook. - sub_ctx, cancel := context.WithTimeout(context.Background(), time.Hour) - - go func() { - defer writer.Close() - defer cancel() - - defer func() { - stats.Hash = hex.EncodeToString(sha_sum.Sum(nil)) - stats.TotalDuration = uint64(time.Now().Unix()) - stats.Timestamp - - db.SetSubject(config_obj, stats_path, stats) - }() - - err := reporting.ExportNotebookToHTML( - sub_ctx, config_obj, notebook.NotebookId, tee_writer) - if err != nil { - logger := logging.GetLogger(config_obj, &logging.GUIComponent) - logger.WithFields(logrus.Fields{ - "notebook_id": notebook.NotebookId, - "export_file": filename, - "error": err.Error(), - }).Error("CreateNotebookDownloadFile") - return - } - }() - - return nil } func (self *ApiServer) RemoveNotebookAttachment( diff --git a/api/proto/notebooks.pb.go b/api/proto/notebooks.pb.go index 593c7aee206..9fc85fb457d 100644 --- a/api/proto/notebooks.pb.go +++ b/api/proto/notebooks.pb.go @@ -133,8 +133,9 @@ type NotebookExportRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - NotebookId string `protobuf:"bytes,1,opt,name=notebook_id,json=notebookId,proto3" json:"notebook_id,omitempty"` - Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + NotebookId string `protobuf:"bytes,1,opt,name=notebook_id,json=notebookId,proto3" json:"notebook_id,omitempty"` + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + PreferredName string `protobuf:"bytes,3,opt,name=preferred_name,json=preferredName,proto3" json:"preferred_name,omitempty"` } func (x *NotebookExportRequest) Reset() { @@ -183,6 +184,13 @@ func (x *NotebookExportRequest) GetType() string { return "" } +func (x *NotebookExportRequest) GetPreferredName() string { + if x != nil { + return x.PreferredName + } + return "" +} + // Message sent to the notebook processor ro request a cell recalc. type NotebookCellRequest struct { state protoimpl.MessageState @@ -194,6 +202,7 @@ type NotebookCellRequest struct { Version string `protobuf:"bytes,12,opt,name=version,proto3" json:"version,omitempty"` AvailableVersions []string `protobuf:"bytes,13,rep,name=available_versions,json=availableVersions,proto3" json:"available_versions,omitempty"` Input string `protobuf:"bytes,3,opt,name=input,proto3" json:"input,omitempty"` + Output string `protobuf:"bytes,14,opt,name=output,proto3" json:"output,omitempty"` Name string `protobuf:"bytes,11,opt,name=name,proto3" json:"name,omitempty"` Offset uint64 `protobuf:"varint,4,opt,name=offset,proto3" json:"offset,omitempty"` Count uint64 `protobuf:"varint,5,opt,name=count,proto3" json:"count,omitempty"` @@ -270,6 +279,13 @@ func (x *NotebookCellRequest) GetInput() string { return "" } +func (x *NotebookCellRequest) GetOutput() string { + if x != nil { + return x.Output + } + return "" +} + func (x *NotebookCellRequest) GetName() string { if x != nil { return x.Name @@ -840,6 +856,7 @@ type NotebookFileUploadRequest struct { Filename string `protobuf:"bytes,2,opt,name=filename,proto3" json:"filename,omitempty"` Components []string `protobuf:"bytes,4,rep,name=components,proto3" json:"components,omitempty"` NotebookId string `protobuf:"bytes,3,opt,name=notebook_id,json=notebookId,proto3" json:"notebook_id,omitempty"` + CellId string `protobuf:"bytes,5,opt,name=cell_id,json=cellId,proto3" json:"cell_id,omitempty"` } func (x *NotebookFileUploadRequest) Reset() { @@ -902,12 +919,21 @@ func (x *NotebookFileUploadRequest) GetNotebookId() string { return "" } +func (x *NotebookFileUploadRequest) GetCellId() string { + if x != nil { + return x.CellId + } + return "" +} + type NotebookFileUploadResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` + Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` + Filename string `protobuf:"bytes,2,opt,name=filename,proto3" json:"filename,omitempty"` + MimeType string `protobuf:"bytes,3,opt,name=mime_type,json=mimeType,proto3" json:"mime_type,omitempty"` } func (x *NotebookFileUploadResponse) Reset() { @@ -949,6 +975,20 @@ func (x *NotebookFileUploadResponse) GetUrl() string { return "" } +func (x *NotebookFileUploadResponse) GetFilename() string { + if x != nil { + return x.Filename + } + return "" +} + +func (x *NotebookFileUploadResponse) GetMimeType() string { + if x != nil { + return x.MimeType + } + return "" +} + var File_notebooks_proto protoreflect.FileDescriptor var file_notebooks_proto_rawDesc = []byte{ @@ -963,149 +1003,158 @@ var file_notebooks_proto_rawDesc = []byte{ 0x08, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x22, 0x2d, 0x0a, 0x03, 0x45, 0x6e, 0x76, 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, 0x22, 0x4c, 0x0a, 0x15, 0x4e, 0x6f, 0x74, 0x65, + 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x73, 0x0a, 0x15, 0x4e, 0x6f, 0x74, 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x6e, 0x6f, 0x74, 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6e, 0x6f, 0x74, 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xf8, 0x02, 0x0a, 0x13, 0x4e, 0x6f, 0x74, 0x65, 0x62, - 0x6f, 0x6f, 0x6b, 0x43, 0x65, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, - 0x0a, 0x0b, 0x6e, 0x6f, 0x74, 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6e, 0x6f, 0x74, 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x49, 0x64, 0x12, - 0x17, 0x0a, 0x07, 0x63, 0x65, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x63, 0x65, 0x6c, 0x6c, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x12, 0x2d, 0x0a, 0x12, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x5f, - 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x09, 0x52, 0x11, - 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, - 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6f, 0x66, 0x66, - 0x73, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2b, 0x0a, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, + 0x72, 0x65, 0x64, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, + 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x90, 0x03, + 0x0a, 0x13, 0x4e, 0x6f, 0x74, 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x43, 0x65, 0x6c, 0x6c, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x6e, 0x6f, 0x74, 0x65, 0x62, 0x6f, 0x6f, + 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6e, 0x6f, 0x74, 0x65, + 0x62, 0x6f, 0x6f, 0x6b, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x63, 0x65, 0x6c, 0x6c, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x65, 0x6c, 0x6c, 0x49, 0x64, 0x12, + 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x0a, 0x12, 0x61, 0x76, 0x61, + 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x0d, 0x20, 0x03, 0x28, 0x09, 0x52, 0x11, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x70, 0x75, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x16, + 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0b, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, + 0x66, 0x73, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, + 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2b, 0x0a, 0x11, + 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x6c, 0x79, 0x5f, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6e, + 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, + 0x6c, 0x79, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x1c, 0x0a, 0x03, 0x65, 0x6e, 0x76, + 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, + 0x6e, 0x76, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x12, 0x27, 0x0a, 0x0f, 0x69, 0x6e, 0x63, 0x6c, 0x75, + 0x64, 0x65, 0x5f, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x0e, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x73, + 0x22, 0xd5, 0x01, 0x0a, 0x0f, 0x4e, 0x6f, 0x74, 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x43, 0x6f, 0x6e, + 0x74, 0x65, 0x78, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x75, 0x6e, 0x74, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x75, 0x6e, 0x74, 0x49, + 0x64, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x66, 0x6c, 0x6f, 0x77, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x76, 0x65, 0x6e, 0x74, + 0x5f, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0d, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x12, 0x1d, + 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x19, 0x0a, + 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xab, 0x06, 0x0a, 0x10, 0x4e, 0x6f, 0x74, + 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x30, 0x0a, + 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x43, + 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, + 0x24, 0x0a, 0x0d, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x73, + 0x18, 0x0c, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x62, 0x6f, 0x72, + 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, + 0x74, 0x73, 0x18, 0x14, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, + 0x63, 0x74, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 0x0d, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x12, 0x21, 0x0a, 0x0c, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x23, + 0x0a, 0x0d, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x54, + 0x69, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6e, 0x6f, 0x74, 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x5f, + 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6e, 0x6f, 0x74, 0x65, 0x62, 0x6f, + 0x6f, 0x6b, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x65, 0x6c, 0x6c, 0x73, 0x18, 0x06, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x05, 0x63, 0x65, 0x6c, 0x6c, 0x73, 0x12, 0x38, 0x0a, 0x0d, 0x63, 0x65, + 0x6c, 0x6c, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x65, 0x62, 0x6f, + 0x6f, 0x6b, 0x43, 0x65, 0x6c, 0x6c, 0x52, 0x0c, 0x63, 0x65, 0x6c, 0x6c, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x12, 0x24, 0x0a, 0x0e, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x63, + 0x65, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6c, 0x61, + 0x74, 0x65, 0x73, 0x74, 0x43, 0x65, 0x6c, 0x6c, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x69, + 0x64, 0x64, 0x65, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x68, 0x69, 0x64, 0x64, + 0x65, 0x6e, 0x12, 0x4a, 0x0a, 0x13, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x5f, + 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, + 0x65, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x52, 0x12, 0x61, 0x76, 0x61, 0x69, + 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x12, 0x46, + 0x0a, 0x11, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x75, 0x70, 0x6c, 0x6f, + 0x61, 0x64, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x6f, 0x77, 0x6e, 0x6c, + 0x6f, 0x61, 0x64, 0x73, 0x52, 0x10, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x55, + 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x12, 0x1c, 0x0a, 0x03, 0x65, 0x6e, 0x76, 0x18, 0x0e, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6e, 0x76, 0x52, + 0x03, 0x65, 0x6e, 0x76, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, 0x65, + 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, + 0x65, 0x73, 0x12, 0x34, 0x0a, 0x0c, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x18, 0x11, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x63, 0x6f, 0x6c, + 0x75, 0x6d, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x3c, 0x0a, 0x0b, 0x73, 0x75, 0x67, 0x67, + 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x13, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x43, 0x65, + 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0b, 0x73, 0x75, 0x67, 0x67, 0x65, + 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x3a, 0x0a, 0x09, 0x4e, 0x6f, 0x74, 0x65, 0x62, 0x6f, + 0x6f, 0x6b, 0x73, 0x12, 0x2d, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x65, 0x62, + 0x6f, 0x6f, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x05, 0x69, 0x74, 0x65, + 0x6d, 0x73, 0x22, 0xd3, 0x03, 0x0a, 0x0c, 0x4e, 0x6f, 0x74, 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x43, + 0x65, 0x6c, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x75, 0x74, + 0x70, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, + 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x17, 0x0a, 0x07, 0x63, 0x65, 0x6c, 0x6c, 0x5f, 0x69, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x65, 0x6c, 0x6c, 0x49, 0x64, 0x12, 0x1a, + 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x6f, + 0x72, 0x65, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0c, 0x6d, 0x6f, 0x72, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, + 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1a, 0x0a, + 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x6c, 0x79, 0x5f, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, - 0x74, 0x6c, 0x79, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x1c, 0x0a, 0x03, 0x65, 0x6e, - 0x76, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x45, 0x6e, 0x76, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x12, 0x27, 0x0a, 0x0f, 0x69, 0x6e, 0x63, 0x6c, - 0x75, 0x64, 0x65, 0x5f, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0e, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, - 0x73, 0x22, 0xd5, 0x01, 0x0a, 0x0f, 0x4e, 0x6f, 0x74, 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x43, 0x6f, - 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x75, 0x6e, - 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x75, 0x6e, 0x74, - 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6c, 0x6f, 0x77, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x63, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x76, 0x65, 0x6e, - 0x74, 0x5f, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0d, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x12, - 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x19, - 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xab, 0x06, 0x0a, 0x10, 0x4e, 0x6f, - 0x74, 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x30, - 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x65, 0x62, 0x6f, 0x6f, 0x6b, - 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, - 0x12, 0x24, 0x0a, 0x0d, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, - 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x62, 0x6f, - 0x72, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, - 0x63, 0x74, 0x73, 0x18, 0x14, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x61, 0x72, 0x74, 0x69, 0x66, - 0x61, 0x63, 0x74, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 0x0d, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x12, 0x21, 0x0a, 0x0c, - 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, - 0x23, 0x0a, 0x0d, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, - 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6e, 0x6f, 0x74, 0x65, 0x62, 0x6f, 0x6f, 0x6b, - 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6e, 0x6f, 0x74, 0x65, 0x62, - 0x6f, 0x6f, 0x6b, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x65, 0x6c, 0x6c, 0x73, 0x18, 0x06, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x63, 0x65, 0x6c, 0x6c, 0x73, 0x12, 0x38, 0x0a, 0x0d, 0x63, - 0x65, 0x6c, 0x6c, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x65, 0x62, - 0x6f, 0x6f, 0x6b, 0x43, 0x65, 0x6c, 0x6c, 0x52, 0x0c, 0x63, 0x65, 0x6c, 0x6c, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x24, 0x0a, 0x0e, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, - 0x63, 0x65, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6c, - 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, 0x65, 0x6c, 0x6c, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x68, - 0x69, 0x64, 0x64, 0x65, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x68, 0x69, 0x64, - 0x64, 0x65, 0x6e, 0x12, 0x4a, 0x0a, 0x13, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, - 0x5f, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, - 0x6c, 0x65, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x52, 0x12, 0x61, 0x76, 0x61, - 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x12, - 0x46, 0x0a, 0x11, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x75, 0x70, 0x6c, - 0x6f, 0x61, 0x64, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x6f, 0x77, 0x6e, - 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x52, 0x10, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, - 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x12, 0x1c, 0x0a, 0x03, 0x65, 0x6e, 0x76, 0x18, 0x0e, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6e, 0x76, - 0x52, 0x03, 0x65, 0x6e, 0x76, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, - 0x65, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x6c, 0x69, - 0x6e, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x0c, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x18, 0x11, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x63, 0x6f, - 0x6c, 0x75, 0x6d, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x3c, 0x0a, 0x0b, 0x73, 0x75, 0x67, - 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x13, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x43, - 0x65, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0b, 0x73, 0x75, 0x67, 0x67, - 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x3a, 0x0a, 0x09, 0x4e, 0x6f, 0x74, 0x65, 0x62, - 0x6f, 0x6f, 0x6b, 0x73, 0x12, 0x2d, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x65, - 0x62, 0x6f, 0x6f, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x05, 0x69, 0x74, - 0x65, 0x6d, 0x73, 0x22, 0xd3, 0x03, 0x0a, 0x0c, 0x4e, 0x6f, 0x74, 0x65, 0x62, 0x6f, 0x6f, 0x6b, - 0x43, 0x65, 0x6c, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x75, - 0x74, 0x70, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, - 0x75, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x17, 0x0a, 0x07, 0x63, 0x65, 0x6c, 0x6c, 0x5f, 0x69, - 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x65, 0x6c, 0x6c, 0x49, 0x64, 0x12, - 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x6d, - 0x6f, 0x72, 0x65, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0c, 0x6d, 0x6f, 0x72, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, - 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1a, - 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2b, - 0x0a, 0x11, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x6c, 0x79, 0x5f, 0x65, 0x64, 0x69, 0x74, - 0x69, 0x6e, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x63, 0x75, 0x72, 0x72, 0x65, - 0x6e, 0x74, 0x6c, 0x79, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x20, 0x0a, 0x0b, 0x63, - 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0b, 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x1c, 0x0a, - 0x03, 0x65, 0x6e, 0x76, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x45, 0x6e, 0x76, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x12, 0x14, 0x0a, 0x05, 0x65, - 0x72, 0x72, 0x6f, 0x72, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, - 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x75, 0x72, 0x72, - 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x0a, 0x12, 0x61, 0x76, - 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x0f, 0x20, 0x03, 0x28, 0x09, 0x52, 0x11, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, - 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x8c, 0x01, 0x0a, 0x19, 0x4e, 0x6f, - 0x74, 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x46, 0x69, 0x6c, 0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x66, - 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, - 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6f, - 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6d, - 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x6e, 0x6f, 0x74, 0x65, 0x62, - 0x6f, 0x6f, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6e, 0x6f, - 0x74, 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x49, 0x64, 0x22, 0x2e, 0x0a, 0x1a, 0x4e, 0x6f, 0x74, 0x65, - 0x62, 0x6f, 0x6f, 0x6b, 0x46, 0x69, 0x6c, 0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x42, 0x31, 0x5a, 0x2f, 0x77, 0x77, 0x77, 0x2e, - 0x76, 0x65, 0x6c, 0x6f, 0x63, 0x69, 0x64, 0x65, 0x78, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, - 0x6c, 0x61, 0x6e, 0x67, 0x2f, 0x76, 0x65, 0x6c, 0x6f, 0x63, 0x69, 0x72, 0x61, 0x70, 0x74, 0x6f, - 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x74, 0x6c, 0x79, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x61, + 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0b, 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x1c, 0x0a, 0x03, + 0x65, 0x6e, 0x76, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x45, 0x6e, 0x76, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, + 0x72, 0x6f, 0x72, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x75, 0x72, 0x72, 0x65, + 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x0a, 0x12, 0x61, 0x76, 0x61, + 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x0f, 0x20, 0x03, 0x28, 0x09, 0x52, 0x11, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xa5, 0x01, 0x0a, 0x19, 0x4e, 0x6f, 0x74, + 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x46, 0x69, 0x6c, 0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, + 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, + 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, + 0x65, 0x6e, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, + 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x6e, 0x6f, 0x74, 0x65, 0x62, 0x6f, + 0x6f, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6e, 0x6f, 0x74, + 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x63, 0x65, 0x6c, 0x6c, 0x5f, + 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x65, 0x6c, 0x6c, 0x49, 0x64, + 0x22, 0x67, 0x0a, 0x1a, 0x4e, 0x6f, 0x74, 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x46, 0x69, 0x6c, 0x65, + 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, + 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, + 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, + 0x6d, 0x69, 0x6d, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x6d, 0x69, 0x6d, 0x65, 0x54, 0x79, 0x70, 0x65, 0x42, 0x31, 0x5a, 0x2f, 0x77, 0x77, 0x77, + 0x2e, 0x76, 0x65, 0x6c, 0x6f, 0x63, 0x69, 0x64, 0x65, 0x78, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, + 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2f, 0x76, 0x65, 0x6c, 0x6f, 0x63, 0x69, 0x72, 0x61, 0x70, 0x74, + 0x6f, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/proto/notebooks.proto b/api/proto/notebooks.proto index 5a7c0c8cd6a..390ae701bdb 100644 --- a/api/proto/notebooks.proto +++ b/api/proto/notebooks.proto @@ -21,6 +21,7 @@ message Env { message NotebookExportRequest { string notebook_id = 1; string type = 2; + string preferred_name = 3; } // Message sent to the notebook processor ro request a cell recalc. @@ -31,6 +32,7 @@ message NotebookCellRequest { repeated string available_versions = 13; string input = 3; + string output = 14; string name = 11; uint64 offset = 4; @@ -140,8 +142,11 @@ message NotebookFileUploadRequest { string filename = 2; repeated string components = 4; string notebook_id = 3; + string cell_id = 5; } message NotebookFileUploadResponse { string url = 1; + string filename = 2; + string mime_type = 3; } diff --git a/api/server_monitoring.go b/api/server_monitoring.go deleted file mode 100644 index 38ee398c392..00000000000 --- a/api/server_monitoring.go +++ /dev/null @@ -1,52 +0,0 @@ -package api - -import ( - context "golang.org/x/net/context" - config_proto "www.velocidex.com/golang/velociraptor/config/proto" - "www.velocidex.com/golang/velociraptor/datastore" - flows_proto "www.velocidex.com/golang/velociraptor/flows/proto" - "www.velocidex.com/golang/velociraptor/paths" - "www.velocidex.com/golang/velociraptor/services" -) - -func getServerMonitoringState(config_obj *config_proto.Config) ( - *flows_proto.ArtifactCollectorArgs, error) { - db, err := datastore.GetDB(config_obj) - if err != nil { - return nil, err - } - - result := &flows_proto.ArtifactCollectorArgs{} - err = db.GetSubject(config_obj, - paths.ServerMonitoringFlowURN, - result, - ) - _ = err // if an error we return an empty collector args. - - return result, nil -} - -func setServerMonitoringState( - ctx context.Context, - config_obj *config_proto.Config, - principal string, - args *flows_proto.ArtifactCollectorArgs) error { - db, err := datastore.GetDB(config_obj) - if err != nil { - return err - } - - server_manager, err := services.GetServerEventManager(config_obj) - if err != nil { - return err - } - - err = server_manager.Update(ctx, config_obj, principal, args) - if err != nil { - return err - } - - return db.SetSubject( - config_obj, paths.ServerMonitoringFlowURN, - args) -} diff --git a/api/status.go b/api/status.go index 67063627b8a..6ff5d454ab5 100644 --- a/api/status.go +++ b/api/status.go @@ -29,6 +29,10 @@ func Status(verbose bool, err error) error { return status.Error(codes.PermissionDenied, err.Error()) } + if errors.Is(err, utils.InvalidStatus) { + return status.Error(codes.InvalidArgument, err.Error()) + } + // With the verbose flag give more detailed errors to the browser. if verbose { if errors.Is(err, os.ErrNotExist) { @@ -49,8 +53,8 @@ func Status(verbose bool, err error) error { return status.Error(codes.Unavailable, err.Error()) } -func InvalidStatus(msg string) error { - return status.Error(codes.InvalidArgument, msg) +func InvalidStatus(message string) error { + return fmt.Errorf("%w: %s", utils.InvalidStatus, message) } func PermissionDenied(err error, message string) error { diff --git a/api/tables/table.go b/api/tables/table.go index a32908bbb61..c7fc9c053de 100644 --- a/api/tables/table.go +++ b/api/tables/table.go @@ -1,19 +1,19 @@ /* - Velociraptor - Dig Deeper - Copyright (C) 2019-2024 Rapid7 Inc. +Velociraptor - Dig Deeper +Copyright (C) 2019-2024 Rapid7 Inc. - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published +by the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . */ package tables @@ -24,7 +24,6 @@ import ( errors "github.com/go-errors/errors" context "golang.org/x/net/context" - "www.velocidex.com/golang/velociraptor/datastore" file_store "www.velocidex.com/golang/velociraptor/file_store" "www.velocidex.com/golang/velociraptor/file_store/api" "www.velocidex.com/golang/velociraptor/json" @@ -217,19 +216,17 @@ func getColumnTypes( // For notebooks, the column_types are set in the notebook metadata. if in.NotebookId != "" { - notebook_path_manager := paths.NewNotebookPathManager( - in.NotebookId) - - db, err := datastore.GetDB(config_obj) + notebook_manager, err := services.GetNotebookManager(config_obj) if err != nil { return nil } - notebook := &api_proto.NotebookMetadata{} - err = db.GetSubject(config_obj, notebook_path_manager.Path(), notebook) - if err == nil { - return notebook.ColumnTypes + notebook, err := notebook_manager.GetNotebook(ctx, in.NotebookId, + services.DO_NOT_INCLUDE_UPLOADS) + if err != nil { + return nil } + return notebook.ColumnTypes } return nil diff --git a/artifacts/testdata/server/notebooks/N.CG74N2JSSV75S.json.db b/artifacts/testdata/server/notebooks/N.CG74N2JSSV75S.json.db index 45fa98140a2..7398ba86826 100644 --- a/artifacts/testdata/server/notebooks/N.CG74N2JSSV75S.json.db +++ b/artifacts/testdata/server/notebooks/N.CG74N2JSSV75S.json.db @@ -1 +1 @@ -{"name":"Test Notebook", "description":"Test exports", "creator":"mic", "collaborators":["test1"], "createdTime":"1678658442", "modifiedTime":"1678658442", "notebookId":"N.CG74N2JSSV75S", "cellMetadata":[{"cellId":"NC.CG74N5GVJAA2E", "timestamp":"1678661693"}, {"cellId":"NC.CG74N2HMAK01C", "timestamp":"1678662970"}], "latestCellId":"NC.CG74N5GVJAA2E", "availableDownloads":{}, "availableUploads":{"files":[{"name":"NA.CG75NPHSURTDQimage.png", "path":"/notebooks/N.CG74N2JSSV75S/files/NA.CG75NPHSURTDQimage.png", "complete":true, "size":"9295", "date":"2023-03-12T23:10:30Z"}]}} \ No newline at end of file +{"name":"Test Notebook", "description":"Test exports", "creator":"mic", "collaborators":["test1"], "public": true, "createdTime":"1678658442", "modifiedTime":"1678658442", "notebookId":"N.CG74N2JSSV75S", "cellMetadata":[{"cellId":"NC.CG74N5GVJAA2E", "timestamp":"1678661693"}, {"cellId":"NC.CG74N2HMAK01C", "timestamp":"1678662970"}], "latestCellId":"NC.CG74N5GVJAA2E", "availableDownloads":{}, "availableUploads":{"files":[{"name":"NA.CG75NPHSURTDQimage.png", "path":"/notebooks/N.CG74N2JSSV75S/files/NA.CG75NPHSURTDQimage.png", "complete":true, "size":"9295", "date":"2023-03-12T23:10:30Z"}]}} \ No newline at end of file diff --git a/artifacts/testdata/server/testcases/notebook.out.yaml b/artifacts/testdata/server/testcases/notebook.out.yaml index d50af469cb7..5e24323ccce 100644 --- a/artifacts/testdata/server/testcases/notebook.out.yaml +++ b/artifacts/testdata/server/testcases/notebook.out.yaml @@ -33,6 +33,6 @@ LET _ <= mock_time(now=1669861615)[]LET _ <= SELECT OSPath, file_store_delete(pa }, { "OSPath": "/Notebook.yaml", - "Size": 1670 + "Size": 1485 } ] \ No newline at end of file diff --git a/config/proto/config.pb.go b/config/proto/config.pb.go index 862d2a62c9d..be9fa885b02 100644 --- a/config/proto/config.pb.go +++ b/config/proto/config.pb.go @@ -3588,6 +3588,9 @@ type Defaults struct { // When the process memory exceeds the high water marrk, we // actively cancel in flight notebook cell calculations. NotebookMemoryHighWaterMark uint64 `protobuf:"varint,37,opt,name=notebook_memory_high_water_mark,json=notebookMemoryHighWaterMark,proto3" json:"notebook_memory_high_water_mark,omitempty"` + // Wait this long for a worker to become available before giving + // up. + NotebookWaitTimeForWorkerMs int64 `protobuf:"varint,46,opt,name=notebook_wait_time_for_worker_ms,json=notebookWaitTimeForWorkerMs,proto3" json:"notebook_wait_time_for_worker_ms,omitempty"` // Set to -1 to disable local workers. The default is 5 local // workers. If you want the master to **not** perform any notebook // computations reduce this to -1 and set @@ -3737,6 +3740,13 @@ func (x *Defaults) GetNotebookMemoryHighWaterMark() uint64 { return 0 } +func (x *Defaults) GetNotebookWaitTimeForWorkerMs() int64 { + if x != nil { + return x.NotebookWaitTimeForWorkerMs + } + return 0 +} + func (x *Defaults) GetNotebookNumberOfLocalWorkers() int64 { if x != nil { return x.NotebookNumberOfLocalWorkers @@ -5739,7 +5749,7 @@ var file_config_proto_rawDesc = []byte{ 0x63, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x2c, 0x0a, 0x12, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x61, - 0x62, 0x6c, 0x65, 0x22, 0xf2, 0x0e, 0x0a, 0x08, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, + 0x62, 0x6c, 0x65, 0x22, 0xb9, 0x0f, 0x0a, 0x08, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x68, 0x75, 0x6e, 0x74, 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x5f, 0x68, 0x6f, 0x75, 0x72, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x68, 0x75, 0x6e, 0x74, 0x45, 0x78, 0x70, 0x69, 0x72, 0x79, 0x48, 0x6f, 0x75, 0x72, 0x73, 0x12, 0x3d, 0x0a, 0x1b, @@ -5759,280 +5769,284 @@ var file_config_proto_rawDesc = []byte{ 0x67, 0x68, 0x5f, 0x77, 0x61, 0x74, 0x65, 0x72, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x25, 0x20, 0x01, 0x28, 0x04, 0x52, 0x1b, 0x6e, 0x6f, 0x74, 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x48, 0x69, 0x67, 0x68, 0x57, 0x61, 0x74, 0x65, 0x72, 0x4d, 0x61, 0x72, 0x6b, - 0x12, 0x46, 0x0a, 0x20, 0x6e, 0x6f, 0x74, 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, - 0x62, 0x65, 0x72, 0x5f, 0x6f, 0x66, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x77, 0x6f, 0x72, - 0x6b, 0x65, 0x72, 0x73, 0x18, 0x26, 0x20, 0x01, 0x28, 0x03, 0x52, 0x1c, 0x6e, 0x6f, 0x74, 0x65, - 0x62, 0x6f, 0x6f, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x4f, 0x66, 0x4c, 0x6f, 0x63, 0x61, - 0x6c, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x73, 0x12, 0x38, 0x0a, 0x18, 0x6e, 0x6f, 0x74, 0x65, - 0x62, 0x6f, 0x6f, 0x6b, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x5f, 0x70, 0x72, 0x69, 0x6f, - 0x72, 0x69, 0x74, 0x79, 0x18, 0x27, 0x20, 0x01, 0x28, 0x03, 0x52, 0x16, 0x6e, 0x6f, 0x74, 0x65, - 0x62, 0x6f, 0x6f, 0x6b, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, - 0x74, 0x79, 0x12, 0x2b, 0x0a, 0x11, 0x6e, 0x6f, 0x74, 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x5f, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x2a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x6e, - 0x6f, 0x74, 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, - 0x23, 0x0a, 0x0d, 0x63, 0x73, 0x76, 0x5f, 0x64, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x73, 0x76, 0x44, 0x65, 0x6c, 0x69, 0x6d, - 0x69, 0x74, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x0e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x61, - 0x78, 0x5f, 0x77, 0x61, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x65, 0x76, - 0x65, 0x6e, 0x74, 0x4d, 0x61, 0x78, 0x57, 0x61, 0x69, 0x74, 0x12, 0x31, 0x0a, 0x15, 0x65, 0x76, - 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x77, 0x61, 0x69, 0x74, 0x5f, 0x6a, 0x69, 0x74, - 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x12, 0x65, 0x76, 0x65, 0x6e, 0x74, - 0x4d, 0x61, 0x78, 0x57, 0x61, 0x69, 0x74, 0x4a, 0x69, 0x74, 0x74, 0x65, 0x72, 0x12, 0x44, 0x0a, - 0x1f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x6e, 0x6f, - 0x74, 0x69, 0x66, 0x79, 0x5f, 0x61, 0x6c, 0x6c, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1b, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x43, 0x68, 0x61, - 0x6e, 0x67, 0x65, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x41, 0x6c, 0x6c, 0x43, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x73, 0x12, 0x33, 0x0a, 0x16, 0x6d, 0x61, 0x78, 0x5f, 0x76, 0x66, 0x73, 0x5f, 0x64, - 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x13, 0x6d, 0x61, 0x78, 0x56, 0x66, 0x73, 0x44, 0x69, 0x72, 0x65, 0x63, - 0x74, 0x6f, 0x72, 0x79, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x48, 0x0a, 0x20, 0x61, 0x72, 0x74, 0x69, - 0x66, 0x61, 0x63, 0x74, 0x5f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x1e, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x44, 0x65, 0x66, 0x69, - 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x69, - 0x65, 0x73, 0x12, 0x32, 0x0a, 0x16, 0x6d, 0x61, 0x78, 0x5f, 0x69, 0x6e, 0x5f, 0x6d, 0x65, 0x6d, - 0x6f, 0x72, 0x79, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x62, 0x79, 0x18, 0x09, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x12, 0x6d, 0x61, 0x78, 0x49, 0x6e, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x47, - 0x72, 0x6f, 0x75, 0x70, 0x42, 0x79, 0x12, 0x27, 0x0a, 0x0f, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, - 0x64, 0x5f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x0e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x12, - 0x2b, 0x0a, 0x11, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x61, 0x6c, 0x6c, 0x6f, - 0x77, 0x65, 0x64, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2b, 0x0a, 0x11, - 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, - 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, - 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x73, 0x12, 0x2d, 0x0a, 0x13, 0x61, 0x63, 0x6c, - 0x5f, 0x6c, 0x72, 0x75, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x73, 0x65, 0x63, - 0x18, 0x0d, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x61, 0x63, 0x6c, 0x4c, 0x72, 0x75, 0x54, 0x69, - 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x53, 0x65, 0x63, 0x12, 0x45, 0x0a, 0x1f, 0x75, 0x6e, 0x61, 0x75, - 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6c, 0x72, 0x75, 0x5f, - 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x18, 0x0e, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x1c, 0x75, 0x6e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, - 0x65, 0x64, 0x4c, 0x72, 0x75, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x53, 0x65, 0x63, 0x12, - 0x33, 0x0a, 0x16, 0x6d, 0x61, 0x78, 0x5f, 0x73, 0x70, 0x61, 0x72, 0x73, 0x65, 0x5f, 0x65, 0x78, - 0x70, 0x61, 0x6e, 0x64, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x13, 0x6d, 0x61, 0x78, 0x53, 0x70, 0x61, 0x72, 0x73, 0x65, 0x45, 0x78, 0x70, 0x61, 0x6e, 0x64, - 0x53, 0x69, 0x7a, 0x65, 0x12, 0x32, 0x0a, 0x15, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x1a, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x13, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x34, 0x0a, 0x16, 0x61, 0x75, 0x74, 0x68, - 0x5f, 0x72, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x61, 0x75, 0x74, 0x68, 0x52, 0x65, - 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x3a, - 0x0a, 0x19, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x71, 0x75, 0x61, 0x72, 0x61, 0x6e, - 0x74, 0x69, 0x6e, 0x65, 0x5f, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x18, 0x1c, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x17, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x51, 0x75, 0x61, 0x72, 0x61, 0x6e, - 0x74, 0x69, 0x6e, 0x65, 0x42, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x65, - 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x74, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x1d, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x54, 0x68, 0x65, 0x6d, 0x65, 0x12, - 0x19, 0x0a, 0x08, 0x6d, 0x61, 0x78, 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x1e, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x52, 0x6f, 0x77, 0x73, 0x12, 0x2d, 0x0a, 0x13, 0x6d, 0x61, - 0x78, 0x5f, 0x72, 0x6f, 0x77, 0x5f, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x5f, 0x73, 0x69, 0x7a, - 0x65, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x6d, 0x61, 0x78, 0x52, 0x6f, 0x77, 0x42, - 0x75, 0x66, 0x66, 0x65, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x6d, 0x61, 0x78, - 0x5f, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x77, 0x61, 0x69, 0x74, 0x18, 0x23, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x0c, 0x6d, 0x61, 0x78, 0x42, 0x61, 0x74, 0x63, 0x68, 0x57, 0x61, 0x69, 0x74, 0x12, - 0x3e, 0x0a, 0x1b, 0x6c, 0x6f, 0x63, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x5f, 0x64, 0x65, 0x6e, 0x69, - 0x65, 0x64, 0x5f, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x20, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x19, 0x6c, 0x6f, 0x63, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x44, 0x65, - 0x6e, 0x69, 0x65, 0x64, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, - 0x3a, 0x0a, 0x19, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x69, 0x74, 0x79, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x18, 0x21, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x17, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x69, 0x74, 0x79, 0x44, 0x61, 0x79, 0x73, 0x12, 0x58, 0x0a, 0x29, 0x64, - 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, - 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, - 0x6c, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x22, 0x20, 0x01, 0x28, 0x08, 0x52, 0x25, - 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x41, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x2d, 0x0a, 0x12, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x5f, - 0x63, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x28, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x11, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, - 0x65, 0x6e, 0x63, 0x79, 0x12, 0x33, 0x0a, 0x16, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x6d, - 0x61, 0x78, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x18, 0x29, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x13, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x61, 0x78, 0x54, - 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x53, 0x65, 0x63, 0x12, 0x34, 0x0a, 0x16, 0x77, 0x61, 0x74, - 0x63, 0x68, 0x5f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x66, 0x72, 0x65, 0x71, 0x75, 0x65, - 0x6e, 0x63, 0x79, 0x18, 0x2c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x14, 0x77, 0x61, 0x74, 0x63, 0x68, - 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x46, 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x79, 0x12, - 0x37, 0x0a, 0x18, 0x77, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, - 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x2d, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x15, 0x77, 0x61, 0x74, 0x63, 0x68, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x42, 0x75, - 0x66, 0x66, 0x65, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x22, 0xad, 0x04, 0x0a, 0x0c, 0x43, 0x72, 0x79, - 0x70, 0x74, 0x6f, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x6f, 0x6f, - 0x74, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, - 0x6f, 0x6f, 0x74, 0x43, 0x65, 0x72, 0x74, 0x73, 0x12, 0x7f, 0x0a, 0x17, 0x63, 0x65, 0x72, 0x74, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x70, 0x72, 0x69, - 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x42, 0x46, 0xe2, 0xfc, 0xe3, 0xc4, 0x01, - 0x40, 0x12, 0x3e, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x70, - 0x72, 0x69, 0x6e, 0x74, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x65, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x74, 0x72, 0x75, 0x73, 0x74, - 0x2e, 0x52, 0x16, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x54, 0x68, - 0x75, 0x6d, 0x62, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x73, 0x12, 0xd5, 0x01, 0x0a, 0x1d, 0x63, 0x65, - 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x90, 0x01, 0xe2, 0xfc, 0xe3, 0xc4, 0x01, 0x89, 0x01, 0x12, 0x86, 0x01, 0x53, 0x65, - 0x6c, 0x65, 0x63, 0x74, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x77, 0x61, 0x79, 0x20, 0x69, 0x6e, - 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x56, 0x65, 0x6c, 0x6f, 0x63, 0x69, 0x72, 0x61, 0x70, - 0x74, 0x6f, 0x72, 0x20, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x73, 0x20, 0x54, 0x4c, 0x53, - 0x20, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x2e, 0x20, 0x41, - 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x3a, 0x20, 0x50, - 0x4b, 0x49, 0x20, 0x28, 0x74, 0x68, 0x65, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x29, - 0x2c, 0x20, 0x50, 0x4b, 0x49, 0x5f, 0x4f, 0x52, 0x5f, 0x54, 0x48, 0x55, 0x4d, 0x42, 0x50, 0x52, - 0x49, 0x4e, 0x54, 0x2c, 0x20, 0x54, 0x48, 0x55, 0x4d, 0x42, 0x50, 0x52, 0x49, 0x4e, 0x54, 0x5f, - 0x4f, 0x4e, 0x4c, 0x59, 0x52, 0x1b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, 0x64, - 0x65, 0x12, 0x31, 0x0a, 0x15, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x77, 0x65, 0x61, 0x6b, 0x5f, - 0x74, 0x6c, 0x73, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x12, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x57, 0x65, 0x61, 0x6b, 0x54, 0x6c, 0x73, 0x53, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x12, 0x2d, 0x0a, 0x12, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x63, - 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x11, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, - 0x61, 0x74, 0x65, 0x12, 0x43, 0x0a, 0x1e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x65, - 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, - 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x1b, 0x63, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x50, 0x72, - 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x22, 0x5d, 0x0a, 0x0a, 0x4d, 0x6f, 0x75, 0x6e, - 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x6f, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, - 0x74, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, - 0x61, 0x74, 0x68, 0x54, 0x79, 0x70, 0x65, 0x22, 0xf0, 0x02, 0x0a, 0x0f, 0x52, 0x65, 0x6d, 0x61, - 0x70, 0x70, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, - 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0a, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x25, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4d, 0x6f, - 0x75, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x21, - 0x0a, 0x02, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x02, 0x6f, - 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x6f, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x02, 0x6f, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x1f, 0x0a, 0x03, 0x65, 0x6e, 0x76, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x56, 0x51, 0x4c, 0x45, 0x6e, 0x76, 0x52, 0x03, 0x65, 0x6e, 0x76, - 0x12, 0x2d, 0x0a, 0x12, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x5f, 0x66, 0x75, 0x6e, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x11, 0x64, 0x69, - 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, - 0x29, 0x0a, 0x10, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x5f, 0x70, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x64, 0x69, 0x73, 0x61, 0x62, - 0x6c, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x22, 0x96, 0x0d, 0x0a, 0x06, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2b, 0x0a, 0x0f, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x65, 0x72, - 0x74, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x15, 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, - 0x18, 0x01, 0x52, 0x0e, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x65, 0x72, 0x74, 0x44, 0x6f, 0x6d, 0x61, - 0x69, 0x6e, 0x12, 0x46, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x42, 0x1c, 0xe2, 0xfc, 0xe3, 0xc4, 0x01, 0x16, 0x12, 0x14, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x4a, 0x0a, 0x06, 0x43, 0x6c, - 0x69, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, - 0x1d, 0xe2, 0xfc, 0xe3, 0xc4, 0x01, 0x17, 0x12, 0x15, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x20, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x06, - 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x50, 0x0a, 0x03, 0x41, 0x50, 0x49, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x50, 0x49, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x2c, 0xe2, 0xfc, 0xe3, 0xc4, 0x01, 0x26, 0x12, 0x24, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x6f, 0x72, - 0x20, 0x67, 0x52, 0x50, 0x43, 0x20, 0x41, 0x50, 0x49, 0x20, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, - 0x6e, 0x74, 0x2e, 0x52, 0x03, 0x41, 0x50, 0x49, 0x12, 0x22, 0x0a, 0x03, 0x47, 0x55, 0x49, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x55, - 0x49, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x03, 0x47, 0x55, 0x49, 0x12, 0x1f, 0x0a, 0x02, - 0x43, 0x41, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x43, 0x41, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x02, 0x43, 0x41, 0x12, 0x31, 0x0a, - 0x08, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x12, 0x45, 0x0a, 0x20, 0x6e, 0x6f, 0x74, 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x5f, 0x77, 0x61, 0x69, + 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x65, + 0x72, 0x5f, 0x6d, 0x73, 0x18, 0x2e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x1b, 0x6e, 0x6f, 0x74, 0x65, + 0x62, 0x6f, 0x6f, 0x6b, 0x57, 0x61, 0x69, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x46, 0x6f, 0x72, 0x57, + 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x4d, 0x73, 0x12, 0x46, 0x0a, 0x20, 0x6e, 0x6f, 0x74, 0x65, 0x62, + 0x6f, 0x6f, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x6f, 0x66, 0x5f, 0x6c, 0x6f, + 0x63, 0x61, 0x6c, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x73, 0x18, 0x26, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x1c, 0x6e, 0x6f, 0x74, 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, + 0x72, 0x4f, 0x66, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x73, 0x12, + 0x38, 0x0a, 0x18, 0x6e, 0x6f, 0x74, 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x5f, 0x77, 0x6f, 0x72, 0x6b, + 0x65, 0x72, 0x5f, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x27, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x16, 0x6e, 0x6f, 0x74, 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x57, 0x6f, 0x72, 0x6b, 0x65, + 0x72, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x2b, 0x0a, 0x11, 0x6e, 0x6f, 0x74, + 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x2a, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x6e, 0x6f, 0x74, 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x73, 0x76, 0x5f, 0x64, 0x65, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, + 0x73, 0x76, 0x44, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x0e, 0x65, + 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x77, 0x61, 0x69, 0x74, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x0c, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4d, 0x61, 0x78, 0x57, 0x61, 0x69, + 0x74, 0x12, 0x31, 0x0a, 0x15, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x77, + 0x61, 0x69, 0x74, 0x5f, 0x6a, 0x69, 0x74, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x12, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4d, 0x61, 0x78, 0x57, 0x61, 0x69, 0x74, 0x4a, 0x69, + 0x74, 0x74, 0x65, 0x72, 0x12, 0x44, 0x0a, 0x1f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x5f, 0x61, 0x6c, 0x6c, 0x5f, + 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1b, 0x65, + 0x76, 0x65, 0x6e, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, + 0x41, 0x6c, 0x6c, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x33, 0x0a, 0x16, 0x6d, 0x61, + 0x78, 0x5f, 0x76, 0x66, 0x73, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x5f, + 0x73, 0x69, 0x7a, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x13, 0x6d, 0x61, 0x78, 0x56, + 0x66, 0x73, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x69, 0x7a, 0x65, 0x12, + 0x48, 0x0a, 0x20, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x5f, 0x64, 0x65, 0x66, 0x69, + 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, + 0x69, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x1e, 0x61, 0x72, 0x74, 0x69, 0x66, + 0x61, 0x63, 0x74, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x44, 0x69, + 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x12, 0x32, 0x0a, 0x16, 0x6d, 0x61, 0x78, + 0x5f, 0x69, 0x6e, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, + 0x5f, 0x62, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x12, 0x6d, 0x61, 0x78, 0x49, 0x6e, + 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x79, 0x12, 0x27, 0x0a, + 0x0f, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, + 0x18, 0x0a, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x50, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, + 0x64, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x10, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x61, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, + 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x73, + 0x12, 0x2d, 0x0a, 0x13, 0x61, 0x63, 0x6c, 0x5f, 0x6c, 0x72, 0x75, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x6f, 0x75, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x61, + 0x63, 0x6c, 0x4c, 0x72, 0x75, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x53, 0x65, 0x63, 0x12, + 0x45, 0x0a, 0x1f, 0x75, 0x6e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x6c, 0x72, 0x75, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x73, + 0x65, 0x63, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x1c, 0x75, 0x6e, 0x61, 0x75, 0x74, 0x68, + 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, 0x4c, 0x72, 0x75, 0x54, 0x69, 0x6d, 0x65, + 0x6f, 0x75, 0x74, 0x53, 0x65, 0x63, 0x12, 0x33, 0x0a, 0x16, 0x6d, 0x61, 0x78, 0x5f, 0x73, 0x70, + 0x61, 0x72, 0x73, 0x65, 0x5f, 0x65, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x5f, 0x73, 0x69, 0x7a, 0x65, + 0x18, 0x0f, 0x20, 0x01, 0x28, 0x04, 0x52, 0x13, 0x6d, 0x61, 0x78, 0x53, 0x70, 0x61, 0x72, 0x73, + 0x65, 0x45, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x32, 0x0a, 0x15, 0x64, + 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x65, 0x76, + 0x65, 0x6e, 0x74, 0x73, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x64, 0x69, 0x73, 0x61, + 0x62, 0x6c, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, + 0x34, 0x0a, 0x16, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x72, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, + 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x14, 0x61, 0x75, 0x74, 0x68, 0x52, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x54, 0x65, 0x6d, + 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x3a, 0x0a, 0x19, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, + 0x5f, 0x71, 0x75, 0x61, 0x72, 0x61, 0x6e, 0x74, 0x69, 0x6e, 0x65, 0x5f, 0x62, 0x75, 0x74, 0x74, + 0x6f, 0x6e, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, + 0x65, 0x51, 0x75, 0x61, 0x72, 0x61, 0x6e, 0x74, 0x69, 0x6e, 0x65, 0x42, 0x75, 0x74, 0x74, 0x6f, + 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x74, 0x68, 0x65, + 0x6d, 0x65, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x54, 0x68, 0x65, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x61, 0x78, 0x5f, 0x72, 0x6f, + 0x77, 0x73, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x52, 0x6f, 0x77, + 0x73, 0x12, 0x2d, 0x0a, 0x13, 0x6d, 0x61, 0x78, 0x5f, 0x72, 0x6f, 0x77, 0x5f, 0x62, 0x75, 0x66, + 0x66, 0x65, 0x72, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, + 0x6d, 0x61, 0x78, 0x52, 0x6f, 0x77, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x53, 0x69, 0x7a, 0x65, + 0x12, 0x24, 0x0a, 0x0e, 0x6d, 0x61, 0x78, 0x5f, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x77, 0x61, + 0x69, 0x74, 0x18, 0x23, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x6d, 0x61, 0x78, 0x42, 0x61, 0x74, + 0x63, 0x68, 0x57, 0x61, 0x69, 0x74, 0x12, 0x3e, 0x0a, 0x1b, 0x6c, 0x6f, 0x63, 0x6b, 0x64, 0x6f, + 0x77, 0x6e, 0x5f, 0x64, 0x65, 0x6e, 0x69, 0x65, 0x64, 0x5f, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x20, 0x20, 0x03, 0x28, 0x09, 0x52, 0x19, 0x6c, 0x6f, 0x63, + 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x44, 0x65, 0x6e, 0x69, 0x65, 0x64, 0x50, 0x65, 0x72, 0x6d, 0x69, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3a, 0x0a, 0x19, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x69, 0x74, 0x79, 0x5f, 0x64, + 0x61, 0x79, 0x73, 0x18, 0x21, 0x20, 0x01, 0x28, 0x03, 0x52, 0x17, 0x63, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x69, 0x74, 0x79, 0x44, 0x61, + 0x79, 0x73, 0x12, 0x58, 0x0a, 0x29, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x69, 0x6e, + 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, + 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, + 0x22, 0x20, 0x01, 0x28, 0x08, 0x52, 0x25, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x49, 0x6e, + 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x78, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x2d, 0x0a, 0x12, + 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, + 0x63, 0x79, 0x18, 0x28, 0x20, 0x01, 0x28, 0x03, 0x52, 0x11, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, + 0x43, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x33, 0x0a, 0x16, 0x65, + 0x78, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, + 0x74, 0x5f, 0x73, 0x65, 0x63, 0x18, 0x29, 0x20, 0x01, 0x28, 0x03, 0x52, 0x13, 0x65, 0x78, 0x70, + 0x6f, 0x72, 0x74, 0x4d, 0x61, 0x78, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x53, 0x65, 0x63, + 0x12, 0x34, 0x0a, 0x16, 0x77, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x5f, 0x66, 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x2c, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x14, 0x77, 0x61, 0x74, 0x63, 0x68, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x46, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x37, 0x0a, 0x18, 0x77, 0x61, 0x74, 0x63, 0x68, 0x5f, + 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x5f, 0x73, 0x69, + 0x7a, 0x65, 0x18, 0x2d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x15, 0x77, 0x61, 0x74, 0x63, 0x68, 0x50, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x22, + 0xad, 0x04, 0x0a, 0x0c, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x6f, 0x6f, 0x74, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x6f, 0x6f, 0x74, 0x43, 0x65, 0x72, 0x74, 0x73, 0x12, + 0x7f, 0x0a, 0x17, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x74, + 0x68, 0x75, 0x6d, 0x62, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, + 0x42, 0x46, 0xe2, 0xfc, 0xe3, 0xc4, 0x01, 0x40, 0x12, 0x3e, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, + 0x20, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x73, 0x20, 0x6f, 0x66, 0x20, + 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x20, 0x74, 0x68, 0x61, + 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x77, 0x69, 0x6c, + 0x6c, 0x20, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x52, 0x16, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x65, 0x54, 0x68, 0x75, 0x6d, 0x62, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x73, + 0x12, 0xd5, 0x01, 0x0a, 0x1d, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x6f, + 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x90, 0x01, 0xe2, 0xfc, 0xe3, 0xc4, 0x01, + 0x89, 0x01, 0x12, 0x86, 0x01, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x73, 0x20, 0x74, 0x68, 0x65, + 0x20, 0x77, 0x61, 0x79, 0x20, 0x69, 0x6e, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x56, 0x65, + 0x6c, 0x6f, 0x63, 0x69, 0x72, 0x61, 0x70, 0x74, 0x6f, 0x72, 0x20, 0x76, 0x65, 0x72, 0x69, 0x66, + 0x69, 0x65, 0x73, 0x20, 0x54, 0x4c, 0x53, 0x20, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x65, 0x73, 0x2e, 0x20, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x20, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x73, 0x3a, 0x20, 0x50, 0x4b, 0x49, 0x20, 0x28, 0x74, 0x68, 0x65, 0x20, 0x64, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x29, 0x2c, 0x20, 0x50, 0x4b, 0x49, 0x5f, 0x4f, 0x52, 0x5f, + 0x54, 0x48, 0x55, 0x4d, 0x42, 0x50, 0x52, 0x49, 0x4e, 0x54, 0x2c, 0x20, 0x54, 0x48, 0x55, 0x4d, + 0x42, 0x50, 0x52, 0x49, 0x4e, 0x54, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x52, 0x1b, 0x63, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x31, 0x0a, 0x15, 0x61, 0x6c, 0x6c, 0x6f, + 0x77, 0x5f, 0x77, 0x65, 0x61, 0x6b, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x57, 0x65, + 0x61, 0x6b, 0x54, 0x6c, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x2d, 0x0a, 0x12, 0x63, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x43, 0x0a, 0x1e, 0x63, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x1b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x65, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x22, + 0x5d, 0x0a, 0x0a, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x1a, 0x0a, + 0x08, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x72, 0x65, + 0x66, 0x69, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, + 0x78, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x74, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x74, 0x68, 0x54, 0x79, 0x70, 0x65, 0x22, 0xf0, + 0x02, 0x0a, 0x0f, 0x52, 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, + 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x25, + 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, + 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x21, 0x0a, 0x02, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x50, + 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x02, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x6d, + 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x70, + 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x6f, 0x73, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x6f, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x6f, + 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, + 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x03, 0x65, 0x6e, 0x76, 0x18, 0x07, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x56, 0x51, 0x4c, 0x45, + 0x6e, 0x76, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x12, 0x2d, 0x0a, 0x12, 0x64, 0x69, 0x73, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x08, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x11, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x46, 0x75, 0x6e, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x5f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x0f, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x73, 0x22, 0x96, 0x0d, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2b, 0x0a, 0x0f, + 0x61, 0x75, 0x74, 0x6f, 0x63, 0x65, 0x72, 0x74, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, + 0x15, 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0e, 0x61, 0x75, 0x74, 0x6f, 0x63, + 0x65, 0x72, 0x74, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x46, 0x0a, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x1c, 0xe2, 0xfc, 0xe3, 0xc4, + 0x01, 0x16, 0x12, 0x14, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x66, 0x6f, + 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x4a, 0x0a, 0x06, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x1d, 0xe2, 0xfc, 0xe3, 0xc4, 0x01, 0x17, 0x12, 0x15, + 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x06, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x50, 0x0a, + 0x03, 0x41, 0x50, 0x49, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x41, 0x50, 0x49, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x2c, 0xe2, 0xfc, + 0xe3, 0xc4, 0x01, 0x26, 0x12, 0x24, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x67, 0x52, 0x50, 0x43, 0x20, 0x41, 0x50, 0x49, + 0x20, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x52, 0x03, 0x41, 0x50, 0x49, 0x12, + 0x22, 0x0a, 0x03, 0x47, 0x55, 0x49, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x55, 0x49, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x03, + 0x47, 0x55, 0x49, 0x12, 0x1f, 0x0a, 0x02, 0x43, 0x41, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x41, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x52, 0x02, 0x43, 0x41, 0x12, 0x31, 0x0a, 0x08, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x46, + 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x08, 0x46, + 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x12, 0x3d, 0x0a, 0x0e, 0x45, 0x78, 0x74, 0x72, 0x61, + 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x73, 0x18, 0x1f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x08, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, - 0x12, 0x3d, 0x0a, 0x0e, 0x45, 0x78, 0x74, 0x72, 0x61, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, - 0x64, 0x73, 0x18, 0x1f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, - 0x0e, 0x45, 0x78, 0x74, 0x72, 0x61, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x73, 0x12, - 0x34, 0x0a, 0x09, 0x44, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x73, - 0x74, 0x6f, 0x72, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x09, 0x44, 0x61, 0x74, 0x61, - 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x32, 0x0a, 0x09, 0x57, 0x72, 0x69, 0x74, 0x65, 0x62, 0x61, - 0x63, 0x6b, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x62, 0x61, 0x63, 0x6b, 0x42, 0x02, 0x18, 0x01, 0x52, 0x09, - 0x57, 0x72, 0x69, 0x74, 0x65, 0x62, 0x61, 0x63, 0x6b, 0x12, 0x25, 0x0a, 0x04, 0x4d, 0x61, 0x69, - 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x4d, 0x61, 0x69, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x04, 0x4d, 0x61, 0x69, 0x6c, - 0x12, 0x2e, 0x0a, 0x07, 0x4c, 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x18, 0x17, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x6f, 0x67, 0x67, 0x69, 0x6e, - 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x07, 0x4c, 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, - 0x12, 0x2b, 0x0a, 0x06, 0x4d, 0x69, 0x6e, 0x69, 0x6f, 0x6e, 0x18, 0x28, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4d, 0x69, 0x6e, 0x69, 0x6f, 0x6e, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06, 0x4d, 0x69, 0x6e, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, - 0x07, 0x76, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x65, 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, 0x42, 0x26, - 0xe2, 0xfc, 0xe3, 0xc4, 0x01, 0x20, 0x12, 0x1e, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x76, - 0x65, 0x72, 0x62, 0x6f, 0x73, 0x65, 0x20, 0x6c, 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x20, 0x6f, - 0x75, 0x74, 0x70, 0x75, 0x74, 0x2e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x65, 0x12, - 0x5c, 0x0a, 0x13, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x65, 0x72, 0x74, 0x5f, 0x63, 0x65, 0x72, 0x74, - 0x5f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x18, 0x16, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2c, 0xe2, 0xfc, - 0xe3, 0xc4, 0x01, 0x26, 0x12, 0x24, 0x50, 0x61, 0x74, 0x68, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x74, - 0x6f, 0x72, 0x65, 0x20, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x65, 0x72, 0x74, 0x20, 0x63, 0x65, 0x72, - 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x2e, 0x52, 0x11, 0x61, 0x75, 0x74, 0x6f, - 0x63, 0x65, 0x72, 0x74, 0x43, 0x65, 0x72, 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, 0x12, 0x6e, 0x0a, - 0x0a, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x19, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, - 0x72, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x35, 0xe2, 0xfc, 0xe3, 0xc4, - 0x01, 0x2f, 0x12, 0x2d, 0x57, 0x68, 0x65, 0x72, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x69, 0x6e, - 0x64, 0x20, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x20, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, - 0x2e, 0x52, 0x0a, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x7f, 0x0a, - 0x0a, 0x61, 0x70, 0x69, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x1a, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x70, 0x69, 0x43, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x48, 0xe2, 0xfc, 0xe3, 0xc4, 0x01, - 0x42, 0x12, 0x40, 0x49, 0x66, 0x20, 0x77, 0x65, 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x20, - 0x74, 0x68, 0x65, 0x20, 0x61, 0x70, 0x69, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x20, 0x77, - 0x65, 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x6e, 0x74, 0x6f, - 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x20, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x2e, 0x52, 0x09, 0x61, 0x70, 0x69, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x8f, - 0x01, 0x0a, 0x08, 0x61, 0x75, 0x74, 0x6f, 0x65, 0x78, 0x65, 0x63, 0x18, 0x1c, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x45, 0x78, - 0x65, 0x63, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x5c, 0xe2, 0xfc, 0xe3, 0xc4, 0x01, 0x56, - 0x12, 0x54, 0x49, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x73, 0x70, 0x65, - 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x77, 0x65, 0x20, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, - 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x20, 0x77, 0x69, 0x74, 0x68, - 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x61, - 0x6e, 0x64, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x69, - 0x63, 0x61, 0x6c, 0x6c, 0x79, 0x2e, 0x52, 0x08, 0x61, 0x75, 0x74, 0x6f, 0x65, 0x78, 0x65, 0x63, - 0x12, 0x50, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x1e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2f, 0xe2, 0xfc, 0xe3, 0xc4, 0x01, 0x29, 0x12, 0x27, 0x54, - 0x79, 0x70, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x28, 0x6c, - 0x69, 0x6e, 0x75, 0x78, 0x2c, 0x20, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x73, 0x2c, 0x20, 0x64, - 0x61, 0x72, 0x77, 0x69, 0x6e, 0x29, 0x52, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x2b, 0x0a, 0x11, 0x6f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x20, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6f, - 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x12, - 0x2b, 0x0a, 0x08, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x21, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, - 0x74, 0x73, 0x52, 0x08, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x27, 0x0a, 0x0f, - 0x61, 0x6e, 0x61, 0x6c, 0x79, 0x73, 0x69, 0x73, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, - 0x22, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x61, 0x6e, 0x61, 0x6c, 0x79, 0x73, 0x69, 0x73, 0x54, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x36, 0x0a, 0x0a, 0x72, 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, - 0x6e, 0x67, 0x73, 0x18, 0x23, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x52, 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x52, 0x0a, 0x72, 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x15, 0x0a, - 0x06, 0x6f, 0x72, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x24, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, - 0x72, 0x67, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x67, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x25, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x1d, 0x0a, 0x0a, 0x64, 0x65, 0x62, 0x75, 0x67, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x29, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x09, 0x64, 0x65, 0x62, 0x75, 0x67, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x37, - 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x26, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x08, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x6b, 0x64, - 0x6f, 0x77, 0x6e, 0x18, 0x27, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x6b, 0x64, - 0x6f, 0x77, 0x6e, 0x42, 0x34, 0x5a, 0x32, 0x77, 0x77, 0x77, 0x2e, 0x76, 0x65, 0x6c, 0x6f, 0x63, - 0x69, 0x64, 0x65, 0x78, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2f, - 0x76, 0x65, 0x6c, 0x6f, 0x63, 0x69, 0x72, 0x61, 0x70, 0x74, 0x6f, 0x72, 0x2f, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0e, 0x45, 0x78, 0x74, 0x72, 0x61, 0x46, 0x72, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x73, 0x12, 0x34, 0x0a, 0x09, 0x44, 0x61, 0x74, 0x61, 0x73, 0x74, + 0x6f, 0x72, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x52, 0x09, 0x44, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x32, 0x0a, 0x09, + 0x57, 0x72, 0x69, 0x74, 0x65, 0x62, 0x61, 0x63, 0x6b, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x62, 0x61, 0x63, + 0x6b, 0x42, 0x02, 0x18, 0x01, 0x52, 0x09, 0x57, 0x72, 0x69, 0x74, 0x65, 0x62, 0x61, 0x63, 0x6b, + 0x12, 0x25, 0x0a, 0x04, 0x4d, 0x61, 0x69, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4d, 0x61, 0x69, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x52, 0x04, 0x4d, 0x61, 0x69, 0x6c, 0x12, 0x2e, 0x0a, 0x07, 0x4c, 0x6f, 0x67, 0x67, 0x69, + 0x6e, 0x67, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x4c, 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x07, + 0x4c, 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x12, 0x2b, 0x0a, 0x06, 0x4d, 0x69, 0x6e, 0x69, 0x6f, + 0x6e, 0x18, 0x28, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x4d, 0x69, 0x6e, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06, 0x4d, 0x69, + 0x6e, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x65, 0x18, + 0x14, 0x20, 0x01, 0x28, 0x08, 0x42, 0x26, 0xe2, 0xfc, 0xe3, 0xc4, 0x01, 0x20, 0x12, 0x1e, 0x45, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x76, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x65, 0x20, 0x6c, 0x6f, + 0x67, 0x67, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2e, 0x52, 0x07, 0x76, + 0x65, 0x72, 0x62, 0x6f, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x13, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x65, + 0x72, 0x74, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x5f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x18, 0x16, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x2c, 0xe2, 0xfc, 0xe3, 0xc4, 0x01, 0x26, 0x12, 0x24, 0x50, 0x61, 0x74, + 0x68, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x20, 0x61, 0x75, 0x74, 0x6f, 0x63, + 0x65, 0x72, 0x74, 0x20, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, + 0x2e, 0x52, 0x11, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x65, 0x72, 0x74, 0x43, 0x65, 0x72, 0x74, 0x43, + 0x61, 0x63, 0x68, 0x65, 0x12, 0x6e, 0x0a, 0x0a, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, + 0x6e, 0x67, 0x18, 0x19, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x42, 0x35, 0xe2, 0xfc, 0xe3, 0xc4, 0x01, 0x2f, 0x12, 0x2d, 0x57, 0x68, 0x65, 0x72, 0x65, + 0x20, 0x74, 0x6f, 0x20, 0x62, 0x69, 0x6e, 0x64, 0x20, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, + 0x65, 0x75, 0x73, 0x20, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x65, + 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x52, 0x0a, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, + 0x72, 0x69, 0x6e, 0x67, 0x12, 0x7f, 0x0a, 0x0a, 0x61, 0x70, 0x69, 0x5f, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x41, 0x70, 0x69, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x42, 0x48, 0xe2, 0xfc, 0xe3, 0xc4, 0x01, 0x42, 0x12, 0x40, 0x49, 0x66, 0x20, 0x77, 0x65, 0x20, + 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x70, 0x69, 0x20, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x20, 0x77, 0x65, 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x20, 0x74, 0x68, + 0x69, 0x73, 0x20, 0x69, 0x6e, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x6c, 0x6f, 0x62, + 0x61, 0x6c, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x52, 0x09, 0x61, 0x70, 0x69, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x8f, 0x01, 0x0a, 0x08, 0x61, 0x75, 0x74, 0x6f, 0x65, 0x78, + 0x65, 0x63, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, + 0x5c, 0xe2, 0xfc, 0xe3, 0xc4, 0x01, 0x56, 0x12, 0x54, 0x49, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, + 0x20, 0x69, 0x73, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x77, 0x65, + 0x20, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x69, 0x6e, 0x61, + 0x72, 0x79, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x69, 0x76, 0x65, + 0x6e, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x61, + 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x6c, 0x79, 0x2e, 0x52, 0x08, 0x61, + 0x75, 0x74, 0x6f, 0x65, 0x78, 0x65, 0x63, 0x12, 0x50, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2f, 0xe2, 0xfc, + 0xe3, 0xc4, 0x01, 0x29, 0x12, 0x27, 0x54, 0x79, 0x70, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x20, 0x28, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x2c, 0x20, 0x77, 0x69, 0x6e, + 0x64, 0x6f, 0x77, 0x73, 0x2c, 0x20, 0x64, 0x61, 0x72, 0x77, 0x69, 0x6e, 0x29, 0x52, 0x0a, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2b, 0x0a, 0x11, 0x6f, 0x62, 0x66, + 0x75, 0x73, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x20, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x2b, 0x0a, 0x08, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x73, 0x18, 0x21, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x52, 0x08, 0x64, 0x65, 0x66, 0x61, 0x75, + 0x6c, 0x74, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x61, 0x6e, 0x61, 0x6c, 0x79, 0x73, 0x69, 0x73, 0x5f, + 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x22, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x61, 0x6e, + 0x61, 0x6c, 0x79, 0x73, 0x69, 0x73, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x36, 0x0a, 0x0a, + 0x72, 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x23, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, + 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0a, 0x72, 0x65, 0x6d, 0x61, 0x70, 0x70, + 0x69, 0x6e, 0x67, 0x73, 0x12, 0x15, 0x0a, 0x06, 0x6f, 0x72, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x24, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x72, 0x67, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6f, + 0x72, 0x67, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x25, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, + 0x72, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x65, 0x62, 0x75, 0x67, 0x5f, + 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x29, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x64, 0x65, 0x62, 0x75, + 0x67, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x37, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x73, 0x18, 0x26, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x1a, + 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x18, 0x27, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x42, 0x34, 0x5a, 0x32, 0x77, 0x77, + 0x77, 0x2e, 0x76, 0x65, 0x6c, 0x6f, 0x63, 0x69, 0x64, 0x65, 0x78, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2f, 0x76, 0x65, 0x6c, 0x6f, 0x63, 0x69, 0x72, 0x61, 0x70, + 0x74, 0x6f, 0x72, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/config/proto/config.proto b/config/proto/config.proto index 33b16f4a1bf..13325e9f1d3 100644 --- a/config/proto/config.proto +++ b/config/proto/config.proto @@ -1059,6 +1059,10 @@ message Defaults { // actively cancel in flight notebook cell calculations. uint64 notebook_memory_high_water_mark = 37; + // Wait this long for a worker to become available before giving + // up. + int64 notebook_wait_time_for_worker_ms = 46; + // Set to -1 to disable local workers. The default is 5 local // workers. If you want the master to **not** perform any notebook // computations reduce this to -1 and set diff --git a/constants/constants.go b/constants/constants.go index 9ca93b3aed6..d539f293f99 100644 --- a/constants/constants.go +++ b/constants/constants.go @@ -1,19 +1,19 @@ /* - Velociraptor - Dig Deeper - Copyright (C) 2019-2024 Rapid7 Inc. +Velociraptor - Dig Deeper +Copyright (C) 2019-2024 Rapid7 Inc. - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published +by the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . */ package constants @@ -125,6 +125,18 @@ const ( // by the sqlite() plugin. SQLITE_ALWAYS_MAKE_TEMPFILE = "SQLITE_ALWAYS_MAKE_TEMPFILE" + // This variable in the scope can set a dict that maps columns to + // their types. For example + // LET ColumnTypes <= dict(Column1="preview_upload") + COLUMN_TYPES = "ColumnTypes" + + // Setting this in the scope causes times to be serialized in the + // specified timezone instead of UTC. NOTE: The GUI changes times + // to the timezone specified in the user preferences so this may + // not be immediately visible in the GUI but will affect the + // timezone actually serialized. + TZ = "TZ" + PinnedServerName = "VelociraptorServer" PinnedGwName = "GRPC_GW" diff --git a/datastore/memcache.go b/datastore/memcache.go index 243ca5bdb13..f7d4a9ad242 100644 --- a/datastore/memcache.go +++ b/datastore/memcache.go @@ -5,6 +5,7 @@ import ( "fmt" "os" "sort" + "strings" "sync" "time" @@ -16,6 +17,7 @@ import ( "google.golang.org/protobuf/proto" config_proto "www.velocidex.com/golang/velociraptor/config/proto" "www.velocidex.com/golang/velociraptor/file_store/api" + "www.velocidex.com/golang/velociraptor/file_store/path_specs" "www.velocidex.com/golang/velociraptor/utils" ) @@ -86,9 +88,9 @@ func (self *BulkData) Len() int { } // Stored in dir_cache - contains information about a directory. -// - List of children in the directory. -// - If the directory is too large we cache this information: Further -// listings will delegate to file based datastore. +// - List of children in the directory. +// - If the directory is too large we cache this information: Further +// listings will delegate to file based datastore. type DirectoryMetadata struct { mu sync.Mutex data map[string]api.DSPathSpec @@ -585,6 +587,20 @@ func (self *MemcacheDatastore) Clear() { self.dir_cache.Purge() } +func (self *MemcacheDatastore) GetForTests( + config_obj *config_proto.Config, + path string) ([]byte, error) { + components := []string{} + for _, s := range strings.Split(path, "/") { + if s != "" { + components = append(components, s) + } + } + + return self.GetBuffer(config_obj, + path_specs.NewUnsafeDatastorePath(components...)) +} + // Support RawDataStore interface func (self *MemcacheDatastore) GetBuffer( config_obj *config_proto.Config, diff --git a/docs/wix/velociraptor_amd64.xml b/docs/wix/velociraptor_amd64.xml index 11abaa32e50..f7430f1415f 100644 --- a/docs/wix/velociraptor_amd64.xml +++ b/docs/wix/velociraptor_amd64.xml @@ -114,6 +114,7 @@ diff --git a/docs/wix/velociraptor_x86.xml b/docs/wix/velociraptor_x86.xml index 3081263499a..e98ad299190 100755 --- a/docs/wix/velociraptor_x86.xml +++ b/docs/wix/velociraptor_x86.xml @@ -114,6 +114,7 @@ diff --git a/file_store/memory/memory.go b/file_store/memory/memory.go index d3021cc6682..30233d8fde0 100644 --- a/file_store/memory/memory.go +++ b/file_store/memory/memory.go @@ -367,6 +367,7 @@ func (self *MemoryFileStore) ListDirectory(root_path api.FSPathSpec) ([]api.File continue } + // The next level after root_path name := components[len(root_components)] // It is a directory if there are more components so we add a @@ -381,6 +382,8 @@ func (self *MemoryFileStore) ListDirectory(root_path api.FSPathSpec) ([]api.File // components = ["a", "b"] var new_child api.FileInfo if len(root_components)+1 == len(components) { + // Get the original extension so we can determine if it is + // a datastore path. base_name := path.Base(filename) // This is a datastore path - skip @@ -388,7 +391,7 @@ func (self *MemoryFileStore) ListDirectory(root_path api.FSPathSpec) ([]api.File continue } - name_type, name := api.GetFileStorePathTypeFromExtension(base_name) + name_type, _ := api.GetFileStorePathTypeFromExtension(base_name) child := root_path.AddUnsafeChild(name).SetType(name_type) new_child = &vtesting.MockFileInfo{ diff --git a/gui/velociraptor/src/components/flows/flow-notebook.jsx b/gui/velociraptor/src/components/flows/flow-notebook.jsx index 4f89d10f701..d6efedd3241 100644 --- a/gui/velociraptor/src/components/flows/flow-notebook.jsx +++ b/gui/velociraptor/src/components/flows/flow-notebook.jsx @@ -64,7 +64,7 @@ export default class FlowNotebook extends React.Component { this.setState({loading: true}); api.get("v1/GetNotebooks", { notebook_id: notebook_id, - include_uploads: true, + include_uploads: false, }, this.source.token).then(response=>{ if (response.cancel) return; diff --git a/gui/velociraptor/src/components/flows/flows-list.jsx b/gui/velociraptor/src/components/flows/flows-list.jsx index 2736d35729d..8fa6eeaf46d 100644 --- a/gui/velociraptor/src/components/flows/flows-list.jsx +++ b/gui/velociraptor/src/components/flows/flows-list.jsx @@ -12,7 +12,6 @@ import Button from 'react-bootstrap/Button'; import api from '../core/api-service.jsx'; import { formatColumns } from "../core/table.jsx"; -import NotebookUploads from '../notebooks/notebook-uploads.jsx'; import NewCollectionWizard from './new-collection.jsx'; import OfflineCollectorWizard from './offline-collector.jsx'; @@ -434,12 +433,6 @@ class FlowsList extends React.Component { onClose={(e) => this.setState({showDeleteNotebook: false})}/> } - { this.state.showNotebookUploadsDialog && - this.setState({showNotebookUploadsDialog: false})}/> - } - { this.state.showExportNotebook && {T("Delete Notebook")} - - - + + } } + {this.state.showNotebookUploadsDialog && + this.setState({ showNotebookUploadsDialog: false })} + /> + } +
{ this.state.currently_editing && selected && diff --git a/gui/velociraptor/src/components/notebooks/notebook-uploads.jsx b/gui/velociraptor/src/components/notebooks/notebook-uploads.jsx index a5e14dfd7a0..d69ca944db7 100644 --- a/gui/velociraptor/src/components/notebooks/notebook-uploads.jsx +++ b/gui/velociraptor/src/components/notebooks/notebook-uploads.jsx @@ -18,6 +18,7 @@ const POLL_TIME = 5000; export default class NotebookUploads extends Component { static propTypes = { notebook: PropTypes.object, + cell: PropTypes.object, closeDialog: PropTypes.func.isRequired, } @@ -75,16 +76,6 @@ export default class NotebookUploads extends Component { ; } - getDeleteLink = (cell, row) =>{ - var stats = row.stats || {}; - return ; - } - render() { let files = this.state.notebook && this.state.notebook.available_uploads && @@ -92,7 +83,6 @@ export default class NotebookUploads extends Component { files = files || []; let columns = formatColumns([ - {dataField: "name_", text: "", formatter: this.getDeleteLink}, {dataField: "name", text: T("Name"), sort: true, filtered: true, formatter: this.getDownloadLink}, {dataField: "size", text: T("Size")}, diff --git a/gui/velociraptor/src/components/notebooks/notebook.jsx b/gui/velociraptor/src/components/notebooks/notebook.jsx index 84e6013f228..8fc47cbd7ef 100644 --- a/gui/velociraptor/src/components/notebooks/notebook.jsx +++ b/gui/velociraptor/src/components/notebooks/notebook.jsx @@ -99,7 +99,7 @@ class Notebooks extends React.Component { api.get("v1/GetNotebooks", { notebook_id: notebook.notebook_id, - include_uploads: true, + include_uploads: false, }, this.source.token).then(response=>{ if (response.cancel) return; diff --git a/paths/notebooks.go b/paths/notebooks.go index 84007ad9e0a..1b1d7cdada9 100644 --- a/paths/notebooks.go +++ b/paths/notebooks.go @@ -21,14 +21,22 @@ func NotebookDir() api.DSPathSpec { return NOTEBOOK_ROOT } -// Where to store attachments? In the notebook path. +// Attachments are not the same as uploads - they are usually uploaded +// by pasting in the cell eg an image. We want the attachment to +// remain whenever the cell is updated to a new version. +// Example workflow: +// - User uploads an attachment into a cell +// - Cell is updated with a link to the attachment +// - User continues to edit the cell in newer versions but the link +// remains valid because the attachment is stored in the notebook +// and not the cell. func (self *NotebookPathManager) Attachment(name string) api.FSPathSpec { - return self.root.AddUnsafeChild(self.notebook_id, "uploads", "attach/"+name). + return self.root.AddUnsafeChild(self.notebook_id, "attach", name). AsFilestorePath().SetType(api.PATH_TYPE_FILESTORE_ANY) } func (self *NotebookPathManager) AttachmentDirectory() api.FSPathSpec { - return self.root.AddChild(self.notebook_id, "uploads"). + return self.root.AddChild(self.notebook_id, "attach"). AsFilestorePath().SetType(api.PATH_TYPE_FILESTORE_ANY) } @@ -67,10 +75,13 @@ func (self *NotebookPathManager) DSDirectory() api.DSPathSpec { return self.root.AddChild(self.notebook_id) } -func (self *NotebookPathManager) HtmlExport() api.FSPathSpec { - return DOWNLOADS_ROOT.AddChild("notebooks", self.notebook_id, - fmt.Sprintf("%s-%s", self.notebook_id, - self.Clock.Now().UTC().Format("20060102150405Z"))). +func (self *NotebookPathManager) HtmlExport(prefered_name string) api.FSPathSpec { + if prefered_name == "" { + prefered_name = fmt.Sprintf("%s-%s", self.notebook_id, + self.Clock.Now().UTC().Format("20060102150405Z")) + } + return DOWNLOADS_ROOT.AddChild( + "notebooks", self.notebook_id, prefered_name). SetType(api.PATH_TYPE_FILESTORE_DOWNLOAD_REPORT) } @@ -201,16 +212,15 @@ func (self *NotebookCellPathManager) QueryStorage(id int64) *NotebookCellQuery { // Uploads are stored at the network level. func (self *NotebookCellPathManager) UploadsDir() api.FSPathSpec { return self.root.AsFilestorePath(). - AddUnsafeChild(self.notebook_id, "uploads"). + AddUnsafeChild(self.notebook_id, self.cell_id, "uploads"). SetType(api.PATH_TYPE_FILESTORE_ANY) } func (self *NotebookCellPathManager) GetUploadsFile(filename string) api.FSPathSpec { - // Cell id and filename are combined so we can read all - // attachments in a single ListDir + // Uploads exist inside each cell so when cells are reaped we + // remove the uploads. return self.root.AsFilestorePath(). - AddUnsafeChild(self.notebook_id, - "uploads", fmt.Sprintf("%s/%s", self.cell_id, filename)). + AddUnsafeChild(self.notebook_id, self.cell_id, "uploads", filename). SetType(api.PATH_TYPE_FILESTORE_ANY) } diff --git a/paths/notebooks_test.go b/paths/notebooks_test.go index dcf7a91e24f..f9fcaefe73c 100644 --- a/paths/notebooks_test.go +++ b/paths/notebooks_test.go @@ -15,12 +15,12 @@ func (self *PathManagerTestSuite) TestNotebookPathManager() { assert.Equal(self.T(), "/ds/notebooks/N.123.json.db", self.getDatastorePath(manager.Path())) - assert.Equal(self.T(), "/fs/notebooks/N.123/uploads/attach%2FNA.123%2Fimage.png", + assert.Equal(self.T(), "/fs/notebooks/N.123/attach/NA.123%2Fimage.png", self.getFilestorePath(manager.Attachment("NA.123/image.png"))) // Exports are available in the (authenticated) downloads directory. assert.Equal(self.T(), "/fs/downloads/notebooks/N.123/N.123-20010909014640Z.html", - self.getFilestorePath(manager.HtmlExport())) + self.getFilestorePath(manager.HtmlExport(""))) assert.Equal(self.T(), "/fs/downloads/notebooks/N.123/N.123-20010909014640Z.zip", self.getFilestorePath(manager.ZipExport())) diff --git a/reporting/gui.go b/reporting/gui.go index 191bf20645e..fa098115fb9 100644 --- a/reporting/gui.go +++ b/reporting/gui.go @@ -26,6 +26,7 @@ import ( actions_proto "www.velocidex.com/golang/velociraptor/actions/proto" artifacts_proto "www.velocidex.com/golang/velociraptor/artifacts/proto" config_proto "www.velocidex.com/golang/velociraptor/config/proto" + "www.velocidex.com/golang/velociraptor/constants" "www.velocidex.com/golang/velociraptor/file_store" "www.velocidex.com/golang/velociraptor/json" "www.velocidex.com/golang/velociraptor/paths" @@ -56,7 +57,7 @@ type GuiTemplateEngine struct { *BaseTemplateEngine tmpl *template.Template ctx context.Context - log_writer *notebooCellLogger + log_writer *notebookCellLogger path_manager *paths.NotebookCellPathManager Data map[string]*actions_proto.VQLResponse Progress utils.ProgressReporter @@ -92,7 +93,7 @@ func parseOptions(values []interface{}) (*ordereddict.Dict, []interface{}) { // When rendering a table the user can introduce options into the // scope. func (self *GuiTemplateEngine) getTableOptions() (*ordereddict.Dict, error) { - column_types, pres := self.Scope.Resolve("ColumnTypes") + column_types, pres := self.Scope.Resolve(constants.COLUMN_TYPES) if !pres { return nil, errors.New("Not found") } @@ -547,6 +548,7 @@ func (self *GuiTemplateEngine) MoreMessages() bool { func (self *GuiTemplateEngine) Close() { if self.log_writer != nil { self.log_writer.Flush() + self.log_writer.Close() } self.BaseTemplateEngine.Close() } diff --git a/reporting/logging.go b/reporting/logging.go index 84186201fec..c4183cd234e 100644 --- a/reporting/logging.go +++ b/reporting/logging.go @@ -2,7 +2,6 @@ package reporting import ( "sync" - "time" "github.com/Velocidex/ordereddict" config_proto "www.velocidex.com/golang/velociraptor/config/proto" @@ -14,7 +13,7 @@ import ( "www.velocidex.com/golang/velociraptor/utils" ) -type notebooCellLogger struct { +type notebookCellLogger struct { mu sync.Mutex messages []string @@ -26,7 +25,7 @@ type notebooCellLogger struct { func newNotebookCellLogger( config_obj *config_proto.Config, log_path api.FSPathSpec) ( - *notebooCellLogger, error) { + *notebookCellLogger, error) { file_store_factory := file_store.GetFileStore(config_obj) // Create a new result set to write the logs @@ -37,15 +36,15 @@ func newNotebookCellLogger( return nil, err } - return ¬ebooCellLogger{ + return ¬ebookCellLogger{ rs_writer: rs_writer, }, nil } -func (self *notebooCellLogger) Write(b []byte) (int, error) { +func (self *notebookCellLogger) Write(b []byte) (int, error) { level, msg := logging.SplitIntoLevelAndLog(b) self.rs_writer.Write(ordereddict.NewDict(). - Set("Timestamp", time.Now().UTC().UnixNano()/1000). + Set("Timestamp", utils.GetTime().Now().UTC().UnixNano()/1000). Set("Level", level). Set("message", msg)) @@ -74,7 +73,7 @@ func (self *notebooCellLogger) Write(b []byte) (int, error) { return len(b), nil } -func (self *notebooCellLogger) Messages() []string { +func (self *notebookCellLogger) Messages() []string { self.mu.Lock() defer self.mu.Unlock() @@ -82,13 +81,17 @@ func (self *notebooCellLogger) Messages() []string { } // Are there additional messages? -func (self *notebooCellLogger) MoreMessages() bool { +func (self *notebookCellLogger) MoreMessages() bool { self.mu.Lock() defer self.mu.Unlock() return self.more_messages } -func (self *notebooCellLogger) Flush() { +func (self *notebookCellLogger) Flush() { self.rs_writer.Flush() } + +func (self *notebookCellLogger) Close() { + self.rs_writer.Close() +} diff --git a/reporting/paths.go b/reporting/paths.go index 76c030a415d..dc1b3033323 100644 --- a/reporting/paths.go +++ b/reporting/paths.go @@ -14,13 +14,8 @@ func (self *NotebookExportPathManager) CellMetadata( return self.root.Append(self.notebook_id, cell_id+".db") } -func (self *NotebookExportPathManager) UploadRoot() *accessors.OSPath { - return self.root.Append(self.notebook_id, "files") -} - -func (self *NotebookExportPathManager) CellUploadRoot( - cell_id string) *accessors.OSPath { - return self.root.Append(self.notebook_id, cell_id, "uploads") +func (self *NotebookExportPathManager) AttachmentRoot() *accessors.OSPath { + return self.root.Append(self.notebook_id, "attach") } func (self *NotebookExportPathManager) CellDirectory( diff --git a/services/notebook.go b/services/notebook.go index 03717d51f32..35e9543058d 100644 --- a/services/notebook.go +++ b/services/notebook.go @@ -7,6 +7,11 @@ import ( config_proto "www.velocidex.com/golang/velociraptor/config/proto" ) +const ( + DO_NOT_INCLUDE_UPLOADS = false + INCLUDE_UPLOADS = true +) + func GetNotebookManager(config_obj *config_proto.Config) (NotebookManager, error) { org_manager, err := GetOrgManager() if err != nil { diff --git a/services/notebook/calculate.go b/services/notebook/calculate.go index a33f622e0b1..6750a673c34 100644 --- a/services/notebook/calculate.go +++ b/services/notebook/calculate.go @@ -54,6 +54,15 @@ func (self *NotebookManager) UpdateNotebookCell( if err != nil { return nil, err } + + // Preserve the cell type + if in.Type == "" { + in.Type = cell_metadata.Type + } + } + + if in.Type == "" { + in.Type = "markdown" } // Write the cell record as calculating while we attempt to @@ -70,6 +79,16 @@ func (self *NotebookManager) UpdateNotebookCell( AvailableVersions: in.AvailableVersions, } + // If the output field is specified, we just set it as is without + // actually calculating it. + if in.Output != "" { + notebook_cell.Calculating = false + notebook_cell.CurrentlyEditing = false + notebook_cell.Output = in.Output + return notebook_cell, self.Store.SetNotebookCell( + notebook_metadata.NotebookId, notebook_cell) + } + err := self.Store.SetNotebookCell( notebook_metadata.NotebookId, notebook_cell) if err != nil { diff --git a/services/notebook/downloads.go b/services/notebook/downloads.go index 5f371745351..24157737ce2 100644 --- a/services/notebook/downloads.go +++ b/services/notebook/downloads.go @@ -3,13 +3,14 @@ package notebook import ( "context" "errors" - "strings" + "os" "time" api_proto "www.velocidex.com/golang/velociraptor/api/proto" "www.velocidex.com/golang/velociraptor/datastore" "www.velocidex.com/golang/velociraptor/file_store" "www.velocidex.com/golang/velociraptor/file_store/api" + "www.velocidex.com/golang/velociraptor/file_store/path_specs" "www.velocidex.com/golang/velociraptor/paths" "www.velocidex.com/golang/velociraptor/reporting" ) @@ -35,7 +36,7 @@ func (self *NotebookStoreImpl) GetAvailableDownloadFiles( notebook_id string) (*api_proto.AvailableDownloads, error) { download_path := paths.NewNotebookPathManager(notebook_id). - HtmlExport().Dir() + HtmlExport("X").Dir() return reporting.GetAvailableDownloadFiles(self.config_obj, download_path) } @@ -46,30 +47,37 @@ func (self *NotebookStoreImpl) GetAvailableUploadFiles(notebook_id string) ( notebook_path_manager := paths.NewNotebookPathManager(notebook_id) file_store_factory := file_store.GetFileStore(self.config_obj) - files, err := file_store_factory.ListDirectory( - notebook_path_manager.AttachmentDirectory()) + + notebook, err := self.GetNotebook(notebook_id) if err != nil { return nil, err } - - for _, item := range files { - ps := item.PathSpec() - parts := strings.SplitN(ps.Base(), "/", 2) - if len(parts) < 2 { - continue + for _, cell_metadata := range notebook.CellMetadata { + cell_manager := notebook_path_manager.Cell( + cell_metadata.CellId, cell_metadata.CurrentVersion) + + err := api.Walk(file_store_factory, cell_manager.UploadsDir(), + func(ps api.FSPathSpec, info os.FileInfo) error { + stat, err := file_store_factory.StatFile(ps) + if err != nil { + return nil + } + + result.Files = append(result.Files, &api_proto.AvailableDownloadFile{ + Name: ps.Base(), + Size: uint64(stat.Size()), + Date: stat.ModTime().UTC().Format(time.RFC3339), + Type: api.GetExtensionForFilestore(ps), + Stats: &api_proto.ContainerStats{ + Components: ps.Components(), + }, + }) + return nil + }) + if err != nil { + return nil, err } - - result.Files = append(result.Files, &api_proto.AvailableDownloadFile{ - Name: parts[1], - Size: uint64(item.Size()), - Date: item.ModTime().UTC().Format(time.RFC3339), - Type: api.GetExtensionForFilestore(ps), - Stats: &api_proto.ContainerStats{ - Components: ps.Components(), - }, - }) } - return result, nil } @@ -86,8 +94,12 @@ func (self *NotebookStoreImpl) RemoveAttachment(ctx context.Context, } notebook_path_manager := paths.NewNotebookPathManager(notebook_id) - attachment_path := notebook_path_manager.AttachmentDirectory(). - AddUnsafeChild(components[len(components)-1]) + attachment_path := path_specs.NewUnsafeFilestorePath(components...) + if !path_specs.IsSubPath( + notebook_path_manager.AttachmentDirectory(), + attachment_path) { + return errors.New("Attachment must be within the notebook directory") + } file_store_factory := file_store.GetFileStore(self.config_obj) return file_store_factory.Delete(attachment_path) diff --git a/services/notebook/initial.go b/services/notebook/initial.go index 2bbbce49cc5..abe41c12d25 100644 --- a/services/notebook/initial.go +++ b/services/notebook/initial.go @@ -77,6 +77,7 @@ func (self *NotebookManager) NewNotebookCell( // Create the new cell with fresh content. new_cell_request := &api_proto.NotebookCellRequest{ Input: in.Input, + Output: in.Output, NotebookId: in.NotebookId, CellId: notebook.LatestCellId, Version: new_version, diff --git a/services/notebook/notebook.go b/services/notebook/notebook.go index b5ca415fad4..6d80d16c647 100644 --- a/services/notebook/notebook.go +++ b/services/notebook/notebook.go @@ -18,6 +18,10 @@ import ( "www.velocidex.com/golang/vfilter/reformat" ) +var ( + invalidNotebookId = errors.New("Invalid notebook id") +) + type NotebookManager struct { config_obj *config_proto.Config Store NotebookStore @@ -27,6 +31,11 @@ func (self *NotebookManager) GetNotebook( ctx context.Context, notebook_id string, include_uploads bool) ( *api_proto.NotebookMetadata, error) { + err := verifyNotebookId(notebook_id) + if err != nil { + return nil, err + } + notebook, err := self.Store.GetNotebook(notebook_id) if err != nil { return nil, err @@ -79,6 +88,10 @@ func (self *NotebookManager) NewNotebook( func (self *NotebookManager) UpdateNotebook( ctx context.Context, in *api_proto.NotebookMetadata) error { + err := verifyNotebookId(in.NotebookId) + if err != nil { + return err + } in.ModifiedTime = utils.GetTime().Now().Unix() return self.Store.SetNotebook(in) @@ -87,6 +100,11 @@ func (self *NotebookManager) UpdateNotebook( func (self *NotebookManager) GetNotebookCell(ctx context.Context, notebook_id, cell_id, version string) (*api_proto.NotebookCell, error) { + err := verifyNotebookId(notebook_id) + if err != nil { + return nil, err + } + notebook_cell, err := self.Store.GetNotebookCell(notebook_id, cell_id, version) // Cell does not exist, make it a default cell. @@ -112,6 +130,11 @@ func (self *NotebookManager) GetNotebookCell(ctx context.Context, func (self *NotebookManager) CancelNotebookCell( ctx context.Context, notebook_id, cell_id, version string) error { + err := verifyNotebookId(notebook_id) + if err != nil { + return err + } + // Unset the calculating bit in the notebook in case the // renderer is not actually running (e.g. server restart). notebook_cell, err := self.Store.GetNotebookCell(notebook_id, cell_id, version) @@ -147,7 +170,12 @@ func (self *NotebookManager) UploadNotebookAttachment( return nil, err } - filename := NewNotebookAttachmentId() + in.Filename + err = verifyNotebookId(in.NotebookId) + if err != nil { + return nil, err + } + + filename := NewNotebookAttachmentId() + "-" + in.Filename full_path, err := self.Store.StoreAttachment( in.NotebookId, filename, decoded) @@ -158,7 +186,9 @@ func (self *NotebookManager) UploadNotebookAttachment( result := &api_proto.NotebookFileUploadResponse{ Url: full_path.AsClientPath() + "?org_id=" + url.QueryEscape(utils.NormalizedOrgId(self.config_obj.OrgId)), + Filename: filename, } + return result, nil } @@ -207,3 +237,10 @@ func (self *NotebookManager) ReformatVQL( return strings.Join(trimmed, "\n"), nil } + +func verifyNotebookId(notebook_id string) error { + if !strings.HasPrefix(notebook_id, "N.") { + return invalidNotebookId + } + return nil +} diff --git a/services/notebook/storage.go b/services/notebook/storage.go index bde96172d5c..cc2ed120d50 100644 --- a/services/notebook/storage.go +++ b/services/notebook/storage.go @@ -26,18 +26,23 @@ type NotebookStore interface { SetNotebook(in *api_proto.NotebookMetadata) error GetNotebook(notebook_id string) (*api_proto.NotebookMetadata, error) SetNotebookCell(notebook_id string, in *api_proto.NotebookCell) error - GetNotebookCell(notebook_id, cell_id, version string) (*api_proto.NotebookCell, error) + GetNotebookCell(notebook_id, cell_id, version string) ( + *api_proto.NotebookCell, error) // progress_chan receives information about deletion. It may be // nil if callers dont care about it. RemoveNotebookCell( ctx context.Context, config_obj *config_proto.Config, - notebook_id, cell_id, version string, progress_chan chan *ordereddict.Dict) error + notebook_id, cell_id, version string, + progress_chan chan *ordereddict.Dict) error - StoreAttachment(notebook_id, filename string, data []byte) (api.FSPathSpec, error) - RemoveAttachment(ctx context.Context, notebook_id string, components []string) error + StoreAttachment(notebook_id, + filename string, data []byte) (api.FSPathSpec, error) + RemoveAttachment(ctx context.Context, + notebook_id string, components []string) error - GetAvailableDownloadFiles(notebook_id string) (*api_proto.AvailableDownloads, error) + GetAvailableDownloadFiles(notebook_id string) ( + *api_proto.AvailableDownloads, error) GetAvailableTimelines(notebook_id string) []string GetAvailableUploadFiles(notebook_id string) ( *api_proto.AvailableDownloads, error) @@ -257,7 +262,8 @@ func (self *NotebookStoreImpl) GetNotebookCell( return notebook_cell, err } -func (self *NotebookStoreImpl) StoreAttachment(notebook_id, filename string, data []byte) (api.FSPathSpec, error) { +func (self *NotebookStoreImpl) StoreAttachment( + notebook_id, filename string, data []byte) (api.FSPathSpec, error) { full_path := paths.NewNotebookPathManager(notebook_id). Attachment(filename) file_store_factory := file_store.GetFileStore(self.config_obj) diff --git a/services/notebook/worker.go b/services/notebook/worker.go index d6c55bbfa31..e41765fdbce 100644 --- a/services/notebook/worker.go +++ b/services/notebook/worker.go @@ -100,6 +100,8 @@ func (self *NotebookWorker) ProcessUpdateRequest( notebook_path_manager.Cell(in.CellId, in.Version), "Server.Internal.ArtifactDescription") if err != nil { + logger.Debug("NotebookWorker: While evaluating template: %v", err) + return nil, err } defer tmpl.Close() @@ -359,6 +361,7 @@ func (self *NotebookWorker) Start( config_obj *config_proto.Config, name string, scheduler services.Scheduler) { + for { err := self.RegisterWorker(ctx, config_obj, name, scheduler) if err != nil { @@ -508,8 +511,8 @@ func (self *NotebookManager) Start( wg *sync.WaitGroup) error { // Only start this once for all orgs. Otherwise we would have as - // many workers as orgs. Orgs will switch into the correct org for - // processing + // many workers as orgs. Workers will switch into the correct org + // for processing if !utils.IsRootOrg(config_obj.OrgId) { return nil } diff --git a/services/scheduler/fixtures/TestNotebookMinionScheduler.golden b/services/scheduler/fixtures/TestNotebookMinionScheduler.golden index 64272046316..095bd3c55e9 100644 --- a/services/scheduler/fixtures/TestNotebookMinionScheduler.golden +++ b/services/scheduler/fixtures/TestNotebookMinionScheduler.golden @@ -7,7 +7,6 @@ "messages": [ "DEBUG:Query Stats: {\"RowsScanned\":1,\"PluginsCalled\":1,\"FunctionsCalled\":1,\"ProtocolSearch\":0,\"ScopeC ..." ], - "timestamp": 10, "type": "vql", "current_version": "XXX", "available_versions": [ diff --git a/services/scheduler/minion_test.go b/services/scheduler/minion_test.go index fda3692c4a5..b163aaa2cd2 100644 --- a/services/scheduler/minion_test.go +++ b/services/scheduler/minion_test.go @@ -41,6 +41,7 @@ func (self *MinionSchedulerTestSuite) SetupTest() { // Do not start local workers to force us to go through the remote // one. self.ConfigObj.Defaults.NotebookNumberOfLocalWorkers = -1 + self.ConfigObj.Defaults.NotebookWaitTimeForWorkerMs = -1 self.ConfigObj.API.BindPort = 8345 // Mock out cell ID generation for tests @@ -111,6 +112,7 @@ func (self *MinionSchedulerTestSuite) TestNotebookMinionScheduler() { }) assert.NoError(self.T(), err) + cell.Timestamp = 0 golden := ordereddict.NewDict(). Set("Updated Cell", cell) diff --git a/services/scheduler/scheduler.go b/services/scheduler/scheduler.go index 8a6dc2b3144..a2214b7444d 100644 --- a/services/scheduler/scheduler.go +++ b/services/scheduler/scheduler.go @@ -69,6 +69,8 @@ type Scheduler struct { mu sync.Mutex queues map[string][]*Worker + + config_obj *config_proto.Config } func (self *Scheduler) RegisterWorker( @@ -133,23 +135,52 @@ func (self *Scheduler) WriteProfile(ctx context.Context, func (self *Scheduler) Schedule(ctx context.Context, job services.SchedulerJob) (chan services.JobResponse, error) { + + var wait_time time.Duration + if self.config_obj.Defaults != nil { + config_wait_time := self.config_obj.Defaults.NotebookWaitTimeForWorkerMs + if config_wait_time > 0 { + wait_time = time.Millisecond * time.Duration(config_wait_time) + } else if config_wait_time == 0 { + wait_time = 10 * time.Second + } else if config_wait_time < 0 { + wait_time = 0 + } + } + for { // The following does not block so we can do it all under lock - self.mu.Lock() - var available_workers []*Worker - // Find a ready worker - workers, _ := self.queues[job.Queue] - for _, w := range workers { - if !w.IsBusy() { - available_workers = append(available_workers, w) + // Retry a few times to get a worker from the queue. + start := utils.GetTime().Now() + for { + self.mu.Lock() + + // Find a ready worker + workers, _ := self.queues[job.Queue] + for _, w := range workers { + if !w.IsBusy() { + available_workers = append(available_workers, w) + } + } + + // Yes we got some workers. + if len(available_workers) > 0 { + // Hold the lock on break + break } - } - if len(available_workers) == 0 { + // Do not wait with the lock held self.mu.Unlock() - return nil, fmt.Errorf("No workers available on queue %v!", job.Queue) + + // Give up after 10 seconds. + if utils.GetTime().Now().Sub(start) > wait_time { + return nil, fmt.Errorf("No workers available on queue %v!", job.Queue) + } + + // Try again soon + utils.GetTime().Sleep(100 * time.Millisecond) } result_chan := make(chan services.JobResponse) @@ -246,7 +277,8 @@ func StartSchedulerService( logger.Info("Starting Server Scheduler Service for %v", services.GetOrgName(config_obj)) scheduler := &Scheduler{ - queues: make(map[string][]*Worker), + queues: make(map[string][]*Worker), + config_obj: config_obj, } services.RegisterScheduler(scheduler) diff --git a/utils/errors.go b/utils/errors.go index 0b1e168f071..1ec0effcbc9 100644 --- a/utils/errors.go +++ b/utils/errors.go @@ -9,8 +9,9 @@ var ( // Error relayed when the error details are added inline. The GUI // API will strip this error as the details are included in the // response already. - InlineError = errors.New("InlineError") - TimeoutError = errors.New("Timeout") + InlineError = errors.New("InlineError") + TimeoutError = errors.New("Timeout") + InvalidStatus = errors.New("InvalidStatus") ) // This is a custom error type that wraps an inner error but does not diff --git a/vql/functions/time.go b/vql/functions/time.go index f3631a052a5..6743f6aa10c 100644 --- a/vql/functions/time.go +++ b/vql/functions/time.go @@ -12,6 +12,7 @@ import ( "github.com/Velocidex/ordereddict" "github.com/araddon/dateparse" + "www.velocidex.com/golang/velociraptor/constants" "www.velocidex.com/golang/velociraptor/third_party/cache" "www.velocidex.com/golang/velociraptor/utils" vql_subsystem "www.velocidex.com/golang/velociraptor/vql" @@ -79,7 +80,7 @@ func getTimezone(scope types.Scope) (*time.Location, string) { // Otherwise the user may have specified a global timezone (which // also affects output). - tz, pres = scope.Resolve("TZ") + tz, pres = scope.Resolve(constants.TZ) if pres { tz_str, ok := tz.(string) if ok { diff --git a/vql/json.go b/vql/json.go index eb7ac54bad3..0b9e5746e88 100644 --- a/vql/json.go +++ b/vql/json.go @@ -5,6 +5,7 @@ import ( "time" "github.com/Velocidex/json" + "www.velocidex.com/golang/velociraptor/constants" vjson "www.velocidex.com/golang/velociraptor/json" "www.velocidex.com/golang/vfilter" ) @@ -26,7 +27,7 @@ func EncOptsFromScope(scope vfilter.Scope) *json.EncOpts { // If the scope contains a TZ variable, then we will use that // instead. - location_name, pres := scope.Resolve("TZ") + location_name, pres := scope.Resolve(constants.TZ) if pres { location_str, ok := location_name.(string) if ok { diff --git a/vql/server/notebooks/create.go b/vql/server/notebooks/create.go new file mode 100644 index 00000000000..3d295f469cd --- /dev/null +++ b/vql/server/notebooks/create.go @@ -0,0 +1,100 @@ +package notebooks + +import ( + "context" + + "github.com/Velocidex/ordereddict" + "www.velocidex.com/golang/velociraptor/acls" + api_proto "www.velocidex.com/golang/velociraptor/api/proto" + "www.velocidex.com/golang/velociraptor/services" + "www.velocidex.com/golang/velociraptor/vql" + vql_subsystem "www.velocidex.com/golang/velociraptor/vql" + "www.velocidex.com/golang/vfilter" + "www.velocidex.com/golang/vfilter/arg_parser" +) + +type CreateNotebookFunctionArg struct { + Name string `vfilter:"optional,field=name,doc=The name of the notebook"` + Description string `vfilter:"optional,field=description,doc=The description of the notebook"` + Collaborators []string `vfilter:"optional,field=collaborators,doc=A list of users to share the notebook with."` + Public bool `vfilter:"optional,field=public,doc=If set the notebook will be public."` + Artifacts []string `vfilter:"optional,field=artifacts,doc=A list of NOTEBOOK artifacts to create the notebook with (Notebooks.Default)"` + Env *ordereddict.Dict `vfilter:"optional,field=env,doc=An environment to initialize the notebook with"` +} + +type CreateNotebookFunction struct{} + +func (self *CreateNotebookFunction) Call(ctx context.Context, + scope vfilter.Scope, + args *ordereddict.Dict) vfilter.Any { + + err := vql_subsystem.CheckAccess(scope, acls.COLLECT_SERVER) + if err != nil { + scope.Log("notebook_create: %v", err) + return vfilter.Null{} + } + + arg := &CreateNotebookFunctionArg{} + err = arg_parser.ExtractArgsWithContext(ctx, scope, args, arg) + if err != nil { + scope.Log("notebook_create: %v", err) + return vfilter.Null{} + } + + principal := vql_subsystem.GetPrincipal(scope) + new_notebook := &api_proto.NotebookMetadata{ + Name: arg.Name, + Description: arg.Description, + Creator: principal, + Collaborators: arg.Collaborators, + Artifacts: arg.Artifacts, + Public: arg.Public, + } + + config_obj, pres := vql_subsystem.GetServerConfig(scope) + if !pres { + scope.Log("notebook_create: must be running on the server") + return vfilter.Null{} + } + + notebook_manager, err := services.GetNotebookManager(config_obj) + if err != nil { + scope.Log("notebook_create: %v", err) + return vfilter.Null{} + } + + new_notebook, err = notebook_manager.NewNotebook(ctx, + principal, new_notebook) + if err != nil { + scope.Log("notebook_create: %v", err) + return vfilter.Null{} + } + + services.LogAudit(ctx, + config_obj, principal, "CreateNotebook", + ordereddict.NewDict(). + Set("notebook_id", new_notebook.NotebookId). + Set("details", vfilter.RowToDict(ctx, scope, arg))) + + err = fillNotebookCells(ctx, config_obj, new_notebook) + if err != nil { + scope.Log("notebook_create: %v", err) + return vfilter.Null{} + } + + return new_notebook +} + +func (self CreateNotebookFunction) Info(scope vfilter.Scope, type_map *vfilter.TypeMap) *vfilter.FunctionInfo { + return &vfilter.FunctionInfo{ + Name: "notebook_create", + Doc: "Create a new notebook.", + ArgType: type_map.AddType(scope, &CreateNotebookFunctionArg{}), + Metadata: vql.VQLMetadata().Permissions( + acls.COLLECT_SERVER).Build(), + } +} + +func init() { + vql_subsystem.RegisterFunction(&CreateNotebookFunction{}) +} diff --git a/vql/server/notebooks/download.go b/vql/server/notebooks/download.go index b2e62cc1649..9f91ac1b2bc 100644 --- a/vql/server/notebooks/download.go +++ b/vql/server/notebooks/download.go @@ -7,8 +7,6 @@ import ( "github.com/Velocidex/ordereddict" "www.velocidex.com/golang/velociraptor/acls" "www.velocidex.com/golang/velociraptor/file_store" - "www.velocidex.com/golang/velociraptor/paths" - "www.velocidex.com/golang/velociraptor/reporting" "www.velocidex.com/golang/velociraptor/vql" vql_subsystem "www.velocidex.com/golang/velociraptor/vql" "www.velocidex.com/golang/vfilter" @@ -17,6 +15,7 @@ import ( type CreateNotebookDownloadArgs struct { NotebookId string `vfilter:"required,field=notebook_id,doc=Notebook ID to export."` + Filename string `vfilter:"optional,field=filename,doc=The name of the export. If not set this will be named according to the notebook id and timestamp"` } type CreateNotebookDownload struct{} @@ -44,10 +43,10 @@ func (self *CreateNotebookDownload) Call(ctx context.Context, return vfilter.Null{} } - notebook_path_manager := paths.NewNotebookPathManager(arg.NotebookId) wg := &sync.WaitGroup{} - - err = reporting.ExportNotebookToZip(ctx, config_obj, wg, notebook_path_manager) + principal := vql_subsystem.GetPrincipal(scope) + path, err := ExportNotebookToZip(ctx, + config_obj, wg, arg.NotebookId, principal, arg.Filename) if err != nil { scope.Log("create_notebook_download: %s", err) return vfilter.Null{} @@ -57,7 +56,7 @@ func (self *CreateNotebookDownload) Call(ctx context.Context, wg.Wait() file_store.FlushFilestore(config_obj) - return notebook_path_manager.ZipExport() + return path } func (self CreateNotebookDownload) Info(scope vfilter.Scope, type_map *vfilter.TypeMap) *vfilter.FunctionInfo { diff --git a/reporting/notebooks.go b/vql/server/notebooks/export.go similarity index 54% rename from reporting/notebooks.go rename to vql/server/notebooks/export.go index 32aa7b7c19c..4c9ab96eb86 100644 --- a/reporting/notebooks.go +++ b/vql/server/notebooks/export.go @@ -1,12 +1,13 @@ -package reporting +package notebooks import ( "bytes" "context" + "crypto/sha256" "encoding/base64" + "encoding/hex" "fmt" "html" - "io" "io/ioutil" "net/url" "os" @@ -14,29 +15,126 @@ import ( "sync" "time" + "github.com/Velocidex/ordereddict" "github.com/Velocidex/yaml/v2" "github.com/go-errors/errors" "www.velocidex.com/golang/velociraptor/accessors" + "www.velocidex.com/golang/velociraptor/acls" actions_proto "www.velocidex.com/golang/velociraptor/actions/proto" api_proto "www.velocidex.com/golang/velociraptor/api/proto" config_proto "www.velocidex.com/golang/velociraptor/config/proto" "www.velocidex.com/golang/velociraptor/datastore" "www.velocidex.com/golang/velociraptor/file_store" "www.velocidex.com/golang/velociraptor/file_store/api" + "www.velocidex.com/golang/velociraptor/file_store/path_specs" "www.velocidex.com/golang/velociraptor/json" "www.velocidex.com/golang/velociraptor/logging" "www.velocidex.com/golang/velociraptor/paths" + "www.velocidex.com/golang/velociraptor/reporting" "www.velocidex.com/golang/velociraptor/result_sets" + "www.velocidex.com/golang/velociraptor/services" "www.velocidex.com/golang/velociraptor/utils" + "www.velocidex.com/golang/velociraptor/vql" + vql_subsystem "www.velocidex.com/golang/velociraptor/vql" + "www.velocidex.com/golang/vfilter" + "www.velocidex.com/golang/vfilter/arg_parser" ) +var () + +type ExportNotebookArg struct { + NotebookId string `vfilter:"required,field=notebook_id,doc=The id of the notebook to export"` + Filename string `vfilter:"optional,field=filename,doc=The name of the export. If not set this will be named according to the notebook id and timestamp"` + Type string `vfilter:"optional,field=type,doc=Set the type of the export (html or zip)."` +} + +type ExportNotebookFunction struct{} + +func (self ExportNotebookFunction) Call(ctx context.Context, + scope vfilter.Scope, + args *ordereddict.Dict) vfilter.Any { + + arg := &ExportNotebookArg{} + err := arg_parser.ExtractArgsWithContext(ctx, scope, args, arg) + if err != nil { + scope.Log("notebook_export: %v", err) + return vfilter.Null{} + } + + err = vql_subsystem.CheckAccess(scope, acls.PREPARE_RESULTS) + if err != nil { + scope.Log("notebook_export: %v", err) + return vfilter.Null{} + } + + config_obj, ok := vql_subsystem.GetServerConfig(scope) + if !ok { + scope.Log("notebook_export: Command can only run on the server") + return vfilter.Null{} + } + + wg := &sync.WaitGroup{} + defer func() { + // Wait here until the export is done. + wg.Wait() + + // Make sure the data is flushed to disk so the VQL can get + // it. + file_store.FlushFilestore(config_obj) + }() + + principal := vql_subsystem.GetPrincipal(scope) + + switch arg.Type { + case "", "zip": + result, err := ExportNotebookToZip(ctx, + config_obj, wg, arg.NotebookId, + principal, arg.Filename) + if err != nil { + scope.Log("notebook_export: %v", err) + return vfilter.Null{} + } + return result + + case "html": + result, err := ExportNotebookToHTML( + config_obj, wg, arg.NotebookId, + principal, arg.Filename) + if err != nil { + scope.Log("notebook_export: %v", err) + return vfilter.Null{} + } + return result + + default: + scope.Log("notebook_export: unsupported export type %v", arg.Type) + return vfilter.Null{} + } +} + +func (self ExportNotebookFunction) Info(scope vfilter.Scope, type_map *vfilter.TypeMap) *vfilter.FunctionInfo { + return &vfilter.FunctionInfo{ + Name: "notebook_export", + Doc: "Exports a notebook to a zip file or HTML.", + ArgType: type_map.AddType(scope, &ExportNotebookArg{}), + Metadata: vql.VQLMetadata().Permissions(acls.PREPARE_RESULTS).Build(), + } +} + +func init() { + vql_subsystem.RegisterFunction(&ExportNotebookFunction{}) +} + var ( // Must match the output emitted by GuiTemplateEngine.Table csvViewerRegexp = regexp.MustCompile( ``) imageRegex = regexp.MustCompile( - `N.[^/]+)/(?PNA.[^.]+.png)\" (?P[^>]*)>`) + `[^>]*)>`) + + hrefRegex = regexp.MustCompile( + `[^>]*)>(?P[^<]+)`) ) const ( @@ -53,6 +151,32 @@ const ( + + +