forked from cruise-automation/k-rail
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplugin.proto
54 lines (43 loc) · 1.21 KB
/
plugin.proto
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
syntax = "proto3";
package proto;
option go_package = "./;proto";
import "google/protobuf/struct.proto";
message PluginNameRequest {}
message PluginNameResponse {
string plugin_name = 1;
}
message PolicyNamesRequest {}
message PolicyNamesResponse {
repeated string policy_names = 1;
}
message ConfigurePluginRequest {
google.protobuf.Struct plugin_config = 1;
}
message ConfigurePluginResponse {}
message ValidateRequest {
string policy_name = 1;
bytes admission_request = 2;
}
message ValidateResponse {
repeated ResourceViolation resource_violations = 1;
repeated PatchOperation patch_operations = 2;
}
message ResourceViolation {
string resource_name = 1;
string resource_kind = 2;
string namespace = 3;
string violation = 4;
string policy = 5;
string error = 6;
}
message PatchOperation {
string op = 1;
string path = 2;
google.protobuf.Value value = 3;
}
service KRailPlugin {
rpc PluginName(PluginNameRequest) returns (PluginNameResponse);
rpc PolicyNames(PolicyNamesRequest) returns (PolicyNamesResponse);
rpc ConfigurePlugin(ConfigurePluginRequest) returns (ConfigurePluginResponse);
rpc Validate(ValidateRequest) returns (ValidateResponse);
}