a4edf38566
Newly designed API defines Ancestry as a set of layers and shrinked the api to only the most used apis: post ancestry, get layer, get notification, delete notification Fixes #98
149 lines
3.1 KiB
Protocol Buffer
149 lines
3.1 KiB
Protocol Buffer
// Copyright 2017 clair authors
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
syntax = "proto3";
|
|
option go_package = "clairpb";
|
|
|
|
package clairpb;
|
|
import "google/api/annotations.proto";
|
|
import "google/protobuf/empty.proto";
|
|
|
|
message Vulnerability {
|
|
string name = 1;
|
|
string namespace_name = 2;
|
|
string description = 3;
|
|
string link = 4;
|
|
string severity = 5;
|
|
string metadata = 6;
|
|
string fixed_by = 7;
|
|
repeated Feature fixed_in_features = 8;
|
|
}
|
|
|
|
message Feature {
|
|
string name = 1;
|
|
string namespace_name = 2;
|
|
string version = 3;
|
|
string version_format = 4;
|
|
string added_by = 5;
|
|
repeated Vulnerability vulnerabilities = 6;
|
|
}
|
|
|
|
message Ancestry {
|
|
string name = 1;
|
|
int32 engine_version = 2;
|
|
repeated Layer layers = 3;
|
|
}
|
|
|
|
message LayersIntroducingVulnerabilty {
|
|
Vulnerability vulnerability = 1;
|
|
repeated OrderedLayerName layers = 2;
|
|
}
|
|
|
|
message OrderedLayerName {
|
|
int32 index = 1;
|
|
string layer_name = 2;
|
|
}
|
|
|
|
message Layer {
|
|
string name = 1;
|
|
repeated string namespace_names = 2;
|
|
}
|
|
|
|
message Notification {
|
|
string name = 1;
|
|
string created = 2;
|
|
string notified = 3;
|
|
string deleted = 4;
|
|
int32 limit = 5;
|
|
Page page = 6;
|
|
}
|
|
|
|
message Page {
|
|
string this_token = 1;
|
|
string next_token = 2;
|
|
LayersIntroducingVulnerabilty old = 3;
|
|
LayersIntroducingVulnerabilty new = 4;
|
|
}
|
|
|
|
|
|
message PostAncestryRequest {
|
|
message PostLayer {
|
|
string name = 1;
|
|
string path = 2;
|
|
map<string, string> headers = 3;
|
|
}
|
|
string ancestry_name = 1;
|
|
string format = 2;
|
|
repeated PostLayer layers = 3;
|
|
}
|
|
|
|
message PostAncestryResponse {
|
|
int32 engine_version = 1;
|
|
}
|
|
|
|
message GetAncestryRequest {
|
|
string ancestry_name = 1;
|
|
bool with_vulnerabilities = 2;
|
|
bool with_features = 3;
|
|
}
|
|
|
|
message GetAncestryResponse {
|
|
Ancestry ancestry = 1;
|
|
repeated Feature features = 2;
|
|
}
|
|
|
|
message GetNotificationRequest {
|
|
string page = 1;
|
|
int32 limit = 2;
|
|
string name = 3;
|
|
}
|
|
|
|
message GetNotificationResponse {
|
|
Notification notification = 1;
|
|
}
|
|
|
|
message DeleteNotificationRequest {
|
|
string name = 1;
|
|
}
|
|
|
|
|
|
|
|
service AncestryService{
|
|
rpc PostAncestry(PostAncestryRequest) returns (PostAncestryResponse) {
|
|
option (google.api.http) = {
|
|
post: "/ancestry"
|
|
body: "*"
|
|
};
|
|
}
|
|
|
|
rpc GetAncestry(GetAncestryRequest) returns (GetAncestryResponse) {
|
|
option (google.api.http) = {
|
|
get: "/ancestry/{ancestry_name}"
|
|
};
|
|
}
|
|
}
|
|
|
|
service NotificationService{
|
|
rpc GetNotification(GetNotificationRequest) returns (GetNotificationResponse) {
|
|
option (google.api.http) = {
|
|
get: "/notifications/{name}"
|
|
};
|
|
}
|
|
|
|
rpc DeleteNotification(DeleteNotificationRequest) returns (google.protobuf.Empty) {
|
|
option (google.api.http) = {
|
|
delete: "/notifications/{name}"
|
|
};
|
|
}
|
|
} |