provenance.proto 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. // Copyright 2018 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. syntax = "proto3";
  15. package grafeas.v1beta1.provenance;
  16. import "google/devtools/containeranalysis/v1beta1/source/source.proto";
  17. import "google/protobuf/timestamp.proto";
  18. option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1beta1/provenance;provenance";
  19. option java_multiple_files = true;
  20. option java_package = "io.grafeas.v1beta1.provenance";
  21. option objc_class_prefix = "GRA";
  22. // Provenance of a build. Contains all information needed to verify the full
  23. // details about the build from source to completion.
  24. message BuildProvenance {
  25. // Required. Unique identifier of the build.
  26. string id = 1;
  27. // ID of the project.
  28. string project_id = 2;
  29. // Commands requested by the build.
  30. repeated Command commands = 3;
  31. // Output of the build.
  32. repeated Artifact built_artifacts = 4;
  33. // Time at which the build was created.
  34. google.protobuf.Timestamp create_time = 5;
  35. // Time at which execution of the build was started.
  36. google.protobuf.Timestamp start_time = 6;
  37. // Time at which execution of the build was finished.
  38. google.protobuf.Timestamp end_time = 7;
  39. // E-mail address of the user who initiated this build. Note that this was the
  40. // user's e-mail address at the time the build was initiated; this address may
  41. // not represent the same end-user for all time.
  42. string creator = 8;
  43. // URI where any logs for this provenance were written.
  44. string logs_uri = 9;
  45. // Details of the Source input to the build.
  46. Source source_provenance = 10;
  47. // Trigger identifier if the build was triggered automatically; empty if not.
  48. string trigger_id = 11;
  49. // Special options applied to this build. This is a catch-all field where
  50. // build providers can enter any desired additional details.
  51. map<string, string> build_options = 12;
  52. // Version string of the builder at the time this build was executed.
  53. string builder_version = 13;
  54. // next_id = 14
  55. }
  56. // Source describes the location of the source used for the build.
  57. message Source {
  58. // If provided, the input binary artifacts for the build came from this
  59. // location.
  60. string artifact_storage_source_uri = 1;
  61. // Hash(es) of the build source, which can be used to verify that the original
  62. // source integrity was maintained in the build.
  63. //
  64. // The keys to this map are file paths used as build source and the values
  65. // contain the hash values for those files.
  66. //
  67. // If the build source came in a single package such as a gzipped tarfile
  68. // (.tar.gz), the FileHash will be for the single path to that file.
  69. map<string, FileHashes> file_hashes = 2;
  70. // If provided, the source code used for the build came from this location.
  71. grafeas.v1beta1.source.SourceContext context = 3;
  72. // If provided, some of the source code used for the build may be found in
  73. // these locations, in the case where the source repository had multiple
  74. // remotes or submodules. This list will not include the context specified in
  75. // the context field.
  76. repeated grafeas.v1beta1.source.SourceContext additional_contexts = 4;
  77. }
  78. // Container message for hashes of byte content of files, used in source
  79. // messages to verify integrity of source input to the build.
  80. message FileHashes {
  81. // Required. Collection of file hashes.
  82. repeated Hash file_hash = 1;
  83. }
  84. // Container message for hash values.
  85. message Hash {
  86. // Specifies the hash algorithm.
  87. enum HashType {
  88. // Unknown.
  89. HASH_TYPE_UNSPECIFIED = 0;
  90. // A SHA-256 hash.
  91. SHA256 = 1;
  92. }
  93. // Required. The type of hash that was performed.
  94. HashType type = 1;
  95. // Required. The hash value.
  96. bytes value = 2;
  97. }
  98. // Command describes a step performed as part of the build pipeline.
  99. message Command {
  100. // Required. Name of the command, as presented on the command line, or if the
  101. // command is packaged as a Docker container, as presented to `docker pull`.
  102. string name = 1;
  103. // Environment variables set before running this command.
  104. repeated string env = 2;
  105. // Command-line arguments used when executing this command.
  106. repeated string args = 3;
  107. // Working directory (relative to project source root) used when running this
  108. // command.
  109. string dir = 4;
  110. // Optional unique identifier for this command, used in wait_for to reference
  111. // this command as a dependency.
  112. string id = 5;
  113. // The ID(s) of the command(s) that this command depends on.
  114. repeated string wait_for = 6;
  115. }
  116. // Artifact describes a build product.
  117. message Artifact {
  118. // Hash or checksum value of a binary, or Docker Registry 2.0 digest of a
  119. // container.
  120. string checksum = 1;
  121. // Artifact ID, if any; for container images, this will be a URL by digest
  122. // like `gcr.io/projectID/imagename@sha256:123456`.
  123. string id = 2;
  124. // Related artifact names. This may be the path to a binary or jar file, or in
  125. // the case of a container build, the name used to push the container image to
  126. // Google Container Registry, as presented to `docker push`. Note that a
  127. // single Artifact ID can have multiple names, for example if two tags are
  128. // applied to one image.
  129. repeated string names = 3;
  130. }