From 3db48767968e3097d5546c1c78ef7aa25d9dd574 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 24 Apr 2025 14:20:17 +0100 Subject: [PATCH 1/2] Add possibility to marshal and unmarshal more complex configuration types --- go.mod | 3 + go.sum | 9 + runner/proto/results.pb.go | 46 ++-- runner/proto/runner.go | 18 ++ runner/proto/runner.pb.go | 157 +++++++------ runner/proto/runner.proto | 12 +- runner/proto/runner_test.go | 238 ++++++++++++++++++++ runner/proto/types.pb.go | 430 +++++++++++++++--------------------- 8 files changed, 562 insertions(+), 351 deletions(-) create mode 100644 runner/proto/runner.go create mode 100644 runner/proto/runner_test.go diff --git a/go.mod b/go.mod index 71d6b92..0720bc0 100644 --- a/go.mod +++ b/go.mod @@ -12,6 +12,7 @@ require ( github.com/google/uuid v1.6.0 github.com/hashicorp/go-hclog v1.5.0 github.com/hashicorp/go-plugin v1.6.2 + github.com/json-iterator/go v1.1.12 github.com/nats-io/nats-server/v2 v2.10.22 github.com/nats-io/nats.go v1.37.0 github.com/open-policy-agent/opa v1.0.0 @@ -56,6 +57,8 @@ require ( github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/moby/sys/userns v0.1.0 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/nats-io/jwt/v2 v2.5.8 // indirect github.com/nats-io/nkeys v0.4.7 // indirect diff --git a/go.sum b/go.sum index e593d5a..3d3817f 100644 --- a/go.sum +++ b/go.sum @@ -138,6 +138,7 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-containerregistry v0.20.2 h1:B1wPJ1SN/S7pB+ZAimcciVD+r+yV/l/DSArMxlbwseo= github.com/google/go-containerregistry v0.20.2/go.mod h1:z38EKdKh4h7IP2gSfUUqEvalZBqs6AoLeWfUy34nQC8= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= @@ -158,6 +159,8 @@ github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgf github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -205,6 +208,11 @@ github.com/moby/sys/userns v0.1.0 h1:tVLXkFOxVu9A64/yh59slHVv9ahO9UIev4JZusOLG/g github.com/moby/sys/userns v0.1.0/go.mod h1:IHUYgu/kao6N8YZlp9Cf444ySSvCmDlmzUcYfDHOl28= github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/montanaflynn/stats v0.7.1 h1:etflOAAHORrCC44V+aR6Ftzort912ZU+YLiSTuV8eaE= github.com/montanaflynn/stats v0.7.1/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= @@ -282,6 +290,7 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= diff --git a/runner/proto/results.pb.go b/runner/proto/results.pb.go index 18d4a44..0f49994 100644 --- a/runner/proto/results.pb.go +++ b/runner/proto/results.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.5 +// protoc-gen-go v1.36.6 // protoc (unknown) // source: runner/proto/results.proto @@ -183,38 +183,18 @@ func (*CreateFindingsResponse) Descriptor() ([]byte, []int) { var File_runner_proto_results_proto protoreflect.FileDescriptor -var file_runner_proto_results_proto_rawDesc = string([]byte{ - 0x0a, 0x1a, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x72, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x53, 0x0a, - 0x19, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x0c, 0x4f, 0x62, - 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x22, 0x43, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x69, 0x6e, 0x64, - 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x08, 0x46, - 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x08, 0x46, - 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x22, 0x1c, 0x0a, 0x1a, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, - 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, - 0xb5, 0x01, 0x0a, 0x09, 0x41, 0x70, 0x69, 0x48, 0x65, 0x6c, 0x70, 0x65, 0x72, 0x12, 0x59, 0x0a, - 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x46, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x1c, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -}) +const file_runner_proto_results_proto_rawDesc = "" + + "\n" + + "\x1arunner/proto/results.proto\x12\x05proto\x1a\x18runner/proto/types.proto\"S\n" + + "\x19CreateObservationsRequest\x126\n" + + "\fObservations\x18\x01 \x03(\v2\x12.proto.ObservationR\fObservations\"C\n" + + "\x15CreateFindingsRequest\x12*\n" + + "\bFindings\x18\x01 \x03(\v2\x0e.proto.FindingR\bFindings\"\x1c\n" + + "\x1aCreateObservationsResponse\"\x18\n" + + "\x16CreateFindingsResponse2\xb5\x01\n" + + "\tApiHelper\x12Y\n" + + "\x12CreateObservations\x12 .proto.CreateObservationsRequest\x1a!.proto.CreateObservationsResponse\x12M\n" + + "\x0eCreateFindings\x12\x1c.proto.CreateFindingsRequest\x1a\x1d.proto.CreateFindingsResponseB\tZ\a./protob\x06proto3" var ( file_runner_proto_results_proto_rawDescOnce sync.Once diff --git a/runner/proto/runner.go b/runner/proto/runner.go new file mode 100644 index 0000000..08b3eaa --- /dev/null +++ b/runner/proto/runner.go @@ -0,0 +1,18 @@ +package proto + +import ( + json "github.com/json-iterator/go" +) + +func (c *Config) Marshal(config map[string]interface{}) error { + data, err := json.Marshal(config) + if err != nil { + return err + } + c.Value = data + return nil +} + +func (c *Config) Unmarshal(out any) error { + return json.Unmarshal(c.GetValue(), out) +} diff --git a/runner/proto/runner.pb.go b/runner/proto/runner.pb.go index 1c5247b..2397509 100644 --- a/runner/proto/runner.pb.go +++ b/runner/proto/runner.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.5 +// protoc-gen-go v1.36.6 // protoc (unknown) // source: runner/proto/runner.proto @@ -9,6 +9,7 @@ package proto import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + _ "google.golang.org/protobuf/types/known/anypb" reflect "reflect" sync "sync" unsafe "unsafe" @@ -67,16 +68,65 @@ func (ExecutionStatus) EnumDescriptor() ([]byte, []int) { return file_runner_proto_runner_proto_rawDescGZIP(), []int{0} } +// This Config item is intended to be used to send configuration as a JSON object, +// and unmarshall it in the agent. +// We had limited time to implement this so went for the fastest and most stable option, +// removing some of the type system safety in favour of speed. +// We have added many tests to ensure whatever solution is created in future will work as expected. +type Config struct { + state protoimpl.MessageState `protogen:"open.v1"` + Value []byte `protobuf:"bytes,1,opt,name=Value,proto3" json:"Value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Config) Reset() { + *x = Config{} + mi := &file_runner_proto_runner_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Config) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Config) ProtoMessage() {} + +func (x *Config) ProtoReflect() protoreflect.Message { + mi := &file_runner_proto_runner_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Config.ProtoReflect.Descriptor instead. +func (*Config) Descriptor() ([]byte, []int) { + return file_runner_proto_runner_proto_rawDescGZIP(), []int{0} +} + +func (x *Config) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + type ConfigureRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - Config map[string]string `protobuf:"bytes,1,rep,name=config,proto3" json:"config,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + Config *Config `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *ConfigureRequest) Reset() { *x = ConfigureRequest{} - mi := &file_runner_proto_runner_proto_msgTypes[0] + mi := &file_runner_proto_runner_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -88,7 +138,7 @@ func (x *ConfigureRequest) String() string { func (*ConfigureRequest) ProtoMessage() {} func (x *ConfigureRequest) ProtoReflect() protoreflect.Message { - mi := &file_runner_proto_runner_proto_msgTypes[0] + mi := &file_runner_proto_runner_proto_msgTypes[1] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -101,10 +151,10 @@ func (x *ConfigureRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ConfigureRequest.ProtoReflect.Descriptor instead. func (*ConfigureRequest) Descriptor() ([]byte, []int) { - return file_runner_proto_runner_proto_rawDescGZIP(), []int{0} + return file_runner_proto_runner_proto_rawDescGZIP(), []int{1} } -func (x *ConfigureRequest) GetConfig() map[string]string { +func (x *ConfigureRequest) GetConfig() *Config { if x != nil { return x.Config } @@ -120,7 +170,7 @@ type ConfigureResponse struct { func (x *ConfigureResponse) Reset() { *x = ConfigureResponse{} - mi := &file_runner_proto_runner_proto_msgTypes[1] + mi := &file_runner_proto_runner_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -132,7 +182,7 @@ func (x *ConfigureResponse) String() string { func (*ConfigureResponse) ProtoMessage() {} func (x *ConfigureResponse) ProtoReflect() protoreflect.Message { - mi := &file_runner_proto_runner_proto_msgTypes[1] + mi := &file_runner_proto_runner_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -145,7 +195,7 @@ func (x *ConfigureResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ConfigureResponse.ProtoReflect.Descriptor instead. func (*ConfigureResponse) Descriptor() ([]byte, []int) { - return file_runner_proto_runner_proto_rawDescGZIP(), []int{1} + return file_runner_proto_runner_proto_rawDescGZIP(), []int{2} } func (x *ConfigureResponse) GetValue() []byte { @@ -165,7 +215,7 @@ type EvalRequest struct { func (x *EvalRequest) Reset() { *x = EvalRequest{} - mi := &file_runner_proto_runner_proto_msgTypes[2] + mi := &file_runner_proto_runner_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -177,7 +227,7 @@ func (x *EvalRequest) String() string { func (*EvalRequest) ProtoMessage() {} func (x *EvalRequest) ProtoReflect() protoreflect.Message { - mi := &file_runner_proto_runner_proto_msgTypes[2] + mi := &file_runner_proto_runner_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -190,7 +240,7 @@ func (x *EvalRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use EvalRequest.ProtoReflect.Descriptor instead. func (*EvalRequest) Descriptor() ([]byte, []int) { - return file_runner_proto_runner_proto_rawDescGZIP(), []int{2} + return file_runner_proto_runner_proto_rawDescGZIP(), []int{3} } func (x *EvalRequest) GetPolicyPaths() []string { @@ -220,7 +270,7 @@ type EvalResponse struct { func (x *EvalResponse) Reset() { *x = EvalResponse{} - mi := &file_runner_proto_runner_proto_msgTypes[3] + mi := &file_runner_proto_runner_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -232,7 +282,7 @@ func (x *EvalResponse) String() string { func (*EvalResponse) ProtoMessage() {} func (x *EvalResponse) ProtoReflect() protoreflect.Message { - mi := &file_runner_proto_runner_proto_msgTypes[3] + mi := &file_runner_proto_runner_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -245,7 +295,7 @@ func (x *EvalResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use EvalResponse.ProtoReflect.Descriptor instead. func (*EvalResponse) Descriptor() ([]byte, []int) { - return file_runner_proto_runner_proto_rawDescGZIP(), []int{3} + return file_runner_proto_runner_proto_rawDescGZIP(), []int{4} } func (x *EvalResponse) GetStatus() ExecutionStatus { @@ -257,43 +307,26 @@ func (x *EvalResponse) GetStatus() ExecutionStatus { var File_runner_proto_runner_proto protoreflect.FileDescriptor -var file_runner_proto_runner_proto_rawDesc = string([]byte{ - 0x0a, 0x19, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x72, - 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0x8a, 0x01, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3b, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x39, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, - 0x29, 0x0a, 0x11, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x4d, 0x0a, 0x0b, 0x45, 0x76, - 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x6f, 0x6c, - 0x69, 0x63, 0x79, 0x50, 0x61, 0x74, 0x68, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, - 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x50, 0x61, 0x74, 0x68, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x61, - 0x70, 0x69, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, - 0x61, 0x70, 0x69, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x22, 0x3e, 0x0a, 0x0c, 0x45, 0x76, 0x61, - 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2a, 0x2b, 0x0a, 0x0f, 0x45, 0x78, 0x65, - 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, - 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x46, 0x41, 0x49, - 0x4c, 0x55, 0x52, 0x45, 0x10, 0x01, 0x32, 0x79, 0x0a, 0x06, 0x52, 0x75, 0x6e, 0x6e, 0x65, 0x72, - 0x12, 0x3e, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x12, 0x17, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x2f, 0x0a, 0x04, 0x45, 0x76, 0x61, 0x6c, 0x12, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, -}) +const file_runner_proto_runner_proto_rawDesc = "" + + "\n" + + "\x19runner/proto/runner.proto\x12\x05proto\x1a\x19google/protobuf/any.proto\"\x1e\n" + + "\x06Config\x12\x14\n" + + "\x05Value\x18\x01 \x01(\fR\x05Value\"9\n" + + "\x10ConfigureRequest\x12%\n" + + "\x06config\x18\x01 \x01(\v2\r.proto.ConfigR\x06config\")\n" + + "\x11ConfigureResponse\x12\x14\n" + + "\x05value\x18\x01 \x01(\fR\x05value\"M\n" + + "\vEvalRequest\x12 \n" + + "\vpolicyPaths\x18\x01 \x03(\tR\vpolicyPaths\x12\x1c\n" + + "\tapiServer\x18\x02 \x01(\rR\tapiServer\">\n" + + "\fEvalResponse\x12.\n" + + "\x06status\x18\x01 \x01(\x0e2\x16.proto.ExecutionStatusR\x06status*+\n" + + "\x0fExecutionStatus\x12\v\n" + + "\aSUCCESS\x10\x00\x12\v\n" + + "\aFAILURE\x10\x012y\n" + + "\x06Runner\x12>\n" + + "\tConfigure\x12\x17.proto.ConfigureRequest\x1a\x18.proto.ConfigureResponse\x12/\n" + + "\x04Eval\x12\x12.proto.EvalRequest\x1a\x13.proto.EvalResponseB\tZ\a./protob\x06proto3" var ( file_runner_proto_runner_proto_rawDescOnce sync.Once @@ -311,19 +344,19 @@ var file_runner_proto_runner_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_runner_proto_runner_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_runner_proto_runner_proto_goTypes = []any{ (ExecutionStatus)(0), // 0: proto.ExecutionStatus - (*ConfigureRequest)(nil), // 1: proto.ConfigureRequest - (*ConfigureResponse)(nil), // 2: proto.ConfigureResponse - (*EvalRequest)(nil), // 3: proto.EvalRequest - (*EvalResponse)(nil), // 4: proto.EvalResponse - nil, // 5: proto.ConfigureRequest.ConfigEntry + (*Config)(nil), // 1: proto.Config + (*ConfigureRequest)(nil), // 2: proto.ConfigureRequest + (*ConfigureResponse)(nil), // 3: proto.ConfigureResponse + (*EvalRequest)(nil), // 4: proto.EvalRequest + (*EvalResponse)(nil), // 5: proto.EvalResponse } var file_runner_proto_runner_proto_depIdxs = []int32{ - 5, // 0: proto.ConfigureRequest.config:type_name -> proto.ConfigureRequest.ConfigEntry + 1, // 0: proto.ConfigureRequest.config:type_name -> proto.Config 0, // 1: proto.EvalResponse.status:type_name -> proto.ExecutionStatus - 1, // 2: proto.Runner.Configure:input_type -> proto.ConfigureRequest - 3, // 3: proto.Runner.Eval:input_type -> proto.EvalRequest - 2, // 4: proto.Runner.Configure:output_type -> proto.ConfigureResponse - 4, // 5: proto.Runner.Eval:output_type -> proto.EvalResponse + 2, // 2: proto.Runner.Configure:input_type -> proto.ConfigureRequest + 4, // 3: proto.Runner.Eval:input_type -> proto.EvalRequest + 3, // 4: proto.Runner.Configure:output_type -> proto.ConfigureResponse + 5, // 5: proto.Runner.Eval:output_type -> proto.EvalResponse 4, // [4:6] is the sub-list for method output_type 2, // [2:4] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name diff --git a/runner/proto/runner.proto b/runner/proto/runner.proto index 9def54f..30b00b5 100644 --- a/runner/proto/runner.proto +++ b/runner/proto/runner.proto @@ -1,5 +1,6 @@ syntax = "proto3"; package proto; +import "google/protobuf/any.proto"; option go_package = "./proto"; @@ -8,8 +9,17 @@ enum ExecutionStatus { FAILURE = 1; } +// This Config item is intended to be used to send configuration as a JSON object, +// and unmarshall it in the agent. +// We had limited time to implement this so went for the fastest and most stable option, +// removing some of the type system safety in favour of speed. +// We have added many tests to ensure whatever solution is created in future will work as expected. +message Config { + bytes Value = 1; +} + message ConfigureRequest { - map config = 1; + Config config = 1; } message ConfigureResponse { diff --git a/runner/proto/runner_test.go b/runner/proto/runner_test.go new file mode 100644 index 0000000..b49d8bb --- /dev/null +++ b/runner/proto/runner_test.go @@ -0,0 +1,238 @@ +package proto + +import ( + "github.com/stretchr/testify/assert" + "gopkg.in/yaml.v2" + "testing" +) + +func TestConfig_UnmarshalMap(t *testing.T) { + t.Run("Basic map", func(t *testing.T) { + config := &Config{} + err := config.Marshal(map[string]interface{}{ + "name": "Chris", + "age": int32(18), + }) + assert.NoError(t, err) + + output := map[string]interface{}{} + err = config.Unmarshal(&output) + assert.NoError(t, err) + assert.Equal(t, "Chris", output["name"]) + assert.EqualValues(t, 18, output["age"]) + }) + t.Run("Complex map", func(t *testing.T) { + config := &Config{} + err := config.Marshal(map[string]interface{}{ + "name": "Chris", + "age": int32(18), + "active": false, + "price": 12.12, + }) + assert.NoError(t, err) + + output := map[string]interface{}{} + err = config.Unmarshal(&output) + assert.NoError(t, err) + assert.Equal(t, "Chris", output["name"]) + assert.EqualValues(t, 18, output["age"]) + assert.Equal(t, false, output["active"]) + assert.EqualValues(t, 12.12, output["price"]) + }) + t.Run("nest", func(t *testing.T) { + config := &Config{} + err := config.Marshal(map[string]interface{}{ + "name": "Chris", + "friends": map[string]interface{}{ + "chris": map[string]interface{}{ + "age": 18, + "home": "London", + }, + }, + }) + assert.NoError(t, err) + + output := map[string]interface{}{} + err = config.Unmarshal(&output) + assert.NoError(t, err) + assert.Equal(t, "Chris", output["name"]) + assert.EqualValues(t, 18, output["friends"].(map[string]interface{})["chris"].(map[string]interface{})["age"]) + assert.EqualValues(t, "London", output["friends"].(map[string]interface{})["chris"].(map[string]interface{})["home"]) + }) + t.Run("list of scalar", func(t *testing.T) { + config := &Config{} + err := config.Marshal(map[string]interface{}{ + "name": "Chris", + "friends": []string{ + "Darren", + "Rod", + }, + }) + assert.NoError(t, err) + + output := map[string]interface{}{} + err = config.Unmarshal(&output) + assert.NoError(t, err) + assert.Equal(t, "Chris", output["name"]) + assert.EqualValues(t, []interface{}{ + "Darren", + "Rod", + }, output["friends"]) + }) + t.Run("List of map", func(t *testing.T) { + config := &Config{} + err := config.Marshal(map[string]interface{}{ + "name": "Chris", + "friends": []map[string]interface{}{ + { + "name": "Chris", + }, + }, + }) + assert.NoError(t, err) + + output := map[string]interface{}{} + err = config.Unmarshal(&output) + assert.NoError(t, err) + assert.Equal(t, "Chris", output["name"]) + assert.Len(t, output["friends"], 1) + assert.Equal(t, "Chris", output["friends"].([]interface{})[0].(map[string]interface{})["name"]) + }) +} + +func TestConfigureRequest_KitchenSink(t *testing.T) { + t.Run("Basic config", func(t *testing.T) { + yamlContent := ` +name: "Chris" +age: 12 +` + input := map[string]interface{}{} + err := yaml.Unmarshal([]byte(yamlContent), input) + if err != nil { + t.Fatal(err) + } + + config := &Config{} + err = config.Marshal(input) + if err != nil { + t.Fatal(err) + } + + type PluginConfig struct { + Name string + Age int32 + } + output := PluginConfig{} + err = config.Unmarshal(&output) + if err != nil { + t.Fatal(err) + } + + assert.Equal(t, "Chris", output.Name) + assert.Equal(t, int32(12), output.Age) + }) + t.Run("Nested config", func(t *testing.T) { + yamlContent := ` +details: + name: "Chris" + age: 20 + active: false +` + input := map[string]interface{}{} + err := yaml.Unmarshal([]byte(yamlContent), input) + if err != nil { + t.Fatal(err) + } + + config := &Config{} + err = config.Marshal(input) + if err != nil { + t.Fatal(err) + } + + type PluginConfig struct { + Details struct { + Name string + Age int32 + Active bool + } + } + output := PluginConfig{} + err = config.Unmarshal(&output) + if err != nil { + t.Fatal(err) + } + + assert.Equal(t, "Chris", output.Details.Name) + assert.Equal(t, int32(20), output.Details.Age) + assert.Equal(t, false, output.Details.Active) + }) + t.Run("List scalar", func(t *testing.T) { + yamlContent := ` +people: + - Chris + - Tanner +` + input := map[string]interface{}{} + err := yaml.Unmarshal([]byte(yamlContent), input) + if err != nil { + t.Fatal(err) + } + + config := &Config{} + err = config.Marshal(input) + if err != nil { + t.Fatal(err) + } + + type PluginConfig struct { + People []string + } + output := PluginConfig{} + err = config.Unmarshal(&output) + if err != nil { + t.Fatal(err) + } + + assert.Equal(t, []string{ + "Chris", + "Tanner", + }, output.People) + }) + t.Run("List Maps", func(t *testing.T) { + yamlContent := ` +people: + - name: Chris + age: 20 + active: false +` + input := map[string]interface{}{} + err := yaml.Unmarshal([]byte(yamlContent), input) + if err != nil { + t.Fatal(err) + } + + config := &Config{} + err = config.Marshal(input) + if err != nil { + t.Fatal(err) + } + + type PluginConfig struct { + People []struct { + Name string + Age int32 + Active bool + } + } + output := PluginConfig{} + err = config.Unmarshal(&output) + if err != nil { + t.Fatal(err) + } + + assert.Equal(t, "Chris", output.People[0].Name) + assert.Equal(t, int32(20), output.People[0].Age) + assert.Equal(t, false, output.People[0].Active) + }) +} diff --git a/runner/proto/types.pb.go b/runner/proto/types.pb.go index 8d51366..4bd4184 100644 --- a/runner/proto/types.pb.go +++ b/runner/proto/types.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.5 +// protoc-gen-go v1.36.6 // protoc (unknown) // source: runner/proto/types.proto @@ -1423,260 +1423,180 @@ func (x *Finding) GetProps() []*Property { var File_runner_proto_types_proto protoreflect.FileDescriptor -var file_runner_proto_types_proto_rawDesc = string([]byte{ - 0x0a, 0x18, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0xe7, 0x01, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, - 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, - 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x17, 0x0a, 0x04, 0x55, 0x75, 0x69, - 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x55, 0x75, 0x69, 0x64, 0x88, - 0x01, 0x01, 0x12, 0x13, 0x0a, 0x02, 0x4e, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, - 0x52, 0x02, 0x4e, 0x73, 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, 0x05, 0x43, 0x6c, 0x61, 0x73, 0x73, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x05, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x88, - 0x01, 0x01, 0x12, 0x19, 0x0a, 0x05, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x09, 0x48, 0x03, 0x52, 0x05, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, - 0x07, 0x52, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x48, 0x04, - 0x52, 0x07, 0x52, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, - 0x5f, 0x55, 0x75, 0x69, 0x64, 0x42, 0x05, 0x0a, 0x03, 0x5f, 0x4e, 0x73, 0x42, 0x08, 0x0a, 0x06, - 0x5f, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x47, 0x72, 0x6f, 0x75, 0x70, - 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x52, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x22, 0xd2, 0x01, 0x0a, - 0x04, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x48, 0x72, 0x65, 0x66, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x48, 0x72, 0x65, 0x66, 0x12, 0x15, 0x0a, 0x03, 0x52, 0x65, 0x6c, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x03, 0x52, 0x65, 0x6c, 0x88, 0x01, 0x01, - 0x12, 0x21, 0x0a, 0x09, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x09, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, - 0x88, 0x01, 0x01, 0x12, 0x2f, 0x0a, 0x10, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x46, - 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, - 0x10, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x46, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, - 0x74, 0x88, 0x01, 0x01, 0x12, 0x17, 0x0a, 0x04, 0x54, 0x65, 0x78, 0x74, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x48, 0x03, 0x52, 0x04, 0x54, 0x65, 0x78, 0x74, 0x88, 0x01, 0x01, 0x42, 0x06, 0x0a, - 0x04, 0x5f, 0x52, 0x65, 0x6c, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x54, - 0x79, 0x70, 0x65, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x46, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x54, 0x65, 0x78, - 0x74, 0x22, 0xa3, 0x01, 0x0a, 0x0b, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x41, 0x63, 0x74, 0x6f, - 0x72, 0x12, 0x17, 0x0a, 0x04, 0x55, 0x55, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, - 0x00, 0x52, 0x04, 0x55, 0x55, 0x49, 0x44, 0x88, 0x01, 0x01, 0x12, 0x14, 0x0a, 0x05, 0x54, 0x69, - 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x54, 0x69, 0x74, 0x6c, 0x65, - 0x12, 0x12, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x21, 0x0a, 0x05, 0x4c, 0x69, 0x6e, 0x6b, 0x73, 0x18, 0x04, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, - 0x52, 0x05, 0x4c, 0x69, 0x6e, 0x6b, 0x73, 0x12, 0x25, 0x0a, 0x05, 0x50, 0x72, 0x6f, 0x70, 0x73, - 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, - 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x52, 0x05, 0x50, 0x72, 0x6f, 0x70, 0x73, 0x42, 0x07, - 0x0a, 0x05, 0x5f, 0x55, 0x55, 0x49, 0x44, 0x22, 0x34, 0x0a, 0x06, 0x4f, 0x72, 0x69, 0x67, 0x69, - 0x6e, 0x12, 0x2a, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, - 0x41, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x06, 0x41, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x22, 0x54, 0x0a, - 0x08, 0x54, 0x68, 0x72, 0x65, 0x61, 0x74, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x79, 0x73, - 0x74, 0x65, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x53, 0x79, 0x73, 0x74, 0x65, - 0x6d, 0x12, 0x17, 0x0a, 0x04, 0x48, 0x72, 0x65, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, - 0x00, 0x52, 0x04, 0x48, 0x72, 0x65, 0x66, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x48, - 0x72, 0x65, 0x66, 0x22, 0x56, 0x0a, 0x12, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, - 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x49, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x49, - 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x04, 0x48, 0x72, 0x65, - 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x48, 0x72, 0x65, 0x66, 0x88, - 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x48, 0x72, 0x65, 0x66, 0x22, 0x6a, 0x0a, 0x10, 0x43, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, - 0x14, 0x0a, 0x05, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x49, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x73, 0x22, 0xc8, 0x02, 0x0a, 0x10, 0x53, 0x75, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x19, 0x0a, 0x05, - 0x54, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x54, - 0x69, 0x74, 0x6c, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x07, 0x52, 0x65, 0x6d, 0x61, 0x72, - 0x6b, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x07, 0x52, 0x65, 0x6d, 0x61, - 0x72, 0x6b, 0x73, 0x88, 0x01, 0x01, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x47, 0x0a, 0x0a, 0x41, 0x74, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, - 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, - 0x74, 0x65, 0x73, 0x12, 0x21, 0x0a, 0x05, 0x4c, 0x69, 0x6e, 0x6b, 0x73, 0x18, 0x05, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x52, - 0x05, 0x4c, 0x69, 0x6e, 0x6b, 0x73, 0x12, 0x25, 0x0a, 0x05, 0x50, 0x72, 0x6f, 0x70, 0x73, 0x18, - 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x72, - 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x52, 0x05, 0x50, 0x72, 0x6f, 0x70, 0x73, 0x1a, 0x3d, 0x0a, - 0x0f, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x08, 0x0a, 0x06, - 0x5f, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x52, 0x65, 0x6d, 0x61, 0x72, - 0x6b, 0x73, 0x22, 0xc1, 0x01, 0x0a, 0x0d, 0x52, 0x69, 0x73, 0x6b, 0x52, 0x65, 0x66, 0x65, 0x72, - 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, - 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x66, 0x69, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x17, 0x0a, 0x04, - 0x48, 0x72, 0x65, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x48, 0x72, - 0x65, 0x66, 0x88, 0x01, 0x01, 0x12, 0x27, 0x0a, 0x07, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x73, - 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4f, - 0x72, 0x69, 0x67, 0x69, 0x6e, 0x52, 0x07, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x73, 0x12, 0x2d, - 0x0a, 0x09, 0x54, 0x68, 0x72, 0x65, 0x61, 0x74, 0x49, 0x64, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x54, 0x68, 0x72, 0x65, 0x61, 0x74, - 0x49, 0x64, 0x52, 0x09, 0x54, 0x68, 0x72, 0x65, 0x61, 0x74, 0x49, 0x64, 0x73, 0x42, 0x07, 0x0a, - 0x05, 0x5f, 0x48, 0x72, 0x65, 0x66, 0x22, 0x3e, 0x0a, 0x12, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, - 0x64, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x0f, - 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x55, 0x49, 0x44, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x55, 0x55, 0x49, 0x44, 0x22, 0x30, 0x0a, 0x0e, 0x41, 0x73, 0x73, 0x6f, 0x63, 0x69, - 0x61, 0x74, 0x65, 0x64, 0x52, 0x69, 0x73, 0x6b, 0x12, 0x1e, 0x0a, 0x0a, 0x49, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x49, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x22, 0xcb, 0x01, 0x0a, 0x10, 0x52, 0x65, 0x6c, - 0x65, 0x76, 0x61, 0x6e, 0x74, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x20, 0x0a, - 0x0b, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x1d, 0x0a, 0x07, 0x52, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x48, 0x00, 0x52, 0x07, 0x52, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x88, 0x01, 0x01, 0x12, 0x17, - 0x0a, 0x04, 0x48, 0x72, 0x65, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x04, - 0x48, 0x72, 0x65, 0x66, 0x88, 0x01, 0x01, 0x12, 0x21, 0x0a, 0x05, 0x4c, 0x69, 0x6e, 0x6b, 0x73, - 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, - 0x69, 0x6e, 0x6b, 0x52, 0x05, 0x4c, 0x69, 0x6e, 0x6b, 0x73, 0x12, 0x25, 0x0a, 0x05, 0x50, 0x72, - 0x6f, 0x70, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x52, 0x05, 0x50, 0x72, 0x6f, 0x70, - 0x73, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x52, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x42, 0x07, 0x0a, - 0x05, 0x5f, 0x48, 0x72, 0x65, 0x66, 0x22, 0xd5, 0x01, 0x0a, 0x04, 0x53, 0x74, 0x65, 0x70, 0x12, - 0x17, 0x0a, 0x04, 0x55, 0x55, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, - 0x04, 0x55, 0x55, 0x49, 0x44, 0x88, 0x01, 0x01, 0x12, 0x14, 0x0a, 0x05, 0x54, 0x69, 0x74, 0x6c, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, - 0x0a, 0x0b, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x1d, 0x0a, 0x07, 0x52, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x48, 0x01, 0x52, 0x07, 0x52, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x88, 0x01, 0x01, 0x12, - 0x21, 0x0a, 0x05, 0x4c, 0x69, 0x6e, 0x6b, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x05, 0x4c, 0x69, 0x6e, - 0x6b, 0x73, 0x12, 0x25, 0x0a, 0x05, 0x50, 0x72, 0x6f, 0x70, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, - 0x74, 0x79, 0x52, 0x05, 0x50, 0x72, 0x6f, 0x70, 0x73, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x55, 0x55, - 0x49, 0x44, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x52, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x22, 0xfc, - 0x01, 0x0a, 0x08, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x17, 0x0a, 0x04, 0x55, - 0x55, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x55, 0x55, 0x49, - 0x44, 0x88, 0x01, 0x01, 0x12, 0x14, 0x0a, 0x05, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x44, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x07, - 0x52, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, - 0x07, 0x52, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x88, 0x01, 0x01, 0x12, 0x21, 0x0a, 0x05, 0x53, - 0x74, 0x65, 0x70, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x53, 0x74, 0x65, 0x70, 0x52, 0x05, 0x53, 0x74, 0x65, 0x70, 0x73, 0x12, 0x21, - 0x0a, 0x05, 0x4c, 0x69, 0x6e, 0x6b, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x05, 0x4c, 0x69, 0x6e, 0x6b, - 0x73, 0x12, 0x25, 0x0a, 0x05, 0x50, 0x72, 0x6f, 0x70, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, - 0x79, 0x52, 0x05, 0x50, 0x72, 0x6f, 0x70, 0x73, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x55, 0x55, 0x49, - 0x44, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x52, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x22, 0x97, 0x05, - 0x0a, 0x0b, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, - 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, 0x44, 0x12, 0x12, 0x0a, - 0x04, 0x55, 0x55, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x55, 0x55, 0x49, - 0x44, 0x12, 0x19, 0x0a, 0x05, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x48, 0x00, 0x52, 0x05, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x88, 0x01, 0x01, 0x12, 0x20, 0x0a, 0x0b, - 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, - 0x0a, 0x07, 0x52, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, - 0x01, 0x52, 0x07, 0x52, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x88, 0x01, 0x01, 0x12, 0x38, 0x0a, - 0x09, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x43, 0x6f, - 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, 0x39, 0x0a, 0x07, 0x45, 0x78, 0x70, 0x69, 0x72, - 0x65, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x48, 0x02, 0x52, 0x07, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x88, - 0x01, 0x01, 0x12, 0x18, 0x0a, 0x07, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x08, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x07, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x12, 0x21, 0x0a, 0x05, - 0x4c, 0x69, 0x6e, 0x6b, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x05, 0x4c, 0x69, 0x6e, 0x6b, 0x73, 0x12, - 0x25, 0x0a, 0x05, 0x50, 0x72, 0x6f, 0x70, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x52, - 0x05, 0x50, 0x72, 0x6f, 0x70, 0x73, 0x12, 0x27, 0x0a, 0x07, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, - 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x52, 0x07, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x73, 0x12, - 0x33, 0x0a, 0x08, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x53, 0x75, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x73, 0x12, 0x2f, 0x0a, 0x0a, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x69, - 0x65, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x52, 0x0a, 0x41, 0x63, 0x74, 0x69, 0x76, - 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, - 0x6e, 0x74, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x66, 0x65, 0x72, - 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0a, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, - 0x12, 0x43, 0x0a, 0x10, 0x52, 0x65, 0x6c, 0x65, 0x76, 0x61, 0x6e, 0x74, 0x45, 0x76, 0x69, 0x64, - 0x65, 0x6e, 0x63, 0x65, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x76, 0x61, 0x6e, 0x74, 0x45, 0x76, 0x69, 0x64, 0x65, - 0x6e, 0x63, 0x65, 0x52, 0x10, 0x52, 0x65, 0x6c, 0x65, 0x76, 0x61, 0x6e, 0x74, 0x45, 0x76, 0x69, - 0x64, 0x65, 0x6e, 0x63, 0x65, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x42, - 0x0a, 0x0a, 0x08, 0x5f, 0x52, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x42, 0x0a, 0x0a, 0x08, 0x5f, - 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x22, 0xf6, 0x01, 0x0a, 0x0d, 0x46, 0x69, 0x6e, 0x64, - 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x19, 0x0a, 0x05, 0x54, 0x69, 0x74, - 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x54, 0x69, 0x74, 0x6c, - 0x65, 0x88, 0x01, 0x01, 0x12, 0x25, 0x0a, 0x0b, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x0b, 0x44, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x07, 0x52, - 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x07, - 0x52, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x88, 0x01, 0x01, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x74, - 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x12, 0x21, 0x0a, 0x05, 0x4c, 0x69, 0x6e, 0x6b, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x0b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x05, 0x4c, 0x69, - 0x6e, 0x6b, 0x73, 0x12, 0x25, 0x0a, 0x05, 0x50, 0x72, 0x6f, 0x70, 0x73, 0x18, 0x06, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, - 0x72, 0x74, 0x79, 0x52, 0x05, 0x50, 0x72, 0x6f, 0x70, 0x73, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x54, - 0x69, 0x74, 0x6c, 0x65, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x52, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x73, - 0x22, 0xf8, 0x05, 0x0a, 0x07, 0x46, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x0e, 0x0a, 0x02, - 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, - 0x55, 0x55, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x55, 0x55, 0x49, 0x44, - 0x12, 0x14, 0x0a, 0x05, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x44, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x07, 0x52, 0x65, 0x6d, 0x61, - 0x72, 0x6b, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x07, 0x52, 0x65, 0x6d, - 0x61, 0x72, 0x6b, 0x73, 0x88, 0x01, 0x01, 0x12, 0x38, 0x0a, 0x09, 0x43, 0x6f, 0x6c, 0x6c, 0x65, - 0x63, 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x65, - 0x64, 0x12, 0x32, 0x0a, 0x06, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x69, 0x6e, - 0x67, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x4c, - 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x27, 0x0a, 0x07, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x73, - 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4f, - 0x72, 0x69, 0x67, 0x69, 0x6e, 0x52, 0x07, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x73, 0x12, 0x33, - 0x0a, 0x08, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x53, 0x75, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x73, 0x12, 0x39, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, - 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, - 0x63, 0x65, 0x52, 0x0a, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x4b, - 0x0a, 0x13, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x4f, 0x62, 0x73, 0x65, 0x72, - 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x4f, - 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x33, 0x0a, 0x08, 0x43, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x52, 0x65, 0x66, - 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x73, - 0x12, 0x2a, 0x0a, 0x05, 0x52, 0x69, 0x73, 0x6b, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x69, 0x73, 0x6b, 0x52, 0x65, 0x66, 0x65, - 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x05, 0x52, 0x69, 0x73, 0x6b, 0x73, 0x12, 0x2c, 0x0a, 0x06, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x52, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x21, 0x0a, 0x05, 0x4c, 0x69, - 0x6e, 0x6b, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x05, 0x4c, 0x69, 0x6e, 0x6b, 0x73, 0x12, 0x25, 0x0a, - 0x05, 0x50, 0x72, 0x6f, 0x70, 0x73, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x52, 0x05, 0x50, - 0x72, 0x6f, 0x70, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, - 0x0a, 0x0a, 0x08, 0x5f, 0x52, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x42, 0x09, 0x5a, 0x07, 0x2e, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -}) +const file_runner_proto_types_proto_rawDesc = "" + + "\n" + + "\x18runner/proto/types.proto\x12\x05proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe7\x01\n" + + "\bProperty\x12\x12\n" + + "\x04Name\x18\x01 \x01(\tR\x04Name\x12\x14\n" + + "\x05Value\x18\x02 \x01(\tR\x05Value\x12\x17\n" + + "\x04Uuid\x18\x03 \x01(\tH\x00R\x04Uuid\x88\x01\x01\x12\x13\n" + + "\x02Ns\x18\x04 \x01(\tH\x01R\x02Ns\x88\x01\x01\x12\x19\n" + + "\x05Class\x18\x05 \x01(\tH\x02R\x05Class\x88\x01\x01\x12\x19\n" + + "\x05Group\x18\x06 \x01(\tH\x03R\x05Group\x88\x01\x01\x12\x1d\n" + + "\aRemarks\x18\a \x01(\tH\x04R\aRemarks\x88\x01\x01B\a\n" + + "\x05_UuidB\x05\n" + + "\x03_NsB\b\n" + + "\x06_ClassB\b\n" + + "\x06_GroupB\n" + + "\n" + + "\b_Remarks\"\xd2\x01\n" + + "\x04Link\x12\x12\n" + + "\x04Href\x18\x01 \x01(\tR\x04Href\x12\x15\n" + + "\x03Rel\x18\x02 \x01(\tH\x00R\x03Rel\x88\x01\x01\x12!\n" + + "\tMediaType\x18\x03 \x01(\tH\x01R\tMediaType\x88\x01\x01\x12/\n" + + "\x10ResourceFragment\x18\x04 \x01(\tH\x02R\x10ResourceFragment\x88\x01\x01\x12\x17\n" + + "\x04Text\x18\x05 \x01(\tH\x03R\x04Text\x88\x01\x01B\x06\n" + + "\x04_RelB\f\n" + + "\n" + + "_MediaTypeB\x13\n" + + "\x11_ResourceFragmentB\a\n" + + "\x05_Text\"\xa3\x01\n" + + "\vOriginActor\x12\x17\n" + + "\x04UUID\x18\x01 \x01(\tH\x00R\x04UUID\x88\x01\x01\x12\x14\n" + + "\x05Title\x18\x02 \x01(\tR\x05Title\x12\x12\n" + + "\x04Type\x18\x03 \x01(\tR\x04Type\x12!\n" + + "\x05Links\x18\x04 \x03(\v2\v.proto.LinkR\x05Links\x12%\n" + + "\x05Props\x18\x05 \x03(\v2\x0f.proto.PropertyR\x05PropsB\a\n" + + "\x05_UUID\"4\n" + + "\x06Origin\x12*\n" + + "\x06Actors\x18\x01 \x03(\v2\x12.proto.OriginActorR\x06Actors\"T\n" + + "\bThreatId\x12\x0e\n" + + "\x02ID\x18\x01 \x01(\tR\x02ID\x12\x16\n" + + "\x06System\x18\x02 \x01(\tR\x06System\x12\x17\n" + + "\x04Href\x18\x03 \x01(\tH\x00R\x04Href\x88\x01\x01B\a\n" + + "\x05_Href\"V\n" + + "\x12ComponentReference\x12\x1e\n" + + "\n" + + "Identifier\x18\x01 \x01(\tR\n" + + "Identifier\x12\x17\n" + + "\x04Href\x18\x02 \x01(\tH\x00R\x04Href\x88\x01\x01B\a\n" + + "\x05_Href\"j\n" + + "\x10ControlReference\x12\x14\n" + + "\x05Class\x18\x01 \x01(\tR\x05Class\x12\x1c\n" + + "\tControlId\x18\x02 \x01(\tR\tControlId\x12\"\n" + + "\fStatementIds\x18\x03 \x03(\tR\fStatementIds\"\xc8\x02\n" + + "\x10SubjectReference\x12\x19\n" + + "\x05Title\x18\x01 \x01(\tH\x00R\x05Title\x88\x01\x01\x12\x1d\n" + + "\aRemarks\x18\x02 \x01(\tH\x01R\aRemarks\x88\x01\x01\x12\x12\n" + + "\x04Type\x18\x03 \x01(\tR\x04Type\x12G\n" + + "\n" + + "Attributes\x18\x04 \x03(\v2'.proto.SubjectReference.AttributesEntryR\n" + + "Attributes\x12!\n" + + "\x05Links\x18\x05 \x03(\v2\v.proto.LinkR\x05Links\x12%\n" + + "\x05Props\x18\x06 \x03(\v2\x0f.proto.PropertyR\x05Props\x1a=\n" + + "\x0fAttributesEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01B\b\n" + + "\x06_TitleB\n" + + "\n" + + "\b_Remarks\"\xc1\x01\n" + + "\rRiskReference\x12\x1e\n" + + "\n" + + "Identifier\x18\x01 \x01(\tR\n" + + "Identifier\x12\x16\n" + + "\x06Status\x18\x02 \x01(\tR\x06Status\x12\x17\n" + + "\x04Href\x18\x03 \x01(\tH\x00R\x04Href\x88\x01\x01\x12'\n" + + "\aOrigins\x18\x04 \x03(\v2\r.proto.OriginR\aOrigins\x12-\n" + + "\tThreatIds\x18\x05 \x03(\v2\x0f.proto.ThreatIdR\tThreatIdsB\a\n" + + "\x05_Href\">\n" + + "\x12RelatedObservation\x12(\n" + + "\x0fObservationUUID\x18\x01 \x01(\tR\x0fObservationUUID\"0\n" + + "\x0eAssociatedRisk\x12\x1e\n" + + "\n" + + "Identifier\x18\x01 \x01(\tR\n" + + "Identifier\"\xcb\x01\n" + + "\x10RelevantEvidence\x12 \n" + + "\vDescription\x18\x01 \x01(\tR\vDescription\x12\x1d\n" + + "\aRemarks\x18\x02 \x01(\tH\x00R\aRemarks\x88\x01\x01\x12\x17\n" + + "\x04Href\x18\x03 \x01(\tH\x01R\x04Href\x88\x01\x01\x12!\n" + + "\x05Links\x18\x04 \x03(\v2\v.proto.LinkR\x05Links\x12%\n" + + "\x05Props\x18\x05 \x03(\v2\x0f.proto.PropertyR\x05PropsB\n" + + "\n" + + "\b_RemarksB\a\n" + + "\x05_Href\"\xd5\x01\n" + + "\x04Step\x12\x17\n" + + "\x04UUID\x18\x01 \x01(\tH\x00R\x04UUID\x88\x01\x01\x12\x14\n" + + "\x05Title\x18\x02 \x01(\tR\x05Title\x12 \n" + + "\vDescription\x18\x03 \x01(\tR\vDescription\x12\x1d\n" + + "\aRemarks\x18\x04 \x01(\tH\x01R\aRemarks\x88\x01\x01\x12!\n" + + "\x05Links\x18\x05 \x03(\v2\v.proto.LinkR\x05Links\x12%\n" + + "\x05Props\x18\x06 \x03(\v2\x0f.proto.PropertyR\x05PropsB\a\n" + + "\x05_UUIDB\n" + + "\n" + + "\b_Remarks\"\xfc\x01\n" + + "\bActivity\x12\x17\n" + + "\x04UUID\x18\x01 \x01(\tH\x00R\x04UUID\x88\x01\x01\x12\x14\n" + + "\x05Title\x18\x02 \x01(\tR\x05Title\x12 \n" + + "\vDescription\x18\x03 \x01(\tR\vDescription\x12\x1d\n" + + "\aRemarks\x18\x04 \x01(\tH\x01R\aRemarks\x88\x01\x01\x12!\n" + + "\x05Steps\x18\x05 \x03(\v2\v.proto.StepR\x05Steps\x12!\n" + + "\x05Links\x18\x06 \x03(\v2\v.proto.LinkR\x05Links\x12%\n" + + "\x05Props\x18\a \x03(\v2\x0f.proto.PropertyR\x05PropsB\a\n" + + "\x05_UUIDB\n" + + "\n" + + "\b_Remarks\"\x97\x05\n" + + "\vObservation\x12\x0e\n" + + "\x02ID\x18\x01 \x01(\tR\x02ID\x12\x12\n" + + "\x04UUID\x18\x02 \x01(\tR\x04UUID\x12\x19\n" + + "\x05Title\x18\x03 \x01(\tH\x00R\x05Title\x88\x01\x01\x12 \n" + + "\vDescription\x18\x04 \x01(\tR\vDescription\x12\x1d\n" + + "\aRemarks\x18\x05 \x01(\tH\x01R\aRemarks\x88\x01\x01\x128\n" + + "\tCollected\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\tCollected\x129\n" + + "\aExpires\x18\a \x01(\v2\x1a.google.protobuf.TimestampH\x02R\aExpires\x88\x01\x01\x12\x18\n" + + "\aMethods\x18\b \x03(\tR\aMethods\x12!\n" + + "\x05Links\x18\t \x03(\v2\v.proto.LinkR\x05Links\x12%\n" + + "\x05Props\x18\n" + + " \x03(\v2\x0f.proto.PropertyR\x05Props\x12'\n" + + "\aOrigins\x18\v \x03(\v2\r.proto.OriginR\aOrigins\x123\n" + + "\bSubjects\x18\f \x03(\v2\x17.proto.SubjectReferenceR\bSubjects\x12/\n" + + "\n" + + "Activities\x18\r \x03(\v2\x0f.proto.ActivityR\n" + + "Activities\x129\n" + + "\n" + + "Components\x18\x0e \x03(\v2\x19.proto.ComponentReferenceR\n" + + "Components\x12C\n" + + "\x10RelevantEvidence\x18\x0f \x03(\v2\x17.proto.RelevantEvidenceR\x10RelevantEvidenceB\b\n" + + "\x06_TitleB\n" + + "\n" + + "\b_RemarksB\n" + + "\n" + + "\b_Expires\"\xf6\x01\n" + + "\rFindingStatus\x12\x19\n" + + "\x05Title\x18\x01 \x01(\tH\x00R\x05Title\x88\x01\x01\x12%\n" + + "\vDescription\x18\x02 \x01(\tH\x01R\vDescription\x88\x01\x01\x12\x1d\n" + + "\aRemarks\x18\x03 \x01(\tH\x02R\aRemarks\x88\x01\x01\x12\x14\n" + + "\x05State\x18\x04 \x01(\tR\x05State\x12!\n" + + "\x05Links\x18\x05 \x03(\v2\v.proto.LinkR\x05Links\x12%\n" + + "\x05Props\x18\x06 \x03(\v2\x0f.proto.PropertyR\x05PropsB\b\n" + + "\x06_TitleB\x0e\n" + + "\f_DescriptionB\n" + + "\n" + + "\b_Remarks\"\xf8\x05\n" + + "\aFinding\x12\x0e\n" + + "\x02ID\x18\x01 \x01(\tR\x02ID\x12\x12\n" + + "\x04UUID\x18\x02 \x01(\tR\x04UUID\x12\x14\n" + + "\x05Title\x18\x03 \x01(\tR\x05Title\x12 \n" + + "\vDescription\x18\x04 \x01(\tR\vDescription\x12\x1d\n" + + "\aRemarks\x18\x05 \x01(\tH\x00R\aRemarks\x88\x01\x01\x128\n" + + "\tCollected\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\tCollected\x122\n" + + "\x06Labels\x18\a \x03(\v2\x1a.proto.Finding.LabelsEntryR\x06Labels\x12'\n" + + "\aOrigins\x18\b \x03(\v2\r.proto.OriginR\aOrigins\x123\n" + + "\bSubjects\x18\t \x03(\v2\x17.proto.SubjectReferenceR\bSubjects\x129\n" + + "\n" + + "Components\x18\n" + + " \x03(\v2\x19.proto.ComponentReferenceR\n" + + "Components\x12K\n" + + "\x13RelatedObservations\x18\v \x03(\v2\x19.proto.RelatedObservationR\x13RelatedObservations\x123\n" + + "\bControls\x18\f \x03(\v2\x17.proto.ControlReferenceR\bControls\x12*\n" + + "\x05Risks\x18\r \x03(\v2\x14.proto.RiskReferenceR\x05Risks\x12,\n" + + "\x06Status\x18\x0e \x01(\v2\x14.proto.FindingStatusR\x06Status\x12!\n" + + "\x05Links\x18\x0f \x03(\v2\v.proto.LinkR\x05Links\x12%\n" + + "\x05Props\x18\x10 \x03(\v2\x0f.proto.PropertyR\x05Props\x1a9\n" + + "\vLabelsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01B\n" + + "\n" + + "\b_RemarksB\tZ\a./protob\x06proto3" var ( file_runner_proto_types_proto_rawDescOnce sync.Once From 4358b278a00e5f98995321994a6ced6bbbe4d6de Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 24 Apr 2025 14:24:07 +0100 Subject: [PATCH 2/2] Marshal config before sending --- cmd/agent.go | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/cmd/agent.go b/cmd/agent.go index 3797b4e..f224b86 100644 --- a/cmd/agent.go +++ b/cmd/agent.go @@ -43,14 +43,12 @@ type apiConfig struct { type agentPolicy string -type agentPluginConfig map[string]string - type agentPlugin struct { - Schedule *string `mapstructure:"schedule,omitempty"` - Source string `mapstructure:"source"` - Policies []agentPolicy `mapstructure:"policies"` - Config agentPluginConfig `mapstructure:"config"` - Labels map[string]string `mapstructure:"labels"` + Schedule *string `mapstructure:"schedule,omitempty"` + Source string `mapstructure:"source"` + Policies []agentPolicy `mapstructure:"policies"` + Config map[string]interface{} `mapstructure:"config"` + Labels map[string]string `mapstructure:"labels"` } type agentConfig struct { @@ -417,8 +415,13 @@ func (ar *AgentRunner) runAllPlugins(ctx context.Context) error { return err } + config := &proto.Config{} + err = config.Marshal(pluginConfig.Config) + if err != nil { + return err + } _, err = runnerInstance.Configure(&proto.ConfigureRequest{ - Config: pluginConfig.Config, + Config: config, }) if err != nil { // What do we do here ? @@ -529,8 +532,13 @@ func (ar *AgentRunner) runPlugin(ctx context.Context, name string, plugin *agent return err } + config := &proto.Config{} + err = config.Marshal(plugin.Config) + if err != nil { + return err + } _, err = runnerInstance.Configure(&proto.ConfigureRequest{ - Config: plugin.Config, + Config: config, }) if err != nil { return err