blob: 128371be121f3741c2d39df2edb8930f7a631319 [file] [log] [blame]
Adrià Vilanova Martínez413cb442021-09-06 00:30:45 +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;
Adrià Vilanova Martínez7c99ad12023-04-15 17:27:09 +020015 TYPE_INTERNAL_KILL_SWITCH = 3;
Adrià Vilanova Martínez413cb442021-09-06 00:30:45 +020016 TYPE_DEPRECATED = 10;
17 }
18 Type type = 3;
19}
20
21message KillSwitch {
22 int32 id = 1;
23 Feature feature = 2;
24 string min_version = 3;
25 string max_version = 4;
26 repeated Environment.Browser browsers = 5;
27 bool active = 6;
28}
29
30message KillSwitchAuthorizedUser {
31 int32 id = 1;
32 string google_uid = 2;
33 string email = 3;
34 enum AccessLevel {
35 ACCESS_LEVEL_NONE = 0;
36 ACCESS_LEVEL_ACTIVATOR = 5; // The user may enable/disable kill switches.
37 ACCESS_LEVEL_ADMIN = 10; // The user may perform any action.
38 }
39 AccessLevel access_level = 4;
40}
41
42message KillSwitchTransformation {
43 KillSwitch old = 1;
44 KillSwitch new = 2;
45}
46
47message AuthorizedUserTransformation {
48 KillSwitchAuthorizedUser old = 1;
49 KillSwitchAuthorizedUser new = 2;
50}
51
52// Log entry which describes an action which has taken place.
53message KillSwitchAuditLogEntry {
54 // Timestamp in which the action was taken.
55 google.protobuf.Timestamp timestamp = 1;
56
57 // User who/which performed the action.
58 KillSwitchAuthorizedUser user = 2;
59
60 message KillSwitchEnabled {
61 KillSwitch kill_switch = 1;
62 }
63
64 message KillSwitchDisabled {
65 KillSwitchTransformation transformation = 1;
66 }
67
68 message AuthorizedUserAdded {
69 KillSwitchAuthorizedUser user = 1;
70 }
71
72 message AuthorizedUserUpdated {
73 AuthorizedUserTransformation transformation = 1;
74 }
75
76 message AuthorizedUserDeleted {
77 KillSwitchAuthorizedUser old_user = 1;
78 }
79
80 // Description of the action taken
81 oneof description {
82 KillSwitchEnabled kill_switch_enabled = 3;
83 KillSwitchDisabled kill_switch_disabled = 4;
84 AuthorizedUserAdded authorized_user_added = 5;
85 AuthorizedUserUpdated authorized_user_updated = 6;
86 AuthorizedUserDeleted authorized_user_deleted = 7;
87 }
88}