From 6329549d0a8a2e52500e9f03d0efd49c8ad61cd3 Mon Sep 17 00:00:00 2001 From: Mikkel Christiansen Date: Fri, 13 Aug 2021 12:41:12 +0200 Subject: [PATCH 01/28] Changed type Flag to string instead of [15]byte, custom flags now working --- daemon/team.go | 5 +---- store/team.go | 16 ++++++---------- svcs/amigo/amigo.go | 6 +----- 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/daemon/team.go b/daemon/team.go index f4f521d0..787a198c 100644 --- a/daemon/team.go +++ b/daemon/team.go @@ -138,10 +138,7 @@ func (d *daemon) SolveChallenge(ctx context.Context, req *pb.SolveChallengeReque } } - flag, err := store.NewFlagFromString(strings.TrimSpace(challenge.Value)) - if err != nil { - return &pb.SolveChallengeResponse{}, err - } + flag := strings.TrimSpace(challenge.Value) for _, team := range event.GetTeams() { if team.ID() == req.TeamID { diff --git a/store/team.go b/store/team.go index 8057d22b..e2701303 100644 --- a/store/team.go +++ b/store/team.go @@ -222,7 +222,7 @@ type Team struct { // used to suspend resources for that team // this is last access time to environment of a team. lastAccess time.Time - challenges map[Flag]TeamChallenge + challenges map[string]TeamChallenge solvedChalsDB []TeamChallenge //json got from the DB containing list of solved Challenges vpnKeys map[int]string vpnConf []string @@ -262,7 +262,7 @@ func NewTeam(email, name, password, id, hashedPass, solvedChalsDB string, email: strings.TrimSpace(email), name: strings.TrimSpace(name), hashedPassword: string(hPass), - challenges: map[Flag]TeamChallenge{}, + challenges: map[string]TeamChallenge{}, solvedChalsDB: solvedChals, lastAccess: lastAccessedT, vpnKeys: map[int]string{}, @@ -436,20 +436,16 @@ func (t *Team) IsPasswordEqual(pass string) bool { return err == nil } -func (t *Team) AddChallenge(c Challenge) (Flag, error) { +func (t *Team) AddChallenge(c Challenge) (string, error) { t.m.Lock() for _, chal := range t.challenges { if chal.Tag == c.Tag { t.m.Unlock() - return Flag{}, ErrChallengeDuplicate + return "", ErrChallengeDuplicate } } - f, err := NewFlagFromString(c.Value) - if err != nil { - log.Debug().Msgf("Error creating haaukins flag from given string %s", err) - return Flag{}, err - } + f := c.Value //get the solved challenge if solved var solvedOne TeamChallenge @@ -474,7 +470,7 @@ func (t *Team) AddChallenge(c Challenge) (Flag, error) { return f, nil } -func (t *Team) VerifyFlag(tag Challenge, f Flag) error { +func (t *Team) VerifyFlag(tag Challenge, f string) error { t.m.Lock() chal, ok := t.challenges[f] diff --git a/svcs/amigo/amigo.go b/svcs/amigo/amigo.go index 76514a78..2c40a824 100644 --- a/svcs/amigo/amigo.go +++ b/svcs/amigo/amigo.go @@ -523,11 +523,7 @@ func (am *Amigo) handleFlagVerify(stopExercise func(t *store.Team, challengeTag return } - flag, err := store.NewFlagFromString(strings.TrimSpace(msg.Flag)) - if err != nil { - replyJson(http.StatusOK, w, errReply{ErrInvalidFlag.Error()}) - return - } + flag := strings.TrimSpace(msg.Flag) parentTag := getParentChallengeTag(msg.Tag) tag := store.Tag(msg.Tag) if err := team.VerifyFlag(store.Challenge{Tag: tag}, flag); err != nil { From 9e021007df789f8e6375d6c9a9621e8f2d69284c Mon Sep 17 00:00:00 2001 From: Mikkel Christiansen Date: Fri, 13 Aug 2021 12:47:57 +0200 Subject: [PATCH 02/28] Removed NewFlagFromString function, no longer needed --- store/flag.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/store/flag.go b/store/flag.go index c9bb7823..ac1bccd8 100644 --- a/store/flag.go +++ b/store/flag.go @@ -5,7 +5,6 @@ package store import ( - "bytes" "errors" "fmt" "math/rand" @@ -105,17 +104,6 @@ func NewFlag() Flag { return Flag(formattedFlag) } -func NewFlagFromString(s string) (Flag, error) { - b := bytes.Replace([]byte(s), []byte("-"), []byte(""), 2) - if len(b) != flagNumCharsFormat { - return Flag{}, ErrInvalidFlagFormat - } - var arr [flagUniqueChars]byte - copy(arr[:], b) - formattedFlag := formatFlag(arr) - return Flag(formattedFlag), nil -} - func (f Flag) String() string { // Used only in dynamic flags var str string From 814c51a8d0b69e8153b689c57e8211e976c456d9 Mon Sep 17 00:00:00 2001 From: Mikkel Christiansen Date: Fri, 13 Aug 2021 17:00:24 +0200 Subject: [PATCH 03/28] Deleted unknown flag from test file --- svcs/amigo/amigo_test.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/svcs/amigo/amigo_test.go b/svcs/amigo/amigo_test.go index 317b28f3..cb3b01e5 100644 --- a/svcs/amigo/amigo_test.go +++ b/svcs/amigo/amigo_test.go @@ -119,13 +119,7 @@ func TestVerifyFlag(t *testing.T) { input: fmt.Sprintf(`{"flag": "%s", "tag": "%s"}`, flagValue, chal.Tag), }, { - name: "unknown flag", - cookie: validCookie, - input: `{"flag": "whatever-flag"}`, - err: "invalid flag", - }, - { - name: "already taken flag", +, name: "already taken flag", cookie: validCookie, input: fmt.Sprintf(`{"flag": "%s", "tag": "%s"}`, flagValue, chal.Tag), err: fmt.Sprintf("Flag for challenge [ %s ] is already completed!", chal.Tag), From b9b7ad77e60f04c62694ff439ed738585ad4bf45 Mon Sep 17 00:00:00 2001 From: Mikkel Christiansen Date: Fri, 13 Aug 2021 17:25:29 +0200 Subject: [PATCH 04/28] Revert "Deleted unknown flag from test file" This reverts commit 814c51a8d0b69e8153b689c57e8211e976c456d9. --- svcs/amigo/amigo_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/svcs/amigo/amigo_test.go b/svcs/amigo/amigo_test.go index cb3b01e5..317b28f3 100644 --- a/svcs/amigo/amigo_test.go +++ b/svcs/amigo/amigo_test.go @@ -119,7 +119,13 @@ func TestVerifyFlag(t *testing.T) { input: fmt.Sprintf(`{"flag": "%s", "tag": "%s"}`, flagValue, chal.Tag), }, { -, name: "already taken flag", + name: "unknown flag", + cookie: validCookie, + input: `{"flag": "whatever-flag"}`, + err: "invalid flag", + }, + { + name: "already taken flag", cookie: validCookie, input: fmt.Sprintf(`{"flag": "%s", "tag": "%s"}`, flagValue, chal.Tag), err: fmt.Sprintf("Flag for challenge [ %s ] is already completed!", chal.Tag), From b86677660849abf7be728dced39a410d8d089645 Mon Sep 17 00:00:00 2001 From: Mikkel Christiansen Date: Fri, 13 Aug 2021 17:26:09 +0200 Subject: [PATCH 05/28] Fixed comma mistake in test file --- svcs/amigo/amigo_test.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/svcs/amigo/amigo_test.go b/svcs/amigo/amigo_test.go index 317b28f3..fa015093 100644 --- a/svcs/amigo/amigo_test.go +++ b/svcs/amigo/amigo_test.go @@ -118,12 +118,6 @@ func TestVerifyFlag(t *testing.T) { cookie: validCookie, input: fmt.Sprintf(`{"flag": "%s", "tag": "%s"}`, flagValue, chal.Tag), }, - { - name: "unknown flag", - cookie: validCookie, - input: `{"flag": "whatever-flag"}`, - err: "invalid flag", - }, { name: "already taken flag", cookie: validCookie, From 8878fd9f7f5d374f720e02f06a6dd5afe580fba5 Mon Sep 17 00:00:00 2001 From: Mikkelhost Date: Fri, 13 Aug 2021 18:12:04 +0200 Subject: [PATCH 06/28] Fixed event_test switched flag type from Flag to string --- store/event_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/store/event_test.go b/store/event_test.go index 6d11a113..07612f91 100644 --- a/store/event_test.go +++ b/store/event_test.go @@ -63,12 +63,12 @@ func TestTeamSolveTask(t *testing.T) { name string team *store.Team chal store.Challenge - flag store.Flag + flag string err string }{ {name: "Normal", team: team, chal: chal, flag: flag, err: ""}, //correct example {name: "Solved chal", team: team, chal: chal, flag: flag, err: "expected error when solving challenge already solved"}, - {name: "Unknown flag", team: team, chal: chal, flag: store.NewFlag(), err: "expected error when solving challenge with wrong flag"}, + {name: "Unknown flag", team: team, chal: chal, flag: store.NewFlag().String(), err: "expected error when solving challenge with wrong flag"}, } for _, tc := range tt { From 9ae14febec2a8783189a9b291d205439c5a8e9f6 Mon Sep 17 00:00:00 2001 From: Ahmet Turkmen Date: Mon, 16 Aug 2021 15:55:06 +0200 Subject: [PATCH 07/28] add check for lab assign Signed-off-by: Ahmet Turkmen --- svcs/amigo/amigo.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/svcs/amigo/amigo.go b/svcs/amigo/amigo.go index 2c40a824..4ddeac78 100644 --- a/svcs/amigo/amigo.go +++ b/svcs/amigo/amigo.go @@ -180,7 +180,7 @@ func (am *Amigo) Handler(hooks Hooks, guacHandler http.Handler) http.Handler { m.HandleFunc("/reset/challenge", am.handleResetChallenge(hooks.ResetExercise)) m.HandleFunc("/manage/challenge", am.handleStartStopChallenge(hooks.StartStopExercise)) m.HandleFunc("/reset/frontend", am.handleResetFrontend(hooks.ResetFrontend)) - m.HandleFunc("/vpn/status", am.handleVPNStatus()) + m.HandleFunc("/vpn/status", am.handleVPNStatus(hooks.AssignLab)) m.HandleFunc("/vpn/download", am.handleVPNFiles()) m.HandleFunc("/get/labsubnet", am.handleLabInfo()) if !am.TeamStore.OnlyVPN { @@ -345,7 +345,7 @@ func (am *Amigo) handleChallenges() http.HandlerFunc { } } -func (am *Amigo) handleVPNStatus() http.HandlerFunc { +func (am *Amigo) handleVPNStatus(hook func(t *store.Team) error) http.HandlerFunc { // data to be sent type vpnStatus struct { VPNConfID string `json:"vpnConnID"` @@ -360,6 +360,15 @@ func (am *Amigo) handleVPNStatus() http.HandlerFunc { replyJsonRequestErr(w, err) return } + + if !team.IsLabAssigned() { + if err := hook(team); err != nil { + w.WriteHeader(http.StatusServiceUnavailable) + w.Header().Set("Content-Type", "text/html; charset=utf-8") + return + } + } + vpnConfig := team.GetVPNConn() teamVPNKeys := team.GetVPNKeys() From 2cc2d05e120eac3efaf758f104206ae9101800fa Mon Sep 17 00:00:00 2001 From: Mikkelhost Date: Mon, 16 Aug 2021 16:11:01 +0200 Subject: [PATCH 08/28] Added grpc calls for listing categories --- daemon/proto/daemon.pb.go | 935 +++++++++++++++++++-------------- daemon/proto/daemon.proto | 10 + daemon/proto/daemon_grpc.pb.go | 36 ++ 3 files changed, 591 insertions(+), 390 deletions(-) diff --git a/daemon/proto/daemon.pb.go b/daemon/proto/daemon.pb.go index a1896355..462a3e06 100644 --- a/daemon/proto/daemon.pb.go +++ b/daemon/proto/daemon.pb.go @@ -2118,6 +2118,53 @@ func (x *ListExercisesResponse) GetExercises() []*ListExercisesResponse_Exercise return nil } +type ListCategoriesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Categories []*ListCategoriesResponse_Category `protobuf:"bytes,1,rep,name=categories,proto3" json:"categories,omitempty"` +} + +func (x *ListCategoriesResponse) Reset() { + *x = ListCategoriesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_daemon_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListCategoriesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListCategoriesResponse) ProtoMessage() {} + +func (x *ListCategoriesResponse) ProtoReflect() protoreflect.Message { + mi := &file_daemon_proto_msgTypes[38] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListCategoriesResponse.ProtoReflect.Descriptor instead. +func (*ListCategoriesResponse) Descriptor() ([]byte, []int) { + return file_daemon_proto_rawDescGZIP(), []int{38} +} + +func (x *ListCategoriesResponse) GetCategories() []*ListCategoriesResponse_Category { + if x != nil { + return x.Categories + } + return nil +} + type ResetTeamStatus struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2130,7 +2177,7 @@ type ResetTeamStatus struct { func (x *ResetTeamStatus) Reset() { *x = ResetTeamStatus{} if protoimpl.UnsafeEnabled { - mi := &file_daemon_proto_msgTypes[38] + mi := &file_daemon_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2143,7 +2190,7 @@ func (x *ResetTeamStatus) String() string { func (*ResetTeamStatus) ProtoMessage() {} func (x *ResetTeamStatus) ProtoReflect() protoreflect.Message { - mi := &file_daemon_proto_msgTypes[38] + mi := &file_daemon_proto_msgTypes[39] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2156,7 +2203,7 @@ func (x *ResetTeamStatus) ProtoReflect() protoreflect.Message { // Deprecated: Use ResetTeamStatus.ProtoReflect.Descriptor instead. func (*ResetTeamStatus) Descriptor() ([]byte, []int) { - return file_daemon_proto_rawDescGZIP(), []int{38} + return file_daemon_proto_rawDescGZIP(), []int{39} } func (x *ResetTeamStatus) GetTeamId() string { @@ -2184,7 +2231,7 @@ type StopEventRequest struct { func (x *StopEventRequest) Reset() { *x = StopEventRequest{} if protoimpl.UnsafeEnabled { - mi := &file_daemon_proto_msgTypes[39] + mi := &file_daemon_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2197,7 +2244,7 @@ func (x *StopEventRequest) String() string { func (*StopEventRequest) ProtoMessage() {} func (x *StopEventRequest) ProtoReflect() protoreflect.Message { - mi := &file_daemon_proto_msgTypes[39] + mi := &file_daemon_proto_msgTypes[40] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2210,7 +2257,7 @@ func (x *StopEventRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StopEventRequest.ProtoReflect.Descriptor instead. func (*StopEventRequest) Descriptor() ([]byte, []int) { - return file_daemon_proto_rawDescGZIP(), []int{39} + return file_daemon_proto_rawDescGZIP(), []int{40} } func (x *StopEventRequest) GetTag() string { @@ -2232,7 +2279,7 @@ type EventStatus struct { func (x *EventStatus) Reset() { *x = EventStatus{} if protoimpl.UnsafeEnabled { - mi := &file_daemon_proto_msgTypes[40] + mi := &file_daemon_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2245,7 +2292,7 @@ func (x *EventStatus) String() string { func (*EventStatus) ProtoMessage() {} func (x *EventStatus) ProtoReflect() protoreflect.Message { - mi := &file_daemon_proto_msgTypes[40] + mi := &file_daemon_proto_msgTypes[41] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2258,7 +2305,7 @@ func (x *EventStatus) ProtoReflect() protoreflect.Message { // Deprecated: Use EventStatus.ProtoReflect.Descriptor instead. func (*EventStatus) Descriptor() ([]byte, []int) { - return file_daemon_proto_rawDescGZIP(), []int{40} + return file_daemon_proto_rawDescGZIP(), []int{41} } func (x *EventStatus) GetEntity() string { @@ -2287,7 +2334,7 @@ type LabStatus struct { func (x *LabStatus) Reset() { *x = LabStatus{} if protoimpl.UnsafeEnabled { - mi := &file_daemon_proto_msgTypes[41] + mi := &file_daemon_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2300,7 +2347,7 @@ func (x *LabStatus) String() string { func (*LabStatus) ProtoMessage() {} func (x *LabStatus) ProtoReflect() protoreflect.Message { - mi := &file_daemon_proto_msgTypes[41] + mi := &file_daemon_proto_msgTypes[42] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2313,7 +2360,7 @@ func (x *LabStatus) ProtoReflect() protoreflect.Message { // Deprecated: Use LabStatus.ProtoReflect.Descriptor instead. func (*LabStatus) Descriptor() ([]byte, []int) { - return file_daemon_proto_rawDescGZIP(), []int{41} + return file_daemon_proto_rawDescGZIP(), []int{42} } func (x *LabStatus) GetMessage() string { @@ -2344,7 +2391,7 @@ type MonitorHostResponse struct { func (x *MonitorHostResponse) Reset() { *x = MonitorHostResponse{} if protoimpl.UnsafeEnabled { - mi := &file_daemon_proto_msgTypes[42] + mi := &file_daemon_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2357,7 +2404,7 @@ func (x *MonitorHostResponse) String() string { func (*MonitorHostResponse) ProtoMessage() {} func (x *MonitorHostResponse) ProtoReflect() protoreflect.Message { - mi := &file_daemon_proto_msgTypes[42] + mi := &file_daemon_proto_msgTypes[43] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2370,7 +2417,7 @@ func (x *MonitorHostResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use MonitorHostResponse.ProtoReflect.Descriptor instead. func (*MonitorHostResponse) Descriptor() ([]byte, []int) { - return file_daemon_proto_rawDescGZIP(), []int{42} + return file_daemon_proto_rawDescGZIP(), []int{43} } func (x *MonitorHostResponse) GetMemoryPercent() float32 { @@ -2410,7 +2457,7 @@ type Empty struct { func (x *Empty) Reset() { *x = Empty{} if protoimpl.UnsafeEnabled { - mi := &file_daemon_proto_msgTypes[43] + mi := &file_daemon_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2423,7 +2470,7 @@ func (x *Empty) String() string { func (*Empty) ProtoMessage() {} func (x *Empty) ProtoReflect() protoreflect.Message { - mi := &file_daemon_proto_msgTypes[43] + mi := &file_daemon_proto_msgTypes[44] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2436,7 +2483,7 @@ func (x *Empty) ProtoReflect() protoreflect.Message { // Deprecated: Use Empty.ProtoReflect.Descriptor instead. func (*Empty) Descriptor() ([]byte, []int) { - return file_daemon_proto_rawDescGZIP(), []int{43} + return file_daemon_proto_rawDescGZIP(), []int{44} } type VersionResponse struct { @@ -2450,7 +2497,7 @@ type VersionResponse struct { func (x *VersionResponse) Reset() { *x = VersionResponse{} if protoimpl.UnsafeEnabled { - mi := &file_daemon_proto_msgTypes[44] + mi := &file_daemon_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2463,7 +2510,7 @@ func (x *VersionResponse) String() string { func (*VersionResponse) ProtoMessage() {} func (x *VersionResponse) ProtoReflect() protoreflect.Message { - mi := &file_daemon_proto_msgTypes[44] + mi := &file_daemon_proto_msgTypes[45] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2476,7 +2523,7 @@ func (x *VersionResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use VersionResponse.ProtoReflect.Descriptor instead. func (*VersionResponse) Descriptor() ([]byte, []int) { - return file_daemon_proto_rawDescGZIP(), []int{44} + return file_daemon_proto_rawDescGZIP(), []int{45} } func (x *VersionResponse) GetVersion() string { @@ -2497,7 +2544,7 @@ type ListFrontendsResponse struct { func (x *ListFrontendsResponse) Reset() { *x = ListFrontendsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_daemon_proto_msgTypes[45] + mi := &file_daemon_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2510,7 +2557,7 @@ func (x *ListFrontendsResponse) String() string { func (*ListFrontendsResponse) ProtoMessage() {} func (x *ListFrontendsResponse) ProtoReflect() protoreflect.Message { - mi := &file_daemon_proto_msgTypes[45] + mi := &file_daemon_proto_msgTypes[46] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2523,7 +2570,7 @@ func (x *ListFrontendsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListFrontendsResponse.ProtoReflect.Descriptor instead. func (*ListFrontendsResponse) Descriptor() ([]byte, []int) { - return file_daemon_proto_rawDescGZIP(), []int{45} + return file_daemon_proto_rawDescGZIP(), []int{46} } func (x *ListFrontendsResponse) GetFrontends() []*ListFrontendsResponse_Frontend { @@ -2545,7 +2592,7 @@ type ResetFrontendsRequest struct { func (x *ResetFrontendsRequest) Reset() { *x = ResetFrontendsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_daemon_proto_msgTypes[46] + mi := &file_daemon_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2558,7 +2605,7 @@ func (x *ResetFrontendsRequest) String() string { func (*ResetFrontendsRequest) ProtoMessage() {} func (x *ResetFrontendsRequest) ProtoReflect() protoreflect.Message { - mi := &file_daemon_proto_msgTypes[46] + mi := &file_daemon_proto_msgTypes[47] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2571,7 +2618,7 @@ func (x *ResetFrontendsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ResetFrontendsRequest.ProtoReflect.Descriptor instead. func (*ResetFrontendsRequest) Descriptor() ([]byte, []int) { - return file_daemon_proto_rawDescGZIP(), []int{46} + return file_daemon_proto_rawDescGZIP(), []int{47} } func (x *ResetFrontendsRequest) GetEventTag() string { @@ -2600,7 +2647,7 @@ type SetFrontendMemoryRequest struct { func (x *SetFrontendMemoryRequest) Reset() { *x = SetFrontendMemoryRequest{} if protoimpl.UnsafeEnabled { - mi := &file_daemon_proto_msgTypes[47] + mi := &file_daemon_proto_msgTypes[48] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2613,7 +2660,7 @@ func (x *SetFrontendMemoryRequest) String() string { func (*SetFrontendMemoryRequest) ProtoMessage() {} func (x *SetFrontendMemoryRequest) ProtoReflect() protoreflect.Message { - mi := &file_daemon_proto_msgTypes[47] + mi := &file_daemon_proto_msgTypes[48] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2626,7 +2673,7 @@ func (x *SetFrontendMemoryRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SetFrontendMemoryRequest.ProtoReflect.Descriptor instead. func (*SetFrontendMemoryRequest) Descriptor() ([]byte, []int) { - return file_daemon_proto_rawDescGZIP(), []int{47} + return file_daemon_proto_rawDescGZIP(), []int{48} } func (x *SetFrontendMemoryRequest) GetImage() string { @@ -2655,7 +2702,7 @@ type SetFrontendCpuRequest struct { func (x *SetFrontendCpuRequest) Reset() { *x = SetFrontendCpuRequest{} if protoimpl.UnsafeEnabled { - mi := &file_daemon_proto_msgTypes[48] + mi := &file_daemon_proto_msgTypes[49] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2668,7 +2715,7 @@ func (x *SetFrontendCpuRequest) String() string { func (*SetFrontendCpuRequest) ProtoMessage() {} func (x *SetFrontendCpuRequest) ProtoReflect() protoreflect.Message { - mi := &file_daemon_proto_msgTypes[48] + mi := &file_daemon_proto_msgTypes[49] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2681,7 +2728,7 @@ func (x *SetFrontendCpuRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SetFrontendCpuRequest.ProtoReflect.Descriptor instead. func (*SetFrontendCpuRequest) Descriptor() ([]byte, []int) { - return file_daemon_proto_rawDescGZIP(), []int{48} + return file_daemon_proto_rawDescGZIP(), []int{49} } func (x *SetFrontendCpuRequest) GetImage() string { @@ -2710,7 +2757,7 @@ type GetTeamInfoRequest struct { func (x *GetTeamInfoRequest) Reset() { *x = GetTeamInfoRequest{} if protoimpl.UnsafeEnabled { - mi := &file_daemon_proto_msgTypes[49] + mi := &file_daemon_proto_msgTypes[50] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2723,7 +2770,7 @@ func (x *GetTeamInfoRequest) String() string { func (*GetTeamInfoRequest) ProtoMessage() {} func (x *GetTeamInfoRequest) ProtoReflect() protoreflect.Message { - mi := &file_daemon_proto_msgTypes[49] + mi := &file_daemon_proto_msgTypes[50] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2736,7 +2783,7 @@ func (x *GetTeamInfoRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetTeamInfoRequest.ProtoReflect.Descriptor instead. func (*GetTeamInfoRequest) Descriptor() ([]byte, []int) { - return file_daemon_proto_rawDescGZIP(), []int{49} + return file_daemon_proto_rawDescGZIP(), []int{50} } func (x *GetTeamInfoRequest) GetTeamId() string { @@ -2764,7 +2811,7 @@ type GetTeamInfoResponse struct { func (x *GetTeamInfoResponse) Reset() { *x = GetTeamInfoResponse{} if protoimpl.UnsafeEnabled { - mi := &file_daemon_proto_msgTypes[50] + mi := &file_daemon_proto_msgTypes[51] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2777,7 +2824,7 @@ func (x *GetTeamInfoResponse) String() string { func (*GetTeamInfoResponse) ProtoMessage() {} func (x *GetTeamInfoResponse) ProtoReflect() protoreflect.Message { - mi := &file_daemon_proto_msgTypes[50] + mi := &file_daemon_proto_msgTypes[51] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2790,7 +2837,7 @@ func (x *GetTeamInfoResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetTeamInfoResponse.ProtoReflect.Descriptor instead. func (*GetTeamInfoResponse) Descriptor() ([]byte, []int) { - return file_daemon_proto_rawDescGZIP(), []int{50} + return file_daemon_proto_rawDescGZIP(), []int{51} } func (x *GetTeamInfoResponse) GetInstances() []*GetTeamInfoResponse_Instance { @@ -2812,7 +2859,7 @@ type GetExsByTagsResp_ExInfo struct { func (x *GetExsByTagsResp_ExInfo) Reset() { *x = GetExsByTagsResp_ExInfo{} if protoimpl.UnsafeEnabled { - mi := &file_daemon_proto_msgTypes[51] + mi := &file_daemon_proto_msgTypes[52] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2825,7 +2872,7 @@ func (x *GetExsByTagsResp_ExInfo) String() string { func (*GetExsByTagsResp_ExInfo) ProtoMessage() {} func (x *GetExsByTagsResp_ExInfo) ProtoReflect() protoreflect.Message { - mi := &file_daemon_proto_msgTypes[51] + mi := &file_daemon_proto_msgTypes[52] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2872,7 +2919,7 @@ type ListUsersResponse_UserInfo struct { func (x *ListUsersResponse_UserInfo) Reset() { *x = ListUsersResponse_UserInfo{} if protoimpl.UnsafeEnabled { - mi := &file_daemon_proto_msgTypes[52] + mi := &file_daemon_proto_msgTypes[53] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2885,7 +2932,7 @@ func (x *ListUsersResponse_UserInfo) String() string { func (*ListUsersResponse_UserInfo) ProtoMessage() {} func (x *ListUsersResponse_UserInfo) ProtoReflect() protoreflect.Message { - mi := &file_daemon_proto_msgTypes[52] + mi := &file_daemon_proto_msgTypes[53] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2971,7 +3018,7 @@ type ListEventsResponse_Events struct { func (x *ListEventsResponse_Events) Reset() { *x = ListEventsResponse_Events{} if protoimpl.UnsafeEnabled { - mi := &file_daemon_proto_msgTypes[53] + mi := &file_daemon_proto_msgTypes[54] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2984,7 +3031,7 @@ func (x *ListEventsResponse_Events) String() string { func (*ListEventsResponse_Events) ProtoMessage() {} func (x *ListEventsResponse_Events) ProtoReflect() protoreflect.Message { - mi := &file_daemon_proto_msgTypes[53] + mi := &file_daemon_proto_msgTypes[54] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3091,7 +3138,7 @@ type ListEventTeamsResponse_Teams struct { func (x *ListEventTeamsResponse_Teams) Reset() { *x = ListEventTeamsResponse_Teams{} if protoimpl.UnsafeEnabled { - mi := &file_daemon_proto_msgTypes[54] + mi := &file_daemon_proto_msgTypes[55] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3104,7 +3151,7 @@ func (x *ListEventTeamsResponse_Teams) String() string { func (*ListEventTeamsResponse_Teams) ProtoMessage() {} func (x *ListEventTeamsResponse_Teams) ProtoReflect() protoreflect.Message { - mi := &file_daemon_proto_msgTypes[54] + mi := &file_daemon_proto_msgTypes[55] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3165,7 +3212,7 @@ type ListExercisesResponse_Exercise struct { func (x *ListExercisesResponse_Exercise) Reset() { *x = ListExercisesResponse_Exercise{} if protoimpl.UnsafeEnabled { - mi := &file_daemon_proto_msgTypes[55] + mi := &file_daemon_proto_msgTypes[56] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3178,7 +3225,7 @@ func (x *ListExercisesResponse_Exercise) String() string { func (*ListExercisesResponse_Exercise) ProtoMessage() {} func (x *ListExercisesResponse_Exercise) ProtoReflect() protoreflect.Message { - mi := &file_daemon_proto_msgTypes[55] + mi := &file_daemon_proto_msgTypes[56] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3258,7 +3305,7 @@ type ListExercisesResponse_Exercise_ExerciseInfo struct { func (x *ListExercisesResponse_Exercise_ExerciseInfo) Reset() { *x = ListExercisesResponse_Exercise_ExerciseInfo{} if protoimpl.UnsafeEnabled { - mi := &file_daemon_proto_msgTypes[56] + mi := &file_daemon_proto_msgTypes[57] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3271,7 +3318,7 @@ func (x *ListExercisesResponse_Exercise_ExerciseInfo) String() string { func (*ListExercisesResponse_Exercise_ExerciseInfo) ProtoMessage() {} func (x *ListExercisesResponse_Exercise_ExerciseInfo) ProtoReflect() protoreflect.Message { - mi := &file_daemon_proto_msgTypes[56] + mi := &file_daemon_proto_msgTypes[57] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3322,6 +3369,69 @@ func (x *ListExercisesResponse_Exercise_ExerciseInfo) GetDescription() string { return "" } +type ListCategoriesResponse_Category struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + CatDescription string `protobuf:"bytes,3,opt,name=catDescription,proto3" json:"catDescription,omitempty"` +} + +func (x *ListCategoriesResponse_Category) Reset() { + *x = ListCategoriesResponse_Category{} + if protoimpl.UnsafeEnabled { + mi := &file_daemon_proto_msgTypes[58] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListCategoriesResponse_Category) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListCategoriesResponse_Category) ProtoMessage() {} + +func (x *ListCategoriesResponse_Category) ProtoReflect() protoreflect.Message { + mi := &file_daemon_proto_msgTypes[58] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListCategoriesResponse_Category.ProtoReflect.Descriptor instead. +func (*ListCategoriesResponse_Category) Descriptor() ([]byte, []int) { + return file_daemon_proto_rawDescGZIP(), []int{38, 0} +} + +func (x *ListCategoriesResponse_Category) GetTag() string { + if x != nil { + return x.Tag + } + return "" +} + +func (x *ListCategoriesResponse_Category) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ListCategoriesResponse_Category) GetCatDescription() string { + if x != nil { + return x.CatDescription + } + return "" +} + type ListFrontendsResponse_Frontend struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3336,7 +3446,7 @@ type ListFrontendsResponse_Frontend struct { func (x *ListFrontendsResponse_Frontend) Reset() { *x = ListFrontendsResponse_Frontend{} if protoimpl.UnsafeEnabled { - mi := &file_daemon_proto_msgTypes[57] + mi := &file_daemon_proto_msgTypes[59] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3349,7 +3459,7 @@ func (x *ListFrontendsResponse_Frontend) String() string { func (*ListFrontendsResponse_Frontend) ProtoMessage() {} func (x *ListFrontendsResponse_Frontend) ProtoReflect() protoreflect.Message { - mi := &file_daemon_proto_msgTypes[57] + mi := &file_daemon_proto_msgTypes[59] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3362,7 +3472,7 @@ func (x *ListFrontendsResponse_Frontend) ProtoReflect() protoreflect.Message { // Deprecated: Use ListFrontendsResponse_Frontend.ProtoReflect.Descriptor instead. func (*ListFrontendsResponse_Frontend) Descriptor() ([]byte, []int) { - return file_daemon_proto_rawDescGZIP(), []int{45, 0} + return file_daemon_proto_rawDescGZIP(), []int{46, 0} } func (x *ListFrontendsResponse_Frontend) GetImage() string { @@ -3407,7 +3517,7 @@ type GetTeamInfoResponse_Instance struct { func (x *GetTeamInfoResponse_Instance) Reset() { *x = GetTeamInfoResponse_Instance{} if protoimpl.UnsafeEnabled { - mi := &file_daemon_proto_msgTypes[58] + mi := &file_daemon_proto_msgTypes[60] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3420,7 +3530,7 @@ func (x *GetTeamInfoResponse_Instance) String() string { func (*GetTeamInfoResponse_Instance) ProtoMessage() {} func (x *GetTeamInfoResponse_Instance) ProtoReflect() protoreflect.Message { - mi := &file_daemon_proto_msgTypes[58] + mi := &file_daemon_proto_msgTypes[60] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3433,7 +3543,7 @@ func (x *GetTeamInfoResponse_Instance) ProtoReflect() protoreflect.Message { // Deprecated: Use GetTeamInfoResponse_Instance.ProtoReflect.Descriptor instead. func (*GetTeamInfoResponse_Instance) Descriptor() ([]byte, []int) { - return file_daemon_proto_rawDescGZIP(), []int{50, 0} + return file_daemon_proto_rawDescGZIP(), []int{51, 0} } func (x *GetTeamInfoResponse_Instance) GetImage() string { @@ -3734,221 +3844,237 @@ var file_daemon_proto_rawDesc = []byte{ 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, - 0x41, 0x0a, 0x0f, 0x52, 0x65, 0x73, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x74, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x22, 0x24, 0x0a, 0x10, 0x53, 0x74, 0x6f, 0x70, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x22, 0x3d, 0x0a, 0x0b, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, - 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x49, 0x0a, 0x09, 0x4c, 0x61, 0x62, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x22, - 0x0a, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x22, 0xa9, 0x01, 0x0a, 0x13, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x48, 0x6f, - 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x4d, 0x65, - 0x6d, 0x6f, 0x72, 0x79, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x02, 0x52, 0x0d, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, - 0x12, 0x28, 0x0a, 0x0f, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x61, 0x64, 0x45, 0x72, - 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x4d, 0x65, 0x6d, 0x6f, 0x72, - 0x79, 0x52, 0x65, 0x61, 0x64, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x43, 0x50, - 0x55, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, - 0x43, 0x50, 0x55, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x43, 0x50, - 0x55, 0x52, 0x65, 0x61, 0x64, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0c, 0x43, 0x50, 0x55, 0x52, 0x65, 0x61, 0x64, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x07, - 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x2b, 0x0a, 0x0f, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xc1, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x72, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, - 0x0a, 0x09, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x26, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x46, - 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x2e, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x52, 0x09, 0x66, 0x72, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x64, 0x73, 0x1a, 0x62, 0x0a, 0x08, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, + 0xbb, 0x01, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, + 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x0a, 0x63, 0x61, + 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, + 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x61, 0x74, 0x65, + 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, + 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, + 0x69, 0x65, 0x73, 0x1a, 0x58, 0x0a, 0x08, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, + 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x61, 0x74, 0x44, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, + 0x61, 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x41, 0x0a, + 0x0f, 0x52, 0x65, 0x73, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x16, 0x0a, 0x06, 0x74, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x74, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x22, 0x24, 0x0a, 0x10, 0x53, 0x74, 0x6f, 0x70, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x22, 0x3d, 0x0a, 0x0b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x49, 0x0a, 0x09, 0x4c, 0x61, 0x62, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x22, 0x0a, 0x0c, + 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x22, 0xa9, 0x01, 0x0a, 0x13, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x48, 0x6f, 0x73, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x4d, 0x65, 0x6d, 0x6f, + 0x72, 0x79, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x52, + 0x0d, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x28, + 0x0a, 0x0f, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x61, 0x64, 0x45, 0x72, 0x72, 0x6f, + 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x52, + 0x65, 0x61, 0x64, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x43, 0x50, 0x55, 0x50, + 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, 0x43, 0x50, + 0x55, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x43, 0x50, 0x55, 0x52, + 0x65, 0x61, 0x64, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x43, 0x50, 0x55, 0x52, 0x65, 0x61, 0x64, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x07, 0x0a, 0x05, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x2b, 0x0a, 0x0f, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x22, 0xc1, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x72, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x09, + 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x26, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x72, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x46, + 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x52, 0x09, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x64, 0x73, 0x1a, 0x62, 0x0a, 0x08, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x12, 0x14, + 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, + 0x6d, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x6d, 0x6f, + 0x72, 0x79, 0x4d, 0x42, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x65, 0x6d, 0x6f, + 0x72, 0x79, 0x4d, 0x42, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x70, 0x75, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x02, 0x52, 0x03, 0x63, 0x70, 0x75, 0x22, 0x57, 0x0a, 0x15, 0x52, 0x65, 0x73, 0x65, 0x74, 0x46, + 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x1a, 0x0a, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x67, 0x12, 0x22, 0x0a, 0x05, 0x74, + 0x65, 0x61, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x64, 0x61, 0x65, + 0x6d, 0x6f, 0x6e, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x05, 0x74, 0x65, 0x61, 0x6d, 0x73, 0x22, + 0x4c, 0x0a, 0x18, 0x53, 0x65, 0x74, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x4d, 0x65, + 0x6d, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, + 0x6d, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, + 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x4d, 0x42, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x4d, 0x42, 0x22, 0x3f, 0x0a, + 0x15, 0x53, 0x65, 0x74, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x43, 0x70, 0x75, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x10, 0x0a, 0x03, + 0x63, 0x70, 0x75, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, 0x52, 0x03, 0x63, 0x70, 0x75, 0x22, 0x48, + 0x0a, 0x12, 0x47, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x67, 0x22, 0xb5, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, + 0x54, 0x65, 0x61, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x42, 0x0a, 0x09, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, + 0x54, 0x65, 0x61, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x09, 0x69, 0x6e, 0x73, 0x74, 0x61, + 0x6e, 0x63, 0x65, 0x73, 0x1a, 0x5a, 0x0a, 0x08, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, - 0x6d, 0x6f, 0x72, 0x79, 0x4d, 0x42, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x65, - 0x6d, 0x6f, 0x72, 0x79, 0x4d, 0x42, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x70, 0x75, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x02, 0x52, 0x03, 0x63, 0x70, 0x75, 0x22, 0x57, 0x0a, 0x15, 0x52, 0x65, 0x73, 0x65, - 0x74, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x67, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x67, 0x12, 0x22, 0x0a, - 0x05, 0x74, 0x65, 0x61, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x64, - 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x05, 0x74, 0x65, 0x61, 0x6d, - 0x73, 0x22, 0x4c, 0x0a, 0x18, 0x53, 0x65, 0x74, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, - 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, - 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, - 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x4d, 0x42, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x4d, 0x42, 0x22, - 0x3f, 0x0a, 0x15, 0x53, 0x65, 0x74, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x43, 0x70, - 0x75, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x10, - 0x0a, 0x03, 0x63, 0x70, 0x75, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, 0x52, 0x03, 0x63, 0x70, 0x75, - 0x22, 0x48, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x65, 0x61, 0x6d, 0x49, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x12, 0x1a, - 0x0a, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x67, 0x22, 0xb5, 0x01, 0x0a, 0x13, 0x47, - 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x42, 0x0a, 0x09, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x47, - 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x09, 0x69, 0x6e, 0x73, - 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x1a, 0x5a, 0x0a, 0x08, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, - 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x32, 0xa4, 0x11, 0x0a, 0x06, 0x44, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x12, 0x42, 0x0a, - 0x09, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x12, 0x18, 0x2e, 0x64, 0x61, 0x65, - 0x6d, 0x6f, 0x6e, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x4c, 0x6f, - 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x44, 0x0a, 0x0a, 0x53, 0x69, 0x67, 0x6e, 0x75, 0x70, 0x55, 0x73, 0x65, 0x72, 0x12, - 0x19, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x75, 0x70, 0x55, - 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x64, 0x61, 0x65, - 0x6d, 0x6f, 0x6e, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x45, 0x0a, 0x0a, 0x49, 0x6e, 0x76, 0x69, 0x74, - 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x19, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x49, - 0x6e, 0x76, 0x69, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1a, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, - 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x37, - 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x0d, 0x2e, 0x64, 0x61, - 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x19, 0x2e, 0x64, 0x61, 0x65, - 0x6d, 0x6f, 0x6e, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x10, 0x43, 0x68, 0x61, 0x6e, 0x67, - 0x65, 0x55, 0x73, 0x65, 0x72, 0x50, 0x61, 0x73, 0x73, 0x77, 0x64, 0x12, 0x1b, 0x2e, 0x64, 0x61, - 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, - 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, - 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x64, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x0b, 0x44, 0x65, 0x73, 0x74, - 0x72, 0x6f, 0x79, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1a, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, - 0x2e, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x73, - 0x74, 0x72, 0x6f, 0x79, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x40, 0x0a, 0x0e, 0x53, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x53, 0x75, 0x73, - 0x70, 0x65, 0x6e, 0x64, 0x12, 0x1d, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x65, - 0x74, 0x54, 0x65, 0x61, 0x6d, 0x53, 0x75, 0x73, 0x70, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, - 0x61, 0x6d, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1d, 0x2e, 0x64, 0x61, 0x65, - 0x6d, 0x6f, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x50, 0x61, - 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x64, 0x61, 0x65, 0x6d, - 0x6f, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x50, 0x61, 0x73, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x35, 0x0a, 0x0b, 0x47, - 0x65, 0x74, 0x41, 0x50, 0x49, 0x43, 0x72, 0x65, 0x64, 0x73, 0x12, 0x0d, 0x2e, 0x64, 0x61, 0x65, - 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x15, 0x2e, 0x64, 0x61, 0x65, 0x6d, - 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x40, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x12, 0x1a, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, - 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x4c, 0x61, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x22, 0x00, 0x30, 0x01, 0x12, 0x3e, 0x0a, 0x09, 0x53, 0x74, 0x6f, 0x70, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x12, 0x18, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x64, 0x61, - 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x22, 0x00, 0x30, 0x01, 0x12, 0x44, 0x0a, 0x0c, 0x53, 0x75, 0x73, 0x70, 0x65, 0x6e, 0x64, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x75, - 0x73, 0x70, 0x65, 0x6e, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x13, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x00, 0x30, 0x01, 0x12, 0x45, 0x0a, 0x0a, 0x4c, 0x69, - 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x19, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, - 0x6e, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x51, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x65, - 0x61, 0x6d, 0x73, 0x12, 0x1d, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, - 0x65, 0x61, 0x6d, 0x4c, 0x61, 0x62, 0x12, 0x1d, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, - 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x4c, 0x61, 0x62, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x00, 0x30, 0x01, 0x12, 0x51, - 0x0a, 0x0e, 0x53, 0x6f, 0x6c, 0x76, 0x65, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, - 0x12, 0x1d, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x6f, 0x6c, 0x76, 0x65, 0x43, - 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1e, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x6f, 0x6c, 0x76, 0x65, 0x43, 0x68, - 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x4d, 0x0a, 0x0c, 0x41, 0x64, 0x64, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, - 0x65, 0x12, 0x1b, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x68, - 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, - 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x68, 0x61, 0x6c, 0x6c, - 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, - 0x12, 0x54, 0x0a, 0x0f, 0x41, 0x64, 0x64, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x41, 0x64, 0x64, - 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x41, 0x64, 0x64, - 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x47, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x54, 0x65, 0x61, 0x6d, 0x12, 0x19, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1a, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, - 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, - 0x43, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x43, 0x68, 0x61, 0x6c, 0x73, 0x12, - 0x1a, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, - 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x64, 0x61, - 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x43, 0x68, 0x61, 0x6c, 0x73, 0x49, 0x6e, - 0x66, 0x6f, 0x22, 0x00, 0x12, 0x44, 0x0a, 0x0b, 0x53, 0x74, 0x72, 0x65, 0x73, 0x73, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x54, 0x65, 0x73, - 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, - 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x4c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x0d, 0x4c, 0x69, - 0x73, 0x74, 0x45, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x73, 0x12, 0x0d, 0x2e, 0x64, 0x61, - 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1d, 0x2e, 0x64, 0x61, 0x65, - 0x6d, 0x6f, 0x6e, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4a, 0x0a, 0x0d, 0x52, - 0x65, 0x73, 0x65, 0x74, 0x45, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x12, 0x1c, 0x2e, 0x64, - 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x45, 0x78, 0x65, 0x72, 0x63, - 0x69, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x64, 0x61, 0x65, - 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x22, 0x00, 0x30, 0x01, 0x12, 0x49, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x45, 0x78, - 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x73, 0x42, 0x79, 0x54, 0x61, 0x67, 0x73, 0x12, 0x17, 0x2e, - 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x73, 0x42, 0x79, 0x54, - 0x61, 0x67, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, - 0x47, 0x65, 0x74, 0x45, 0x78, 0x73, 0x42, 0x79, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x64, 0x73, 0x12, 0x0d, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x1a, 0x1d, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x46, 0x72, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x64, 0x73, 0x12, 0x1d, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, - 0x65, 0x73, 0x65, 0x74, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, - 0x73, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x00, 0x30, - 0x01, 0x12, 0x46, 0x0a, 0x11, 0x53, 0x65, 0x74, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, - 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x20, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, - 0x53, 0x65, 0x74, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x4d, 0x65, 0x6d, 0x6f, 0x72, - 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, - 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x0e, 0x53, 0x65, 0x74, - 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x43, 0x70, 0x75, 0x12, 0x1d, 0x2e, 0x64, 0x61, - 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x74, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, - 0x43, 0x70, 0x75, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x64, 0x61, 0x65, - 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x0b, 0x47, - 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x2e, 0x64, 0x61, 0x65, - 0x6d, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, - 0x47, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0b, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x48, 0x6f, 0x73, 0x74, 0x12, 0x0d, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x1a, 0x1b, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x48, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x30, 0x01, 0x12, 0x33, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x0d, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x17, - 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x61, 0x75, 0x2d, 0x6e, 0x65, 0x74, 0x77, - 0x6f, 0x72, 0x6b, 0x2d, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2f, 0x68, 0x61, 0x61, - 0x75, 0x6b, 0x69, 0x6e, 0x73, 0x2f, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x32, 0xe7, 0x11, 0x0a, 0x06, 0x44, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x12, 0x42, 0x0a, 0x09, 0x4c, + 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x12, 0x18, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, + 0x6e, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x4c, 0x6f, 0x67, 0x69, + 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x44, 0x0a, 0x0a, 0x53, 0x69, 0x67, 0x6e, 0x75, 0x70, 0x55, 0x73, 0x65, 0x72, 0x12, 0x19, 0x2e, + 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x75, 0x70, 0x55, 0x73, 0x65, + 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, + 0x6e, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x45, 0x0a, 0x0a, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x55, + 0x73, 0x65, 0x72, 0x12, 0x19, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x76, + 0x69, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, + 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x55, 0x73, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x37, 0x0a, 0x09, + 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x0d, 0x2e, 0x64, 0x61, 0x65, 0x6d, + 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x19, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, + 0x6e, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x10, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x55, + 0x73, 0x65, 0x72, 0x50, 0x61, 0x73, 0x73, 0x77, 0x64, 0x12, 0x1b, 0x2e, 0x64, 0x61, 0x65, 0x6d, + 0x6f, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x64, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x0b, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, + 0x79, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1a, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x44, + 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1b, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x73, 0x74, 0x72, + 0x6f, 0x79, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x40, 0x0a, 0x0e, 0x53, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x53, 0x75, 0x73, 0x70, 0x65, + 0x6e, 0x64, 0x12, 0x1d, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x74, 0x54, + 0x65, 0x61, 0x6d, 0x53, 0x75, 0x73, 0x70, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x0d, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x22, 0x00, 0x12, 0x55, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, + 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1d, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, + 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x50, 0x61, 0x73, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, + 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x50, 0x61, 0x73, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x35, 0x0a, 0x0b, 0x47, 0x65, 0x74, + 0x41, 0x50, 0x49, 0x43, 0x72, 0x65, 0x64, 0x73, 0x12, 0x0d, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, + 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x15, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, + 0x2e, 0x43, 0x72, 0x65, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x40, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, + 0x1a, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x64, 0x61, + 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x4c, 0x61, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x00, + 0x30, 0x01, 0x12, 0x3e, 0x0a, 0x09, 0x53, 0x74, 0x6f, 0x70, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, + 0x18, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x64, 0x61, 0x65, 0x6d, + 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x00, + 0x30, 0x01, 0x12, 0x44, 0x0a, 0x0c, 0x53, 0x75, 0x73, 0x70, 0x65, 0x6e, 0x64, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x12, 0x1b, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x75, 0x73, 0x70, + 0x65, 0x6e, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x13, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x22, 0x00, 0x30, 0x01, 0x12, 0x45, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x19, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1a, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x51, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x65, 0x61, 0x6d, + 0x73, 0x12, 0x1d, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1e, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x48, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x65, 0x61, + 0x6d, 0x4c, 0x61, 0x62, 0x12, 0x1d, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x4c, 0x61, 0x62, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x00, 0x30, 0x01, 0x12, 0x51, 0x0a, 0x0e, + 0x53, 0x6f, 0x6c, 0x76, 0x65, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x12, 0x1d, + 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x6f, 0x6c, 0x76, 0x65, 0x43, 0x68, 0x61, + 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, + 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x6f, 0x6c, 0x76, 0x65, 0x43, 0x68, 0x61, 0x6c, + 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x4d, 0x0a, 0x0c, 0x41, 0x64, 0x64, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x12, + 0x1b, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x68, 0x61, 0x6c, + 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x64, + 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, + 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x54, + 0x0a, 0x0f, 0x41, 0x64, 0x64, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x1e, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x4e, 0x6f, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1f, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x4e, 0x6f, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x47, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, + 0x61, 0x6d, 0x12, 0x19, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, + 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x61, + 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x43, 0x0a, + 0x0c, 0x47, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x43, 0x68, 0x61, 0x6c, 0x73, 0x12, 0x1a, 0x2e, + 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x64, 0x61, 0x65, 0x6d, + 0x6f, 0x6e, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x43, 0x68, 0x61, 0x6c, 0x73, 0x49, 0x6e, 0x66, 0x6f, + 0x22, 0x00, 0x12, 0x44, 0x0a, 0x0b, 0x53, 0x74, 0x72, 0x65, 0x73, 0x73, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x12, 0x18, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x64, 0x61, + 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x6f, + 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, + 0x45, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x73, 0x12, 0x0d, 0x2e, 0x64, 0x61, 0x65, 0x6d, + 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1d, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, + 0x6e, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4a, 0x0a, 0x0d, 0x52, 0x65, 0x73, + 0x65, 0x74, 0x45, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x12, 0x1c, 0x2e, 0x64, 0x61, 0x65, + 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x45, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, + 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x22, 0x00, 0x30, 0x01, 0x12, 0x49, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x45, 0x78, 0x65, 0x72, + 0x63, 0x69, 0x73, 0x65, 0x73, 0x42, 0x79, 0x54, 0x61, 0x67, 0x73, 0x12, 0x17, 0x2e, 0x64, 0x61, + 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x73, 0x42, 0x79, 0x54, 0x61, 0x67, + 0x73, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x47, 0x65, + 0x74, 0x45, 0x78, 0x73, 0x42, 0x79, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, + 0x12, 0x3f, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, + 0x73, 0x12, 0x0d, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x1a, 0x1d, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x72, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x4c, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x64, 0x73, 0x12, 0x1d, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, + 0x65, 0x74, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x65, + 0x74, 0x54, 0x65, 0x61, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x00, 0x30, 0x01, 0x12, + 0x46, 0x0a, 0x11, 0x53, 0x65, 0x74, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x4d, 0x65, + 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x20, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x65, + 0x74, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x0e, 0x53, 0x65, 0x74, 0x46, 0x72, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x43, 0x70, 0x75, 0x12, 0x1d, 0x2e, 0x64, 0x61, 0x65, 0x6d, + 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x74, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x43, 0x70, + 0x75, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, + 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x0b, 0x47, 0x65, 0x74, + 0x54, 0x65, 0x61, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, + 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x47, 0x65, + 0x74, 0x54, 0x65, 0x61, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0b, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x48, 0x6f, + 0x73, 0x74, 0x12, 0x0d, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x1a, 0x1b, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, + 0x6f, 0x72, 0x48, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x30, 0x01, 0x12, 0x33, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0d, 0x2e, + 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x17, 0x2e, 0x64, + 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x43, + 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x12, 0x0d, 0x2e, 0x64, 0x61, 0x65, 0x6d, + 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1e, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, + 0x6e, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x61, 0x75, 0x2d, 0x6e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x2d, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2f, 0x68, 0x61, + 0x61, 0x75, 0x6b, 0x69, 0x6e, 0x73, 0x2f, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3963,7 +4089,7 @@ func file_daemon_proto_rawDescGZIP() []byte { return file_daemon_proto_rawDescData } -var file_daemon_proto_msgTypes = make([]protoimpl.MessageInfo, 59) +var file_daemon_proto_msgTypes = make([]protoimpl.MessageInfo, 61) var file_daemon_proto_goTypes = []interface{}{ (*AddNotificationRequest)(nil), // 0: daemon.AddNotificationRequest (*AddNotificationResponse)(nil), // 1: daemon.AddNotificationResponse @@ -4003,107 +4129,112 @@ var file_daemon_proto_goTypes = []interface{}{ (*RestartTeamLabRequest)(nil), // 35: daemon.RestartTeamLabRequest (*ResetExerciseRequest)(nil), // 36: daemon.ResetExerciseRequest (*ListExercisesResponse)(nil), // 37: daemon.ListExercisesResponse - (*ResetTeamStatus)(nil), // 38: daemon.ResetTeamStatus - (*StopEventRequest)(nil), // 39: daemon.StopEventRequest - (*EventStatus)(nil), // 40: daemon.EventStatus - (*LabStatus)(nil), // 41: daemon.LabStatus - (*MonitorHostResponse)(nil), // 42: daemon.MonitorHostResponse - (*Empty)(nil), // 43: daemon.Empty - (*VersionResponse)(nil), // 44: daemon.VersionResponse - (*ListFrontendsResponse)(nil), // 45: daemon.ListFrontendsResponse - (*ResetFrontendsRequest)(nil), // 46: daemon.ResetFrontendsRequest - (*SetFrontendMemoryRequest)(nil), // 47: daemon.SetFrontendMemoryRequest - (*SetFrontendCpuRequest)(nil), // 48: daemon.SetFrontendCpuRequest - (*GetTeamInfoRequest)(nil), // 49: daemon.GetTeamInfoRequest - (*GetTeamInfoResponse)(nil), // 50: daemon.GetTeamInfoResponse - (*GetExsByTagsResp_ExInfo)(nil), // 51: daemon.GetExsByTagsResp.ExInfo - (*ListUsersResponse_UserInfo)(nil), // 52: daemon.ListUsersResponse.UserInfo - (*ListEventsResponse_Events)(nil), // 53: daemon.ListEventsResponse.Events - (*ListEventTeamsResponse_Teams)(nil), // 54: daemon.ListEventTeamsResponse.Teams - (*ListExercisesResponse_Exercise)(nil), // 55: daemon.ListExercisesResponse.Exercise - (*ListExercisesResponse_Exercise_ExerciseInfo)(nil), // 56: daemon.ListExercisesResponse.Exercise.ExerciseInfo - (*ListFrontendsResponse_Frontend)(nil), // 57: daemon.ListFrontendsResponse.Frontend - (*GetTeamInfoResponse_Instance)(nil), // 58: daemon.GetTeamInfoResponse.Instance + (*ListCategoriesResponse)(nil), // 38: daemon.ListCategoriesResponse + (*ResetTeamStatus)(nil), // 39: daemon.ResetTeamStatus + (*StopEventRequest)(nil), // 40: daemon.StopEventRequest + (*EventStatus)(nil), // 41: daemon.EventStatus + (*LabStatus)(nil), // 42: daemon.LabStatus + (*MonitorHostResponse)(nil), // 43: daemon.MonitorHostResponse + (*Empty)(nil), // 44: daemon.Empty + (*VersionResponse)(nil), // 45: daemon.VersionResponse + (*ListFrontendsResponse)(nil), // 46: daemon.ListFrontendsResponse + (*ResetFrontendsRequest)(nil), // 47: daemon.ResetFrontendsRequest + (*SetFrontendMemoryRequest)(nil), // 48: daemon.SetFrontendMemoryRequest + (*SetFrontendCpuRequest)(nil), // 49: daemon.SetFrontendCpuRequest + (*GetTeamInfoRequest)(nil), // 50: daemon.GetTeamInfoRequest + (*GetTeamInfoResponse)(nil), // 51: daemon.GetTeamInfoResponse + (*GetExsByTagsResp_ExInfo)(nil), // 52: daemon.GetExsByTagsResp.ExInfo + (*ListUsersResponse_UserInfo)(nil), // 53: daemon.ListUsersResponse.UserInfo + (*ListEventsResponse_Events)(nil), // 54: daemon.ListEventsResponse.Events + (*ListEventTeamsResponse_Teams)(nil), // 55: daemon.ListEventTeamsResponse.Teams + (*ListExercisesResponse_Exercise)(nil), // 56: daemon.ListExercisesResponse.Exercise + (*ListExercisesResponse_Exercise_ExerciseInfo)(nil), // 57: daemon.ListExercisesResponse.Exercise.ExerciseInfo + (*ListCategoriesResponse_Category)(nil), // 58: daemon.ListCategoriesResponse.Category + (*ListFrontendsResponse_Frontend)(nil), // 59: daemon.ListFrontendsResponse.Frontend + (*GetTeamInfoResponse_Instance)(nil), // 60: daemon.GetTeamInfoResponse.Instance } var file_daemon_proto_depIdxs = []int32{ - 51, // 0: daemon.GetExsByTagsResp.exercises:type_name -> daemon.GetExsByTagsResp.ExInfo + 52, // 0: daemon.GetExsByTagsResp.exercises:type_name -> daemon.GetExsByTagsResp.ExInfo 12, // 1: daemon.TeamChalsInfo.flags:type_name -> daemon.Flag - 52, // 2: daemon.ListUsersResponse.users:type_name -> daemon.ListUsersResponse.UserInfo - 53, // 3: daemon.ListEventsResponse.events:type_name -> daemon.ListEventsResponse.Events - 54, // 4: daemon.ListEventTeamsResponse.teams:type_name -> daemon.ListEventTeamsResponse.Teams + 53, // 2: daemon.ListUsersResponse.users:type_name -> daemon.ListUsersResponse.UserInfo + 54, // 3: daemon.ListEventsResponse.events:type_name -> daemon.ListEventsResponse.Events + 55, // 4: daemon.ListEventTeamsResponse.teams:type_name -> daemon.ListEventTeamsResponse.Teams 15, // 5: daemon.ResetExerciseRequest.teams:type_name -> daemon.Team - 55, // 6: daemon.ListExercisesResponse.exercises:type_name -> daemon.ListExercisesResponse.Exercise - 57, // 7: daemon.ListFrontendsResponse.frontends:type_name -> daemon.ListFrontendsResponse.Frontend - 15, // 8: daemon.ResetFrontendsRequest.teams:type_name -> daemon.Team - 58, // 9: daemon.GetTeamInfoResponse.instances:type_name -> daemon.GetTeamInfoResponse.Instance - 56, // 10: daemon.ListExercisesResponse.Exercise.exerciseinfo:type_name -> daemon.ListExercisesResponse.Exercise.ExerciseInfo - 22, // 11: daemon.Daemon.LoginUser:input_type -> daemon.LoginUserRequest - 24, // 12: daemon.Daemon.SignupUser:input_type -> daemon.SignupUserRequest - 25, // 13: daemon.Daemon.InviteUser:input_type -> daemon.InviteUserRequest - 43, // 14: daemon.Daemon.ListUsers:input_type -> daemon.Empty - 20, // 15: daemon.Daemon.ChangeUserPasswd:input_type -> daemon.UpdatePasswdRequest - 18, // 16: daemon.Daemon.DestroyUser:input_type -> daemon.DestroyUserRequest - 17, // 17: daemon.Daemon.SetTeamSuspend:input_type -> daemon.SetTeamSuspendRequest - 8, // 18: daemon.Daemon.UpdateTeamPassword:input_type -> daemon.UpdateTeamPassRequest - 43, // 19: daemon.Daemon.GetAPICreds:input_type -> daemon.Empty - 28, // 20: daemon.Daemon.CreateEvent:input_type -> daemon.CreateEventRequest - 39, // 21: daemon.Daemon.StopEvent:input_type -> daemon.StopEventRequest - 16, // 22: daemon.Daemon.SuspendEvent:input_type -> daemon.SuspendEventRequest - 31, // 23: daemon.Daemon.ListEvents:input_type -> daemon.ListEventsRequest - 33, // 24: daemon.Daemon.ListEventTeams:input_type -> daemon.ListEventTeamsRequest - 35, // 25: daemon.Daemon.RestartTeamLab:input_type -> daemon.RestartTeamLabRequest - 10, // 26: daemon.Daemon.SolveChallenge:input_type -> daemon.SolveChallengeRequest - 2, // 27: daemon.Daemon.AddChallenge:input_type -> daemon.AddChallengeRequest - 0, // 28: daemon.Daemon.AddNotification:input_type -> daemon.AddNotificationRequest - 6, // 29: daemon.Daemon.DeleteTeam:input_type -> daemon.DeleteTeamRequest - 49, // 30: daemon.Daemon.GetTeamChals:input_type -> daemon.GetTeamInfoRequest - 29, // 31: daemon.Daemon.StressEvent:input_type -> daemon.TestEventLoadReq - 43, // 32: daemon.Daemon.ListExercises:input_type -> daemon.Empty - 36, // 33: daemon.Daemon.ResetExercise:input_type -> daemon.ResetExerciseRequest - 4, // 34: daemon.Daemon.GetExercisesByTags:input_type -> daemon.GetExsByTagsReq - 43, // 35: daemon.Daemon.ListFrontends:input_type -> daemon.Empty - 46, // 36: daemon.Daemon.ResetFrontends:input_type -> daemon.ResetFrontendsRequest - 47, // 37: daemon.Daemon.SetFrontendMemory:input_type -> daemon.SetFrontendMemoryRequest - 48, // 38: daemon.Daemon.SetFrontendCpu:input_type -> daemon.SetFrontendCpuRequest - 49, // 39: daemon.Daemon.GetTeamInfo:input_type -> daemon.GetTeamInfoRequest - 43, // 40: daemon.Daemon.MonitorHost:input_type -> daemon.Empty - 43, // 41: daemon.Daemon.Version:input_type -> daemon.Empty - 23, // 42: daemon.Daemon.LoginUser:output_type -> daemon.LoginUserResponse - 23, // 43: daemon.Daemon.SignupUser:output_type -> daemon.LoginUserResponse - 26, // 44: daemon.Daemon.InviteUser:output_type -> daemon.InviteUserResponse - 27, // 45: daemon.Daemon.ListUsers:output_type -> daemon.ListUsersResponse - 21, // 46: daemon.Daemon.ChangeUserPasswd:output_type -> daemon.UpdatePasswdResponse - 19, // 47: daemon.Daemon.DestroyUser:output_type -> daemon.DestroyUserResponse - 43, // 48: daemon.Daemon.SetTeamSuspend:output_type -> daemon.Empty - 9, // 49: daemon.Daemon.UpdateTeamPassword:output_type -> daemon.UpdateTeamPassResponse - 14, // 50: daemon.Daemon.GetAPICreds:output_type -> daemon.CredsResponse - 41, // 51: daemon.Daemon.CreateEvent:output_type -> daemon.LabStatus - 40, // 52: daemon.Daemon.StopEvent:output_type -> daemon.EventStatus - 40, // 53: daemon.Daemon.SuspendEvent:output_type -> daemon.EventStatus - 32, // 54: daemon.Daemon.ListEvents:output_type -> daemon.ListEventsResponse - 34, // 55: daemon.Daemon.ListEventTeams:output_type -> daemon.ListEventTeamsResponse - 40, // 56: daemon.Daemon.RestartTeamLab:output_type -> daemon.EventStatus - 11, // 57: daemon.Daemon.SolveChallenge:output_type -> daemon.SolveChallengeResponse - 3, // 58: daemon.Daemon.AddChallenge:output_type -> daemon.AddChallengeResponse - 1, // 59: daemon.Daemon.AddNotification:output_type -> daemon.AddNotificationResponse - 7, // 60: daemon.Daemon.DeleteTeam:output_type -> daemon.DeleteTeamResponse - 13, // 61: daemon.Daemon.GetTeamChals:output_type -> daemon.TeamChalsInfo - 30, // 62: daemon.Daemon.StressEvent:output_type -> daemon.TestEventLoadResp - 37, // 63: daemon.Daemon.ListExercises:output_type -> daemon.ListExercisesResponse - 38, // 64: daemon.Daemon.ResetExercise:output_type -> daemon.ResetTeamStatus - 5, // 65: daemon.Daemon.GetExercisesByTags:output_type -> daemon.GetExsByTagsResp - 45, // 66: daemon.Daemon.ListFrontends:output_type -> daemon.ListFrontendsResponse - 38, // 67: daemon.Daemon.ResetFrontends:output_type -> daemon.ResetTeamStatus - 43, // 68: daemon.Daemon.SetFrontendMemory:output_type -> daemon.Empty - 43, // 69: daemon.Daemon.SetFrontendCpu:output_type -> daemon.Empty - 50, // 70: daemon.Daemon.GetTeamInfo:output_type -> daemon.GetTeamInfoResponse - 42, // 71: daemon.Daemon.MonitorHost:output_type -> daemon.MonitorHostResponse - 44, // 72: daemon.Daemon.Version:output_type -> daemon.VersionResponse - 42, // [42:73] is the sub-list for method output_type - 11, // [11:42] is the sub-list for method input_type - 11, // [11:11] is the sub-list for extension type_name - 11, // [11:11] is the sub-list for extension extendee - 0, // [0:11] is the sub-list for field type_name + 56, // 6: daemon.ListExercisesResponse.exercises:type_name -> daemon.ListExercisesResponse.Exercise + 58, // 7: daemon.ListCategoriesResponse.categories:type_name -> daemon.ListCategoriesResponse.Category + 59, // 8: daemon.ListFrontendsResponse.frontends:type_name -> daemon.ListFrontendsResponse.Frontend + 15, // 9: daemon.ResetFrontendsRequest.teams:type_name -> daemon.Team + 60, // 10: daemon.GetTeamInfoResponse.instances:type_name -> daemon.GetTeamInfoResponse.Instance + 57, // 11: daemon.ListExercisesResponse.Exercise.exerciseinfo:type_name -> daemon.ListExercisesResponse.Exercise.ExerciseInfo + 22, // 12: daemon.Daemon.LoginUser:input_type -> daemon.LoginUserRequest + 24, // 13: daemon.Daemon.SignupUser:input_type -> daemon.SignupUserRequest + 25, // 14: daemon.Daemon.InviteUser:input_type -> daemon.InviteUserRequest + 44, // 15: daemon.Daemon.ListUsers:input_type -> daemon.Empty + 20, // 16: daemon.Daemon.ChangeUserPasswd:input_type -> daemon.UpdatePasswdRequest + 18, // 17: daemon.Daemon.DestroyUser:input_type -> daemon.DestroyUserRequest + 17, // 18: daemon.Daemon.SetTeamSuspend:input_type -> daemon.SetTeamSuspendRequest + 8, // 19: daemon.Daemon.UpdateTeamPassword:input_type -> daemon.UpdateTeamPassRequest + 44, // 20: daemon.Daemon.GetAPICreds:input_type -> daemon.Empty + 28, // 21: daemon.Daemon.CreateEvent:input_type -> daemon.CreateEventRequest + 40, // 22: daemon.Daemon.StopEvent:input_type -> daemon.StopEventRequest + 16, // 23: daemon.Daemon.SuspendEvent:input_type -> daemon.SuspendEventRequest + 31, // 24: daemon.Daemon.ListEvents:input_type -> daemon.ListEventsRequest + 33, // 25: daemon.Daemon.ListEventTeams:input_type -> daemon.ListEventTeamsRequest + 35, // 26: daemon.Daemon.RestartTeamLab:input_type -> daemon.RestartTeamLabRequest + 10, // 27: daemon.Daemon.SolveChallenge:input_type -> daemon.SolveChallengeRequest + 2, // 28: daemon.Daemon.AddChallenge:input_type -> daemon.AddChallengeRequest + 0, // 29: daemon.Daemon.AddNotification:input_type -> daemon.AddNotificationRequest + 6, // 30: daemon.Daemon.DeleteTeam:input_type -> daemon.DeleteTeamRequest + 50, // 31: daemon.Daemon.GetTeamChals:input_type -> daemon.GetTeamInfoRequest + 29, // 32: daemon.Daemon.StressEvent:input_type -> daemon.TestEventLoadReq + 44, // 33: daemon.Daemon.ListExercises:input_type -> daemon.Empty + 36, // 34: daemon.Daemon.ResetExercise:input_type -> daemon.ResetExerciseRequest + 4, // 35: daemon.Daemon.GetExercisesByTags:input_type -> daemon.GetExsByTagsReq + 44, // 36: daemon.Daemon.ListFrontends:input_type -> daemon.Empty + 47, // 37: daemon.Daemon.ResetFrontends:input_type -> daemon.ResetFrontendsRequest + 48, // 38: daemon.Daemon.SetFrontendMemory:input_type -> daemon.SetFrontendMemoryRequest + 49, // 39: daemon.Daemon.SetFrontendCpu:input_type -> daemon.SetFrontendCpuRequest + 50, // 40: daemon.Daemon.GetTeamInfo:input_type -> daemon.GetTeamInfoRequest + 44, // 41: daemon.Daemon.MonitorHost:input_type -> daemon.Empty + 44, // 42: daemon.Daemon.Version:input_type -> daemon.Empty + 44, // 43: daemon.Daemon.ListCategories:input_type -> daemon.Empty + 23, // 44: daemon.Daemon.LoginUser:output_type -> daemon.LoginUserResponse + 23, // 45: daemon.Daemon.SignupUser:output_type -> daemon.LoginUserResponse + 26, // 46: daemon.Daemon.InviteUser:output_type -> daemon.InviteUserResponse + 27, // 47: daemon.Daemon.ListUsers:output_type -> daemon.ListUsersResponse + 21, // 48: daemon.Daemon.ChangeUserPasswd:output_type -> daemon.UpdatePasswdResponse + 19, // 49: daemon.Daemon.DestroyUser:output_type -> daemon.DestroyUserResponse + 44, // 50: daemon.Daemon.SetTeamSuspend:output_type -> daemon.Empty + 9, // 51: daemon.Daemon.UpdateTeamPassword:output_type -> daemon.UpdateTeamPassResponse + 14, // 52: daemon.Daemon.GetAPICreds:output_type -> daemon.CredsResponse + 42, // 53: daemon.Daemon.CreateEvent:output_type -> daemon.LabStatus + 41, // 54: daemon.Daemon.StopEvent:output_type -> daemon.EventStatus + 41, // 55: daemon.Daemon.SuspendEvent:output_type -> daemon.EventStatus + 32, // 56: daemon.Daemon.ListEvents:output_type -> daemon.ListEventsResponse + 34, // 57: daemon.Daemon.ListEventTeams:output_type -> daemon.ListEventTeamsResponse + 41, // 58: daemon.Daemon.RestartTeamLab:output_type -> daemon.EventStatus + 11, // 59: daemon.Daemon.SolveChallenge:output_type -> daemon.SolveChallengeResponse + 3, // 60: daemon.Daemon.AddChallenge:output_type -> daemon.AddChallengeResponse + 1, // 61: daemon.Daemon.AddNotification:output_type -> daemon.AddNotificationResponse + 7, // 62: daemon.Daemon.DeleteTeam:output_type -> daemon.DeleteTeamResponse + 13, // 63: daemon.Daemon.GetTeamChals:output_type -> daemon.TeamChalsInfo + 30, // 64: daemon.Daemon.StressEvent:output_type -> daemon.TestEventLoadResp + 37, // 65: daemon.Daemon.ListExercises:output_type -> daemon.ListExercisesResponse + 39, // 66: daemon.Daemon.ResetExercise:output_type -> daemon.ResetTeamStatus + 5, // 67: daemon.Daemon.GetExercisesByTags:output_type -> daemon.GetExsByTagsResp + 46, // 68: daemon.Daemon.ListFrontends:output_type -> daemon.ListFrontendsResponse + 39, // 69: daemon.Daemon.ResetFrontends:output_type -> daemon.ResetTeamStatus + 44, // 70: daemon.Daemon.SetFrontendMemory:output_type -> daemon.Empty + 44, // 71: daemon.Daemon.SetFrontendCpu:output_type -> daemon.Empty + 51, // 72: daemon.Daemon.GetTeamInfo:output_type -> daemon.GetTeamInfoResponse + 43, // 73: daemon.Daemon.MonitorHost:output_type -> daemon.MonitorHostResponse + 45, // 74: daemon.Daemon.Version:output_type -> daemon.VersionResponse + 38, // 75: daemon.Daemon.ListCategories:output_type -> daemon.ListCategoriesResponse + 44, // [44:76] is the sub-list for method output_type + 12, // [12:44] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name } func init() { file_daemon_proto_init() } @@ -4569,7 +4700,7 @@ func file_daemon_proto_init() { } } file_daemon_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResetTeamStatus); i { + switch v := v.(*ListCategoriesResponse); i { case 0: return &v.state case 1: @@ -4581,7 +4712,7 @@ func file_daemon_proto_init() { } } file_daemon_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StopEventRequest); i { + switch v := v.(*ResetTeamStatus); i { case 0: return &v.state case 1: @@ -4593,7 +4724,7 @@ func file_daemon_proto_init() { } } file_daemon_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EventStatus); i { + switch v := v.(*StopEventRequest); i { case 0: return &v.state case 1: @@ -4605,7 +4736,7 @@ func file_daemon_proto_init() { } } file_daemon_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LabStatus); i { + switch v := v.(*EventStatus); i { case 0: return &v.state case 1: @@ -4617,7 +4748,7 @@ func file_daemon_proto_init() { } } file_daemon_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MonitorHostResponse); i { + switch v := v.(*LabStatus); i { case 0: return &v.state case 1: @@ -4629,7 +4760,7 @@ func file_daemon_proto_init() { } } file_daemon_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Empty); i { + switch v := v.(*MonitorHostResponse); i { case 0: return &v.state case 1: @@ -4641,7 +4772,7 @@ func file_daemon_proto_init() { } } file_daemon_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VersionResponse); i { + switch v := v.(*Empty); i { case 0: return &v.state case 1: @@ -4653,7 +4784,7 @@ func file_daemon_proto_init() { } } file_daemon_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListFrontendsResponse); i { + switch v := v.(*VersionResponse); i { case 0: return &v.state case 1: @@ -4665,7 +4796,7 @@ func file_daemon_proto_init() { } } file_daemon_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResetFrontendsRequest); i { + switch v := v.(*ListFrontendsResponse); i { case 0: return &v.state case 1: @@ -4677,7 +4808,7 @@ func file_daemon_proto_init() { } } file_daemon_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetFrontendMemoryRequest); i { + switch v := v.(*ResetFrontendsRequest); i { case 0: return &v.state case 1: @@ -4689,7 +4820,7 @@ func file_daemon_proto_init() { } } file_daemon_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetFrontendCpuRequest); i { + switch v := v.(*SetFrontendMemoryRequest); i { case 0: return &v.state case 1: @@ -4701,7 +4832,7 @@ func file_daemon_proto_init() { } } file_daemon_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetTeamInfoRequest); i { + switch v := v.(*SetFrontendCpuRequest); i { case 0: return &v.state case 1: @@ -4713,7 +4844,7 @@ func file_daemon_proto_init() { } } file_daemon_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetTeamInfoResponse); i { + switch v := v.(*GetTeamInfoRequest); i { case 0: return &v.state case 1: @@ -4725,7 +4856,7 @@ func file_daemon_proto_init() { } } file_daemon_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExsByTagsResp_ExInfo); i { + switch v := v.(*GetTeamInfoResponse); i { case 0: return &v.state case 1: @@ -4737,7 +4868,7 @@ func file_daemon_proto_init() { } } file_daemon_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListUsersResponse_UserInfo); i { + switch v := v.(*GetExsByTagsResp_ExInfo); i { case 0: return &v.state case 1: @@ -4749,7 +4880,7 @@ func file_daemon_proto_init() { } } file_daemon_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListEventsResponse_Events); i { + switch v := v.(*ListUsersResponse_UserInfo); i { case 0: return &v.state case 1: @@ -4761,7 +4892,7 @@ func file_daemon_proto_init() { } } file_daemon_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListEventTeamsResponse_Teams); i { + switch v := v.(*ListEventsResponse_Events); i { case 0: return &v.state case 1: @@ -4773,7 +4904,7 @@ func file_daemon_proto_init() { } } file_daemon_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExercisesResponse_Exercise); i { + switch v := v.(*ListEventTeamsResponse_Teams); i { case 0: return &v.state case 1: @@ -4785,7 +4916,7 @@ func file_daemon_proto_init() { } } file_daemon_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExercisesResponse_Exercise_ExerciseInfo); i { + switch v := v.(*ListExercisesResponse_Exercise); i { case 0: return &v.state case 1: @@ -4797,7 +4928,7 @@ func file_daemon_proto_init() { } } file_daemon_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListFrontendsResponse_Frontend); i { + switch v := v.(*ListExercisesResponse_Exercise_ExerciseInfo); i { case 0: return &v.state case 1: @@ -4809,6 +4940,30 @@ func file_daemon_proto_init() { } } file_daemon_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListCategoriesResponse_Category); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_daemon_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListFrontendsResponse_Frontend); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_daemon_proto_msgTypes[60].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetTeamInfoResponse_Instance); i { case 0: return &v.state @@ -4827,7 +4982,7 @@ func file_daemon_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_daemon_proto_rawDesc, NumEnums: 0, - NumMessages: 59, + NumMessages: 61, NumExtensions: 0, NumServices: 1, }, diff --git a/daemon/proto/daemon.proto b/daemon/proto/daemon.proto index 49200caf..d30d08eb 100644 --- a/daemon/proto/daemon.proto +++ b/daemon/proto/daemon.proto @@ -39,6 +39,7 @@ service Daemon { rpc GetTeamInfo (GetTeamInfoRequest) returns (GetTeamInfoResponse) {} rpc MonitorHost (Empty) returns (stream MonitorHostResponse) {} rpc Version (Empty) returns (VersionResponse) {} + rpc ListCategories (Empty) returns (ListCategoriesResponse) {} } @@ -286,6 +287,15 @@ message ListExercisesResponse { repeated Exercise exercises = 1; } +message ListCategoriesResponse { + message Category { + string tag = 1; + string name = 2; + string catDescription = 3; + } + repeated Category categories = 1; +} + message ResetTeamStatus { string teamId = 1; string status = 2; diff --git a/daemon/proto/daemon_grpc.pb.go b/daemon/proto/daemon_grpc.pb.go index 6ff47a88..df952c0a 100644 --- a/daemon/proto/daemon_grpc.pb.go +++ b/daemon/proto/daemon_grpc.pb.go @@ -49,6 +49,7 @@ type DaemonClient interface { GetTeamInfo(ctx context.Context, in *GetTeamInfoRequest, opts ...grpc.CallOption) (*GetTeamInfoResponse, error) MonitorHost(ctx context.Context, in *Empty, opts ...grpc.CallOption) (Daemon_MonitorHostClient, error) Version(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*VersionResponse, error) + ListCategories(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ListCategoriesResponse, error) } type daemonClient struct { @@ -545,6 +546,15 @@ func (c *daemonClient) Version(ctx context.Context, in *Empty, opts ...grpc.Call return out, nil } +func (c *daemonClient) ListCategories(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ListCategoriesResponse, error) { + out := new(ListCategoriesResponse) + err := c.cc.Invoke(ctx, "/daemon.Daemon/ListCategories", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // DaemonServer is the server API for Daemon service. // All implementations must embed UnimplementedDaemonServer // for forward compatibility @@ -580,6 +590,7 @@ type DaemonServer interface { GetTeamInfo(context.Context, *GetTeamInfoRequest) (*GetTeamInfoResponse, error) MonitorHost(*Empty, Daemon_MonitorHostServer) error Version(context.Context, *Empty) (*VersionResponse, error) + ListCategories(context.Context, *Empty) (*ListCategoriesResponse, error) mustEmbedUnimplementedDaemonServer() } @@ -680,6 +691,9 @@ func (UnimplementedDaemonServer) MonitorHost(*Empty, Daemon_MonitorHostServer) e func (UnimplementedDaemonServer) Version(context.Context, *Empty) (*VersionResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Version not implemented") } +func (UnimplementedDaemonServer) ListCategories(context.Context, *Empty) (*ListCategoriesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListCategories not implemented") +} func (UnimplementedDaemonServer) mustEmbedUnimplementedDaemonServer() {} // UnsafeDaemonServer may be embedded to opt out of forward compatibility for this service. @@ -1278,6 +1292,24 @@ func _Daemon_Version_Handler(srv interface{}, ctx context.Context, dec func(inte return interceptor(ctx, in, info, handler) } +func _Daemon_ListCategories_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DaemonServer).ListCategories(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/daemon.Daemon/ListCategories", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DaemonServer).ListCategories(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + // Daemon_ServiceDesc is the grpc.ServiceDesc for Daemon service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -1373,6 +1405,10 @@ var Daemon_ServiceDesc = grpc.ServiceDesc{ MethodName: "Version", Handler: _Daemon_Version_Handler, }, + { + MethodName: "ListCategories", + Handler: _Daemon_ListCategories_Handler, + }, }, Streams: []grpc.StreamDesc{ { From a9dc6a4d44e0ff4f9635ad4082b68b35bce4eb26 Mon Sep 17 00:00:00 2001 From: Mikkelhost Date: Mon, 16 Aug 2021 16:11:53 +0200 Subject: [PATCH 09/28] Added exercise proto from exercises service --- exercise/ex-proto/exercise.pb.go | 112 +++++++++++++++++-------------- exercise/ex-proto/exercise.proto | 1 + 2 files changed, 62 insertions(+), 51 deletions(-) diff --git a/exercise/ex-proto/exercise.pb.go b/exercise/ex-proto/exercise.pb.go index 5ce94711..94cbabfd 100644 --- a/exercise/ex-proto/exercise.pb.go +++ b/exercise/ex-proto/exercise.pb.go @@ -802,8 +802,9 @@ type GetCategoriesResponse_Category struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + CatDesc string `protobuf:"bytes,3,opt,name=catDesc,proto3" json:"catDesc,omitempty"` } func (x *GetCategoriesResponse_Category) Reset() { @@ -852,6 +853,13 @@ func (x *GetCategoriesResponse_Category) GetName() string { return "" } +func (x *GetCategoriesResponse_Category) GetCatDesc() string { + if x != nil { + return x.CatDesc + } + return "" +} + var File_exercise_proto protoreflect.FileDescriptor var file_exercise_proto_rawDesc = []byte{ @@ -921,63 +929,65 @@ var file_exercise_proto_rawDesc = []byte{ 0x67, 0x22, 0x3a, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x45, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x42, 0x79, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x22, 0x93, 0x01, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x22, 0xad, 0x01, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, - 0x73, 0x1a, 0x30, 0x0a, 0x08, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x73, 0x1a, 0x4a, 0x0a, 0x08, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x22, 0x2e, 0x0a, 0x12, 0x41, 0x64, 0x64, 0x45, 0x78, 0x65, 0x72, 0x63, 0x69, - 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x74, 0x22, 0x3a, 0x0a, 0x12, 0x41, 0x64, 0x64, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, - 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, - 0x10, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x32, 0xa4, 0x04, 0x0a, 0x0d, 0x45, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x53, 0x74, - 0x6f, 0x72, 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x45, 0x78, 0x65, 0x72, 0x63, 0x69, - 0x73, 0x65, 0x73, 0x12, 0x0f, 0x2e, 0x65, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1e, 0x2e, 0x65, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x2e, - 0x47, 0x65, 0x74, 0x45, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x59, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x45, 0x78, 0x65, - 0x72, 0x63, 0x69, 0x73, 0x65, 0x42, 0x79, 0x54, 0x61, 0x67, 0x73, 0x12, 0x22, 0x2e, 0x65, 0x78, - 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x65, 0x72, 0x63, 0x69, - 0x73, 0x65, 0x42, 0x79, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1e, 0x2e, 0x65, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, - 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x61, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x45, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, - 0x42, 0x79, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x26, 0x2e, 0x65, 0x78, 0x65, - 0x72, 0x63, 0x69, 0x73, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, - 0x65, 0x42, 0x79, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x65, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x2e, 0x47, 0x65, - 0x74, 0x45, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, - 0x6f, 0x72, 0x69, 0x65, 0x73, 0x12, 0x0f, 0x2e, 0x65, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, - 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1f, 0x2e, 0x65, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, - 0x65, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3b, 0x0a, 0x0c, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0f, 0x2e, 0x65, 0x78, 0x65, 0x72, - 0x63, 0x69, 0x73, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x18, 0x2e, 0x65, 0x78, 0x65, - 0x72, 0x63, 0x69, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x22, 0x00, 0x12, 0x47, 0x0a, 0x0b, 0x41, 0x64, 0x64, 0x45, 0x78, 0x65, - 0x72, 0x63, 0x69, 0x73, 0x65, 0x12, 0x1c, 0x2e, 0x65, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, - 0x2e, 0x41, 0x64, 0x64, 0x45, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x65, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x2e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x00, 0x12, - 0x47, 0x0a, 0x0b, 0x41, 0x64, 0x64, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x1c, - 0x2e, 0x65, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x61, 0x74, - 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x65, - 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x00, 0x42, 0x3a, 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x61, 0x75, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, - 0x72, 0x6b, 0x2d, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2f, 0x68, 0x61, 0x61, 0x75, - 0x6b, 0x69, 0x6e, 0x73, 0x2d, 0x65, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x73, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x61, 0x74, 0x44, 0x65, 0x73, 0x63, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x61, 0x74, 0x44, 0x65, 0x73, 0x63, 0x22, 0x2e, 0x0a, + 0x12, 0x41, 0x64, 0x64, 0x45, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x3a, 0x0a, + 0x12, 0x41, 0x64, 0x64, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x10, 0x0a, 0x0e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x32, 0xa4, 0x04, 0x0a, 0x0d, + 0x45, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x41, 0x0a, + 0x0c, 0x47, 0x65, 0x74, 0x45, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x73, 0x12, 0x0f, 0x2e, + 0x65, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1e, + 0x2e, 0x65, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x65, + 0x72, 0x63, 0x69, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x59, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x45, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x42, + 0x79, 0x54, 0x61, 0x67, 0x73, 0x12, 0x22, 0x2e, 0x65, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, + 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x42, 0x79, 0x54, 0x61, + 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x65, 0x78, 0x65, 0x72, + 0x63, 0x69, 0x73, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x61, 0x0a, 0x15, 0x47, + 0x65, 0x74, 0x45, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x42, 0x79, 0x43, 0x61, 0x74, 0x65, + 0x67, 0x6f, 0x72, 0x79, 0x12, 0x26, 0x2e, 0x65, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x2e, + 0x47, 0x65, 0x74, 0x45, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x42, 0x79, 0x43, 0x61, 0x74, + 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x65, + 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x65, 0x72, 0x63, + 0x69, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, + 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x12, + 0x0f, 0x2e, 0x65, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x1a, 0x1f, 0x2e, 0x65, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x43, + 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x3b, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x0f, 0x2e, 0x65, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x18, 0x2e, 0x65, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x2e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x00, + 0x12, 0x47, 0x0a, 0x0b, 0x41, 0x64, 0x64, 0x45, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x12, + 0x1c, 0x2e, 0x65, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x45, 0x78, + 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, + 0x65, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x00, 0x12, 0x47, 0x0a, 0x0b, 0x41, 0x64, 0x64, + 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x1c, 0x2e, 0x65, 0x78, 0x65, 0x72, 0x63, + 0x69, 0x73, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x65, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, + 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x22, 0x00, 0x42, 0x3a, 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x61, 0x61, 0x75, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2d, 0x73, 0x65, 0x63, + 0x75, 0x72, 0x69, 0x74, 0x79, 0x2f, 0x68, 0x61, 0x61, 0x75, 0x6b, 0x69, 0x6e, 0x73, 0x2d, 0x65, + 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/exercise/ex-proto/exercise.proto b/exercise/ex-proto/exercise.proto index 83392c64..324b9812 100644 --- a/exercise/ex-proto/exercise.proto +++ b/exercise/ex-proto/exercise.proto @@ -74,6 +74,7 @@ message GetCategoriesResponse{ message Category { string tag = 1; string name = 2; + string catDesc = 3; } repeated Category categories = 1; } From 8fab13885f45d2b34cf1930fb8b537e461df79a5 Mon Sep 17 00:00:00 2001 From: Mikkelhost Date: Mon, 16 Aug 2021 16:13:22 +0200 Subject: [PATCH 10/28] Added ListCategories function --- daemon/exercise.go | 44 ++++++++++++++++++++++++++++++++++++++++++++ store/model.go | 1 + 2 files changed, 45 insertions(+) diff --git a/daemon/exercise.go b/daemon/exercise.go index 2bf86853..d51dfa5a 100644 --- a/daemon/exercise.go +++ b/daemon/exercise.go @@ -21,6 +21,50 @@ import ( "github.com/rs/zerolog/log" ) +func (d *daemon) ListCategories(ctx context.Context, req *pb.Empty) (*pb.ListCategoriesResponse, error) { + var categories []*pb.ListCategoriesResponse_Category + _, err := getUserFromIncomingContext(ctx) + if err != nil { + return &pb.ListCategoriesResponse{}, NoUserInformation + } + + categs, err := d.exClient.GetCategories(ctx, &eproto.Empty{}) + if err != nil { + return &pb.ListCategoriesResponse{}, fmt.Errorf("[exercise-service]: ERR getting categories %v", err) + } + var cats []store.Category + + for _, c := range categs.Categories { + category, err := protobufToJson(c) + if err != nil { + return nil, err + } + cstruct := store.Category{} + json.Unmarshal([]byte(category), &cstruct) + cats = append(cats, cstruct) + } + + for _, c := range cats { + // Render markdown from orgdescription to html + extensions := parser.CommonExtensions | parser.AutoHeadingIDs | parser.HardLineBreak + parser := parser.NewWithExtensions(extensions) + + md := []byte(c.CatDescription) + unsafeHtml := markdown.ToHTML(md, parser, nil) + + //Sanitizing unsafe HTML with bluemonday + html := bluemonday.UGCPolicy().SanitizeBytes(unsafeHtml) + c.CatDescription = string(html) + + categories = append(categories, &pb.ListCategoriesResponse_Category{ + Tag: string(c.Tag), + Name: c.Name, + CatDescription: c.CatDescription, + }) + } + + return &pb.ListCategoriesResponse{Categories: categories}, nil +} func (d *daemon) ListExercises(ctx context.Context, req *pb.Empty) (*pb.ListExercisesResponse, error) { var vboxCount int32 var exercises []*pb.ListExercisesResponse_Exercise diff --git a/store/model.go b/store/model.go index d243b6fc..f58013ce 100644 --- a/store/model.go +++ b/store/model.go @@ -5,6 +5,7 @@ type Tag string type Category struct { Tag Tag `json:"tag,omitempty"` Name string `json:"name,omitempty"` + CatDescription string `json:"catDesc,omitempty"` } //todo manage the status somehow From cfabc7e04ea0fb058e23306ecea2d740cb1945c2 Mon Sep 17 00:00:00 2001 From: Mikkel Christiansen Date: Tue, 17 Aug 2021 12:51:25 +0200 Subject: [PATCH 11/28] Made static bool var to ignore env if static flag is present --- store/exercise.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/store/exercise.go b/store/exercise.go index 3f124688..f5c4a13f 100644 --- a/store/exercise.go +++ b/store/exercise.go @@ -69,11 +69,14 @@ func (e Exercise) ContainerOpts() []ContainerOptions { for _, flag := range conf.Flags { value := flag.StaticFlag + var static = false // static flag format in exercises file // should obey flag format HKN{*********} if value == "" { // flag is not static value = NewFlag().String() + } else { + static = true } challenges = append(challenges, Challenge{ @@ -81,7 +84,13 @@ func (e Exercise) ContainerOpts() []ContainerOptions { Tag: flag.Tag, Value: value, }) - envVars[flag.EnvVar] = value + + if static { + //Do Nothing with flag env var + } else { + envVars[flag.EnvVar] = value + } + } for _, env := range conf.Envs { From 92bedfc0b0a9d726d5b7ef65ac09e6da2b40bdad Mon Sep 17 00:00:00 2001 From: Mikkelhost <36157675+Mikkelhost@users.noreply.github.com> Date: Tue, 17 Aug 2021 15:30:33 +0200 Subject: [PATCH 12/28] Update store/exercise.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ahmet Türkmen --- store/exercise.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/store/exercise.go b/store/exercise.go index f5c4a13f..9dbac33e 100644 --- a/store/exercise.go +++ b/store/exercise.go @@ -69,7 +69,7 @@ func (e Exercise) ContainerOpts() []ContainerOptions { for _, flag := range conf.Flags { value := flag.StaticFlag - var static = false + var static = true // static flag format in exercises file // should obey flag format HKN{*********} if value == "" { From 454c21749ba80aa6816a3cc965586b461c2ab8f5 Mon Sep 17 00:00:00 2001 From: Mikkelhost <36157675+Mikkelhost@users.noreply.github.com> Date: Tue, 17 Aug 2021 15:30:38 +0200 Subject: [PATCH 13/28] Update store/exercise.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ahmet Türkmen --- store/exercise.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/store/exercise.go b/store/exercise.go index 9dbac33e..152724ef 100644 --- a/store/exercise.go +++ b/store/exercise.go @@ -84,12 +84,9 @@ func (e Exercise) ContainerOpts() []ContainerOptions { Tag: flag.Tag, Value: value, }) - - if static { - //Do Nothing with flag env var - } else { + if !static { envVars[flag.EnvVar] = value - } + } } From 12a549214128fe4ed6b4bf228138c3aff382837a Mon Sep 17 00:00:00 2001 From: Mikkelhost <36157675+Mikkelhost@users.noreply.github.com> Date: Tue, 17 Aug 2021 15:30:42 +0200 Subject: [PATCH 14/28] Update store/exercise.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ahmet Türkmen --- store/exercise.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/store/exercise.go b/store/exercise.go index 152724ef..cc188141 100644 --- a/store/exercise.go +++ b/store/exercise.go @@ -75,9 +75,8 @@ func (e Exercise) ContainerOpts() []ContainerOptions { if value == "" { // flag is not static value = NewFlag().String() - } else { - static = true - } + static = false + } challenges = append(challenges, Challenge{ Name: flag.Name, From 4acd521b549aeeb314c93669d6bb3739d3025b20 Mon Sep 17 00:00:00 2001 From: Ahmet Turkmen Date: Tue, 17 Aug 2021 15:36:44 +0200 Subject: [PATCH 15/28] update add event request and list event response messages Signed-off-by: Ahmet Turkmen --- store/proto/store.pb.go | 16 ++++++++-------- store/proto/store.proto | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/store/proto/store.pb.go b/store/proto/store.pb.go index f603fcb6..1b275fe4 100644 --- a/store/proto/store.pb.go +++ b/store/proto/store.pb.go @@ -942,7 +942,7 @@ type AddEventRequest struct { FinishedAt string `protobuf:"bytes,9,opt,name=finishedAt,proto3" json:"finishedAt,omitempty"` Status int32 `protobuf:"varint,10,opt,name=status,proto3" json:"status,omitempty"` CreatedBy string `protobuf:"bytes,11,opt,name=createdBy,proto3" json:"createdBy,omitempty"` - OnlyVPN bool `protobuf:"varint,12,opt,name=onlyVPN,proto3" json:"onlyVPN,omitempty"` + OnlyVPN int32 `protobuf:"varint,12,opt,name=onlyVPN,proto3" json:"onlyVPN,omitempty"` // 0 NoVPN 1 VPN 2 Browser+VPN SecretKey string `protobuf:"bytes,13,opt,name=secretKey,proto3" json:"secretKey,omitempty"` DisabledExercises string `protobuf:"bytes,14,opt,name=disabledExercises,proto3" json:"disabledExercises,omitempty"` } @@ -1056,11 +1056,11 @@ func (x *AddEventRequest) GetCreatedBy() string { return "" } -func (x *AddEventRequest) GetOnlyVPN() bool { +func (x *AddEventRequest) GetOnlyVPN() int32 { if x != nil { return x.OnlyVPN } - return false + return 0 } func (x *AddEventRequest) GetSecretKey() string { @@ -1620,7 +1620,7 @@ type GetEventResponse_Events struct { FinishedAt string `protobuf:"bytes,9,opt,name=finishedAt,proto3" json:"finishedAt,omitempty"` Status int32 `protobuf:"varint,10,opt,name=status,proto3" json:"status,omitempty"` CreatedBy string `protobuf:"bytes,11,opt,name=createdBy,proto3" json:"createdBy,omitempty"` - OnlyVPN bool `protobuf:"varint,12,opt,name=onlyVPN,proto3" json:"onlyVPN,omitempty"` + OnlyVPN int32 `protobuf:"varint,12,opt,name=onlyVPN,proto3" json:"onlyVPN,omitempty"` SecretKey string `protobuf:"bytes,13,opt,name=secretKey,proto3" json:"secretKey,omitempty"` DisabledExercises string `protobuf:"bytes,14,opt,name=disabledExercises,proto3" json:"disabledExercises,omitempty"` } @@ -1734,11 +1734,11 @@ func (x *GetEventResponse_Events) GetCreatedBy() string { return "" } -func (x *GetEventResponse_Events) GetOnlyVPN() bool { +func (x *GetEventResponse_Events) GetOnlyVPN() int32 { if x != nil { return x.OnlyVPN } - return false + return 0 } func (x *GetEventResponse_Events) GetSecretKey() string { @@ -1947,7 +1947,7 @@ var file_store_proto_rawDesc = []byte{ 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x6e, 0x6c, 0x79, 0x56, 0x50, 0x4e, - 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x6f, 0x6e, 0x6c, 0x79, 0x56, 0x50, 0x4e, 0x12, + 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6f, 0x6e, 0x6c, 0x79, 0x56, 0x50, 0x4e, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x11, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x45, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, @@ -1994,7 +1994,7 @@ var file_store_proto_rawDesc = []byte{ 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x12, 0x18, 0x0a, - 0x07, 0x6f, 0x6e, 0x6c, 0x79, 0x56, 0x50, 0x4e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, + 0x07, 0x6f, 0x6e, 0x6c, 0x79, 0x56, 0x50, 0x4e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6f, 0x6e, 0x6c, 0x79, 0x56, 0x50, 0x4e, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x11, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, diff --git a/store/proto/store.proto b/store/proto/store.proto index 8e5c5baf..735ea780 100644 --- a/store/proto/store.proto +++ b/store/proto/store.proto @@ -128,7 +128,7 @@ message AddEventRequest{ string finishedAt = 9; int32 status = 10; string createdBy = 11; - bool onlyVPN = 12; + int32 onlyVPN = 12; // 0 NoVPN 1 VPN 2 Browser+VPN string secretKey = 13; string disabledExercises = 14; } @@ -159,7 +159,7 @@ message GetEventResponse{ string finishedAt = 9; int32 status = 10; string createdBy =11; - bool onlyVPN = 12; + int32 onlyVPN = 12; string secretKey = 13; string disabledExercises = 14; } From a10361e7929dfae1691bc3bcc62cb28c3fe40e49 Mon Sep 17 00:00:00 2001 From: Ahmet Turkmen Date: Tue, 17 Aug 2021 15:37:08 +0200 Subject: [PATCH 16/28] update grpc message for onlyvpn field Signed-off-by: Ahmet Turkmen --- daemon/proto/daemon.pb.go | 12 ++++++------ daemon/proto/daemon.proto | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/daemon/proto/daemon.pb.go b/daemon/proto/daemon.pb.go index 462a3e06..428e0429 100644 --- a/daemon/proto/daemon.pb.go +++ b/daemon/proto/daemon.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 -// protoc v3.6.1 +// protoc-gen-go v1.27.0 +// protoc v3.17.3 // source: daemon.proto package proto @@ -1549,7 +1549,7 @@ type CreateEventRequest struct { Capacity int32 `protobuf:"varint,6,opt,name=capacity,proto3" json:"capacity,omitempty"` StartTime string `protobuf:"bytes,7,opt,name=startTime,proto3" json:"startTime,omitempty"` FinishTime string `protobuf:"bytes,8,opt,name=finishTime,proto3" json:"finishTime,omitempty"` - OnlyVPN bool `protobuf:"varint,9,opt,name=onlyVPN,proto3" json:"onlyVPN,omitempty"` + OnlyVPN int32 `protobuf:"varint,9,opt,name=onlyVPN,proto3" json:"onlyVPN,omitempty"` SecretEvent string `protobuf:"bytes,10,opt,name=secretEvent,proto3" json:"secretEvent,omitempty"` DisableExercises []string `protobuf:"bytes,11,rep,name=disableExercises,proto3" json:"disableExercises,omitempty"` } @@ -1642,11 +1642,11 @@ func (x *CreateEventRequest) GetFinishTime() string { return "" } -func (x *CreateEventRequest) GetOnlyVPN() bool { +func (x *CreateEventRequest) GetOnlyVPN() int32 { if x != nil { return x.OnlyVPN } - return false + return 0 } func (x *CreateEventRequest) GetSecretEvent() string { @@ -3741,7 +3741,7 @@ var file_daemon_proto_rawDesc = []byte{ 0x69, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x6e, 0x6c, 0x79, 0x56, 0x50, 0x4e, 0x18, 0x09, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x6f, 0x6e, 0x6c, 0x79, 0x56, 0x50, 0x4e, 0x12, 0x20, 0x0a, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6f, 0x6e, 0x6c, 0x79, 0x56, 0x50, 0x4e, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x10, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x78, 0x65, 0x72, 0x63, 0x69, diff --git a/daemon/proto/daemon.proto b/daemon/proto/daemon.proto index d30d08eb..b0a82384 100644 --- a/daemon/proto/daemon.proto +++ b/daemon/proto/daemon.proto @@ -205,7 +205,7 @@ message CreateEventRequest { int32 capacity = 6; string startTime = 7; string finishTime = 8; - bool onlyVPN = 9; + int32 onlyVPN = 9; string secretEvent = 10; repeated string disableExercises = 11; } From 712a28deac04c2776750cd4e52044c0982c7ee19 Mon Sep 17 00:00:00 2001 From: Ahmet Turkmen Date: Tue, 17 Aug 2021 15:37:42 +0200 Subject: [PATCH 17/28] update amigo handlers for browser+vpn events Signed-off-by: Ahmet Turkmen --- svcs/amigo/amigo.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/svcs/amigo/amigo.go b/svcs/amigo/amigo.go index 4ddeac78..b2990a14 100644 --- a/svcs/amigo/amigo.go +++ b/svcs/amigo/amigo.go @@ -61,7 +61,7 @@ type siteInfo struct { EventName string Team *team EventSecret string // this will be the secret value which will be used on signup ! - IsVPN bool + IsVPN int32 IsSecretEvent bool Content interface{} Hosts []Hosts @@ -183,7 +183,7 @@ func (am *Amigo) Handler(hooks Hooks, guacHandler http.Handler) http.Handler { m.HandleFunc("/vpn/status", am.handleVPNStatus(hooks.AssignLab)) m.HandleFunc("/vpn/download", am.handleVPNFiles()) m.HandleFunc("/get/labsubnet", am.handleLabInfo()) - if !am.TeamStore.OnlyVPN { + if am.TeamStore.OnlyVPN == 0 || am.TeamStore.OnlyVPN == 2 { m.Handle("/guaclogin", am.handleGuacConnection(hooks.AssignLab, guacHandler)) m.Handle("/guacamole", guacHandler) m.Handle("/guacamole/", guacHandler) @@ -860,13 +860,13 @@ func (am *Amigo) handleLogin(resumeLabHook func(t *store.Team) error) http.Handl func (am *Amigo) handleLabInfo() http.HandlerFunc { type labInfo struct { - IsVPN bool `json:"isVPN"` + IsVPN int32 `json:"isVPN"` LabSubnet string `json:"labSubnet"` } endpoint := func(w http.ResponseWriter, r *http.Request) { - if !am.TeamStore.OnlyVPN { - replyJson(http.StatusOK, w, labInfo{IsVPN: false, LabSubnet: "VPN is not enabled !"}) + if am.TeamStore.OnlyVPN == 0 { + replyJson(http.StatusOK, w, labInfo{IsVPN: 0, LabSubnet: "VPN is not enabled !"}) } else { team, err := am.getTeamFromRequest(w, r) if err != nil { @@ -876,7 +876,7 @@ func (am *Amigo) handleLabInfo() http.HandlerFunc { teamLabSubnet := team.GetLabInfo() tLabInfo := labInfo{ LabSubnet: teamLabSubnet, - IsVPN: true, + IsVPN: am.TeamStore.OnlyVPN, } replyJson(http.StatusOK, w, tLabInfo) } From b08395244d385973029f30b7a79fd895f64fc26f Mon Sep 17 00:00:00 2001 From: Ahmet Turkmen Date: Tue, 17 Aug 2021 15:38:40 +0200 Subject: [PATCH 18/28] onlyVPN refactored from bool to integer Signed-off-by: Ahmet Turkmen --- daemon/event.go | 15 +++++++++------ exercise/environment.go | 4 ++-- lab/hub.go | 2 +- lab/lab.go | 4 ++-- store/event.go | 2 +- svcs/guacamole/event.go | 36 +++++++++++++++++++++++++++++------- svcs/guacamole/guacamole.go | 4 ++-- virtual/docker/docker.go | 18 ++++++++++++------ 8 files changed, 58 insertions(+), 27 deletions(-) diff --git a/daemon/event.go b/daemon/event.go index 75fa5847..3649e23f 100644 --- a/daemon/event.go +++ b/daemon/event.go @@ -24,7 +24,10 @@ import ( const ( charSet = "abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - numSet = "0123456789" + numSet = "0123456789" + NoVPN = 0 + VPN = 1 + VPNBrowser = 2 ) var ( @@ -40,7 +43,7 @@ var ( func (d *daemon) startEvent(ev guacamole.Event) { conf := ev.GetConfig() var frontendNames []string - if !ev.GetConfig().OnlyVPN { + if ev.GetConfig().OnlyVPN != VPN { for _, f := range conf.Lab.Frontends { frontendNames = append(frontendNames, f.Image) } @@ -76,7 +79,7 @@ func (d *daemon) CreateEvent(req *pb.CreateEventRequest, resp pb.Daemon_CreateEv Str("startTime", req.StartTime). Str("finishTime", req.FinishTime). Str("SecretKey", req.SecretEvent). - Bool("VPN", req.OnlyVPN). + Int32("VPN", req.OnlyVPN). Msg("create event") // get random subnet for vpn connection // check from database if subnet is already assigned to an event or not @@ -86,7 +89,7 @@ func (d *daemon) CreateEvent(req *pb.CreateEventRequest, resp pb.Daemon_CreateEv return fmt.Errorf("user credentials could not found on context %v", err) } - if req.OnlyVPN && req.Capacity > 253 { + if (req.OnlyVPN == VPN || req.OnlyVPN == VPNBrowser) && req.Capacity > 253 { resp.Send(&pb.LabStatus{ErrorMessage: CapacityExceedsErr.Error()}) return CapacityExceedsErr } @@ -192,7 +195,7 @@ func (d *daemon) CreateEvent(req *pb.CreateEventRequest, resp pb.Daemon_CreateEv }, Status: Running, CreatedBy: user.Username, - OnlyVPN: req.OnlyVPN, + OnlyVPN: req.OnlyVPN, // 0 novpn 1 // vpn 2 // browser+vpn VPNAddress: vpnAddress, SecretKey: secretKey, } @@ -625,7 +628,7 @@ func (d *daemon) generateEventConfig(event *pbc.GetEventResponse_Events, status Str("startTime", event.StartedAt). Str("finishTime", event.ExpectedFinishTime). Str("SecretKey", event.SecretKey). - Bool("VPN", event.OnlyVPN).Msgf("Generating event config from database !") + Int32("VPN", event.OnlyVPN).Msgf("Generating event config from database !") eventConfig := store.EventConfig{ Name: event.Name, diff --git a/exercise/environment.go b/exercise/environment.go index a159e283..a4c2360d 100644 --- a/exercise/environment.go +++ b/exercise/environment.go @@ -21,7 +21,7 @@ import ( ) type Environment interface { - Create(context.Context, bool) error + Create(context.Context, int32) error Add(context.Context, ...store.Exercise) error ResetByTag(context.Context, string) error Reset(context.Context) error @@ -70,7 +70,7 @@ func (ee *environment) SetDisabledExercises(disabledExs []store.Tag) { ee.disabledExercises = disabledExs } -func (ee *environment) Create(ctx context.Context, isVPN bool) error { +func (ee *environment) Create(ctx context.Context, isVPN int32) error { network, err := docker.NewNetwork(isVPN) if err != nil { return fmt.Errorf("docker new network err %v", err) diff --git a/lab/hub.go b/lab/hub.go index 6fa837bd..5a277c93 100644 --- a/lab/hub.go +++ b/lab/hub.go @@ -36,7 +36,7 @@ type hub struct { stop chan struct{} } -func NewHub(creator Creator, buffer int, cap int, isVPN bool) (*hub, error) { +func NewHub(creator Creator, buffer int, cap int, isVPN int32) (*hub, error) { workerAmount := 2 if buffer < workerAmount { buffer = workerAmount diff --git a/lab/lab.go b/lab/lab.go index d5af58d4..6dd34318 100644 --- a/lab/lab.go +++ b/lab/lab.go @@ -56,7 +56,7 @@ func (conf Config) GetChildrenChallenges(parentTag string) []string { } type Creator interface { - NewLab(context.Context, bool) (Lab, error) + NewLab(context.Context, int32) (Lab, error) UpdateExercises([]store.Exercise) } @@ -70,7 +70,7 @@ func (lh *LabHost) UpdateExercises(newExercises []store.Exercise) { lh.Conf.Exercises = newExercises } -func (lh *LabHost) NewLab(ctx context.Context, isVPN bool) (Lab, error) { +func (lh *LabHost) NewLab(ctx context.Context, isVPN int32) (Lab, error) { env := newEnvironment(lh.Vlib) if err := env.Create(ctx, isVPN); err != nil { return nil, fmt.Errorf("new environment create err %v ", err) diff --git a/store/event.go b/store/event.go index 04222dca..5e70b5e6 100644 --- a/store/event.go +++ b/store/event.go @@ -43,7 +43,7 @@ type EventConfig struct { FinishedAt *time.Time Status int32 CreatedBy string - OnlyVPN bool + OnlyVPN int32 VPNAddress string EndPointPort int DisabledChallenges map[string][]string // list of disabled children challenge tags to be used for amigo frontend ... diff --git a/svcs/guacamole/event.go b/svcs/guacamole/event.go index 2715337d..88611da1 100755 --- a/svcs/guacamole/event.go +++ b/svcs/guacamole/event.go @@ -132,10 +132,14 @@ func (eh *eventHost) CreateEventFromEventDB(ctx context.Context, conf store.Even if err != nil { return nil, err } - if conf.OnlyVPN { + + if conf.OnlyVPN == docker.OnlyVPN || conf.OnlyVPN == docker.VPNBrowser { labConf.DisabledExercises = conf.Lab.DisabledExercises es.OnlyVPN = conf.OnlyVPN es.WireGuardConfig = eh.vpnConfig + if conf.OnlyVPN == docker.VPNBrowser { + labConf.Frontends = conf.Lab.Frontends + } } else { labConf.DisabledExercises = conf.Lab.DisabledExercises labConf.Frontends = conf.Lab.Frontends @@ -359,7 +363,7 @@ func (ev *event) DeleteTeam(id string) (bool, error) { } func (ev *event) Start(ctx context.Context) error { - if ev.store.OnlyVPN { + if ev.store.OnlyVPN == docker.OnlyVPN || ev.store.OnlyVPN == docker.VPNBrowser { //randomly taken port for each VPN endpoint port := rand.Intn(max-min) + min for checkPort(port) { @@ -376,6 +380,15 @@ func (ev *event) Start(ctx context.Context) error { IName: string(ev.store.Tag), }) + if err := ev.guac.Start(ctx); err != nil { + log. + Error(). + Err(err). + Msg("error starting guac") + + return StartingGuacErr + } + if err != nil { // handle error log.Debug().Msgf("Initializing interface %s for wireguard failed , VPN connection will not be available: %v\n", ev.store.VPNAddress, err) @@ -418,6 +431,8 @@ func (ev *event) Start(ctx context.Context) error { //CreateVPNConn will generate VPN Connection configuration per team. func (ev *event) CreateVPNConn(t *store.Team, labInfo *labNetInfo) ([]string, error) { var teamConfigFiles []string + lowBound := 240 + upperBound := 244 ctx := context.Background() var vpnIPs []string vpnInstructions := getContent(vpnInfo) @@ -445,7 +460,7 @@ func (ev *event) CreateVPNConn(t *store.Team, labInfo *labNetInfo) ([]string, er } // create 4 different config file for 1 user - for i := 240; i < 244; i++ { + for i := lowBound; i < upperBound; i++ { // generate client privatekey ipAddr := pop(&ev.ipAddrs) @@ -608,7 +623,7 @@ func (ev *event) Close() error { }(closer) } waitGroup.Wait() - if ev.store.OnlyVPN { + if ev.store.OnlyVPN == docker.OnlyVPN || ev.store.OnlyVPN == docker.VPNBrowser { ev.removeVPNConfs() ev.removeIPTableRules() } @@ -733,13 +748,14 @@ func (ev *event) AssignLab(t *store.Team, lab lab.Lab) error { subnet: lab.Environment().LabSubnet(), dnsrecords: lab.Environment().DNSRecords(), } - if !ev.store.OnlyVPN { + hosts = getDNSRecords(labInfo.dnsrecords) + + if ev.store.OnlyVPN == docker.NoVPN { if err := ev.createGuacConn(t, lab); err != nil { log.Error().Msgf("Error on creating guacamole connection !, err : %v", err) return err } - hosts = getDNSRecords(labInfo.dnsrecords) t.SetHostsInfo(hosts) log.Info().Str("Team DNS", labInfo.dns). Str("Team Subnet", labInfo.subnet). @@ -749,7 +765,13 @@ func (ev *event) AssignLab(t *store.Team, lab lab.Lab) error { log.Info().Str("Team DNS", labInfo.dns). Str("Team Subnet", labInfo.subnet). Msgf("Creating VPN connection for team %s", t.ID()) - + if ev.store.OnlyVPN == docker.VPNBrowser { + log.Debug().Msg("Creating guacamole for VPN + Browser events ") + if err := ev.createGuacConn(t, lab); err != nil { + log.Error().Msgf("Error on creating guacamole connection !, err : %v", err) + return err + } + } clientConf, err := ev.CreateVPNConn(t, labInfo) if err != nil { return err diff --git a/svcs/guacamole/guacamole.go b/svcs/guacamole/guacamole.go index c87a3e73..fd11ca9e 100644 --- a/svcs/guacamole/guacamole.go +++ b/svcs/guacamole/guacamole.go @@ -100,7 +100,7 @@ type Guacamole interface { ProxyHandler(us *GuacUserStore, klp KeyLoggerPool, am *amigo.Amigo, event Event) svcs.ProxyConnector } -func New(ctx context.Context, conf Config, onlyVPN bool) (Guacamole, error) { +func New(ctx context.Context, conf Config, onlyVPN int32) (Guacamole, error) { jar, err := cookiejar.New(nil) if err != nil { return nil, err @@ -123,7 +123,7 @@ func New(ctx context.Context, conf Config, onlyVPN bool) (Guacamole, error) { client: client, conf: conf, } - if !onlyVPN { + if onlyVPN != docker.OnlyVPN { if err := guac.create(ctx); err != nil { return nil, err } diff --git a/virtual/docker/docker.go b/virtual/docker/docker.go index 1e839699..ddc61900 100644 --- a/virtual/docker/docker.go +++ b/virtual/docker/docker.go @@ -53,6 +53,12 @@ var ( ipPool = newIPPoolFromHost() ) +const ( + NoVPN = 0 + OnlyVPN = 1 + VPNBrowser = 2 +) + func init() { var err error DefaultClient, err = docker.NewClient("unix:///var/run/docker.sock") @@ -472,7 +478,7 @@ func (c *container) BridgeAlias(alias string) (string, error) { type network struct { net *docker.Network subnet string - isVPN bool + isVPN int32 ipPool map[uint]struct{} connected []Identifier } @@ -480,19 +486,19 @@ type network struct { type Network interface { FormatIP(num int) string Interface() string - SetIsVPN(bool) + SetIsVPN(int32) Connect(c Container, ip ...int) (int, error) io.Closer } -func NewNetwork(isVPN bool) (Network, error) { +func NewNetwork(isVPN int32) (Network, error) { sub, err := ipPool.Get() if err != nil { return nil, fmt.Errorf("ip pool get new network err %v", err) } var dOption string - if isVPN { + if isVPN == OnlyVPN || isVPN == VPNBrowser { dOption = "bridge" } else { dOption = "macvlan" @@ -529,7 +535,7 @@ func NewNetwork(isVPN bool) (Network, error) { return &network{net: netw, subnet: subnet, isVPN: isVPN, ipPool: ipPool}, nil } -func (n *network) SetIsVPN(isVPN bool) { +func (n *network) SetIsVPN(isVPN int32) { n.isVPN = isVPN } func (n *network) Close() error { @@ -550,7 +556,7 @@ func (n *network) FormatIP(num int) string { func (n *network) Interface() string { var pDriver string - if n.isVPN { + if n.isVPN == OnlyVPN || n.isVPN == VPNBrowser { pDriver = "br" log.Info().Msg("Getting bridge interface from network.Interface function") } else { From 3d726ad0a9e4949e29b56c30c38318fc45afffdf Mon Sep 17 00:00:00 2001 From: Ahmet Turkmen Date: Tue, 17 Aug 2021 15:39:14 +0200 Subject: [PATCH 19/28] html templates updated according to onlyVPN field Signed-off-by: Ahmet Turkmen --- .../resources/private/challenges.tmpl.html | 16 +++--------- svcs/amigo/resources/private/info.tmpl.html | 13 +++++----- svcs/amigo/resources/private/navbar.tmpl.html | 26 ++++++++++++++----- 3 files changed, 30 insertions(+), 25 deletions(-) diff --git a/svcs/amigo/resources/private/challenges.tmpl.html b/svcs/amigo/resources/private/challenges.tmpl.html index fc52c05d..a1352d8d 100644 --- a/svcs/amigo/resources/private/challenges.tmpl.html +++ b/svcs/amigo/resources/private/challenges.tmpl.html @@ -11,22 +11,14 @@

Ch
- {{ if not .IsVPN }} - - {{ end }} - {{ if .IsVPN }} - - {{ end }} +
diff --git a/svcs/amigo/resources/private/info.tmpl.html b/svcs/amigo/resources/private/info.tmpl.html index 5a6de71f..f6efe992 100644 --- a/svcs/amigo/resources/private/info.tmpl.html +++ b/svcs/amigo/resources/private/info.tmpl.html @@ -22,17 +22,18 @@