-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathsemgrep_runner_v1.proto
51 lines (42 loc) · 1.3 KB
/
semgrep_runner_v1.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
/*
* Spec of the Semgrep Runner service utilized in semgrep-proprietary server command.
*
* This file has the _v1 suffix to explicitely represent the
* version of this protobuf format used by the Semgrep Runner service.
* If you need to extend this file, please check that all changes are backwards compatible.
* If a breaking change is introduced (and ensure that it does need to be introduced), then
* bump the version number.
*/
syntax = "proto3";
package semgrep_runner_v1;
option go_package = "semgrep_runner.v1";
import "protos/semgrep_output_v1.proto";
enum RuleFormat {
RULE_FORMAT_UNSPECIFIED = 0;
RULE_FORMAT_YAML = 1;
RULE_FORMAT_JSON = 2;
RULE_FORMAT_JSONNET = 3;
}
message FilePath {
string path = 1;
}
message FileBlob {
FilePath file_path = 1;
string contents = 2;
}
message ScanRequest {
// the rule raw content
string rule = 1;
// how to parse the rule content
RuleFormat rule_format = 2;
// list of file blobs to receive via SubmitFileBlob service
repeated FileBlob files = 3;
}
message ScanResult {
string request_id = 1;
semgrep_output_v1.CliMatch cli_match = 2;
}
service ScanService {
// we provide a streaming interface here! to return results as soon as they arrive!
rpc Scan(ScanRequest) returns (stream ScanResult) {};
}