Implemented the rest of the methods except for GetKillSwitchStatus
Change-Id: Ia5b1a1c44c2e52653b9845ecc9557f525e6d41b1
diff --git a/api_proto/common.pb.go b/api_proto/common.pb.go
index b98c610..279881e 100644
--- a/api_proto/common.pb.go
+++ b/api_proto/common.pb.go
@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
-// protoc-gen-go v1.27.1
-// protoc v3.17.3
+// protoc-gen-go v1.26.0
+// protoc v3.17.1
// source: api_proto/common.proto
package api_proto
diff --git a/api_proto/kill_switch.pb.go b/api_proto/kill_switch.pb.go
index 22622f8..4dd0884 100644
--- a/api_proto/kill_switch.pb.go
+++ b/api_proto/kill_switch.pb.go
@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
-// protoc-gen-go v1.27.1
-// protoc v3.17.3
+// protoc-gen-go v1.26.0
+// protoc v3.17.1
// source: api_proto/kill_switch.proto
package api_proto
@@ -592,7 +592,7 @@
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- AuthorizedUsers *KillSwitchAuthorizedUser `protobuf:"bytes,1,opt,name=authorized_users,json=authorizedUsers,proto3" json:"authorized_users,omitempty"`
+ Users []*KillSwitchAuthorizedUser `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"`
}
func (x *ListAuthorizedUsersResponse) Reset() {
@@ -627,9 +627,9 @@
return file_api_proto_kill_switch_proto_rawDescGZIP(), []int{13}
}
-func (x *ListAuthorizedUsersResponse) GetAuthorizedUsers() *KillSwitchAuthorizedUser {
+func (x *ListAuthorizedUsersResponse) GetUsers() []*KillSwitchAuthorizedUser {
if x != nil {
- return x.AuthorizedUsers
+ return x.Users
}
return nil
}
@@ -951,88 +951,86 @@
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,
+ 0x73, 0x74, 0x22, 0x4e, 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, 0x12, 0x2f, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 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, 0x05, 0x75, 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, 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,
+ 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 (
@@ -1081,7 +1079,7 @@
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, // 6: ListAuthorizedUsersResponse.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
diff --git a/api_proto/kill_switch.proto b/api_proto/kill_switch.proto
index 38b688c..9b2f450 100644
--- a/api_proto/kill_switch.proto
+++ b/api_proto/kill_switch.proto
@@ -67,7 +67,7 @@
}
message ListAuthorizedUsersResponse {
- KillSwitchAuthorizedUser authorized_users = 1;
+ repeated KillSwitchAuthorizedUser users = 1;
}
message AddAuthorizedUserRequest {
diff --git a/api_proto/kill_switch_objects.pb.go b/api_proto/kill_switch_objects.pb.go
index 825047f..f449ce6 100644
--- a/api_proto/kill_switch_objects.pb.go
+++ b/api_proto/kill_switch_objects.pb.go
@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
-// protoc-gen-go v1.27.1
-// protoc v3.17.3
+// protoc-gen-go v1.26.0
+// protoc v3.17.1
// source: api_proto/kill_switch_objects.proto
package api_proto
@@ -348,8 +348,8 @@
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"`
+ Old *KillSwitch `protobuf:"bytes,1,opt,name=old,proto3" json:"old,omitempty"`
+ New *KillSwitch `protobuf:"bytes,2,opt,name=new,proto3" json:"new,omitempty"`
}
func (x *KillSwitchTransformation) Reset() {
@@ -384,16 +384,71 @@
return file_api_proto_kill_switch_objects_proto_rawDescGZIP(), []int{3}
}
-func (x *KillSwitchTransformation) GetKillSwitchFrom() *KillSwitch {
+func (x *KillSwitchTransformation) GetOld() *KillSwitch {
if x != nil {
- return x.KillSwitchFrom
+ return x.Old
}
return nil
}
-func (x *KillSwitchTransformation) GetKillSwitchTo() *KillSwitch {
+func (x *KillSwitchTransformation) GetNew() *KillSwitch {
if x != nil {
- return x.KillSwitchTo
+ return x.New
+ }
+ return nil
+}
+
+type AuthorizedUserTransformation struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Old *KillSwitchAuthorizedUser `protobuf:"bytes,1,opt,name=old,proto3" json:"old,omitempty"`
+ New *KillSwitchAuthorizedUser `protobuf:"bytes,2,opt,name=new,proto3" json:"new,omitempty"`
+}
+
+func (x *AuthorizedUserTransformation) Reset() {
+ *x = AuthorizedUserTransformation{}
+ 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 *AuthorizedUserTransformation) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*AuthorizedUserTransformation) ProtoMessage() {}
+
+func (x *AuthorizedUserTransformation) 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 AuthorizedUserTransformation.ProtoReflect.Descriptor instead.
+func (*AuthorizedUserTransformation) Descriptor() ([]byte, []int) {
+ return file_api_proto_kill_switch_objects_proto_rawDescGZIP(), []int{4}
+}
+
+func (x *AuthorizedUserTransformation) GetOld() *KillSwitchAuthorizedUser {
+ if x != nil {
+ return x.Old
+ }
+ return nil
+}
+
+func (x *AuthorizedUserTransformation) GetNew() *KillSwitchAuthorizedUser {
+ if x != nil {
+ return x.New
}
return nil
}
@@ -413,13 +468,16 @@
// Types that are assignable to Description:
// *KillSwitchAuditLogEntry_KillSwitchEnabled_
// *KillSwitchAuditLogEntry_KillSwitchDisabled_
+ // *KillSwitchAuditLogEntry_AuthorizedUserAdded_
+ // *KillSwitchAuditLogEntry_AuthorizedUserUpdated_
+ // *KillSwitchAuditLogEntry_AuthorizedUserDeleted_
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]
+ mi := &file_api_proto_kill_switch_objects_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -432,7 +490,7 @@
func (*KillSwitchAuditLogEntry) ProtoMessage() {}
func (x *KillSwitchAuditLogEntry) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_kill_switch_objects_proto_msgTypes[4]
+ 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 {
@@ -445,7 +503,7 @@
// Deprecated: Use KillSwitchAuditLogEntry.ProtoReflect.Descriptor instead.
func (*KillSwitchAuditLogEntry) Descriptor() ([]byte, []int) {
- return file_api_proto_kill_switch_objects_proto_rawDescGZIP(), []int{4}
+ return file_api_proto_kill_switch_objects_proto_rawDescGZIP(), []int{5}
}
func (x *KillSwitchAuditLogEntry) GetTimestamp() *timestamppb.Timestamp {
@@ -483,6 +541,27 @@
return nil
}
+func (x *KillSwitchAuditLogEntry) GetAuthorizedUserAdded() *KillSwitchAuditLogEntry_AuthorizedUserAdded {
+ if x, ok := x.GetDescription().(*KillSwitchAuditLogEntry_AuthorizedUserAdded_); ok {
+ return x.AuthorizedUserAdded
+ }
+ return nil
+}
+
+func (x *KillSwitchAuditLogEntry) GetAuthorizedUserUpdated() *KillSwitchAuditLogEntry_AuthorizedUserUpdated {
+ if x, ok := x.GetDescription().(*KillSwitchAuditLogEntry_AuthorizedUserUpdated_); ok {
+ return x.AuthorizedUserUpdated
+ }
+ return nil
+}
+
+func (x *KillSwitchAuditLogEntry) GetAuthorizedUserDeleted() *KillSwitchAuditLogEntry_AuthorizedUserDeleted {
+ if x, ok := x.GetDescription().(*KillSwitchAuditLogEntry_AuthorizedUserDeleted_); ok {
+ return x.AuthorizedUserDeleted
+ }
+ return nil
+}
+
type isKillSwitchAuditLogEntry_Description interface {
isKillSwitchAuditLogEntry_Description()
}
@@ -495,22 +574,40 @@
KillSwitchDisabled *KillSwitchAuditLogEntry_KillSwitchDisabled `protobuf:"bytes,4,opt,name=kill_switch_disabled,json=killSwitchDisabled,proto3,oneof"`
}
+type KillSwitchAuditLogEntry_AuthorizedUserAdded_ struct {
+ AuthorizedUserAdded *KillSwitchAuditLogEntry_AuthorizedUserAdded `protobuf:"bytes,5,opt,name=authorized_user_added,json=authorizedUserAdded,proto3,oneof"`
+}
+
+type KillSwitchAuditLogEntry_AuthorizedUserUpdated_ struct {
+ AuthorizedUserUpdated *KillSwitchAuditLogEntry_AuthorizedUserUpdated `protobuf:"bytes,6,opt,name=authorized_user_updated,json=authorizedUserUpdated,proto3,oneof"`
+}
+
+type KillSwitchAuditLogEntry_AuthorizedUserDeleted_ struct {
+ AuthorizedUserDeleted *KillSwitchAuditLogEntry_AuthorizedUserDeleted `protobuf:"bytes,7,opt,name=authorized_user_deleted,json=authorizedUserDeleted,proto3,oneof"`
+}
+
func (*KillSwitchAuditLogEntry_KillSwitchEnabled_) isKillSwitchAuditLogEntry_Description() {}
func (*KillSwitchAuditLogEntry_KillSwitchDisabled_) isKillSwitchAuditLogEntry_Description() {}
+func (*KillSwitchAuditLogEntry_AuthorizedUserAdded_) isKillSwitchAuditLogEntry_Description() {}
+
+func (*KillSwitchAuditLogEntry_AuthorizedUserUpdated_) isKillSwitchAuditLogEntry_Description() {}
+
+func (*KillSwitchAuditLogEntry_AuthorizedUserDeleted_) 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"`
+ KillSwitch *KillSwitch `protobuf:"bytes,1,opt,name=kill_switch,json=killSwitch,proto3" json:"kill_switch,omitempty"`
}
func (x *KillSwitchAuditLogEntry_KillSwitchEnabled) Reset() {
*x = KillSwitchAuditLogEntry_KillSwitchEnabled{}
if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_kill_switch_objects_proto_msgTypes[5]
+ mi := &file_api_proto_kill_switch_objects_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -523,7 +620,7 @@
func (*KillSwitchAuditLogEntry_KillSwitchEnabled) ProtoMessage() {}
func (x *KillSwitchAuditLogEntry_KillSwitchEnabled) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_kill_switch_objects_proto_msgTypes[5]
+ 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 {
@@ -536,12 +633,12 @@
// 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}
+ return file_api_proto_kill_switch_objects_proto_rawDescGZIP(), []int{5, 0}
}
-func (x *KillSwitchAuditLogEntry_KillSwitchEnabled) GetTransformation() *KillSwitchTransformation {
+func (x *KillSwitchAuditLogEntry_KillSwitchEnabled) GetKillSwitch() *KillSwitch {
if x != nil {
- return x.Transformation
+ return x.KillSwitch
}
return nil
}
@@ -557,7 +654,7 @@
func (x *KillSwitchAuditLogEntry_KillSwitchDisabled) Reset() {
*x = KillSwitchAuditLogEntry_KillSwitchDisabled{}
if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_kill_switch_objects_proto_msgTypes[6]
+ mi := &file_api_proto_kill_switch_objects_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -570,7 +667,7 @@
func (*KillSwitchAuditLogEntry_KillSwitchDisabled) ProtoMessage() {}
func (x *KillSwitchAuditLogEntry_KillSwitchDisabled) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_kill_switch_objects_proto_msgTypes[6]
+ mi := &file_api_proto_kill_switch_objects_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -583,7 +680,7 @@
// 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}
+ return file_api_proto_kill_switch_objects_proto_rawDescGZIP(), []int{5, 1}
}
func (x *KillSwitchAuditLogEntry_KillSwitchDisabled) GetTransformation() *KillSwitchTransformation {
@@ -593,6 +690,147 @@
return nil
}
+type KillSwitchAuditLogEntry_AuthorizedUserAdded struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ User *KillSwitchAuthorizedUser `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
+}
+
+func (x *KillSwitchAuditLogEntry_AuthorizedUserAdded) Reset() {
+ *x = KillSwitchAuditLogEntry_AuthorizedUserAdded{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_api_proto_kill_switch_objects_proto_msgTypes[8]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *KillSwitchAuditLogEntry_AuthorizedUserAdded) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*KillSwitchAuditLogEntry_AuthorizedUserAdded) ProtoMessage() {}
+
+func (x *KillSwitchAuditLogEntry_AuthorizedUserAdded) ProtoReflect() protoreflect.Message {
+ mi := &file_api_proto_kill_switch_objects_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 KillSwitchAuditLogEntry_AuthorizedUserAdded.ProtoReflect.Descriptor instead.
+func (*KillSwitchAuditLogEntry_AuthorizedUserAdded) Descriptor() ([]byte, []int) {
+ return file_api_proto_kill_switch_objects_proto_rawDescGZIP(), []int{5, 2}
+}
+
+func (x *KillSwitchAuditLogEntry_AuthorizedUserAdded) GetUser() *KillSwitchAuthorizedUser {
+ if x != nil {
+ return x.User
+ }
+ return nil
+}
+
+type KillSwitchAuditLogEntry_AuthorizedUserUpdated struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Transformation *AuthorizedUserTransformation `protobuf:"bytes,1,opt,name=transformation,proto3" json:"transformation,omitempty"`
+}
+
+func (x *KillSwitchAuditLogEntry_AuthorizedUserUpdated) Reset() {
+ *x = KillSwitchAuditLogEntry_AuthorizedUserUpdated{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_api_proto_kill_switch_objects_proto_msgTypes[9]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *KillSwitchAuditLogEntry_AuthorizedUserUpdated) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*KillSwitchAuditLogEntry_AuthorizedUserUpdated) ProtoMessage() {}
+
+func (x *KillSwitchAuditLogEntry_AuthorizedUserUpdated) ProtoReflect() protoreflect.Message {
+ mi := &file_api_proto_kill_switch_objects_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 KillSwitchAuditLogEntry_AuthorizedUserUpdated.ProtoReflect.Descriptor instead.
+func (*KillSwitchAuditLogEntry_AuthorizedUserUpdated) Descriptor() ([]byte, []int) {
+ return file_api_proto_kill_switch_objects_proto_rawDescGZIP(), []int{5, 3}
+}
+
+func (x *KillSwitchAuditLogEntry_AuthorizedUserUpdated) GetTransformation() *AuthorizedUserTransformation {
+ if x != nil {
+ return x.Transformation
+ }
+ return nil
+}
+
+type KillSwitchAuditLogEntry_AuthorizedUserDeleted struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ OldUser *KillSwitchAuthorizedUser `protobuf:"bytes,1,opt,name=old_user,json=oldUser,proto3" json:"old_user,omitempty"`
+}
+
+func (x *KillSwitchAuditLogEntry_AuthorizedUserDeleted) Reset() {
+ *x = KillSwitchAuditLogEntry_AuthorizedUserDeleted{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_api_proto_kill_switch_objects_proto_msgTypes[10]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *KillSwitchAuditLogEntry_AuthorizedUserDeleted) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*KillSwitchAuditLogEntry_AuthorizedUserDeleted) ProtoMessage() {}
+
+func (x *KillSwitchAuditLogEntry_AuthorizedUserDeleted) ProtoReflect() protoreflect.Message {
+ mi := &file_api_proto_kill_switch_objects_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 KillSwitchAuditLogEntry_AuthorizedUserDeleted.ProtoReflect.Descriptor instead.
+func (*KillSwitchAuditLogEntry_AuthorizedUserDeleted) Descriptor() ([]byte, []int) {
+ return file_api_proto_kill_switch_objects_proto_rawDescGZIP(), []int{5, 4}
+}
+
+func (x *KillSwitchAuditLogEntry_AuthorizedUserDeleted) GetOldUser() *KillSwitchAuthorizedUser {
+ if x != nil {
+ return x.OldUser
+ }
+ return nil
+}
+
var File_api_proto_kill_switch_objects_proto protoreflect.FileDescriptor
var file_api_proto_kill_switch_objects_proto_rawDesc = []byte{
@@ -642,51 +880,89 @@
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,
+ 0x4e, 0x10, 0x02, 0x22, 0x58, 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,
+ 0x1d, 0x0a, 0x03, 0x6f, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x4b,
+ 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x52, 0x03, 0x6f, 0x6c, 0x64, 0x12, 0x1d,
+ 0x0a, 0x03, 0x6e, 0x65, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x4b, 0x69,
+ 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x52, 0x03, 0x6e, 0x65, 0x77, 0x22, 0x78, 0x0a,
+ 0x1c, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x54,
+ 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a,
+ 0x03, 0x6f, 0x6c, 0x64, 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, 0x03, 0x6f, 0x6c, 0x64, 0x12, 0x2b, 0x0a, 0x03, 0x6e, 0x65,
+ 0x77, 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, 0x03, 0x6e, 0x65, 0x77, 0x22, 0x99, 0x08, 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, 0x12, 0x62, 0x0a, 0x15, 0x61,
+ 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x61,
+ 0x64, 0x64, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 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, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x55,
+ 0x73, 0x65, 0x72, 0x41, 0x64, 0x64, 0x65, 0x64, 0x48, 0x00, 0x52, 0x13, 0x61, 0x75, 0x74, 0x68,
+ 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x41, 0x64, 0x64, 0x65, 0x64, 0x12,
+ 0x68, 0x0a, 0x17, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x75, 0x73,
+ 0x65, 0x72, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b,
+ 0x32, 0x2e, 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, 0x41, 0x75, 0x74, 0x68, 0x6f,
+ 0x72, 0x69, 0x7a, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64,
+ 0x48, 0x00, 0x52, 0x15, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x55, 0x73,
+ 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x12, 0x68, 0x0a, 0x17, 0x61, 0x75, 0x74,
+ 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x64, 0x65, 0x6c,
+ 0x65, 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 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, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x55,
+ 0x73, 0x65, 0x72, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x48, 0x00, 0x52, 0x15, 0x61, 0x75,
+ 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x6c, 0x65,
+ 0x74, 0x65, 0x64, 0x1a, 0x41, 0x0a, 0x11, 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x77, 0x69, 0x74, 0x63,
+ 0x68, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 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, 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,
+ 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a,
+ 0x44, 0x0a, 0x13, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x55, 0x73, 0x65,
+ 0x72, 0x41, 0x64, 0x64, 0x65, 0x64, 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, 0x1a, 0x5e, 0x0a, 0x15, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69,
+ 0x7a, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x12, 0x45,
+ 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69,
+ 0x7a, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 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, 0x4d, 0x0a, 0x15, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69,
+ 0x7a, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x12, 0x34,
+ 0x0a, 0x08, 0x6f, 0x6c, 0x64, 0x5f, 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, 0x07, 0x6f, 0x6c, 0x64,
+ 0x55, 0x73, 0x65, 0x72, 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 (
@@ -702,38 +978,50 @@
}
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_msgTypes = make([]protoimpl.MessageInfo, 11)
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
+ (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
+ (*AuthorizedUserTransformation)(nil), // 6: AuthorizedUserTransformation
+ (*KillSwitchAuditLogEntry)(nil), // 7: KillSwitchAuditLogEntry
+ (*KillSwitchAuditLogEntry_KillSwitchEnabled)(nil), // 8: KillSwitchAuditLogEntry.KillSwitchEnabled
+ (*KillSwitchAuditLogEntry_KillSwitchDisabled)(nil), // 9: KillSwitchAuditLogEntry.KillSwitchDisabled
+ (*KillSwitchAuditLogEntry_AuthorizedUserAdded)(nil), // 10: KillSwitchAuditLogEntry.AuthorizedUserAdded
+ (*KillSwitchAuditLogEntry_AuthorizedUserUpdated)(nil), // 11: KillSwitchAuditLogEntry.AuthorizedUserUpdated
+ (*KillSwitchAuditLogEntry_AuthorizedUserDeleted)(nil), // 12: KillSwitchAuditLogEntry.AuthorizedUserDeleted
+ (Environment_Browser)(0), // 13: Environment.Browser
+ (*timestamppb.Timestamp)(nil), // 14: 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
+ 13, // 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
+ 3, // 4: KillSwitchTransformation.old:type_name -> KillSwitch
+ 3, // 5: KillSwitchTransformation.new:type_name -> KillSwitch
+ 4, // 6: AuthorizedUserTransformation.old:type_name -> KillSwitchAuthorizedUser
+ 4, // 7: AuthorizedUserTransformation.new:type_name -> KillSwitchAuthorizedUser
+ 14, // 8: KillSwitchAuditLogEntry.timestamp:type_name -> google.protobuf.Timestamp
+ 4, // 9: KillSwitchAuditLogEntry.user:type_name -> KillSwitchAuthorizedUser
+ 8, // 10: KillSwitchAuditLogEntry.kill_switch_enabled:type_name -> KillSwitchAuditLogEntry.KillSwitchEnabled
+ 9, // 11: KillSwitchAuditLogEntry.kill_switch_disabled:type_name -> KillSwitchAuditLogEntry.KillSwitchDisabled
+ 10, // 12: KillSwitchAuditLogEntry.authorized_user_added:type_name -> KillSwitchAuditLogEntry.AuthorizedUserAdded
+ 11, // 13: KillSwitchAuditLogEntry.authorized_user_updated:type_name -> KillSwitchAuditLogEntry.AuthorizedUserUpdated
+ 12, // 14: KillSwitchAuditLogEntry.authorized_user_deleted:type_name -> KillSwitchAuditLogEntry.AuthorizedUserDeleted
+ 3, // 15: KillSwitchAuditLogEntry.KillSwitchEnabled.kill_switch:type_name -> KillSwitch
+ 5, // 16: KillSwitchAuditLogEntry.KillSwitchDisabled.transformation:type_name -> KillSwitchTransformation
+ 4, // 17: KillSwitchAuditLogEntry.AuthorizedUserAdded.user:type_name -> KillSwitchAuthorizedUser
+ 6, // 18: KillSwitchAuditLogEntry.AuthorizedUserUpdated.transformation:type_name -> AuthorizedUserTransformation
+ 4, // 19: KillSwitchAuditLogEntry.AuthorizedUserDeleted.old_user:type_name -> KillSwitchAuthorizedUser
+ 20, // [20:20] is the sub-list for method output_type
+ 20, // [20:20] is the sub-list for method input_type
+ 20, // [20:20] is the sub-list for extension type_name
+ 20, // [20:20] is the sub-list for extension extendee
+ 0, // [0:20] is the sub-list for field type_name
}
func init() { file_api_proto_kill_switch_objects_proto_init() }
@@ -792,7 +1080,7 @@
}
}
file_api_proto_kill_switch_objects_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*KillSwitchAuditLogEntry); i {
+ switch v := v.(*AuthorizedUserTransformation); i {
case 0:
return &v.state
case 1:
@@ -804,7 +1092,7 @@
}
}
file_api_proto_kill_switch_objects_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*KillSwitchAuditLogEntry_KillSwitchEnabled); i {
+ switch v := v.(*KillSwitchAuditLogEntry); i {
case 0:
return &v.state
case 1:
@@ -816,6 +1104,18 @@
}
}
file_api_proto_kill_switch_objects_proto_msgTypes[6].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[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*KillSwitchAuditLogEntry_KillSwitchDisabled); i {
case 0:
return &v.state
@@ -827,10 +1127,49 @@
return nil
}
}
+ file_api_proto_kill_switch_objects_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*KillSwitchAuditLogEntry_AuthorizedUserAdded); 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[9].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*KillSwitchAuditLogEntry_AuthorizedUserUpdated); 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[10].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*KillSwitchAuditLogEntry_AuthorizedUserDeleted); 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{}{
+ file_api_proto_kill_switch_objects_proto_msgTypes[5].OneofWrappers = []interface{}{
(*KillSwitchAuditLogEntry_KillSwitchEnabled_)(nil),
(*KillSwitchAuditLogEntry_KillSwitchDisabled_)(nil),
+ (*KillSwitchAuditLogEntry_AuthorizedUserAdded_)(nil),
+ (*KillSwitchAuditLogEntry_AuthorizedUserUpdated_)(nil),
+ (*KillSwitchAuditLogEntry_AuthorizedUserDeleted_)(nil),
}
type x struct{}
out := protoimpl.TypeBuilder{
@@ -838,7 +1177,7 @@
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_api_proto_kill_switch_objects_proto_rawDesc,
NumEnums: 2,
- NumMessages: 7,
+ NumMessages: 11,
NumExtensions: 0,
NumServices: 0,
},
diff --git a/api_proto/kill_switch_objects.proto b/api_proto/kill_switch_objects.proto
index 77ff071..11c2c16 100644
--- a/api_proto/kill_switch_objects.proto
+++ b/api_proto/kill_switch_objects.proto
@@ -39,8 +39,13 @@
}
message KillSwitchTransformation {
- KillSwitch kill_switch_from = 1;
- KillSwitch kill_switch_to = 2;
+ KillSwitch old = 1;
+ KillSwitch new = 2;
+}
+
+message AuthorizedUserTransformation {
+ KillSwitchAuthorizedUser old = 1;
+ KillSwitchAuthorizedUser new = 2;
}
// Log entry which describes an action which has taken place.
@@ -52,16 +57,31 @@
KillSwitchAuthorizedUser user = 2;
message KillSwitchEnabled {
- KillSwitchTransformation transformation = 1;
+ KillSwitch kill_switch = 1;
}
message KillSwitchDisabled {
KillSwitchTransformation transformation = 1;
}
+ message AuthorizedUserAdded {
+ KillSwitchAuthorizedUser user = 1;
+ }
+
+ message AuthorizedUserUpdated {
+ AuthorizedUserTransformation transformation = 1;
+ }
+
+ message AuthorizedUserDeleted {
+ KillSwitchAuthorizedUser old_user = 1;
+ }
+
// Description of the action taken
oneof description {
KillSwitchEnabled kill_switch_enabled = 3;
KillSwitchDisabled kill_switch_disabled = 4;
+ AuthorizedUserAdded authorized_user_added = 5;
+ AuthorizedUserUpdated authorized_user_updated = 6;
+ AuthorizedUserDeleted authorized_user_deleted = 7;
}
}
diff --git a/cmd/server/server.go b/cmd/server/server.go
index 53ab224..684d1d7 100644
--- a/cmd/server/server.go
+++ b/cmd/server/server.go
@@ -59,7 +59,14 @@
}
func (s *killSwitchServiceServer) GetKillSwitchOverview(ctx context.Context, req *pb.GetKillSwitchOverviewRequest) (*pb.GetKillSwitchOverviewResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "Unimplemented method.")
+ killSwitches, err := db.ListKillSwitches(s.dbPool, ctx)
+ if err != nil {
+ return nil, status.Errorf(codes.Unavailable, err.Error())
+ }
+ res := &pb.GetKillSwitchOverviewResponse{
+ KillSwitches: killSwitches,
+ }
+ return res, nil
}
func (s *killSwitchServiceServer) SyncFeatures(ctx context.Context, req *pb.SyncFeaturesRequest) (*pb.SyncFeaturesResponse, error) {
@@ -91,38 +98,94 @@
}
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
+ 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.")
+ if req.GetKillSwitch().GetFeature().GetId() == 0 {
+ return nil, status.Errorf(codes.InvalidArgument, "feature.id must be set.")
+ }
+
+ err := db.EnableKillSwitch(s.dbPool, ctx, req.KillSwitch)
+ if err != nil {
+ return nil, status.Errorf(codes.Unavailable, err.Error())
+ }
+ res := &pb.EnableKillSwitchResponse{}
+ return res, nil
}
func (s *killSwitchServiceServer) DisableKillSwitch(ctx context.Context, req *pb.DisableKillSwitchRequest) (*pb.DisableKillSwitchResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "Unimplemented method.")
+ if req.GetKillSwitchId() == 0 {
+ return nil, status.Errorf(codes.InvalidArgument, "kill_switch_id must be set.")
+ }
+
+ err := db.DisableKillSwitch(s.dbPool, ctx, req.KillSwitchId)
+ if err != nil {
+ return nil, status.Errorf(codes.Unavailable, err.Error())
+ }
+ res := &pb.DisableKillSwitchResponse{}
+ return res, nil
}
func (s *killSwitchServiceServer) ListAuthorizedUsers(ctx context.Context, req *pb.ListAuthorizedUsersRequest) (*pb.ListAuthorizedUsersResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "Unimplemented method.")
+ users, err := db.ListAuthorizedUsers(s.dbPool, ctx)
+ if err != nil {
+ return nil, status.Errorf(codes.Unavailable, err.Error())
+ }
+ res := &pb.ListAuthorizedUsersResponse{
+ Users: users,
+ }
+ return res, nil
}
func (s *killSwitchServiceServer) AddAuthorizedUser(ctx context.Context, req *pb.AddAuthorizedUserRequest) (*pb.AddAuthorizedUserResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "Unimplemented method.")
+ if req.GetUser().GetGoogleUid() == "" && req.GetUser().GetEmail() == "" {
+ return nil, status.Errorf(codes.InvalidArgument, "At least one of google_uid or email must be set.")
+ }
+
+ err := db.AddAuthorizedUser(s.dbPool, ctx, req.User)
+ if err != nil {
+ return nil, status.Errorf(codes.Unavailable, err.Error())
+ }
+ res := &pb.AddAuthorizedUserResponse{}
+ return res, nil
}
func (s *killSwitchServiceServer) UpdateAuthorizedUser(ctx context.Context, req *pb.UpdateAuthorizedUserRequest) (*pb.UpdateAuthorizedUserResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "Unimplemented method.")
+ if req.GetUserId() == 0 {
+ return nil, status.Errorf(codes.InvalidArgument, "user_id must be greater than 0.")
+ }
+
+ if req.GetUser().GetGoogleUid() == "" && req.GetUser().GetEmail() == "" {
+ return nil, status.Errorf(codes.InvalidArgument, "At least one of google_uid or email must be set.")
+ }
+
+ err := db.UpdateAuthorizedUser(s.dbPool, ctx, req.UserId, req.User)
+ if err != nil {
+ return nil, status.Errorf(codes.Unavailable, err.Error())
+ }
+ res := &pb.UpdateAuthorizedUserResponse{}
+ return res, nil
}
func (s *killSwitchServiceServer) DeleteAuthorizedUser(ctx context.Context, req *pb.DeleteAuthorizedUserRequest) (*pb.DeleteAuthorizedUserResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "Unimplemented method.")
+ if req.GetUserId() == 0 {
+ return nil, status.Errorf(codes.InvalidArgument, "user_id must be greater than 0.")
+ }
+
+ err := db.DeleteAuthorizedUser(s.dbPool, ctx, req.UserId)
+ if err != nil {
+ return nil, status.Errorf(codes.Unavailable, err.Error())
+ }
+ res := &pb.DeleteAuthorizedUserResponse{}
+ return res, nil
}
func main() {
diff --git a/go.mod b/go.mod
index d8fa362..b56fa0d 100644
--- a/go.mod
+++ b/go.mod
@@ -3,6 +3,7 @@
go 1.16
require (
+ github.com/Masterminds/semver/v3 v3.1.1 // indirect
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
index 6a0865d..fc8eea2 100644
--- a/go.sum
+++ b/go.sum
@@ -1,6 +1,8 @@
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/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc=
+github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
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=
diff --git a/internal/db/authorized_users.go b/internal/db/authorized_users.go
new file mode 100644
index 0000000..13a272f
--- /dev/null
+++ b/internal/db/authorized_users.go
@@ -0,0 +1,152 @@
+package db
+
+import (
+ "context"
+ "database/sql"
+ "fmt"
+
+ pb "gomodules.avm99963.com/twpt-server/api_proto"
+)
+
+func GetAuthorizedUserById(db *sql.DB, ctx context.Context, id int32) (*pb.KillSwitchAuthorizedUser, error) {
+ query := db.QueryRowContext(ctx, "SELECT user_id, google_uid, email, access_level FROM KillSwitchAuthorizedUser WHERE user_id = ?", id)
+ var u pb.KillSwitchAuthorizedUser
+ if err := query.Scan(&u.Id, &u.GoogleUid, &u.Email, &u.AccessLevel); err != nil {
+ if err == sql.ErrNoRows {
+ return nil, nil
+ }
+ return nil, fmt.Errorf("GetAuthorizedUserById: %v.", err)
+ }
+ return &u, nil
+}
+
+func AddAuthorizedUser(db *sql.DB, ctx context.Context, u *pb.KillSwitchAuthorizedUser) error {
+ tx, err := db.BeginTx(ctx, nil)
+ if err != nil {
+ return err
+ }
+
+ result, err := db.ExecContext(ctx, "INSERT INTO KillSwitchAuthorizedUser (google_uid, email, access_level) VALUES (?, ?, ?)", u.GoogleUid, u.Email, u.AccessLevel)
+ if err != nil {
+ tx.Rollback()
+ return err
+ }
+
+ id, err := result.LastInsertId()
+ if err != nil {
+ tx.Rollback()
+ return err
+ }
+
+ u.Id = int32(id)
+
+ logEntry := &pb.KillSwitchAuditLogEntry{
+ Description: &pb.KillSwitchAuditLogEntry_AuthorizedUserAdded_{
+ &pb.KillSwitchAuditLogEntry_AuthorizedUserAdded{
+ User: u,
+ },
+ },
+ }
+ if err := AddKillSwitchAuditLogEntry(tx, ctx, logEntry); err != nil {
+ tx.Rollback()
+ return err
+ }
+
+ return tx.Commit()
+}
+
+func UpdateAuthorizedUser(db *sql.DB, ctx context.Context, id int32, newUser *pb.KillSwitchAuthorizedUser) error {
+ oldUser, err := GetAuthorizedUserById(db, ctx, id)
+ if err != nil {
+ return err
+ }
+ if oldUser == nil {
+ return fmt.Errorf("Such user doesn't exist")
+ }
+
+ tx, err := db.BeginTx(ctx, nil)
+ if err != nil {
+ return err
+ }
+
+ if _, err := tx.ExecContext(ctx, "UPDATE KillSwitchAuthorizedUser SET google_uid = ?, email = ?, access_level = ? WHERE user_id = ?", newUser.GoogleUid, newUser.Email, newUser.AccessLevel, id); err != nil {
+ tx.Rollback()
+ return err
+ }
+
+ newUser.Id = id
+
+ logEntry := &pb.KillSwitchAuditLogEntry{
+ Description: &pb.KillSwitchAuditLogEntry_AuthorizedUserUpdated_{
+ &pb.KillSwitchAuditLogEntry_AuthorizedUserUpdated{
+ Transformation: &pb.AuthorizedUserTransformation{
+ Old: oldUser,
+ New: newUser,
+ },
+ },
+ },
+ }
+ if err := AddKillSwitchAuditLogEntry(tx, ctx, logEntry); err != nil {
+ tx.Rollback()
+ return err
+ }
+
+ return tx.Commit()
+}
+
+func DeleteAuthorizedUser(db *sql.DB, ctx context.Context, id int32) error {
+ u, err := GetAuthorizedUserById(db, ctx, id)
+ if err != nil {
+ return err
+ }
+ if u == nil {
+ return fmt.Errorf("Such user doesn't exist")
+ }
+
+ tx, err := db.BeginTx(ctx, nil)
+ if err != nil {
+ return err
+ }
+
+ if _, err := tx.ExecContext(ctx, "DELETE FROM KillSwitchAuthorizedUser WHERE user_id = ?", id); err != nil {
+ tx.Rollback()
+ return err
+ }
+
+ logEntry := &pb.KillSwitchAuditLogEntry{
+ Description: &pb.KillSwitchAuditLogEntry_AuthorizedUserDeleted_{
+ &pb.KillSwitchAuditLogEntry_AuthorizedUserDeleted{
+ OldUser: u,
+ },
+ },
+ }
+ if err := AddKillSwitchAuditLogEntry(tx, ctx, logEntry); err != nil {
+ tx.Rollback()
+ return err
+ }
+
+ return tx.Commit()
+}
+
+func ListAuthorizedUsers(db *sql.DB, ctx context.Context) ([]*pb.KillSwitchAuthorizedUser, error) {
+ var rows *sql.Rows
+ var err error
+ rows, err = db.QueryContext(ctx, "SELECT user_id, google_uid, email, access_level FROM KillSwitchAuthorizedUser")
+ if err != nil {
+ return nil, fmt.Errorf("ListAuthorizedUsers: %v", err)
+ }
+ defer rows.Close()
+
+ var users []*pb.KillSwitchAuthorizedUser
+ for rows.Next() {
+ var u pb.KillSwitchAuthorizedUser
+ if err := rows.Scan(&u.Id, &u.GoogleUid, &u.Email, &u.AccessLevel); err != nil {
+ return nil, fmt.Errorf("ListAuthorizedUsers: %v", err)
+ }
+ users = append(users, &u)
+ }
+ if err := rows.Err(); err != nil {
+ return nil, fmt.Errorf("ListAuthorizedUsers: %v", err)
+ }
+ return users, nil
+}
diff --git a/internal/db/common.go b/internal/db/common.go
new file mode 100644
index 0000000..845db2c
--- /dev/null
+++ b/internal/db/common.go
@@ -0,0 +1,26 @@
+package db
+
+import (
+ "context"
+ "database/sql"
+
+ "google.golang.org/protobuf/proto"
+ "google.golang.org/protobuf/types/known/timestamppb"
+
+ pb "gomodules.avm99963.com/twpt-server/api_proto"
+)
+
+func AddKillSwitchAuditLogEntry(tx *sql.Tx, ctx context.Context, logEntry *pb.KillSwitchAuditLogEntry) error {
+ logEntry.Timestamp = timestamppb.Now()
+
+ logEntryBytes, err := proto.Marshal(logEntry)
+ if err != nil {
+ return err
+ }
+
+ if _, err := tx.ExecContext(ctx, "INSERT INTO KillSwitchAuditLog (data) VALUES (?)", logEntryBytes); err != nil {
+ return err
+ }
+
+ return nil
+}
diff --git a/internal/db/features.go b/internal/db/features.go
index 4a263b3..5b68228 100644
--- a/internal/db/features.go
+++ b/internal/db/features.go
@@ -8,6 +8,18 @@
pb "gomodules.avm99963.com/twpt-server/api_proto"
)
+func GetFeatureById(db *sql.DB, ctx context.Context, id int32) (*pb.Feature, error) {
+ query := db.QueryRowContext(ctx, "SELECT feat_id, codename, feat_type FROM Feature WHERE feat_id = ?", id)
+ 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 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
@@ -29,7 +41,7 @@
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)
+ return nil, fmt.Errorf("ListFeatures: %v", err)
}
defer rows.Close()
@@ -37,12 +49,12 @@
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)
+ return nil, fmt.Errorf("ListFeatures: %v", err)
}
features = append(features, &f)
}
if err := rows.Err(); err != nil {
- return nil, fmt.Errorf("ListFeatures: ", err)
+ return nil, fmt.Errorf("ListFeatures: %v", err)
}
return features, nil
}
diff --git a/internal/db/kill_switch.go b/internal/db/kill_switch.go
new file mode 100644
index 0000000..8b80286
--- /dev/null
+++ b/internal/db/kill_switch.go
@@ -0,0 +1,206 @@
+package db
+
+import (
+ "context"
+ "database/sql"
+ "fmt"
+
+ "github.com/Masterminds/semver/v3"
+
+ pb "gomodules.avm99963.com/twpt-server/api_proto"
+)
+
+func isValidSemVersion(v string) bool {
+ _, err := semver.NewVersion(v)
+ return err == nil
+}
+
+func fillRawKillSwitch(db *sql.DB, ctx context.Context, k *pb.KillSwitch, featureId int32) error {
+ f, err := GetFeatureById(db, ctx, featureId)
+ if err != nil {
+ return fmt.Errorf("fillRawKillSwitch: %v", err)
+ }
+ if f == nil {
+ return fmt.Errorf("fillRawKillSwitch: linked feature doesn't exist.")
+ }
+ k.Feature = f
+
+ rows, err := db.QueryContext(ctx, "SELECT browser FROM KillSwitch2Browser WHERE kswitch_id = ?", k.Id)
+ if err != nil {
+ return fmt.Errorf("fillRawKillSwitch: %v", err)
+ }
+ defer rows.Close()
+
+ var browsers []pb.Environment_Browser
+ for rows.Next() {
+ var b pb.Environment_Browser
+ if err := rows.Scan(&b); err != nil {
+ return fmt.Errorf("fillRawKillSwitch: %v", err)
+ }
+ browsers = append(browsers, b)
+ }
+ k.Browsers = browsers
+
+ return nil
+}
+
+func GetKillSwitchById(db *sql.DB, ctx context.Context, id int32) (*pb.KillSwitch, error) {
+ query := db.QueryRowContext(ctx, "SELECT kswitch_id, feat_id, min_version, max_version, active FROM KillSwitch WHERE kswitch_id = ?", id)
+ var featureId int32
+ var k pb.KillSwitch
+ if err := query.Scan(&k.Id, &featureId, &k.MinVersion, &k.MaxVersion, &k.Active); err != nil {
+ if err == sql.ErrNoRows {
+ return nil, nil
+ }
+ return nil, fmt.Errorf("GetKillSwitchById: %v.", err)
+ }
+
+ err := fillRawKillSwitch(db, ctx, &k, featureId)
+ if err != nil {
+ return nil, fmt.Errorf("GetKillSwitchById: $v.", err)
+ }
+
+ return &k, nil
+}
+
+func ListKillSwitches(db *sql.DB, ctx context.Context) ([]*pb.KillSwitch, error) {
+ var rows *sql.Rows
+ var err error
+ rows, err = db.QueryContext(ctx, "SELECT kswitch_id, feat_id, min_version, max_version, active FROM KillSwitch")
+ if err != nil {
+ return nil, fmt.Errorf("ListKillSwitches: ", err)
+ }
+ defer rows.Close()
+
+ var killSwitches []*pb.KillSwitch
+ for rows.Next() {
+ var featureId int32
+ var k pb.KillSwitch
+ if err := rows.Scan(&k.Id, &featureId, &k.MinVersion, &k.MaxVersion, &k.Active); err != nil {
+ return nil, fmt.Errorf("ListKillSwitches: %v.", err)
+ }
+ err := fillRawKillSwitch(db, ctx, &k, featureId)
+ if err != nil {
+ return nil, fmt.Errorf("ListKillSwitches: $v.", err)
+ }
+ killSwitches = append(killSwitches, &k)
+ }
+ if err := rows.Err(); err != nil {
+ return nil, fmt.Errorf("ListKillSwitches: ", err)
+ }
+ return killSwitches, nil
+}
+
+func EnableKillSwitch(db *sql.DB, ctx context.Context, k *pb.KillSwitch) error {
+ if k.MinVersion != "" && !isValidSemVersion(k.MinVersion) {
+ return fmt.Errorf("min_version is not a valid semantic version.")
+ }
+ if k.MaxVersion != "" && !isValidSemVersion(k.MaxVersion) {
+ return fmt.Errorf("max_version is not a valid semantic version.")
+ }
+ if k.MinVersion != "" && k.MaxVersion != "" {
+ minVersion, _ := semver.NewVersion(k.MinVersion)
+ maxVersion, _ := semver.NewVersion(k.MaxVersion)
+ if minVersion.GreaterThan(maxVersion) {
+ return fmt.Errorf("min_version must be less than max_version.")
+ }
+ }
+ for _, b := range k.GetBrowsers() {
+ if b == pb.Environment_BROWSER_UNKNOWN {
+ return fmt.Errorf("browsers cannot contain BROWSER_UNKNOWN.")
+ }
+ }
+
+ k.Active = true
+
+ f, err := GetFeatureById(db, ctx, k.Feature.Id)
+ if err != nil {
+ return fmt.Errorf("EnableKillSwitch: %v", err)
+ }
+ if f == nil {
+ return fmt.Errorf("EnableKillSwitch: this feature doesn't exist.")
+ }
+ k.Feature = f
+
+ tx, err := db.BeginTx(ctx, nil)
+ if err != nil {
+ return err
+ }
+
+ result, err := tx.ExecContext(ctx, "INSERT INTO KillSwitch (feat_id, min_version, max_version, active) VALUES (?, ?, ?, ?)", k.Feature.Id, k.MinVersion, k.MaxVersion, k.Active)
+ if err != nil {
+ tx.Rollback()
+ return err
+ }
+
+ id, err := result.LastInsertId()
+ if err != nil {
+ tx.Rollback()
+ return err
+ }
+ k.Id = int32(id)
+
+ for _, b := range k.GetBrowsers() {
+ if _, err := tx.ExecContext(ctx, "INSERT INTO KillSwitch2Browser (kswitch_id, browser) VALUES (?, ?)", k.Id, b); err != nil {
+ tx.Rollback()
+ return err
+ }
+ }
+
+ logEntry := &pb.KillSwitchAuditLogEntry{
+ Description: &pb.KillSwitchAuditLogEntry_KillSwitchEnabled_{
+ &pb.KillSwitchAuditLogEntry_KillSwitchEnabled{
+ KillSwitch: k,
+ },
+ },
+ }
+ if err := AddKillSwitchAuditLogEntry(tx, ctx, logEntry); err != nil {
+ tx.Rollback()
+ return err
+ }
+
+ return tx.Commit()
+}
+
+func DisableKillSwitch(db *sql.DB, ctx context.Context, id int32) error {
+ oldKillSwitch, err := GetKillSwitchById(db, ctx, id)
+ if err != nil {
+ return err
+ }
+ if oldKillSwitch == nil {
+ return fmt.Errorf("Such kill switch doesn't exist")
+ }
+ if oldKillSwitch.GetActive() != true {
+ return fmt.Errorf("The kill switch is not active")
+ }
+
+ tx, err := db.BeginTx(ctx, nil)
+ if err != nil {
+ return err
+ }
+
+ newKillSwitch := *oldKillSwitch
+ newKillSwitch.Active = false
+
+ if _, err := tx.ExecContext(ctx, "UPDATE KillSwitch SET active = ? WHERE kswitch_id = ?", newKillSwitch.Active, id); err != nil {
+ tx.Rollback()
+ return err
+ }
+
+ logEntry := &pb.KillSwitchAuditLogEntry{
+ Description: &pb.KillSwitchAuditLogEntry_KillSwitchDisabled_{
+ &pb.KillSwitchAuditLogEntry_KillSwitchDisabled{
+ Transformation: &pb.KillSwitchTransformation{
+ Old: oldKillSwitch,
+ New: &newKillSwitch,
+ },
+ },
+ },
+ }
+ if err := AddKillSwitchAuditLogEntry(tx, ctx, logEntry); err != nil {
+ tx.Rollback()
+ return err
+ }
+
+ return tx.Commit()
+}