xref: /aosp_15_r20/external/google-cloud-java/java-grafeas/src/main/proto/grafeas/v1/image.proto (revision 55e87721aa1bc457b326496a7ca40f3ea1a63287)
1// Copyright 2019 The Grafeas Authors. All rights reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//    http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package grafeas.v1;
18
19option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas";
20option java_multiple_files = true;
21option java_package = "io.grafeas.v1";
22option objc_class_prefix = "GRA";
23
24// Layer holds metadata specific to a layer of a Docker image.
25message Layer {
26  // Required. The recovered Dockerfile directive used to construct this layer.
27  // See https://docs.docker.com/engine/reference/builder/ for more information.
28  string directive = 1;
29
30  // The recovered arguments to the Dockerfile directive.
31  string arguments = 2;
32}
33
34// A set of properties that uniquely identify a given Docker image.
35message Fingerprint {
36  // Required. The layer ID of the final layer in the Docker image's v1
37  // representation.
38  string v1_name = 1;
39
40  // Required. The ordered list of v2 blobs that represent a given image.
41  repeated string v2_blob = 2;
42
43  // Output only. The name of the image's v2 blobs computed via:
44  //   [bottom] := v2_blob[bottom]
45  //   [N] := sha256(v2_blob[N] + " " + v2_name[N+1])
46  // Only the name of the final blob is kept.
47  string v2_name = 3;
48}
49
50// Basis describes the base image portion (Note) of the DockerImage
51// relationship. Linked occurrences are derived from this or an equivalent image
52// via:
53//   FROM <Basis.resource_url>
54// Or an equivalent reference, e.g., a tag of the resource_url.
55message ImageNote {
56  // Required. Immutable. The resource_url for the resource representing the
57  // basis of associated occurrence images.
58  string resource_url = 1;
59
60  // Required. Immutable. The fingerprint of the base image.
61  Fingerprint fingerprint = 2;
62}
63
64// Details of the derived image portion of the DockerImage relationship. This
65// image would be produced from a Dockerfile with FROM <DockerImage.Basis in
66// attached Note>.
67message ImageOccurrence {
68  // Required. The fingerprint of the derived image.
69  Fingerprint fingerprint = 1;
70
71  // Output only. The number of layers by which this image differs from the
72  // associated image basis.
73  int32 distance = 2;
74
75  // This contains layer-specific metadata, if populated it has length
76  // "distance" and is ordered with [distance] being the layer immediately
77  // following the base image and [1] being the final layer.
78  repeated Layer layer_info = 3;
79
80  // Output only. This contains the base image URL for the derived image
81  // occurrence.
82  string base_resource_url = 4;
83}
84