package.proto 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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.package;
  16. option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1beta1/package";
  17. option java_multiple_files = true;
  18. option java_package = "io.grafeas.v1beta1.pkg";
  19. option objc_class_prefix = "GRA";
  20. // Instruction set architectures supported by various package managers.
  21. enum Architecture {
  22. // Unknown architecture.
  23. ARCHITECTURE_UNSPECIFIED = 0;
  24. // X86 architecture.
  25. X86 = 1;
  26. // X64 architecture.
  27. X64 = 2;
  28. }
  29. // This represents a particular channel of distribution for a given package.
  30. // E.g., Debian's jessie-backports dpkg mirror.
  31. message Distribution {
  32. // Required. The cpe_uri in [CPE format](https://cpe.mitre.org/specification/)
  33. // denoting the package manager version distributing a package.
  34. string cpe_uri = 1;
  35. // The CPU architecture for which packages in this distribution channel were
  36. // built.
  37. Architecture architecture = 2;
  38. // The latest available version of this package in this distribution channel.
  39. Version latest_version = 3;
  40. // A freeform string denoting the maintainer of this package.
  41. string maintainer = 4;
  42. // The distribution channel-specific homepage for this package.
  43. string url = 5;
  44. // The distribution channel-specific description of this package.
  45. string description = 6;
  46. }
  47. // An occurrence of a particular package installation found within a system's
  48. // filesystem. E.g., glibc was found in `/var/lib/dpkg/status`.
  49. message Location {
  50. // Required. The CPE URI in [CPE format](https://cpe.mitre.org/specification/)
  51. // denoting the package manager version distributing a package.
  52. string cpe_uri = 1;
  53. // The version installed at this location.
  54. Version version = 2;
  55. // The path from which we gathered that this package/version is installed.
  56. string path = 3;
  57. }
  58. // This represents a particular package that is distributed over various
  59. // channels. E.g., glibc (aka libc6) is distributed by many, at various
  60. // versions.
  61. message Package {
  62. // Required. Immutable. The name of the package.
  63. string name = 1;
  64. // The various channels by which a package is distributed.
  65. repeated Distribution distribution = 10;
  66. }
  67. // Details of a package occurrence.
  68. message Details {
  69. // Required. Where the package was installed.
  70. Installation installation = 1;
  71. }
  72. // This represents how a particular software package may be installed on a
  73. // system.
  74. message Installation {
  75. // Output only. The name of the installed package.
  76. string name = 1;
  77. // Required. All of the places within the filesystem versions of this package
  78. // have been found.
  79. repeated Location location = 2;
  80. }
  81. // Version contains structured information about the version of a package.
  82. message Version {
  83. // Used to correct mistakes in the version numbering scheme.
  84. int32 epoch = 1;
  85. // Required only when version kind is NORMAL. The main part of the version
  86. // name.
  87. string name = 2;
  88. // The iteration of the package build from the above version.
  89. string revision = 3;
  90. // Whether this is an ordinary package version or a sentinel MIN/MAX version.
  91. enum VersionKind {
  92. // Unknown.
  93. VERSION_KIND_UNSPECIFIED = 0;
  94. // A standard package version.
  95. NORMAL = 1;
  96. // A special version representing negative infinity.
  97. MINIMUM = 2;
  98. // A special version representing positive infinity.
  99. MAXIMUM = 3;
  100. };
  101. // Required. Distinguishes between sentinel MIN/MAX versions and normal
  102. // versions.
  103. VersionKind kind = 4;
  104. }