First prototype
Change-Id: Ieceb55636bda133466609471f25508d0ae83c52c
diff --git a/.gitreview b/.gitreview
new file mode 100644
index 0000000..3ddbe16
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,5 @@
+[gerrit]
+host=gerrit.avm99963.com
+port=29418
+project=gomodules/twpt-server
+defaultbranch=main
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..1866e09
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,2 @@
+grpc_proto_gen:
+ protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative api_proto/*.proto
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..f9d3f41
--- /dev/null
+++ b/README.md
@@ -0,0 +1,8 @@
+# TWPT-server
+
+TWPT-server is the code for the
+[TW Power Tools](https://gerrit.avm99963.com/plugins/gitiles/infinitegforums/)
+gRPC server and its frontend.
+
+This repository is under active development, and is not ready yet for
+production.
diff --git a/api_proto/README.md b/api_proto/README.md
new file mode 100644
index 0000000..9a18c22
--- /dev/null
+++ b/api_proto/README.md
@@ -0,0 +1 @@
+Regenerate the code by running `make grpc_proto_gen` in the root directory.
diff --git a/api_proto/common.pb.go b/api_proto/common.pb.go
new file mode 100644
index 0000000..b98c610
--- /dev/null
+++ b/api_proto/common.pb.go
@@ -0,0 +1,281 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.27.1
+// protoc v3.17.3
+// source: api_proto/common.proto
+
+package api_proto
+
+import (
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ reflect "reflect"
+ sync "sync"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+type Environment_Browser int32
+
+const (
+ Environment_BROWSER_UNKNOWN Environment_Browser = 0
+ Environment_BROWSER_CHROMIUM Environment_Browser = 1
+ Environment_BROWSER_GECKO Environment_Browser = 2
+)
+
+// Enum value maps for Environment_Browser.
+var (
+ Environment_Browser_name = map[int32]string{
+ 0: "BROWSER_UNKNOWN",
+ 1: "BROWSER_CHROMIUM",
+ 2: "BROWSER_GECKO",
+ }
+ Environment_Browser_value = map[string]int32{
+ "BROWSER_UNKNOWN": 0,
+ "BROWSER_CHROMIUM": 1,
+ "BROWSER_GECKO": 2,
+ }
+)
+
+func (x Environment_Browser) Enum() *Environment_Browser {
+ p := new(Environment_Browser)
+ *p = x
+ return p
+}
+
+func (x Environment_Browser) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (Environment_Browser) Descriptor() protoreflect.EnumDescriptor {
+ return file_api_proto_common_proto_enumTypes[0].Descriptor()
+}
+
+func (Environment_Browser) Type() protoreflect.EnumType {
+ return &file_api_proto_common_proto_enumTypes[0]
+}
+
+func (x Environment_Browser) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use Environment_Browser.Descriptor instead.
+func (Environment_Browser) EnumDescriptor() ([]byte, []int) {
+ return file_api_proto_common_proto_rawDescGZIP(), []int{0, 0}
+}
+
+type Environment_VersionChannel int32
+
+const (
+ Environment_CHANNEL_UNKNOWN Environment_VersionChannel = 0
+ Environment_CHANNEL_STABLE Environment_VersionChannel = 1
+ Environment_CHANNEL_BETA Environment_VersionChannel = 2
+)
+
+// Enum value maps for Environment_VersionChannel.
+var (
+ Environment_VersionChannel_name = map[int32]string{
+ 0: "CHANNEL_UNKNOWN",
+ 1: "CHANNEL_STABLE",
+ 2: "CHANNEL_BETA",
+ }
+ Environment_VersionChannel_value = map[string]int32{
+ "CHANNEL_UNKNOWN": 0,
+ "CHANNEL_STABLE": 1,
+ "CHANNEL_BETA": 2,
+ }
+)
+
+func (x Environment_VersionChannel) Enum() *Environment_VersionChannel {
+ p := new(Environment_VersionChannel)
+ *p = x
+ return p
+}
+
+func (x Environment_VersionChannel) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (Environment_VersionChannel) Descriptor() protoreflect.EnumDescriptor {
+ return file_api_proto_common_proto_enumTypes[1].Descriptor()
+}
+
+func (Environment_VersionChannel) Type() protoreflect.EnumType {
+ return &file_api_proto_common_proto_enumTypes[1]
+}
+
+func (x Environment_VersionChannel) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use Environment_VersionChannel.Descriptor instead.
+func (Environment_VersionChannel) EnumDescriptor() ([]byte, []int) {
+ return file_api_proto_common_proto_rawDescGZIP(), []int{0, 1}
+}
+
+type Environment struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Browser Environment_Browser `protobuf:"varint,1,opt,name=browser,proto3,enum=Environment_Browser" json:"browser,omitempty"`
+ Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
+ VersionChannel Environment_VersionChannel `protobuf:"varint,3,opt,name=version_channel,json=versionChannel,proto3,enum=Environment_VersionChannel" json:"version_channel,omitempty"`
+}
+
+func (x *Environment) Reset() {
+ *x = Environment{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_api_proto_common_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *Environment) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Environment) ProtoMessage() {}
+
+func (x *Environment) ProtoReflect() protoreflect.Message {
+ mi := &file_api_proto_common_proto_msgTypes[0]
+ 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 Environment.ProtoReflect.Descriptor instead.
+func (*Environment) Descriptor() ([]byte, []int) {
+ return file_api_proto_common_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *Environment) GetBrowser() Environment_Browser {
+ if x != nil {
+ return x.Browser
+ }
+ return Environment_BROWSER_UNKNOWN
+}
+
+func (x *Environment) GetVersion() string {
+ if x != nil {
+ return x.Version
+ }
+ return ""
+}
+
+func (x *Environment) GetVersionChannel() Environment_VersionChannel {
+ if x != nil {
+ return x.VersionChannel
+ }
+ return Environment_CHANNEL_UNKNOWN
+}
+
+var File_api_proto_common_proto protoreflect.FileDescriptor
+
+var file_api_proto_common_proto_rawDesc = []byte{
+ 0x0a, 0x16, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d,
+ 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb3, 0x02, 0x0a, 0x0b, 0x45, 0x6e, 0x76,
+ 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2e, 0x0a, 0x07, 0x62, 0x72, 0x6f, 0x77,
+ 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x45, 0x6e, 0x76, 0x69,
+ 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x42, 0x72, 0x6f, 0x77, 0x73, 0x65, 0x72, 0x52,
+ 0x07, 0x62, 0x72, 0x6f, 0x77, 0x73, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73,
+ 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69,
+ 0x6f, 0x6e, 0x12, 0x44, 0x0a, 0x0f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x68,
+ 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x45, 0x6e,
+ 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f,
+ 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x0e, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f,
+ 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x22, 0x47, 0x0a, 0x07, 0x42, 0x72, 0x6f, 0x77,
+ 0x73, 0x65, 0x72, 0x12, 0x13, 0x0a, 0x0f, 0x42, 0x52, 0x4f, 0x57, 0x53, 0x45, 0x52, 0x5f, 0x55,
+ 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x42, 0x52, 0x4f, 0x57,
+ 0x53, 0x45, 0x52, 0x5f, 0x43, 0x48, 0x52, 0x4f, 0x4d, 0x49, 0x55, 0x4d, 0x10, 0x01, 0x12, 0x11,
+ 0x0a, 0x0d, 0x42, 0x52, 0x4f, 0x57, 0x53, 0x45, 0x52, 0x5f, 0x47, 0x45, 0x43, 0x4b, 0x4f, 0x10,
+ 0x02, 0x22, 0x4b, 0x0a, 0x0e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e,
+ 0x6e, 0x65, 0x6c, 0x12, 0x13, 0x0a, 0x0f, 0x43, 0x48, 0x41, 0x4e, 0x4e, 0x45, 0x4c, 0x5f, 0x55,
+ 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x43, 0x48, 0x41, 0x4e,
+ 0x4e, 0x45, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c,
+ 0x43, 0x48, 0x41, 0x4e, 0x4e, 0x45, 0x4c, 0x5f, 0x42, 0x45, 0x54, 0x41, 0x10, 0x02, 0x42, 0x2e,
+ 0x5a, 0x2c, 0x67, 0x6f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x61, 0x76, 0x6d, 0x39,
+ 0x39, 0x39, 0x36, 0x33, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x77, 0x70, 0x74, 0x2d, 0x73, 0x65,
+ 0x72, 0x76, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06,
+ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+ file_api_proto_common_proto_rawDescOnce sync.Once
+ file_api_proto_common_proto_rawDescData = file_api_proto_common_proto_rawDesc
+)
+
+func file_api_proto_common_proto_rawDescGZIP() []byte {
+ file_api_proto_common_proto_rawDescOnce.Do(func() {
+ file_api_proto_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_proto_common_proto_rawDescData)
+ })
+ return file_api_proto_common_proto_rawDescData
+}
+
+var file_api_proto_common_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
+var file_api_proto_common_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
+var file_api_proto_common_proto_goTypes = []interface{}{
+ (Environment_Browser)(0), // 0: Environment.Browser
+ (Environment_VersionChannel)(0), // 1: Environment.VersionChannel
+ (*Environment)(nil), // 2: Environment
+}
+var file_api_proto_common_proto_depIdxs = []int32{
+ 0, // 0: Environment.browser:type_name -> Environment.Browser
+ 1, // 1: Environment.version_channel:type_name -> Environment.VersionChannel
+ 2, // [2:2] is the sub-list for method output_type
+ 2, // [2:2] is the sub-list for method input_type
+ 2, // [2:2] is the sub-list for extension type_name
+ 2, // [2:2] is the sub-list for extension extendee
+ 0, // [0:2] is the sub-list for field type_name
+}
+
+func init() { file_api_proto_common_proto_init() }
+func file_api_proto_common_proto_init() {
+ if File_api_proto_common_proto != nil {
+ return
+ }
+ if !protoimpl.UnsafeEnabled {
+ file_api_proto_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*Environment); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ }
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: file_api_proto_common_proto_rawDesc,
+ NumEnums: 2,
+ NumMessages: 1,
+ NumExtensions: 0,
+ NumServices: 0,
+ },
+ GoTypes: file_api_proto_common_proto_goTypes,
+ DependencyIndexes: file_api_proto_common_proto_depIdxs,
+ EnumInfos: file_api_proto_common_proto_enumTypes,
+ MessageInfos: file_api_proto_common_proto_msgTypes,
+ }.Build()
+ File_api_proto_common_proto = out.File
+ file_api_proto_common_proto_rawDesc = nil
+ file_api_proto_common_proto_goTypes = nil
+ file_api_proto_common_proto_depIdxs = nil
+}
diff --git a/api_proto/common.proto b/api_proto/common.proto
new file mode 100644
index 0000000..fd5867e
--- /dev/null
+++ b/api_proto/common.proto
@@ -0,0 +1,21 @@
+syntax = "proto3";
+
+option go_package = "gomodules.avm99963.com/twpt-server/api_proto";
+
+message Environment {
+ enum Browser {
+ BROWSER_UNKNOWN = 0;
+ BROWSER_CHROMIUM = 1;
+ BROWSER_GECKO = 2;
+ }
+
+ enum VersionChannel {
+ CHANNEL_UNKNOWN = 0;
+ CHANNEL_STABLE = 1;
+ CHANNEL_BETA = 2;
+ }
+
+ Browser browser = 1;
+ string version = 2;
+ VersionChannel version_channel = 3;
+}
diff --git a/api_proto/kill_switch.pb.go b/api_proto/kill_switch.pb.go
new file mode 100644
index 0000000..22622f8
--- /dev/null
+++ b/api_proto/kill_switch.pb.go
@@ -0,0 +1,1381 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.27.1
+// protoc v3.17.3
+// source: api_proto/kill_switch.proto
+
+package api_proto
+
+import (
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ reflect "reflect"
+ sync "sync"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+// Retrieve kill switch status depending on the environment.
+type GetKillSwitchStatusRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Environment *Environment `protobuf:"bytes,1,opt,name=environment,proto3" json:"environment,omitempty"`
+}
+
+func (x *GetKillSwitchStatusRequest) Reset() {
+ *x = GetKillSwitchStatusRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *GetKillSwitchStatusRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GetKillSwitchStatusRequest) ProtoMessage() {}
+
+func (x *GetKillSwitchStatusRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[0]
+ 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 GetKillSwitchStatusRequest.ProtoReflect.Descriptor instead.
+func (*GetKillSwitchStatusRequest) Descriptor() ([]byte, []int) {
+ return file_api_proto_kill_switch_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *GetKillSwitchStatusRequest) GetEnvironment() *Environment {
+ if x != nil {
+ return x.Environment
+ }
+ return nil
+}
+
+type GetKillSwitchStatusResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ KillSwitches []*KillSwitch `protobuf:"bytes,1,rep,name=kill_switches,json=killSwitches,proto3" json:"kill_switches,omitempty"`
+}
+
+func (x *GetKillSwitchStatusResponse) Reset() {
+ *x = GetKillSwitchStatusResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *GetKillSwitchStatusResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GetKillSwitchStatusResponse) ProtoMessage() {}
+
+func (x *GetKillSwitchStatusResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[1]
+ 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 GetKillSwitchStatusResponse.ProtoReflect.Descriptor instead.
+func (*GetKillSwitchStatusResponse) Descriptor() ([]byte, []int) {
+ return file_api_proto_kill_switch_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *GetKillSwitchStatusResponse) GetKillSwitches() []*KillSwitch {
+ if x != nil {
+ return x.KillSwitches
+ }
+ return nil
+}
+
+type GetKillSwitchOverviewRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+}
+
+func (x *GetKillSwitchOverviewRequest) Reset() {
+ *x = GetKillSwitchOverviewRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[2]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *GetKillSwitchOverviewRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GetKillSwitchOverviewRequest) ProtoMessage() {}
+
+func (x *GetKillSwitchOverviewRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[2]
+ 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 GetKillSwitchOverviewRequest.ProtoReflect.Descriptor instead.
+func (*GetKillSwitchOverviewRequest) Descriptor() ([]byte, []int) {
+ return file_api_proto_kill_switch_proto_rawDescGZIP(), []int{2}
+}
+
+type GetKillSwitchOverviewResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ KillSwitches []*KillSwitch `protobuf:"bytes,1,rep,name=kill_switches,json=killSwitches,proto3" json:"kill_switches,omitempty"`
+}
+
+func (x *GetKillSwitchOverviewResponse) Reset() {
+ *x = GetKillSwitchOverviewResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[3]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *GetKillSwitchOverviewResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GetKillSwitchOverviewResponse) ProtoMessage() {}
+
+func (x *GetKillSwitchOverviewResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[3]
+ 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 GetKillSwitchOverviewResponse.ProtoReflect.Descriptor instead.
+func (*GetKillSwitchOverviewResponse) Descriptor() ([]byte, []int) {
+ return file_api_proto_kill_switch_proto_rawDescGZIP(), []int{3}
+}
+
+func (x *GetKillSwitchOverviewResponse) GetKillSwitches() []*KillSwitch {
+ if x != nil {
+ return x.KillSwitches
+ }
+ return nil
+}
+
+type ListFeaturesRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ WithDeprecatedFeatures bool `protobuf:"varint,1,opt,name=with_deprecated_features,json=withDeprecatedFeatures,proto3" json:"with_deprecated_features,omitempty"`
+}
+
+func (x *ListFeaturesRequest) Reset() {
+ *x = ListFeaturesRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[4]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ListFeaturesRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ListFeaturesRequest) ProtoMessage() {}
+
+func (x *ListFeaturesRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[4]
+ 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 ListFeaturesRequest.ProtoReflect.Descriptor instead.
+func (*ListFeaturesRequest) Descriptor() ([]byte, []int) {
+ return file_api_proto_kill_switch_proto_rawDescGZIP(), []int{4}
+}
+
+func (x *ListFeaturesRequest) GetWithDeprecatedFeatures() bool {
+ if x != nil {
+ return x.WithDeprecatedFeatures
+ }
+ return false
+}
+
+type ListFeaturesResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Features []*Feature `protobuf:"bytes,1,rep,name=features,proto3" json:"features,omitempty"`
+}
+
+func (x *ListFeaturesResponse) Reset() {
+ *x = ListFeaturesResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[5]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ListFeaturesResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ListFeaturesResponse) ProtoMessage() {}
+
+func (x *ListFeaturesResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[5]
+ 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 ListFeaturesResponse.ProtoReflect.Descriptor instead.
+func (*ListFeaturesResponse) Descriptor() ([]byte, []int) {
+ return file_api_proto_kill_switch_proto_rawDescGZIP(), []int{5}
+}
+
+func (x *ListFeaturesResponse) GetFeatures() []*Feature {
+ if x != nil {
+ return x.Features
+ }
+ return nil
+}
+
+type SyncFeaturesRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Features []*Feature `protobuf:"bytes,1,rep,name=features,proto3" json:"features,omitempty"`
+}
+
+func (x *SyncFeaturesRequest) Reset() {
+ *x = SyncFeaturesRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[6]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *SyncFeaturesRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*SyncFeaturesRequest) ProtoMessage() {}
+
+func (x *SyncFeaturesRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[6]
+ 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 SyncFeaturesRequest.ProtoReflect.Descriptor instead.
+func (*SyncFeaturesRequest) Descriptor() ([]byte, []int) {
+ return file_api_proto_kill_switch_proto_rawDescGZIP(), []int{6}
+}
+
+func (x *SyncFeaturesRequest) GetFeatures() []*Feature {
+ if x != nil {
+ return x.Features
+ }
+ return nil
+}
+
+type SyncFeaturesResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+}
+
+func (x *SyncFeaturesResponse) Reset() {
+ *x = SyncFeaturesResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[7]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *SyncFeaturesResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*SyncFeaturesResponse) ProtoMessage() {}
+
+func (x *SyncFeaturesResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[7]
+ 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 SyncFeaturesResponse.ProtoReflect.Descriptor instead.
+func (*SyncFeaturesResponse) Descriptor() ([]byte, []int) {
+ return file_api_proto_kill_switch_proto_rawDescGZIP(), []int{7}
+}
+
+type EnableKillSwitchRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ KillSwitch *KillSwitch `protobuf:"bytes,1,opt,name=kill_switch,json=killSwitch,proto3" json:"kill_switch,omitempty"`
+}
+
+func (x *EnableKillSwitchRequest) Reset() {
+ *x = EnableKillSwitchRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[8]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *EnableKillSwitchRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*EnableKillSwitchRequest) ProtoMessage() {}
+
+func (x *EnableKillSwitchRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[8]
+ 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 EnableKillSwitchRequest.ProtoReflect.Descriptor instead.
+func (*EnableKillSwitchRequest) Descriptor() ([]byte, []int) {
+ return file_api_proto_kill_switch_proto_rawDescGZIP(), []int{8}
+}
+
+func (x *EnableKillSwitchRequest) GetKillSwitch() *KillSwitch {
+ if x != nil {
+ return x.KillSwitch
+ }
+ return nil
+}
+
+type EnableKillSwitchResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+}
+
+func (x *EnableKillSwitchResponse) Reset() {
+ *x = EnableKillSwitchResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[9]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *EnableKillSwitchResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*EnableKillSwitchResponse) ProtoMessage() {}
+
+func (x *EnableKillSwitchResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[9]
+ 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 EnableKillSwitchResponse.ProtoReflect.Descriptor instead.
+func (*EnableKillSwitchResponse) Descriptor() ([]byte, []int) {
+ return file_api_proto_kill_switch_proto_rawDescGZIP(), []int{9}
+}
+
+type DisableKillSwitchRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ KillSwitchId int32 `protobuf:"varint,1,opt,name=kill_switch_id,json=killSwitchId,proto3" json:"kill_switch_id,omitempty"`
+}
+
+func (x *DisableKillSwitchRequest) Reset() {
+ *x = DisableKillSwitchRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[10]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *DisableKillSwitchRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*DisableKillSwitchRequest) ProtoMessage() {}
+
+func (x *DisableKillSwitchRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[10]
+ 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 DisableKillSwitchRequest.ProtoReflect.Descriptor instead.
+func (*DisableKillSwitchRequest) Descriptor() ([]byte, []int) {
+ return file_api_proto_kill_switch_proto_rawDescGZIP(), []int{10}
+}
+
+func (x *DisableKillSwitchRequest) GetKillSwitchId() int32 {
+ if x != nil {
+ return x.KillSwitchId
+ }
+ return 0
+}
+
+type DisableKillSwitchResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+}
+
+func (x *DisableKillSwitchResponse) Reset() {
+ *x = DisableKillSwitchResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[11]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *DisableKillSwitchResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*DisableKillSwitchResponse) ProtoMessage() {}
+
+func (x *DisableKillSwitchResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[11]
+ 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 DisableKillSwitchResponse.ProtoReflect.Descriptor instead.
+func (*DisableKillSwitchResponse) Descriptor() ([]byte, []int) {
+ return file_api_proto_kill_switch_proto_rawDescGZIP(), []int{11}
+}
+
+type ListAuthorizedUsersRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+}
+
+func (x *ListAuthorizedUsersRequest) Reset() {
+ *x = ListAuthorizedUsersRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[12]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ListAuthorizedUsersRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ListAuthorizedUsersRequest) ProtoMessage() {}
+
+func (x *ListAuthorizedUsersRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[12]
+ 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 ListAuthorizedUsersRequest.ProtoReflect.Descriptor instead.
+func (*ListAuthorizedUsersRequest) Descriptor() ([]byte, []int) {
+ return file_api_proto_kill_switch_proto_rawDescGZIP(), []int{12}
+}
+
+type ListAuthorizedUsersResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ AuthorizedUsers *KillSwitchAuthorizedUser `protobuf:"bytes,1,opt,name=authorized_users,json=authorizedUsers,proto3" json:"authorized_users,omitempty"`
+}
+
+func (x *ListAuthorizedUsersResponse) Reset() {
+ *x = ListAuthorizedUsersResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[13]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ListAuthorizedUsersResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ListAuthorizedUsersResponse) ProtoMessage() {}
+
+func (x *ListAuthorizedUsersResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[13]
+ 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 ListAuthorizedUsersResponse.ProtoReflect.Descriptor instead.
+func (*ListAuthorizedUsersResponse) Descriptor() ([]byte, []int) {
+ return file_api_proto_kill_switch_proto_rawDescGZIP(), []int{13}
+}
+
+func (x *ListAuthorizedUsersResponse) GetAuthorizedUsers() *KillSwitchAuthorizedUser {
+ if x != nil {
+ return x.AuthorizedUsers
+ }
+ return nil
+}
+
+type AddAuthorizedUserRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ User *KillSwitchAuthorizedUser `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
+}
+
+func (x *AddAuthorizedUserRequest) Reset() {
+ *x = AddAuthorizedUserRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[14]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *AddAuthorizedUserRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*AddAuthorizedUserRequest) ProtoMessage() {}
+
+func (x *AddAuthorizedUserRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[14]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use AddAuthorizedUserRequest.ProtoReflect.Descriptor instead.
+func (*AddAuthorizedUserRequest) Descriptor() ([]byte, []int) {
+ return file_api_proto_kill_switch_proto_rawDescGZIP(), []int{14}
+}
+
+func (x *AddAuthorizedUserRequest) GetUser() *KillSwitchAuthorizedUser {
+ if x != nil {
+ return x.User
+ }
+ return nil
+}
+
+type AddAuthorizedUserResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+}
+
+func (x *AddAuthorizedUserResponse) Reset() {
+ *x = AddAuthorizedUserResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[15]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *AddAuthorizedUserResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*AddAuthorizedUserResponse) ProtoMessage() {}
+
+func (x *AddAuthorizedUserResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[15]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use AddAuthorizedUserResponse.ProtoReflect.Descriptor instead.
+func (*AddAuthorizedUserResponse) Descriptor() ([]byte, []int) {
+ return file_api_proto_kill_switch_proto_rawDescGZIP(), []int{15}
+}
+
+type UpdateAuthorizedUserRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ UserId int32 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
+ User *KillSwitchAuthorizedUser `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"`
+}
+
+func (x *UpdateAuthorizedUserRequest) Reset() {
+ *x = UpdateAuthorizedUserRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[16]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *UpdateAuthorizedUserRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*UpdateAuthorizedUserRequest) ProtoMessage() {}
+
+func (x *UpdateAuthorizedUserRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[16]
+ 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 UpdateAuthorizedUserRequest.ProtoReflect.Descriptor instead.
+func (*UpdateAuthorizedUserRequest) Descriptor() ([]byte, []int) {
+ return file_api_proto_kill_switch_proto_rawDescGZIP(), []int{16}
+}
+
+func (x *UpdateAuthorizedUserRequest) GetUserId() int32 {
+ if x != nil {
+ return x.UserId
+ }
+ return 0
+}
+
+func (x *UpdateAuthorizedUserRequest) GetUser() *KillSwitchAuthorizedUser {
+ if x != nil {
+ return x.User
+ }
+ return nil
+}
+
+type UpdateAuthorizedUserResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+}
+
+func (x *UpdateAuthorizedUserResponse) Reset() {
+ *x = UpdateAuthorizedUserResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[17]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *UpdateAuthorizedUserResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*UpdateAuthorizedUserResponse) ProtoMessage() {}
+
+func (x *UpdateAuthorizedUserResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[17]
+ 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 UpdateAuthorizedUserResponse.ProtoReflect.Descriptor instead.
+func (*UpdateAuthorizedUserResponse) Descriptor() ([]byte, []int) {
+ return file_api_proto_kill_switch_proto_rawDescGZIP(), []int{17}
+}
+
+type DeleteAuthorizedUserRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ UserId int32 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
+}
+
+func (x *DeleteAuthorizedUserRequest) Reset() {
+ *x = DeleteAuthorizedUserRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[18]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *DeleteAuthorizedUserRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*DeleteAuthorizedUserRequest) ProtoMessage() {}
+
+func (x *DeleteAuthorizedUserRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[18]
+ 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 DeleteAuthorizedUserRequest.ProtoReflect.Descriptor instead.
+func (*DeleteAuthorizedUserRequest) Descriptor() ([]byte, []int) {
+ return file_api_proto_kill_switch_proto_rawDescGZIP(), []int{18}
+}
+
+func (x *DeleteAuthorizedUserRequest) GetUserId() int32 {
+ if x != nil {
+ return x.UserId
+ }
+ return 0
+}
+
+type DeleteAuthorizedUserResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+}
+
+func (x *DeleteAuthorizedUserResponse) Reset() {
+ *x = DeleteAuthorizedUserResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[19]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *DeleteAuthorizedUserResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*DeleteAuthorizedUserResponse) ProtoMessage() {}
+
+func (x *DeleteAuthorizedUserResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_api_proto_kill_switch_proto_msgTypes[19]
+ 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 DeleteAuthorizedUserResponse.ProtoReflect.Descriptor instead.
+func (*DeleteAuthorizedUserResponse) Descriptor() ([]byte, []int) {
+ return file_api_proto_kill_switch_proto_rawDescGZIP(), []int{19}
+}
+
+var File_api_proto_kill_switch_proto protoreflect.FileDescriptor
+
+var file_api_proto_kill_switch_proto_rawDesc = []byte{
+ 0x0a, 0x1b, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6b, 0x69, 0x6c, 0x6c,
+ 0x5f, 0x73, 0x77, 0x69, 0x74, 0x63, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x61,
+ 0x70, 0x69, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e,
+ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x23, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+ 0x2f, 0x6b, 0x69, 0x6c, 0x6c, 0x5f, 0x73, 0x77, 0x69, 0x74, 0x63, 0x68, 0x5f, 0x6f, 0x62, 0x6a,
+ 0x65, 0x63, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4c, 0x0a, 0x1a, 0x47, 0x65,
+ 0x74, 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75,
+ 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x0b, 0x65, 0x6e, 0x76, 0x69,
+ 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e,
+ 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0b, 0x65, 0x6e, 0x76,
+ 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x4f, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x4b,
+ 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52,
+ 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x0d, 0x6b, 0x69, 0x6c, 0x6c, 0x5f,
+ 0x73, 0x77, 0x69, 0x74, 0x63, 0x68, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b,
+ 0x2e, 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x52, 0x0c, 0x6b, 0x69, 0x6c,
+ 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x65, 0x73, 0x22, 0x1e, 0x0a, 0x1c, 0x47, 0x65, 0x74,
+ 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x4f, 0x76, 0x65, 0x72, 0x76, 0x69,
+ 0x65, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x51, 0x0a, 0x1d, 0x47, 0x65, 0x74,
+ 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x4f, 0x76, 0x65, 0x72, 0x76, 0x69,
+ 0x65, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x0d, 0x6b, 0x69,
+ 0x6c, 0x6c, 0x5f, 0x73, 0x77, 0x69, 0x74, 0x63, 0x68, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28,
+ 0x0b, 0x32, 0x0b, 0x2e, 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x52, 0x0c,
+ 0x6b, 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x65, 0x73, 0x22, 0x4f, 0x0a, 0x13,
+ 0x4c, 0x69, 0x73, 0x74, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75,
+ 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x18, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x64, 0x65, 0x70, 0x72,
+ 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18,
+ 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x77, 0x69, 0x74, 0x68, 0x44, 0x65, 0x70, 0x72, 0x65,
+ 0x63, 0x61, 0x74, 0x65, 0x64, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0x3c, 0x0a,
+ 0x14, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x52, 0x65, 0x73,
+ 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65,
+ 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72,
+ 0x65, 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0x3b, 0x0a, 0x13, 0x53,
+ 0x79, 0x6e, 0x63, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
+ 0x73, 0x74, 0x12, 0x24, 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x01,
+ 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x08,
+ 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0x16, 0x0a, 0x14, 0x53, 0x79, 0x6e, 0x63,
+ 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
+ 0x22, 0x47, 0x0a, 0x17, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x77,
+ 0x69, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x0b, 0x6b,
+ 0x69, 0x6c, 0x6c, 0x5f, 0x73, 0x77, 0x69, 0x74, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
+ 0x32, 0x0b, 0x2e, 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x52, 0x0a, 0x6b,
+ 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x22, 0x1a, 0x0a, 0x18, 0x45, 0x6e, 0x61,
+ 0x62, 0x6c, 0x65, 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73,
+ 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x40, 0x0a, 0x18, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65,
+ 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+ 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x6b, 0x69, 0x6c, 0x6c, 0x5f, 0x73, 0x77, 0x69, 0x74, 0x63, 0x68,
+ 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6b, 0x69, 0x6c, 0x6c, 0x53,
+ 0x77, 0x69, 0x74, 0x63, 0x68, 0x49, 0x64, 0x22, 0x1b, 0x0a, 0x19, 0x44, 0x69, 0x73, 0x61, 0x62,
+ 0x6c, 0x65, 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70,
+ 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x75, 0x74, 0x68,
+ 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
+ 0x73, 0x74, 0x22, 0x63, 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72,
+ 0x69, 0x7a, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
+ 0x65, 0x12, 0x44, 0x0a, 0x10, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x5f,
+ 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x4b, 0x69,
+ 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a,
+ 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x0f, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a,
+ 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, 0x22, 0x49, 0x0a, 0x18, 0x41, 0x64, 0x64, 0x41, 0x75,
+ 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75,
+ 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28,
+ 0x0b, 0x32, 0x19, 0x2e, 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x41, 0x75,
+ 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73,
+ 0x65, 0x72, 0x22, 0x1b, 0x0a, 0x19, 0x41, 0x64, 0x64, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69,
+ 0x7a, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
+ 0x65, 0x0a, 0x1b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69,
+ 0x7a, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17,
+ 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
+ 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x2d, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18,
+ 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74,
+ 0x63, 0x68, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72,
+ 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x1e, 0x0a, 0x1c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
+ 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65,
+ 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x0a, 0x1b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65,
+ 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65,
+ 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64,
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x1e,
+ 0x0a, 0x1c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a,
+ 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xa8,
+ 0x06, 0x0a, 0x11, 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x53, 0x65, 0x72,
+ 0x76, 0x69, 0x63, 0x65, 0x12, 0x52, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x4b, 0x69, 0x6c, 0x6c, 0x53,
+ 0x77, 0x69, 0x74, 0x63, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x2e, 0x47, 0x65,
+ 0x74, 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75,
+ 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x47, 0x65, 0x74, 0x4b, 0x69,
+ 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65,
+ 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x58, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x4b,
+ 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x4f, 0x76, 0x65, 0x72, 0x76, 0x69, 0x65,
+ 0x77, 0x12, 0x1d, 0x2e, 0x47, 0x65, 0x74, 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63,
+ 0x68, 0x4f, 0x76, 0x65, 0x72, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
+ 0x1a, 0x1e, 0x2e, 0x47, 0x65, 0x74, 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68,
+ 0x4f, 0x76, 0x65, 0x72, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
+ 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72,
+ 0x65, 0x73, 0x12, 0x14, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65,
+ 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x46,
+ 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
+ 0x00, 0x12, 0x3d, 0x0a, 0x0c, 0x53, 0x79, 0x6e, 0x63, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65,
+ 0x73, 0x12, 0x14, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73,
+ 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x46, 0x65,
+ 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00,
+ 0x12, 0x49, 0x0a, 0x10, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x77,
+ 0x69, 0x74, 0x63, 0x68, 0x12, 0x18, 0x2e, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x4b, 0x69, 0x6c,
+ 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19,
+ 0x2e, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63,
+ 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x11, 0x44,
+ 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68,
+ 0x12, 0x19, 0x2e, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x77,
+ 0x69, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x44, 0x69,
+ 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x52,
+ 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x13, 0x4c, 0x69, 0x73,
+ 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x73,
+ 0x12, 0x1b, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65,
+ 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e,
+ 0x4c, 0x69, 0x73, 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x55, 0x73,
+ 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4c, 0x0a,
+ 0x11, 0x41, 0x64, 0x64, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x55, 0x73,
+ 0x65, 0x72, 0x12, 0x19, 0x2e, 0x41, 0x64, 0x64, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a,
+ 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e,
+ 0x41, 0x64, 0x64, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x55, 0x73, 0x65,
+ 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x14, 0x55,
+ 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x55,
+ 0x73, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68,
+ 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+ 0x74, 0x1a, 0x1d, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72,
+ 0x69, 0x7a, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
+ 0x22, 0x00, 0x12, 0x55, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68,
+ 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x44, 0x65, 0x6c,
+ 0x65, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x55, 0x73, 0x65,
+ 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74,
+ 0x65, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52,
+ 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x2e, 0x5a, 0x2c, 0x67, 0x6f, 0x6d,
+ 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x61, 0x76, 0x6d, 0x39, 0x39, 0x39, 0x36, 0x33, 0x2e,
+ 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x77, 0x70, 0x74, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f,
+ 0x61, 0x70, 0x69, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+ 0x33,
+}
+
+var (
+ file_api_proto_kill_switch_proto_rawDescOnce sync.Once
+ file_api_proto_kill_switch_proto_rawDescData = file_api_proto_kill_switch_proto_rawDesc
+)
+
+func file_api_proto_kill_switch_proto_rawDescGZIP() []byte {
+ file_api_proto_kill_switch_proto_rawDescOnce.Do(func() {
+ file_api_proto_kill_switch_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_proto_kill_switch_proto_rawDescData)
+ })
+ return file_api_proto_kill_switch_proto_rawDescData
+}
+
+var file_api_proto_kill_switch_proto_msgTypes = make([]protoimpl.MessageInfo, 20)
+var file_api_proto_kill_switch_proto_goTypes = []interface{}{
+ (*GetKillSwitchStatusRequest)(nil), // 0: GetKillSwitchStatusRequest
+ (*GetKillSwitchStatusResponse)(nil), // 1: GetKillSwitchStatusResponse
+ (*GetKillSwitchOverviewRequest)(nil), // 2: GetKillSwitchOverviewRequest
+ (*GetKillSwitchOverviewResponse)(nil), // 3: GetKillSwitchOverviewResponse
+ (*ListFeaturesRequest)(nil), // 4: ListFeaturesRequest
+ (*ListFeaturesResponse)(nil), // 5: ListFeaturesResponse
+ (*SyncFeaturesRequest)(nil), // 6: SyncFeaturesRequest
+ (*SyncFeaturesResponse)(nil), // 7: SyncFeaturesResponse
+ (*EnableKillSwitchRequest)(nil), // 8: EnableKillSwitchRequest
+ (*EnableKillSwitchResponse)(nil), // 9: EnableKillSwitchResponse
+ (*DisableKillSwitchRequest)(nil), // 10: DisableKillSwitchRequest
+ (*DisableKillSwitchResponse)(nil), // 11: DisableKillSwitchResponse
+ (*ListAuthorizedUsersRequest)(nil), // 12: ListAuthorizedUsersRequest
+ (*ListAuthorizedUsersResponse)(nil), // 13: ListAuthorizedUsersResponse
+ (*AddAuthorizedUserRequest)(nil), // 14: AddAuthorizedUserRequest
+ (*AddAuthorizedUserResponse)(nil), // 15: AddAuthorizedUserResponse
+ (*UpdateAuthorizedUserRequest)(nil), // 16: UpdateAuthorizedUserRequest
+ (*UpdateAuthorizedUserResponse)(nil), // 17: UpdateAuthorizedUserResponse
+ (*DeleteAuthorizedUserRequest)(nil), // 18: DeleteAuthorizedUserRequest
+ (*DeleteAuthorizedUserResponse)(nil), // 19: DeleteAuthorizedUserResponse
+ (*Environment)(nil), // 20: Environment
+ (*KillSwitch)(nil), // 21: KillSwitch
+ (*Feature)(nil), // 22: Feature
+ (*KillSwitchAuthorizedUser)(nil), // 23: KillSwitchAuthorizedUser
+}
+var file_api_proto_kill_switch_proto_depIdxs = []int32{
+ 20, // 0: GetKillSwitchStatusRequest.environment:type_name -> Environment
+ 21, // 1: GetKillSwitchStatusResponse.kill_switches:type_name -> KillSwitch
+ 21, // 2: GetKillSwitchOverviewResponse.kill_switches:type_name -> KillSwitch
+ 22, // 3: ListFeaturesResponse.features:type_name -> Feature
+ 22, // 4: SyncFeaturesRequest.features:type_name -> Feature
+ 21, // 5: EnableKillSwitchRequest.kill_switch:type_name -> KillSwitch
+ 23, // 6: ListAuthorizedUsersResponse.authorized_users:type_name -> KillSwitchAuthorizedUser
+ 23, // 7: AddAuthorizedUserRequest.user:type_name -> KillSwitchAuthorizedUser
+ 23, // 8: UpdateAuthorizedUserRequest.user:type_name -> KillSwitchAuthorizedUser
+ 0, // 9: KillSwitchService.GetKillSwitchStatus:input_type -> GetKillSwitchStatusRequest
+ 2, // 10: KillSwitchService.GetKillSwitchOverview:input_type -> GetKillSwitchOverviewRequest
+ 4, // 11: KillSwitchService.ListFeatures:input_type -> ListFeaturesRequest
+ 6, // 12: KillSwitchService.SyncFeatures:input_type -> SyncFeaturesRequest
+ 8, // 13: KillSwitchService.EnableKillSwitch:input_type -> EnableKillSwitchRequest
+ 10, // 14: KillSwitchService.DisableKillSwitch:input_type -> DisableKillSwitchRequest
+ 12, // 15: KillSwitchService.ListAuthorizedUsers:input_type -> ListAuthorizedUsersRequest
+ 14, // 16: KillSwitchService.AddAuthorizedUser:input_type -> AddAuthorizedUserRequest
+ 16, // 17: KillSwitchService.UpdateAuthorizedUser:input_type -> UpdateAuthorizedUserRequest
+ 18, // 18: KillSwitchService.DeleteAuthorizedUser:input_type -> DeleteAuthorizedUserRequest
+ 1, // 19: KillSwitchService.GetKillSwitchStatus:output_type -> GetKillSwitchStatusResponse
+ 3, // 20: KillSwitchService.GetKillSwitchOverview:output_type -> GetKillSwitchOverviewResponse
+ 5, // 21: KillSwitchService.ListFeatures:output_type -> ListFeaturesResponse
+ 7, // 22: KillSwitchService.SyncFeatures:output_type -> SyncFeaturesResponse
+ 9, // 23: KillSwitchService.EnableKillSwitch:output_type -> EnableKillSwitchResponse
+ 11, // 24: KillSwitchService.DisableKillSwitch:output_type -> DisableKillSwitchResponse
+ 13, // 25: KillSwitchService.ListAuthorizedUsers:output_type -> ListAuthorizedUsersResponse
+ 15, // 26: KillSwitchService.AddAuthorizedUser:output_type -> AddAuthorizedUserResponse
+ 17, // 27: KillSwitchService.UpdateAuthorizedUser:output_type -> UpdateAuthorizedUserResponse
+ 19, // 28: KillSwitchService.DeleteAuthorizedUser:output_type -> DeleteAuthorizedUserResponse
+ 19, // [19:29] is the sub-list for method output_type
+ 9, // [9:19] is the sub-list for method input_type
+ 9, // [9:9] is the sub-list for extension type_name
+ 9, // [9:9] is the sub-list for extension extendee
+ 0, // [0:9] is the sub-list for field type_name
+}
+
+func init() { file_api_proto_kill_switch_proto_init() }
+func file_api_proto_kill_switch_proto_init() {
+ if File_api_proto_kill_switch_proto != nil {
+ return
+ }
+ file_api_proto_common_proto_init()
+ file_api_proto_kill_switch_objects_proto_init()
+ if !protoimpl.UnsafeEnabled {
+ file_api_proto_kill_switch_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*GetKillSwitchStatusRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_api_proto_kill_switch_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*GetKillSwitchStatusResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_api_proto_kill_switch_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*GetKillSwitchOverviewRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_api_proto_kill_switch_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*GetKillSwitchOverviewResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_api_proto_kill_switch_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ListFeaturesRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_api_proto_kill_switch_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ListFeaturesResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_api_proto_kill_switch_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*SyncFeaturesRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_api_proto_kill_switch_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*SyncFeaturesResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_api_proto_kill_switch_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*EnableKillSwitchRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_api_proto_kill_switch_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*EnableKillSwitchResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_api_proto_kill_switch_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*DisableKillSwitchRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_api_proto_kill_switch_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*DisableKillSwitchResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_api_proto_kill_switch_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ListAuthorizedUsersRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_api_proto_kill_switch_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ListAuthorizedUsersResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_api_proto_kill_switch_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*AddAuthorizedUserRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_api_proto_kill_switch_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*AddAuthorizedUserResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_api_proto_kill_switch_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*UpdateAuthorizedUserRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_api_proto_kill_switch_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*UpdateAuthorizedUserResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_api_proto_kill_switch_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*DeleteAuthorizedUserRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_api_proto_kill_switch_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*DeleteAuthorizedUserResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ }
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: file_api_proto_kill_switch_proto_rawDesc,
+ NumEnums: 0,
+ NumMessages: 20,
+ NumExtensions: 0,
+ NumServices: 1,
+ },
+ GoTypes: file_api_proto_kill_switch_proto_goTypes,
+ DependencyIndexes: file_api_proto_kill_switch_proto_depIdxs,
+ MessageInfos: file_api_proto_kill_switch_proto_msgTypes,
+ }.Build()
+ File_api_proto_kill_switch_proto = out.File
+ file_api_proto_kill_switch_proto_rawDesc = nil
+ file_api_proto_kill_switch_proto_goTypes = nil
+ file_api_proto_kill_switch_proto_depIdxs = nil
+}
diff --git a/api_proto/kill_switch.proto b/api_proto/kill_switch.proto
new file mode 100644
index 0000000..38b688c
--- /dev/null
+++ b/api_proto/kill_switch.proto
@@ -0,0 +1,93 @@
+syntax = "proto3";
+
+import "api_proto/common.proto";
+import "api_proto/kill_switch_objects.proto";
+
+option go_package = "gomodules.avm99963.com/twpt-server/api_proto";
+
+service KillSwitchService {
+ rpc GetKillSwitchStatus (GetKillSwitchStatusRequest) returns (GetKillSwitchStatusResponse) {}
+ rpc GetKillSwitchOverview (GetKillSwitchOverviewRequest) returns (GetKillSwitchOverviewResponse) {}
+ rpc ListFeatures (ListFeaturesRequest) returns (ListFeaturesResponse) {}
+ rpc SyncFeatures (SyncFeaturesRequest) returns (SyncFeaturesResponse) {}
+ rpc EnableKillSwitch (EnableKillSwitchRequest) returns (EnableKillSwitchResponse) {}
+ rpc DisableKillSwitch (DisableKillSwitchRequest) returns (DisableKillSwitchResponse) {}
+ rpc ListAuthorizedUsers (ListAuthorizedUsersRequest) returns (ListAuthorizedUsersResponse) {}
+ rpc AddAuthorizedUser (AddAuthorizedUserRequest) returns (AddAuthorizedUserResponse) {}
+ rpc UpdateAuthorizedUser (UpdateAuthorizedUserRequest) returns (UpdateAuthorizedUserResponse) {}
+ rpc DeleteAuthorizedUser (DeleteAuthorizedUserRequest) returns (DeleteAuthorizedUserResponse) {}
+}
+
+// Retrieve kill switch status depending on the environment.
+message GetKillSwitchStatusRequest {
+ Environment environment = 1;
+}
+
+message GetKillSwitchStatusResponse {
+ repeated KillSwitch kill_switches = 1;
+}
+
+message GetKillSwitchOverviewRequest {
+}
+
+message GetKillSwitchOverviewResponse {
+ repeated KillSwitch kill_switches = 1;
+}
+
+message ListFeaturesRequest {
+ bool with_deprecated_features = 1;
+}
+
+message ListFeaturesResponse {
+ repeated Feature features = 1;
+}
+
+message SyncFeaturesRequest {
+ repeated Feature features = 1;
+}
+
+message SyncFeaturesResponse {
+}
+
+message EnableKillSwitchRequest {
+ KillSwitch kill_switch = 1;
+}
+
+message EnableKillSwitchResponse {
+}
+
+message DisableKillSwitchRequest {
+ int32 kill_switch_id = 1;
+}
+
+message DisableKillSwitchResponse {
+}
+
+message ListAuthorizedUsersRequest {
+}
+
+message ListAuthorizedUsersResponse {
+ KillSwitchAuthorizedUser authorized_users = 1;
+}
+
+message AddAuthorizedUserRequest {
+ KillSwitchAuthorizedUser user = 1;
+}
+
+message AddAuthorizedUserResponse {
+}
+
+message UpdateAuthorizedUserRequest {
+ int32 user_id = 1;
+ KillSwitchAuthorizedUser user = 2;
+}
+
+message UpdateAuthorizedUserResponse {
+}
+
+message DeleteAuthorizedUserRequest {
+ int32 user_id = 1;
+}
+
+message DeleteAuthorizedUserResponse {
+}
diff --git a/api_proto/kill_switch_grpc.pb.go b/api_proto/kill_switch_grpc.pb.go
new file mode 100644
index 0000000..d9250b2
--- /dev/null
+++ b/api_proto/kill_switch_grpc.pb.go
@@ -0,0 +1,425 @@
+// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
+
+package api_proto
+
+import (
+ context "context"
+ grpc "google.golang.org/grpc"
+ codes "google.golang.org/grpc/codes"
+ status "google.golang.org/grpc/status"
+)
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the grpc package it is being compiled against.
+// Requires gRPC-Go v1.32.0 or later.
+const _ = grpc.SupportPackageIsVersion7
+
+// KillSwitchServiceClient is the client API for KillSwitchService service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
+type KillSwitchServiceClient interface {
+ GetKillSwitchStatus(ctx context.Context, in *GetKillSwitchStatusRequest, opts ...grpc.CallOption) (*GetKillSwitchStatusResponse, error)
+ GetKillSwitchOverview(ctx context.Context, in *GetKillSwitchOverviewRequest, opts ...grpc.CallOption) (*GetKillSwitchOverviewResponse, error)
+ ListFeatures(ctx context.Context, in *ListFeaturesRequest, opts ...grpc.CallOption) (*ListFeaturesResponse, error)
+ SyncFeatures(ctx context.Context, in *SyncFeaturesRequest, opts ...grpc.CallOption) (*SyncFeaturesResponse, error)
+ EnableKillSwitch(ctx context.Context, in *EnableKillSwitchRequest, opts ...grpc.CallOption) (*EnableKillSwitchResponse, error)
+ DisableKillSwitch(ctx context.Context, in *DisableKillSwitchRequest, opts ...grpc.CallOption) (*DisableKillSwitchResponse, error)
+ ListAuthorizedUsers(ctx context.Context, in *ListAuthorizedUsersRequest, opts ...grpc.CallOption) (*ListAuthorizedUsersResponse, error)
+ AddAuthorizedUser(ctx context.Context, in *AddAuthorizedUserRequest, opts ...grpc.CallOption) (*AddAuthorizedUserResponse, error)
+ UpdateAuthorizedUser(ctx context.Context, in *UpdateAuthorizedUserRequest, opts ...grpc.CallOption) (*UpdateAuthorizedUserResponse, error)
+ DeleteAuthorizedUser(ctx context.Context, in *DeleteAuthorizedUserRequest, opts ...grpc.CallOption) (*DeleteAuthorizedUserResponse, error)
+}
+
+type killSwitchServiceClient struct {
+ cc grpc.ClientConnInterface
+}
+
+func NewKillSwitchServiceClient(cc grpc.ClientConnInterface) KillSwitchServiceClient {
+ return &killSwitchServiceClient{cc}
+}
+
+func (c *killSwitchServiceClient) GetKillSwitchStatus(ctx context.Context, in *GetKillSwitchStatusRequest, opts ...grpc.CallOption) (*GetKillSwitchStatusResponse, error) {
+ out := new(GetKillSwitchStatusResponse)
+ err := c.cc.Invoke(ctx, "/KillSwitchService/GetKillSwitchStatus", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *killSwitchServiceClient) GetKillSwitchOverview(ctx context.Context, in *GetKillSwitchOverviewRequest, opts ...grpc.CallOption) (*GetKillSwitchOverviewResponse, error) {
+ out := new(GetKillSwitchOverviewResponse)
+ err := c.cc.Invoke(ctx, "/KillSwitchService/GetKillSwitchOverview", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *killSwitchServiceClient) ListFeatures(ctx context.Context, in *ListFeaturesRequest, opts ...grpc.CallOption) (*ListFeaturesResponse, error) {
+ out := new(ListFeaturesResponse)
+ err := c.cc.Invoke(ctx, "/KillSwitchService/ListFeatures", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *killSwitchServiceClient) SyncFeatures(ctx context.Context, in *SyncFeaturesRequest, opts ...grpc.CallOption) (*SyncFeaturesResponse, error) {
+ out := new(SyncFeaturesResponse)
+ err := c.cc.Invoke(ctx, "/KillSwitchService/SyncFeatures", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *killSwitchServiceClient) EnableKillSwitch(ctx context.Context, in *EnableKillSwitchRequest, opts ...grpc.CallOption) (*EnableKillSwitchResponse, error) {
+ out := new(EnableKillSwitchResponse)
+ err := c.cc.Invoke(ctx, "/KillSwitchService/EnableKillSwitch", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *killSwitchServiceClient) DisableKillSwitch(ctx context.Context, in *DisableKillSwitchRequest, opts ...grpc.CallOption) (*DisableKillSwitchResponse, error) {
+ out := new(DisableKillSwitchResponse)
+ err := c.cc.Invoke(ctx, "/KillSwitchService/DisableKillSwitch", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *killSwitchServiceClient) ListAuthorizedUsers(ctx context.Context, in *ListAuthorizedUsersRequest, opts ...grpc.CallOption) (*ListAuthorizedUsersResponse, error) {
+ out := new(ListAuthorizedUsersResponse)
+ err := c.cc.Invoke(ctx, "/KillSwitchService/ListAuthorizedUsers", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *killSwitchServiceClient) AddAuthorizedUser(ctx context.Context, in *AddAuthorizedUserRequest, opts ...grpc.CallOption) (*AddAuthorizedUserResponse, error) {
+ out := new(AddAuthorizedUserResponse)
+ err := c.cc.Invoke(ctx, "/KillSwitchService/AddAuthorizedUser", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *killSwitchServiceClient) UpdateAuthorizedUser(ctx context.Context, in *UpdateAuthorizedUserRequest, opts ...grpc.CallOption) (*UpdateAuthorizedUserResponse, error) {
+ out := new(UpdateAuthorizedUserResponse)
+ err := c.cc.Invoke(ctx, "/KillSwitchService/UpdateAuthorizedUser", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *killSwitchServiceClient) DeleteAuthorizedUser(ctx context.Context, in *DeleteAuthorizedUserRequest, opts ...grpc.CallOption) (*DeleteAuthorizedUserResponse, error) {
+ out := new(DeleteAuthorizedUserResponse)
+ err := c.cc.Invoke(ctx, "/KillSwitchService/DeleteAuthorizedUser", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+// KillSwitchServiceServer is the server API for KillSwitchService service.
+// All implementations must embed UnimplementedKillSwitchServiceServer
+// for forward compatibility
+type KillSwitchServiceServer interface {
+ GetKillSwitchStatus(context.Context, *GetKillSwitchStatusRequest) (*GetKillSwitchStatusResponse, error)
+ GetKillSwitchOverview(context.Context, *GetKillSwitchOverviewRequest) (*GetKillSwitchOverviewResponse, error)
+ ListFeatures(context.Context, *ListFeaturesRequest) (*ListFeaturesResponse, error)
+ SyncFeatures(context.Context, *SyncFeaturesRequest) (*SyncFeaturesResponse, error)
+ EnableKillSwitch(context.Context, *EnableKillSwitchRequest) (*EnableKillSwitchResponse, error)
+ DisableKillSwitch(context.Context, *DisableKillSwitchRequest) (*DisableKillSwitchResponse, error)
+ ListAuthorizedUsers(context.Context, *ListAuthorizedUsersRequest) (*ListAuthorizedUsersResponse, error)
+ AddAuthorizedUser(context.Context, *AddAuthorizedUserRequest) (*AddAuthorizedUserResponse, error)
+ UpdateAuthorizedUser(context.Context, *UpdateAuthorizedUserRequest) (*UpdateAuthorizedUserResponse, error)
+ DeleteAuthorizedUser(context.Context, *DeleteAuthorizedUserRequest) (*DeleteAuthorizedUserResponse, error)
+ mustEmbedUnimplementedKillSwitchServiceServer()
+}
+
+// UnimplementedKillSwitchServiceServer must be embedded to have forward compatible implementations.
+type UnimplementedKillSwitchServiceServer struct {
+}
+
+func (UnimplementedKillSwitchServiceServer) GetKillSwitchStatus(context.Context, *GetKillSwitchStatusRequest) (*GetKillSwitchStatusResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method GetKillSwitchStatus not implemented")
+}
+func (UnimplementedKillSwitchServiceServer) GetKillSwitchOverview(context.Context, *GetKillSwitchOverviewRequest) (*GetKillSwitchOverviewResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method GetKillSwitchOverview not implemented")
+}
+func (UnimplementedKillSwitchServiceServer) ListFeatures(context.Context, *ListFeaturesRequest) (*ListFeaturesResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method ListFeatures not implemented")
+}
+func (UnimplementedKillSwitchServiceServer) SyncFeatures(context.Context, *SyncFeaturesRequest) (*SyncFeaturesResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method SyncFeatures not implemented")
+}
+func (UnimplementedKillSwitchServiceServer) EnableKillSwitch(context.Context, *EnableKillSwitchRequest) (*EnableKillSwitchResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method EnableKillSwitch not implemented")
+}
+func (UnimplementedKillSwitchServiceServer) DisableKillSwitch(context.Context, *DisableKillSwitchRequest) (*DisableKillSwitchResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method DisableKillSwitch not implemented")
+}
+func (UnimplementedKillSwitchServiceServer) ListAuthorizedUsers(context.Context, *ListAuthorizedUsersRequest) (*ListAuthorizedUsersResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method ListAuthorizedUsers not implemented")
+}
+func (UnimplementedKillSwitchServiceServer) AddAuthorizedUser(context.Context, *AddAuthorizedUserRequest) (*AddAuthorizedUserResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method AddAuthorizedUser not implemented")
+}
+func (UnimplementedKillSwitchServiceServer) UpdateAuthorizedUser(context.Context, *UpdateAuthorizedUserRequest) (*UpdateAuthorizedUserResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method UpdateAuthorizedUser not implemented")
+}
+func (UnimplementedKillSwitchServiceServer) DeleteAuthorizedUser(context.Context, *DeleteAuthorizedUserRequest) (*DeleteAuthorizedUserResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method DeleteAuthorizedUser not implemented")
+}
+func (UnimplementedKillSwitchServiceServer) mustEmbedUnimplementedKillSwitchServiceServer() {}
+
+// UnsafeKillSwitchServiceServer may be embedded to opt out of forward compatibility for this service.
+// Use of this interface is not recommended, as added methods to KillSwitchServiceServer will
+// result in compilation errors.
+type UnsafeKillSwitchServiceServer interface {
+ mustEmbedUnimplementedKillSwitchServiceServer()
+}
+
+func RegisterKillSwitchServiceServer(s grpc.ServiceRegistrar, srv KillSwitchServiceServer) {
+ s.RegisterService(&KillSwitchService_ServiceDesc, srv)
+}
+
+func _KillSwitchService_GetKillSwitchStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(GetKillSwitchStatusRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(KillSwitchServiceServer).GetKillSwitchStatus(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/KillSwitchService/GetKillSwitchStatus",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(KillSwitchServiceServer).GetKillSwitchStatus(ctx, req.(*GetKillSwitchStatusRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _KillSwitchService_GetKillSwitchOverview_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(GetKillSwitchOverviewRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(KillSwitchServiceServer).GetKillSwitchOverview(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/KillSwitchService/GetKillSwitchOverview",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(KillSwitchServiceServer).GetKillSwitchOverview(ctx, req.(*GetKillSwitchOverviewRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _KillSwitchService_ListFeatures_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(ListFeaturesRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(KillSwitchServiceServer).ListFeatures(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/KillSwitchService/ListFeatures",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(KillSwitchServiceServer).ListFeatures(ctx, req.(*ListFeaturesRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _KillSwitchService_SyncFeatures_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(SyncFeaturesRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(KillSwitchServiceServer).SyncFeatures(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/KillSwitchService/SyncFeatures",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(KillSwitchServiceServer).SyncFeatures(ctx, req.(*SyncFeaturesRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _KillSwitchService_EnableKillSwitch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(EnableKillSwitchRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(KillSwitchServiceServer).EnableKillSwitch(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/KillSwitchService/EnableKillSwitch",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(KillSwitchServiceServer).EnableKillSwitch(ctx, req.(*EnableKillSwitchRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _KillSwitchService_DisableKillSwitch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(DisableKillSwitchRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(KillSwitchServiceServer).DisableKillSwitch(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/KillSwitchService/DisableKillSwitch",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(KillSwitchServiceServer).DisableKillSwitch(ctx, req.(*DisableKillSwitchRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _KillSwitchService_ListAuthorizedUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(ListAuthorizedUsersRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(KillSwitchServiceServer).ListAuthorizedUsers(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/KillSwitchService/ListAuthorizedUsers",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(KillSwitchServiceServer).ListAuthorizedUsers(ctx, req.(*ListAuthorizedUsersRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _KillSwitchService_AddAuthorizedUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(AddAuthorizedUserRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(KillSwitchServiceServer).AddAuthorizedUser(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/KillSwitchService/AddAuthorizedUser",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(KillSwitchServiceServer).AddAuthorizedUser(ctx, req.(*AddAuthorizedUserRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _KillSwitchService_UpdateAuthorizedUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(UpdateAuthorizedUserRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(KillSwitchServiceServer).UpdateAuthorizedUser(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/KillSwitchService/UpdateAuthorizedUser",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(KillSwitchServiceServer).UpdateAuthorizedUser(ctx, req.(*UpdateAuthorizedUserRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _KillSwitchService_DeleteAuthorizedUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(DeleteAuthorizedUserRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(KillSwitchServiceServer).DeleteAuthorizedUser(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/KillSwitchService/DeleteAuthorizedUser",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(KillSwitchServiceServer).DeleteAuthorizedUser(ctx, req.(*DeleteAuthorizedUserRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+// KillSwitchService_ServiceDesc is the grpc.ServiceDesc for KillSwitchService service.
+// It's only intended for direct use with grpc.RegisterService,
+// and not to be introspected or modified (even as a copy)
+var KillSwitchService_ServiceDesc = grpc.ServiceDesc{
+ ServiceName: "KillSwitchService",
+ HandlerType: (*KillSwitchServiceServer)(nil),
+ Methods: []grpc.MethodDesc{
+ {
+ MethodName: "GetKillSwitchStatus",
+ Handler: _KillSwitchService_GetKillSwitchStatus_Handler,
+ },
+ {
+ MethodName: "GetKillSwitchOverview",
+ Handler: _KillSwitchService_GetKillSwitchOverview_Handler,
+ },
+ {
+ MethodName: "ListFeatures",
+ Handler: _KillSwitchService_ListFeatures_Handler,
+ },
+ {
+ MethodName: "SyncFeatures",
+ Handler: _KillSwitchService_SyncFeatures_Handler,
+ },
+ {
+ MethodName: "EnableKillSwitch",
+ Handler: _KillSwitchService_EnableKillSwitch_Handler,
+ },
+ {
+ MethodName: "DisableKillSwitch",
+ Handler: _KillSwitchService_DisableKillSwitch_Handler,
+ },
+ {
+ MethodName: "ListAuthorizedUsers",
+ Handler: _KillSwitchService_ListAuthorizedUsers_Handler,
+ },
+ {
+ MethodName: "AddAuthorizedUser",
+ Handler: _KillSwitchService_AddAuthorizedUser_Handler,
+ },
+ {
+ MethodName: "UpdateAuthorizedUser",
+ Handler: _KillSwitchService_UpdateAuthorizedUser_Handler,
+ },
+ {
+ MethodName: "DeleteAuthorizedUser",
+ Handler: _KillSwitchService_DeleteAuthorizedUser_Handler,
+ },
+ },
+ Streams: []grpc.StreamDesc{},
+ Metadata: "api_proto/kill_switch.proto",
+}
diff --git a/api_proto/kill_switch_objects.pb.go b/api_proto/kill_switch_objects.pb.go
new file mode 100644
index 0000000..825047f
--- /dev/null
+++ b/api_proto/kill_switch_objects.pb.go
@@ -0,0 +1,854 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.27.1
+// protoc v3.17.3
+// source: api_proto/kill_switch_objects.proto
+
+package api_proto
+
+import (
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ timestamppb "google.golang.org/protobuf/types/known/timestamppb"
+ reflect "reflect"
+ sync "sync"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+type Feature_Type int32
+
+const (
+ Feature_TYPE_UNKNOWN Feature_Type = 0
+ Feature_TYPE_EXPERIMENT Feature_Type = 1
+ Feature_TYPE_OPTION Feature_Type = 2
+ Feature_TYPE_DEPRECATED Feature_Type = 10
+)
+
+// Enum value maps for Feature_Type.
+var (
+ Feature_Type_name = map[int32]string{
+ 0: "TYPE_UNKNOWN",
+ 1: "TYPE_EXPERIMENT",
+ 2: "TYPE_OPTION",
+ 10: "TYPE_DEPRECATED",
+ }
+ Feature_Type_value = map[string]int32{
+ "TYPE_UNKNOWN": 0,
+ "TYPE_EXPERIMENT": 1,
+ "TYPE_OPTION": 2,
+ "TYPE_DEPRECATED": 10,
+ }
+)
+
+func (x Feature_Type) Enum() *Feature_Type {
+ p := new(Feature_Type)
+ *p = x
+ return p
+}
+
+func (x Feature_Type) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (Feature_Type) Descriptor() protoreflect.EnumDescriptor {
+ return file_api_proto_kill_switch_objects_proto_enumTypes[0].Descriptor()
+}
+
+func (Feature_Type) Type() protoreflect.EnumType {
+ return &file_api_proto_kill_switch_objects_proto_enumTypes[0]
+}
+
+func (x Feature_Type) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use Feature_Type.Descriptor instead.
+func (Feature_Type) EnumDescriptor() ([]byte, []int) {
+ return file_api_proto_kill_switch_objects_proto_rawDescGZIP(), []int{0, 0}
+}
+
+type KillSwitchAuthorizedUser_AccessLevel int32
+
+const (
+ KillSwitchAuthorizedUser_ACCESS_LEVEL_NONE KillSwitchAuthorizedUser_AccessLevel = 0
+ KillSwitchAuthorizedUser_ACCESS_LEVEL_ACTIVATOR KillSwitchAuthorizedUser_AccessLevel = 1 // The user may enable/disable kill switches.
+ KillSwitchAuthorizedUser_ACCESS_LEVEL_ADMIN KillSwitchAuthorizedUser_AccessLevel = 2 // The user may perform any action.
+)
+
+// Enum value maps for KillSwitchAuthorizedUser_AccessLevel.
+var (
+ KillSwitchAuthorizedUser_AccessLevel_name = map[int32]string{
+ 0: "ACCESS_LEVEL_NONE",
+ 1: "ACCESS_LEVEL_ACTIVATOR",
+ 2: "ACCESS_LEVEL_ADMIN",
+ }
+ KillSwitchAuthorizedUser_AccessLevel_value = map[string]int32{
+ "ACCESS_LEVEL_NONE": 0,
+ "ACCESS_LEVEL_ACTIVATOR": 1,
+ "ACCESS_LEVEL_ADMIN": 2,
+ }
+)
+
+func (x KillSwitchAuthorizedUser_AccessLevel) Enum() *KillSwitchAuthorizedUser_AccessLevel {
+ p := new(KillSwitchAuthorizedUser_AccessLevel)
+ *p = x
+ return p
+}
+
+func (x KillSwitchAuthorizedUser_AccessLevel) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (KillSwitchAuthorizedUser_AccessLevel) Descriptor() protoreflect.EnumDescriptor {
+ return file_api_proto_kill_switch_objects_proto_enumTypes[1].Descriptor()
+}
+
+func (KillSwitchAuthorizedUser_AccessLevel) Type() protoreflect.EnumType {
+ return &file_api_proto_kill_switch_objects_proto_enumTypes[1]
+}
+
+func (x KillSwitchAuthorizedUser_AccessLevel) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use KillSwitchAuthorizedUser_AccessLevel.Descriptor instead.
+func (KillSwitchAuthorizedUser_AccessLevel) EnumDescriptor() ([]byte, []int) {
+ return file_api_proto_kill_switch_objects_proto_rawDescGZIP(), []int{2, 0}
+}
+
+type Feature struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
+ Codename string `protobuf:"bytes,2,opt,name=codename,proto3" json:"codename,omitempty"`
+ Type Feature_Type `protobuf:"varint,3,opt,name=type,proto3,enum=Feature_Type" json:"type,omitempty"`
+}
+
+func (x *Feature) Reset() {
+ *x = Feature{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_api_proto_kill_switch_objects_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *Feature) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Feature) ProtoMessage() {}
+
+func (x *Feature) ProtoReflect() protoreflect.Message {
+ mi := &file_api_proto_kill_switch_objects_proto_msgTypes[0]
+ 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 Feature.ProtoReflect.Descriptor instead.
+func (*Feature) Descriptor() ([]byte, []int) {
+ return file_api_proto_kill_switch_objects_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *Feature) GetId() int32 {
+ if x != nil {
+ return x.Id
+ }
+ return 0
+}
+
+func (x *Feature) GetCodename() string {
+ if x != nil {
+ return x.Codename
+ }
+ return ""
+}
+
+func (x *Feature) GetType() Feature_Type {
+ if x != nil {
+ return x.Type
+ }
+ return Feature_TYPE_UNKNOWN
+}
+
+type KillSwitch struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
+ Feature *Feature `protobuf:"bytes,2,opt,name=feature,proto3" json:"feature,omitempty"`
+ MinVersion string `protobuf:"bytes,3,opt,name=min_version,json=minVersion,proto3" json:"min_version,omitempty"`
+ MaxVersion string `protobuf:"bytes,4,opt,name=max_version,json=maxVersion,proto3" json:"max_version,omitempty"`
+ Browsers []Environment_Browser `protobuf:"varint,5,rep,packed,name=browsers,proto3,enum=Environment_Browser" json:"browsers,omitempty"`
+ Active bool `protobuf:"varint,6,opt,name=active,proto3" json:"active,omitempty"`
+}
+
+func (x *KillSwitch) Reset() {
+ *x = KillSwitch{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_api_proto_kill_switch_objects_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *KillSwitch) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*KillSwitch) ProtoMessage() {}
+
+func (x *KillSwitch) ProtoReflect() protoreflect.Message {
+ mi := &file_api_proto_kill_switch_objects_proto_msgTypes[1]
+ 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 KillSwitch.ProtoReflect.Descriptor instead.
+func (*KillSwitch) Descriptor() ([]byte, []int) {
+ return file_api_proto_kill_switch_objects_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *KillSwitch) GetId() int32 {
+ if x != nil {
+ return x.Id
+ }
+ return 0
+}
+
+func (x *KillSwitch) GetFeature() *Feature {
+ if x != nil {
+ return x.Feature
+ }
+ return nil
+}
+
+func (x *KillSwitch) GetMinVersion() string {
+ if x != nil {
+ return x.MinVersion
+ }
+ return ""
+}
+
+func (x *KillSwitch) GetMaxVersion() string {
+ if x != nil {
+ return x.MaxVersion
+ }
+ return ""
+}
+
+func (x *KillSwitch) GetBrowsers() []Environment_Browser {
+ if x != nil {
+ return x.Browsers
+ }
+ return nil
+}
+
+func (x *KillSwitch) GetActive() bool {
+ if x != nil {
+ return x.Active
+ }
+ return false
+}
+
+type KillSwitchAuthorizedUser struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
+ GoogleUid string `protobuf:"bytes,2,opt,name=google_uid,json=googleUid,proto3" json:"google_uid,omitempty"`
+ Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"`
+ AccessLevel KillSwitchAuthorizedUser_AccessLevel `protobuf:"varint,4,opt,name=access_level,json=accessLevel,proto3,enum=KillSwitchAuthorizedUser_AccessLevel" json:"access_level,omitempty"`
+}
+
+func (x *KillSwitchAuthorizedUser) Reset() {
+ *x = KillSwitchAuthorizedUser{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_api_proto_kill_switch_objects_proto_msgTypes[2]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *KillSwitchAuthorizedUser) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*KillSwitchAuthorizedUser) ProtoMessage() {}
+
+func (x *KillSwitchAuthorizedUser) ProtoReflect() protoreflect.Message {
+ mi := &file_api_proto_kill_switch_objects_proto_msgTypes[2]
+ 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 KillSwitchAuthorizedUser.ProtoReflect.Descriptor instead.
+func (*KillSwitchAuthorizedUser) Descriptor() ([]byte, []int) {
+ return file_api_proto_kill_switch_objects_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *KillSwitchAuthorizedUser) GetId() int32 {
+ if x != nil {
+ return x.Id
+ }
+ return 0
+}
+
+func (x *KillSwitchAuthorizedUser) GetGoogleUid() string {
+ if x != nil {
+ return x.GoogleUid
+ }
+ return ""
+}
+
+func (x *KillSwitchAuthorizedUser) GetEmail() string {
+ if x != nil {
+ return x.Email
+ }
+ return ""
+}
+
+func (x *KillSwitchAuthorizedUser) GetAccessLevel() KillSwitchAuthorizedUser_AccessLevel {
+ if x != nil {
+ return x.AccessLevel
+ }
+ return KillSwitchAuthorizedUser_ACCESS_LEVEL_NONE
+}
+
+type KillSwitchTransformation struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ KillSwitchFrom *KillSwitch `protobuf:"bytes,1,opt,name=kill_switch_from,json=killSwitchFrom,proto3" json:"kill_switch_from,omitempty"`
+ KillSwitchTo *KillSwitch `protobuf:"bytes,2,opt,name=kill_switch_to,json=killSwitchTo,proto3" json:"kill_switch_to,omitempty"`
+}
+
+func (x *KillSwitchTransformation) Reset() {
+ *x = KillSwitchTransformation{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_api_proto_kill_switch_objects_proto_msgTypes[3]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *KillSwitchTransformation) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*KillSwitchTransformation) ProtoMessage() {}
+
+func (x *KillSwitchTransformation) ProtoReflect() protoreflect.Message {
+ mi := &file_api_proto_kill_switch_objects_proto_msgTypes[3]
+ 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 KillSwitchTransformation.ProtoReflect.Descriptor instead.
+func (*KillSwitchTransformation) Descriptor() ([]byte, []int) {
+ return file_api_proto_kill_switch_objects_proto_rawDescGZIP(), []int{3}
+}
+
+func (x *KillSwitchTransformation) GetKillSwitchFrom() *KillSwitch {
+ if x != nil {
+ return x.KillSwitchFrom
+ }
+ return nil
+}
+
+func (x *KillSwitchTransformation) GetKillSwitchTo() *KillSwitch {
+ if x != nil {
+ return x.KillSwitchTo
+ }
+ return nil
+}
+
+// Log entry which describes an action which has taken place.
+type KillSwitchAuditLogEntry struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Timestamp in which the action was taken.
+ Timestamp *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
+ // User who/which performed the action.
+ User *KillSwitchAuthorizedUser `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"`
+ // Description of the action taken
+ //
+ // Types that are assignable to Description:
+ // *KillSwitchAuditLogEntry_KillSwitchEnabled_
+ // *KillSwitchAuditLogEntry_KillSwitchDisabled_
+ Description isKillSwitchAuditLogEntry_Description `protobuf_oneof:"description"`
+}
+
+func (x *KillSwitchAuditLogEntry) Reset() {
+ *x = KillSwitchAuditLogEntry{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_api_proto_kill_switch_objects_proto_msgTypes[4]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *KillSwitchAuditLogEntry) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*KillSwitchAuditLogEntry) ProtoMessage() {}
+
+func (x *KillSwitchAuditLogEntry) ProtoReflect() protoreflect.Message {
+ mi := &file_api_proto_kill_switch_objects_proto_msgTypes[4]
+ 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 KillSwitchAuditLogEntry.ProtoReflect.Descriptor instead.
+func (*KillSwitchAuditLogEntry) Descriptor() ([]byte, []int) {
+ return file_api_proto_kill_switch_objects_proto_rawDescGZIP(), []int{4}
+}
+
+func (x *KillSwitchAuditLogEntry) GetTimestamp() *timestamppb.Timestamp {
+ if x != nil {
+ return x.Timestamp
+ }
+ return nil
+}
+
+func (x *KillSwitchAuditLogEntry) GetUser() *KillSwitchAuthorizedUser {
+ if x != nil {
+ return x.User
+ }
+ return nil
+}
+
+func (m *KillSwitchAuditLogEntry) GetDescription() isKillSwitchAuditLogEntry_Description {
+ if m != nil {
+ return m.Description
+ }
+ return nil
+}
+
+func (x *KillSwitchAuditLogEntry) GetKillSwitchEnabled() *KillSwitchAuditLogEntry_KillSwitchEnabled {
+ if x, ok := x.GetDescription().(*KillSwitchAuditLogEntry_KillSwitchEnabled_); ok {
+ return x.KillSwitchEnabled
+ }
+ return nil
+}
+
+func (x *KillSwitchAuditLogEntry) GetKillSwitchDisabled() *KillSwitchAuditLogEntry_KillSwitchDisabled {
+ if x, ok := x.GetDescription().(*KillSwitchAuditLogEntry_KillSwitchDisabled_); ok {
+ return x.KillSwitchDisabled
+ }
+ return nil
+}
+
+type isKillSwitchAuditLogEntry_Description interface {
+ isKillSwitchAuditLogEntry_Description()
+}
+
+type KillSwitchAuditLogEntry_KillSwitchEnabled_ struct {
+ KillSwitchEnabled *KillSwitchAuditLogEntry_KillSwitchEnabled `protobuf:"bytes,3,opt,name=kill_switch_enabled,json=killSwitchEnabled,proto3,oneof"`
+}
+
+type KillSwitchAuditLogEntry_KillSwitchDisabled_ struct {
+ KillSwitchDisabled *KillSwitchAuditLogEntry_KillSwitchDisabled `protobuf:"bytes,4,opt,name=kill_switch_disabled,json=killSwitchDisabled,proto3,oneof"`
+}
+
+func (*KillSwitchAuditLogEntry_KillSwitchEnabled_) isKillSwitchAuditLogEntry_Description() {}
+
+func (*KillSwitchAuditLogEntry_KillSwitchDisabled_) isKillSwitchAuditLogEntry_Description() {}
+
+type KillSwitchAuditLogEntry_KillSwitchEnabled struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Transformation *KillSwitchTransformation `protobuf:"bytes,1,opt,name=transformation,proto3" json:"transformation,omitempty"`
+}
+
+func (x *KillSwitchAuditLogEntry_KillSwitchEnabled) Reset() {
+ *x = KillSwitchAuditLogEntry_KillSwitchEnabled{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_api_proto_kill_switch_objects_proto_msgTypes[5]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *KillSwitchAuditLogEntry_KillSwitchEnabled) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*KillSwitchAuditLogEntry_KillSwitchEnabled) ProtoMessage() {}
+
+func (x *KillSwitchAuditLogEntry_KillSwitchEnabled) ProtoReflect() protoreflect.Message {
+ mi := &file_api_proto_kill_switch_objects_proto_msgTypes[5]
+ 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 KillSwitchAuditLogEntry_KillSwitchEnabled.ProtoReflect.Descriptor instead.
+func (*KillSwitchAuditLogEntry_KillSwitchEnabled) Descriptor() ([]byte, []int) {
+ return file_api_proto_kill_switch_objects_proto_rawDescGZIP(), []int{4, 0}
+}
+
+func (x *KillSwitchAuditLogEntry_KillSwitchEnabled) GetTransformation() *KillSwitchTransformation {
+ if x != nil {
+ return x.Transformation
+ }
+ return nil
+}
+
+type KillSwitchAuditLogEntry_KillSwitchDisabled struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Transformation *KillSwitchTransformation `protobuf:"bytes,1,opt,name=transformation,proto3" json:"transformation,omitempty"`
+}
+
+func (x *KillSwitchAuditLogEntry_KillSwitchDisabled) Reset() {
+ *x = KillSwitchAuditLogEntry_KillSwitchDisabled{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_api_proto_kill_switch_objects_proto_msgTypes[6]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *KillSwitchAuditLogEntry_KillSwitchDisabled) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*KillSwitchAuditLogEntry_KillSwitchDisabled) ProtoMessage() {}
+
+func (x *KillSwitchAuditLogEntry_KillSwitchDisabled) ProtoReflect() protoreflect.Message {
+ mi := &file_api_proto_kill_switch_objects_proto_msgTypes[6]
+ 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 KillSwitchAuditLogEntry_KillSwitchDisabled.ProtoReflect.Descriptor instead.
+func (*KillSwitchAuditLogEntry_KillSwitchDisabled) Descriptor() ([]byte, []int) {
+ return file_api_proto_kill_switch_objects_proto_rawDescGZIP(), []int{4, 1}
+}
+
+func (x *KillSwitchAuditLogEntry_KillSwitchDisabled) GetTransformation() *KillSwitchTransformation {
+ if x != nil {
+ return x.Transformation
+ }
+ return nil
+}
+
+var File_api_proto_kill_switch_objects_proto protoreflect.FileDescriptor
+
+var file_api_proto_kill_switch_objects_proto_rawDesc = []byte{
+ 0x0a, 0x23, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6b, 0x69, 0x6c, 0x6c,
+ 0x5f, 0x73, 0x77, 0x69, 0x74, 0x63, 0x68, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2e,
+ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+ 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 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, 0xad,
+ 0x01, 0x0a, 0x07, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64,
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f,
+ 0x64, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f,
+ 0x64, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03,
+ 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0d, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x54,
+ 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x53, 0x0a, 0x04, 0x54, 0x79, 0x70,
+ 0x65, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57,
+ 0x4e, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x58, 0x50, 0x45,
+ 0x52, 0x49, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45,
+ 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x54, 0x59, 0x50,
+ 0x45, 0x5f, 0x44, 0x45, 0x50, 0x52, 0x45, 0x43, 0x41, 0x54, 0x45, 0x44, 0x10, 0x0a, 0x22, 0xcc,
+ 0x01, 0x0a, 0x0a, 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x12, 0x0e, 0x0a,
+ 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x22, 0x0a,
+ 0x07, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08,
+ 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x07, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72,
+ 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x69, 0x6e, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
+ 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x69, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69,
+ 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x61, 0x78, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f,
+ 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x61, 0x78, 0x56, 0x65, 0x72, 0x73,
+ 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x0a, 0x08, 0x62, 0x72, 0x6f, 0x77, 0x73, 0x65, 0x72, 0x73, 0x18,
+ 0x05, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d,
+ 0x65, 0x6e, 0x74, 0x2e, 0x42, 0x72, 0x6f, 0x77, 0x73, 0x65, 0x72, 0x52, 0x08, 0x62, 0x72, 0x6f,
+ 0x77, 0x73, 0x65, 0x72, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18,
+ 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x22, 0x83, 0x02,
+ 0x0a, 0x18, 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x41, 0x75, 0x74, 0x68,
+ 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64,
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x67, 0x6f,
+ 0x6f, 0x67, 0x6c, 0x65, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x55, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61,
+ 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12,
+ 0x48, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18,
+ 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74,
+ 0x63, 0x68, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72,
+ 0x2e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x0b, 0x61, 0x63,
+ 0x63, 0x65, 0x73, 0x73, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0x58, 0x0a, 0x0b, 0x41, 0x63, 0x63,
+ 0x65, 0x73, 0x73, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x15, 0x0a, 0x11, 0x41, 0x43, 0x43, 0x45,
+ 0x53, 0x53, 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12,
+ 0x1a, 0x0a, 0x16, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f,
+ 0x41, 0x43, 0x54, 0x49, 0x56, 0x41, 0x54, 0x4f, 0x52, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x41,
+ 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x41, 0x44, 0x4d, 0x49,
+ 0x4e, 0x10, 0x02, 0x22, 0x84, 0x01, 0x0a, 0x18, 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74,
+ 0x63, 0x68, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x12, 0x35, 0x0a, 0x10, 0x6b, 0x69, 0x6c, 0x6c, 0x5f, 0x73, 0x77, 0x69, 0x74, 0x63, 0x68, 0x5f,
+ 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x4b, 0x69, 0x6c,
+ 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x52, 0x0e, 0x6b, 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69,
+ 0x74, 0x63, 0x68, 0x46, 0x72, 0x6f, 0x6d, 0x12, 0x31, 0x0a, 0x0e, 0x6b, 0x69, 0x6c, 0x6c, 0x5f,
+ 0x73, 0x77, 0x69, 0x74, 0x63, 0x68, 0x5f, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
+ 0x0b, 0x2e, 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x52, 0x0c, 0x6b, 0x69,
+ 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x54, 0x6f, 0x22, 0x81, 0x04, 0x0a, 0x17, 0x4b,
+ 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f,
+ 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74,
+ 0x61, 0x6d, 0x70, 0x18, 0x01, 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, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70,
+ 0x12, 0x2d, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19,
+ 0x2e, 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x41, 0x75, 0x74, 0x68, 0x6f,
+ 0x72, 0x69, 0x7a, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12,
+ 0x5c, 0x0a, 0x13, 0x6b, 0x69, 0x6c, 0x6c, 0x5f, 0x73, 0x77, 0x69, 0x74, 0x63, 0x68, 0x5f, 0x65,
+ 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x4b,
+ 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f,
+ 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63,
+ 0x68, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x48, 0x00, 0x52, 0x11, 0x6b, 0x69, 0x6c, 0x6c,
+ 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x5f, 0x0a,
+ 0x14, 0x6b, 0x69, 0x6c, 0x6c, 0x5f, 0x73, 0x77, 0x69, 0x74, 0x63, 0x68, 0x5f, 0x64, 0x69, 0x73,
+ 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x4b, 0x69,
+ 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67,
+ 0x45, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68,
+ 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x48, 0x00, 0x52, 0x12, 0x6b, 0x69, 0x6c, 0x6c,
+ 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x1a, 0x56,
+ 0x0a, 0x11, 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x45, 0x6e, 0x61, 0x62,
+ 0x6c, 0x65, 0x64, 0x12, 0x41, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x4b, 0x69,
+ 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72,
+ 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72,
+ 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x57, 0x0a, 0x12, 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x77,
+ 0x69, 0x74, 0x63, 0x68, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x41, 0x0a, 0x0e,
+ 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01,
+ 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63,
+ 0x68, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52,
+ 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42,
+ 0x0d, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x2e,
+ 0x5a, 0x2c, 0x67, 0x6f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x61, 0x76, 0x6d, 0x39,
+ 0x39, 0x39, 0x36, 0x33, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x77, 0x70, 0x74, 0x2d, 0x73, 0x65,
+ 0x72, 0x76, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06,
+ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+ file_api_proto_kill_switch_objects_proto_rawDescOnce sync.Once
+ file_api_proto_kill_switch_objects_proto_rawDescData = file_api_proto_kill_switch_objects_proto_rawDesc
+)
+
+func file_api_proto_kill_switch_objects_proto_rawDescGZIP() []byte {
+ file_api_proto_kill_switch_objects_proto_rawDescOnce.Do(func() {
+ file_api_proto_kill_switch_objects_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_proto_kill_switch_objects_proto_rawDescData)
+ })
+ return file_api_proto_kill_switch_objects_proto_rawDescData
+}
+
+var file_api_proto_kill_switch_objects_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
+var file_api_proto_kill_switch_objects_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
+var file_api_proto_kill_switch_objects_proto_goTypes = []interface{}{
+ (Feature_Type)(0), // 0: Feature.Type
+ (KillSwitchAuthorizedUser_AccessLevel)(0), // 1: KillSwitchAuthorizedUser.AccessLevel
+ (*Feature)(nil), // 2: Feature
+ (*KillSwitch)(nil), // 3: KillSwitch
+ (*KillSwitchAuthorizedUser)(nil), // 4: KillSwitchAuthorizedUser
+ (*KillSwitchTransformation)(nil), // 5: KillSwitchTransformation
+ (*KillSwitchAuditLogEntry)(nil), // 6: KillSwitchAuditLogEntry
+ (*KillSwitchAuditLogEntry_KillSwitchEnabled)(nil), // 7: KillSwitchAuditLogEntry.KillSwitchEnabled
+ (*KillSwitchAuditLogEntry_KillSwitchDisabled)(nil), // 8: KillSwitchAuditLogEntry.KillSwitchDisabled
+ (Environment_Browser)(0), // 9: Environment.Browser
+ (*timestamppb.Timestamp)(nil), // 10: google.protobuf.Timestamp
+}
+var file_api_proto_kill_switch_objects_proto_depIdxs = []int32{
+ 0, // 0: Feature.type:type_name -> Feature.Type
+ 2, // 1: KillSwitch.feature:type_name -> Feature
+ 9, // 2: KillSwitch.browsers:type_name -> Environment.Browser
+ 1, // 3: KillSwitchAuthorizedUser.access_level:type_name -> KillSwitchAuthorizedUser.AccessLevel
+ 3, // 4: KillSwitchTransformation.kill_switch_from:type_name -> KillSwitch
+ 3, // 5: KillSwitchTransformation.kill_switch_to:type_name -> KillSwitch
+ 10, // 6: KillSwitchAuditLogEntry.timestamp:type_name -> google.protobuf.Timestamp
+ 4, // 7: KillSwitchAuditLogEntry.user:type_name -> KillSwitchAuthorizedUser
+ 7, // 8: KillSwitchAuditLogEntry.kill_switch_enabled:type_name -> KillSwitchAuditLogEntry.KillSwitchEnabled
+ 8, // 9: KillSwitchAuditLogEntry.kill_switch_disabled:type_name -> KillSwitchAuditLogEntry.KillSwitchDisabled
+ 5, // 10: KillSwitchAuditLogEntry.KillSwitchEnabled.transformation:type_name -> KillSwitchTransformation
+ 5, // 11: KillSwitchAuditLogEntry.KillSwitchDisabled.transformation:type_name -> KillSwitchTransformation
+ 12, // [12:12] is the sub-list for method output_type
+ 12, // [12:12] 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_api_proto_kill_switch_objects_proto_init() }
+func file_api_proto_kill_switch_objects_proto_init() {
+ if File_api_proto_kill_switch_objects_proto != nil {
+ return
+ }
+ file_api_proto_common_proto_init()
+ if !protoimpl.UnsafeEnabled {
+ file_api_proto_kill_switch_objects_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*Feature); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_api_proto_kill_switch_objects_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*KillSwitch); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_api_proto_kill_switch_objects_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*KillSwitchAuthorizedUser); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_api_proto_kill_switch_objects_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*KillSwitchTransformation); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_api_proto_kill_switch_objects_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*KillSwitchAuditLogEntry); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_api_proto_kill_switch_objects_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*KillSwitchAuditLogEntry_KillSwitchEnabled); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_api_proto_kill_switch_objects_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*KillSwitchAuditLogEntry_KillSwitchDisabled); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ }
+ file_api_proto_kill_switch_objects_proto_msgTypes[4].OneofWrappers = []interface{}{
+ (*KillSwitchAuditLogEntry_KillSwitchEnabled_)(nil),
+ (*KillSwitchAuditLogEntry_KillSwitchDisabled_)(nil),
+ }
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: file_api_proto_kill_switch_objects_proto_rawDesc,
+ NumEnums: 2,
+ NumMessages: 7,
+ NumExtensions: 0,
+ NumServices: 0,
+ },
+ GoTypes: file_api_proto_kill_switch_objects_proto_goTypes,
+ DependencyIndexes: file_api_proto_kill_switch_objects_proto_depIdxs,
+ EnumInfos: file_api_proto_kill_switch_objects_proto_enumTypes,
+ MessageInfos: file_api_proto_kill_switch_objects_proto_msgTypes,
+ }.Build()
+ File_api_proto_kill_switch_objects_proto = out.File
+ file_api_proto_kill_switch_objects_proto_rawDesc = nil
+ file_api_proto_kill_switch_objects_proto_goTypes = nil
+ file_api_proto_kill_switch_objects_proto_depIdxs = nil
+}
diff --git a/api_proto/kill_switch_objects.proto b/api_proto/kill_switch_objects.proto
new file mode 100644
index 0000000..77ff071
--- /dev/null
+++ b/api_proto/kill_switch_objects.proto
@@ -0,0 +1,67 @@
+syntax = "proto3";
+
+import "api_proto/common.proto";
+import "google/protobuf/timestamp.proto";
+
+option go_package = "gomodules.avm99963.com/twpt-server/api_proto";
+
+message Feature {
+ int32 id = 1;
+ string codename = 2;
+ enum Type {
+ TYPE_UNKNOWN = 0;
+ TYPE_EXPERIMENT = 1;
+ TYPE_OPTION = 2;
+ TYPE_DEPRECATED = 10;
+ }
+ Type type = 3;
+}
+
+message KillSwitch {
+ int32 id = 1;
+ Feature feature = 2;
+ string min_version = 3;
+ string max_version = 4;
+ repeated Environment.Browser browsers = 5;
+ bool active = 6;
+}
+
+message KillSwitchAuthorizedUser {
+ int32 id = 1;
+ string google_uid = 2;
+ string email = 3;
+ enum AccessLevel {
+ ACCESS_LEVEL_NONE = 0;
+ ACCESS_LEVEL_ACTIVATOR = 1; // The user may enable/disable kill switches.
+ ACCESS_LEVEL_ADMIN = 2; // The user may perform any action.
+ }
+ AccessLevel access_level = 4;
+}
+
+message KillSwitchTransformation {
+ KillSwitch kill_switch_from = 1;
+ KillSwitch kill_switch_to = 2;
+}
+
+// Log entry which describes an action which has taken place.
+message KillSwitchAuditLogEntry {
+ // Timestamp in which the action was taken.
+ google.protobuf.Timestamp timestamp = 1;
+
+ // User who/which performed the action.
+ KillSwitchAuthorizedUser user = 2;
+
+ message KillSwitchEnabled {
+ KillSwitchTransformation transformation = 1;
+ }
+
+ message KillSwitchDisabled {
+ KillSwitchTransformation transformation = 1;
+ }
+
+ // Description of the action taken
+ oneof description {
+ KillSwitchEnabled kill_switch_enabled = 3;
+ KillSwitchDisabled kill_switch_disabled = 4;
+ }
+}
diff --git a/cmd/server/server.go b/cmd/server/server.go
new file mode 100644
index 0000000..53ab224
--- /dev/null
+++ b/cmd/server/server.go
@@ -0,0 +1,141 @@
+package main
+
+import (
+ "context"
+ "database/sql"
+ "flag"
+ "fmt"
+ "log"
+ "net"
+ "time"
+
+ _ "github.com/go-sql-driver/mysql"
+ "google.golang.org/grpc"
+ "google.golang.org/grpc/codes"
+ "google.golang.org/grpc/reflection"
+ "google.golang.org/grpc/status"
+ "google.golang.org/protobuf/proto"
+
+ pb "gomodules.avm99963.com/twpt-server/api_proto"
+ db "gomodules.avm99963.com/twpt-server/internal/db"
+)
+
+var (
+ port = flag.Int("port", 10000, "The server port")
+ dbDsn = flag.String("db", "", "MySQL/MariaDB database data source name (DSN)") // https://github.com/go-sql-driver/mysql#dsn-data-source-name
+ dbConnMaxLifetime = flag.Int("dbConnMaxLifetime", 3*60, "Maximum amount of time a connection to the database may be reused in seconds.")
+ dbMaxOpenConns = flag.Int("dbMaxOpenConns", 5, "Maximum number of open connections to the database.")
+ dbMaxIdleConns = flag.Int("dbMaxIdleConns", *dbMaxOpenConns, "Maximum number of connections to the database in the idle connection pool.")
+)
+
+type killSwitchServiceServer struct {
+ pb.UnimplementedKillSwitchServiceServer
+ dbPool *sql.DB
+}
+
+func newKillSwitchServiceServer() *killSwitchServiceServer {
+ s := &killSwitchServiceServer{}
+ db, err := sql.Open("mysql", *dbDsn)
+ if err != nil {
+ log.Fatalf("unable to open database connection: %v", err)
+ }
+ db.SetConnMaxLifetime(time.Duration(*dbConnMaxLifetime) * time.Second)
+ db.SetMaxOpenConns(*dbMaxOpenConns)
+ db.SetMaxIdleConns(*dbMaxIdleConns)
+
+ ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second)
+ defer cancel()
+
+ if err := db.PingContext(ctx); err != nil {
+ log.Fatalf("unable to connect to database: %v", err)
+ }
+
+ s.dbPool = db
+ return s
+}
+
+func (s *killSwitchServiceServer) GetKillSwitchStatus(ctx context.Context, req *pb.GetKillSwitchStatusRequest) (*pb.GetKillSwitchStatusResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "Unimplemented method.")
+}
+
+func (s *killSwitchServiceServer) GetKillSwitchOverview(ctx context.Context, req *pb.GetKillSwitchOverviewRequest) (*pb.GetKillSwitchOverviewResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "Unimplemented method.")
+}
+
+func (s *killSwitchServiceServer) SyncFeatures(ctx context.Context, req *pb.SyncFeaturesRequest) (*pb.SyncFeaturesResponse, error) {
+ log.Println("Syncing features...")
+
+ for _, feature := range req.Features {
+ existingFeature, err := db.GetFeatureByCodename(s.dbPool, ctx, feature.Codename)
+ if err != nil {
+ return nil, status.Errorf(codes.Unavailable, err.Error())
+ }
+ // If the feature didn't exist in the db, add it. Otherwise, update it if applicable.
+ if existingFeature == nil {
+ if err := db.AddFeature(s.dbPool, ctx, feature); err != nil {
+ return nil, status.Error(codes.Unavailable, err.Error())
+ }
+ } else {
+ canonicalExistingFeature := *existingFeature
+ canonicalExistingFeature.Id = 0
+ if !proto.Equal(&canonicalExistingFeature, feature) {
+ if err := db.UpdateFeature(s.dbPool, ctx, existingFeature.Id, feature); err != nil {
+ return nil, status.Error(codes.Unavailable, err.Error())
+ }
+ }
+ }
+ }
+
+ res := &pb.SyncFeaturesResponse{}
+ return res, nil
+}
+
+func (s *killSwitchServiceServer) ListFeatures(ctx context.Context, req *pb.ListFeaturesRequest) (*pb.ListFeaturesResponse, error) {
+ features, err := db.ListFeatures(s.dbPool, ctx, req.WithDeprecatedFeatures)
+ if err != nil {
+ return nil, status.Errorf(codes.Unavailable, err.Error())
+ }
+ res := &pb.ListFeaturesResponse{
+ Features: features,
+ }
+ return res, nil
+}
+
+func (s *killSwitchServiceServer) EnableKillSwitch(ctx context.Context, req *pb.EnableKillSwitchRequest) (*pb.EnableKillSwitchResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "Unimplemented method.")
+}
+
+func (s *killSwitchServiceServer) DisableKillSwitch(ctx context.Context, req *pb.DisableKillSwitchRequest) (*pb.DisableKillSwitchResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "Unimplemented method.")
+}
+
+func (s *killSwitchServiceServer) ListAuthorizedUsers(ctx context.Context, req *pb.ListAuthorizedUsersRequest) (*pb.ListAuthorizedUsersResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "Unimplemented method.")
+}
+
+func (s *killSwitchServiceServer) AddAuthorizedUser(ctx context.Context, req *pb.AddAuthorizedUserRequest) (*pb.AddAuthorizedUserResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "Unimplemented method.")
+}
+
+func (s *killSwitchServiceServer) UpdateAuthorizedUser(ctx context.Context, req *pb.UpdateAuthorizedUserRequest) (*pb.UpdateAuthorizedUserResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "Unimplemented method.")
+}
+
+func (s *killSwitchServiceServer) DeleteAuthorizedUser(ctx context.Context, req *pb.DeleteAuthorizedUserRequest) (*pb.DeleteAuthorizedUserResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "Unimplemented method.")
+}
+
+func main() {
+ flag.Parse()
+
+ lis, err := net.Listen("tcp", fmt.Sprintf("localhost:%d", *port))
+ if err != nil {
+ log.Fatalf("Failed to listen: %v", err)
+ }
+
+ grpcServer := grpc.NewServer()
+ pb.RegisterKillSwitchServiceServer(grpcServer, newKillSwitchServiceServer())
+ // Register reflection service on gRPC server.
+ reflection.Register(grpcServer)
+ grpcServer.Serve(lis)
+}
diff --git a/go.mod b/go.mod
new file mode 100644
index 0000000..d8fa362
--- /dev/null
+++ b/go.mod
@@ -0,0 +1,9 @@
+module gomodules.avm99963.com/twpt-server
+
+go 1.16
+
+require (
+ github.com/go-sql-driver/mysql v1.6.0
+ google.golang.org/grpc v1.40.0
+ google.golang.org/protobuf v1.25.0
+)
diff --git a/go.sum b/go.sum
new file mode 100644
index 0000000..6a0865d
--- /dev/null
+++ b/go.sum
@@ -0,0 +1,114 @@
+cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
+cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
+github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
+github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
+github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
+github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
+github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
+github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
+github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
+github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
+github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
+github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
+github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
+github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
+github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
+github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
+github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
+github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
+github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
+github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
+github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
+github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
+github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
+github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
+github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
+github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
+github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
+github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
+github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
+github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
+github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM=
+github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
+github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
+github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w=
+github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
+github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
+github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
+go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
+golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
+golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
+golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
+golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
+golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
+golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA=
+golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
+golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
+golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
+golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884=
+golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
+golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
+golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
+golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
+golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
+google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
+google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
+google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
+google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
+google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY=
+google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
+google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
+google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
+google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
+google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
+google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
+google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
+google.golang.org/grpc v1.40.0 h1:AGJ0Ih4mHjSeibYkFGh1dD9KJ/eOtZ93I6hoHhukQ5Q=
+google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
+google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
+google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
+google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
+google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
+google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
+google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c=
+google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
diff --git a/internal/db/features.go b/internal/db/features.go
new file mode 100644
index 0000000..ea56c3d
--- /dev/null
+++ b/internal/db/features.go
@@ -0,0 +1,58 @@
+package db
+
+import (
+ "context"
+ "database/sql"
+ "fmt"
+
+ pb "gomodules.avm99963.com/twpt-server/api_proto"
+)
+
+func GetFeatureByCodename(db *sql.DB, ctx context.Context, codename string) (*pb.Feature, error) {
+ query := db.QueryRowContext(ctx, "SELECT feat_id, codename, feat_type FROM Feature WHERE codename = ?", codename)
+ var f pb.Feature
+ if err := query.Scan(&f.Id, &f.Codename, &f.Type); err != nil {
+ if err == sql.ErrNoRows {
+ return nil, nil
+ }
+ return nil, fmt.Errorf("Error while querying feature by codename: %v.", err)
+ }
+ return &f, nil
+}
+
+func ListFeatures(db *sql.DB, ctx context.Context, withDeprecatedFeatures bool) ([]*pb.Feature, error) {
+ var rows *sql.Rows
+ var err error
+ if withDeprecatedFeatures {
+ rows, err = db.QueryContext(ctx, "SELECT feat_id, codename, feat_type FROM Feature")
+ } else {
+ rows, err = db.QueryContext(ctx, "SELECT feat_id, codename, feat_type FROM Feature WHERE feat_type <> ?", pb.Feature_TYPE_DEPRECATED)
+ }
+ if err != nil {
+ return nil, fmt.Errorf("ListFeatures: ", err)
+ }
+ defer rows.Close()
+
+ var features []*pb.Feature
+ for rows.Next() {
+ var f pb.Feature
+ if err := rows.Scan(&f.Id, &f.Codename, &f.Type); err != nil {
+ return nil, fmt.Errorf("ListFeatures: ", err)
+ }
+ features = append(features, &f)
+ }
+ if err := rows.Err(); err != nil {
+ return nil, fmt.Errorf("ListFeatures: ", err)
+ }
+ return features, nil
+}
+
+func AddFeature(db *sql.DB, ctx context.Context, f *pb.Feature) error {
+ _, err := db.ExecContext(ctx, "INSERT INTO Feature (codename, feat_type) VALUES (?, ?)", f.Codename, f.Type)
+ return err
+}
+
+func UpdateFeature(db *sql.DB, ctx context.Context, id int32, f *pb.Feature) error {
+ _, err := db.ExecContext(ctx, "UPDATE Feature SET feat_type = ? WHERE id = ?", f.Type, id)
+ return err
+}
diff --git a/schema/common.sql b/schema/common.sql
new file mode 100644
index 0000000..c74d7e5
--- /dev/null
+++ b/schema/common.sql
@@ -0,0 +1,8 @@
+CREATE TABLE Feature (
+ feat_id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
+ codename VARCHAR(80) NOT NULL,
+ feat_type SMALLINT NOT NULL,
+
+ PRIMARY KEY (feat_id),
+ UNIQUE KEY (codename)
+);
diff --git a/schema/kill-switch.sql b/schema/kill-switch.sql
new file mode 100644
index 0000000..91b3e39
--- /dev/null
+++ b/schema/kill-switch.sql
@@ -0,0 +1,36 @@
+CREATE TABLE KillSwitch (
+ kswitch_id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
+ feat_id SMALLINT UNSIGNED NOT NULL,
+ min_version VARCHAR(50),
+ max_version VARCHAR(50),
+ active BOOLEAN NOT NULL,
+
+ PRIMARY KEY (kswitch_id),
+ KEY (feat_id)
+);
+
+CREATE TABLE KillSwitch2Browser (
+ kswitch_id SMALLINT UNSIGNED NOT NULL,
+ browser SMALLINT UNSIGNED NOT NULL,
+
+ PRIMARY KEY (kswitch_id, browser),
+ KEY (kswitch_id)
+);
+
+CREATE TABLE KillSwitchAuthorizedUser (
+ user_id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
+ google_uid VARCHAR(64),
+ email VARCHAR(255),
+ access_level SMALLINT NOT NULL,
+
+ PRIMARY KEY (user_id),
+ KEY (google_uid),
+ KEY (email)
+);
+
+CREATE TABLE KillSwitchAuditLog (
+ log_id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
+ data BLOB,
+
+ PRIMARY KEY (log_id)
+);