First prototype
Change-Id: Ieceb55636bda133466609471f25508d0ae83c52c
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;
+ }
+}