-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefinitions.proto
More file actions
97 lines (89 loc) · 1.67 KB
/
definitions.proto
File metadata and controls
97 lines (89 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
syntax = "proto3";
package proto;
option go_package = ".;proto";
service Logging {
// Creates a log
rpc WriteLog(Log) returns (Result) {}
// Creates an audit log
rpc WriteAuditLog(AuditLog) returns (Result) {}
// Query audit logs for reporting or something
rpc AuditQuery(Query) returns (QueryResult) {}
}
message Log {
string source = 1;
string thread = 2;
string message = 3;
repeated Claim claims = 4;
string file = 5;
uint32 line = 6;
string function = 7;
enum Level {
NONE = 0;
INFO = 1;
DEBUG = 2;
WARNING = 3;
ERROR = 4;
FATAL = 5;
}
Level level = 8;
uint64 timestamp = 9;
bool group = 10;
}
message Claim {
enum Type {
STRING = 0;
NUMBER = 1;
BOOLEAN = 2;
TIMESTAMP = 3;
}
Type type = 1;
string name = 2;
string value = 3;
}
message Result {
enum Status {
ACKNOWLEDGED = 0;
UNAUTHORIZED = 1;
ACCESS_DENIED = 2;
INTERNAL_ERROR = 3;
};
Status status = 1;
string message = 2;
}
message AuditLog {
string message = 1;
repeated Claim claims = 2;
string topic = 3;
uint64 timestamp = 4;
}
message Condition {
enum Comparison {
EQUAL = 0;
NOT_EQUAL = 1;
GREATER_THAN = 2;
GREATER_OR_EQUAL = 3;
LESS_THAN = 4;
LESS_OR_EQUAL = 5;
}
string field = 1;
Comparison comparison = 2;
string value = 3;
}
message Query {
string topic = 1;
repeated Condition conditions = 2;
string cursor = 3;
}
message QueryResult {
enum QueryStatus {
SUCCESS = 0;
UNAUTHORIZED = 1;
ACCESS_DENIED = 3;
QUERY_ERROR = 4;
INTERNAL_ERROR = 5;
}
QueryResult status = 1;
string message = 2;
repeated AuditLog logs = 3;
string cursor = 4;
}