blob: 041291fed1255ec8d11431e5ed1d9079e30e5cee [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;
Adrià Vilanova Martínezc147b6a2021-09-01 17:25:38 +020035 ACCESS_LEVEL_ACTIVATOR = 5; // The user may enable/disable kill switches.
36 ACCESS_LEVEL_ADMIN = 10; // The user may perform any action.
avm9996383f8f292021-08-24 18:26:52 +020037 }
38 AccessLevel access_level = 4;
39}
40
41message KillSwitchTransformation {
Adrià Vilanova Martínez25e12112021-08-25 13:48:06 +020042 KillSwitch old = 1;
43 KillSwitch new = 2;
44}
45
46message AuthorizedUserTransformation {
47 KillSwitchAuthorizedUser old = 1;
48 KillSwitchAuthorizedUser new = 2;
avm9996383f8f292021-08-24 18:26:52 +020049}
50
51// Log entry which describes an action which has taken place.
52message KillSwitchAuditLogEntry {
53 // Timestamp in which the action was taken.
54 google.protobuf.Timestamp timestamp = 1;
55
56 // User who/which performed the action.
57 KillSwitchAuthorizedUser user = 2;
58
59 message KillSwitchEnabled {
Adrià Vilanova Martínez25e12112021-08-25 13:48:06 +020060 KillSwitch kill_switch = 1;
avm9996383f8f292021-08-24 18:26:52 +020061 }
62
63 message KillSwitchDisabled {
64 KillSwitchTransformation transformation = 1;
65 }
66
Adrià Vilanova Martínez25e12112021-08-25 13:48:06 +020067 message AuthorizedUserAdded {
68 KillSwitchAuthorizedUser user = 1;
69 }
70
71 message AuthorizedUserUpdated {
72 AuthorizedUserTransformation transformation = 1;
73 }
74
75 message AuthorizedUserDeleted {
76 KillSwitchAuthorizedUser old_user = 1;
77 }
78
avm9996383f8f292021-08-24 18:26:52 +020079 // Description of the action taken
80 oneof description {
81 KillSwitchEnabled kill_switch_enabled = 3;
82 KillSwitchDisabled kill_switch_disabled = 4;
Adrià Vilanova Martínez25e12112021-08-25 13:48:06 +020083 AuthorizedUserAdded authorized_user_added = 5;
84 AuthorizedUserUpdated authorized_user_updated = 6;
85 AuthorizedUserDeleted authorized_user_deleted = 7;
avm9996383f8f292021-08-24 18:26:52 +020086 }
87}