blob: 77ff0716f7f686be27e7cef0ca03dea4eb0420f9 [file] [log] [blame]
avm9996383f8f292021-08-24 18:26:52 +02001syntax = "proto3";
2
3import "api_proto/common.proto";
4import "google/protobuf/timestamp.proto";
5
6option go_package = "gomodules.avm99963.com/twpt-server/api_proto";
7
8message Feature {
9 int32 id = 1;
10 string codename = 2;
11 enum Type {
12 TYPE_UNKNOWN = 0;
13 TYPE_EXPERIMENT = 1;
14 TYPE_OPTION = 2;
15 TYPE_DEPRECATED = 10;
16 }
17 Type type = 3;
18}
19
20message KillSwitch {
21 int32 id = 1;
22 Feature feature = 2;
23 string min_version = 3;
24 string max_version = 4;
25 repeated Environment.Browser browsers = 5;
26 bool active = 6;
27}
28
29message KillSwitchAuthorizedUser {
30 int32 id = 1;
31 string google_uid = 2;
32 string email = 3;
33 enum AccessLevel {
34 ACCESS_LEVEL_NONE = 0;
35 ACCESS_LEVEL_ACTIVATOR = 1; // The user may enable/disable kill switches.
36 ACCESS_LEVEL_ADMIN = 2; // The user may perform any action.
37 }
38 AccessLevel access_level = 4;
39}
40
41message KillSwitchTransformation {
42 KillSwitch kill_switch_from = 1;
43 KillSwitch kill_switch_to = 2;
44}
45
46// Log entry which describes an action which has taken place.
47message KillSwitchAuditLogEntry {
48 // Timestamp in which the action was taken.
49 google.protobuf.Timestamp timestamp = 1;
50
51 // User who/which performed the action.
52 KillSwitchAuthorizedUser user = 2;
53
54 message KillSwitchEnabled {
55 KillSwitchTransformation transformation = 1;
56 }
57
58 message KillSwitchDisabled {
59 KillSwitchTransformation transformation = 1;
60 }
61
62 // Description of the action taken
63 oneof description {
64 KillSwitchEnabled kill_switch_enabled = 3;
65 KillSwitchDisabled kill_switch_disabled = 4;
66 }
67}