grafeas 0.0.1 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +11 -0
  3. data/AUTHENTICATION.md +199 -0
  4. data/LICENSE +201 -0
  5. data/README.md +55 -25
  6. data/lib/grafeas.rb +151 -2
  7. data/lib/grafeas/v1.rb +155 -0
  8. data/lib/grafeas/v1/attestation_pb.rb +27 -0
  9. data/lib/grafeas/v1/build_pb.rb +23 -0
  10. data/lib/grafeas/v1/common_pb.rb +34 -0
  11. data/lib/grafeas/v1/credentials.rb +37 -0
  12. data/lib/grafeas/v1/cvss_pb.rb +67 -0
  13. data/lib/grafeas/v1/deployment_pb.rb +35 -0
  14. data/lib/grafeas/v1/discovery_pb.rb +40 -0
  15. data/lib/grafeas/v1/doc/google/protobuf/any.rb +131 -0
  16. data/lib/grafeas/v1/doc/google/protobuf/empty.rb +29 -0
  17. data/lib/grafeas/v1/doc/google/protobuf/field_mask.rb +222 -0
  18. data/lib/grafeas/v1/doc/google/protobuf/timestamp.rb +113 -0
  19. data/lib/grafeas/v1/doc/google/rpc/status.rb +87 -0
  20. data/lib/grafeas/v1/doc/grafeas/v1/attestation.rb +64 -0
  21. data/lib/grafeas/v1/doc/grafeas/v1/build.rb +44 -0
  22. data/lib/grafeas/v1/doc/grafeas/v1/common.rb +105 -0
  23. data/lib/grafeas/v1/doc/grafeas/v1/cvss.rb +104 -0
  24. data/lib/grafeas/v1/doc/grafeas/v1/deployment.rb +64 -0
  25. data/lib/grafeas/v1/doc/grafeas/v1/discovery.rb +76 -0
  26. data/lib/grafeas/v1/doc/grafeas/v1/grafeas.rb +322 -0
  27. data/lib/grafeas/v1/doc/grafeas/v1/image.rb +79 -0
  28. data/lib/grafeas/v1/doc/grafeas/v1/package.rb +125 -0
  29. data/lib/grafeas/v1/doc/grafeas/v1/provenance.rb +248 -0
  30. data/lib/grafeas/v1/doc/grafeas/v1/vulnerability.rb +214 -0
  31. data/lib/grafeas/v1/grafeas_client.rb +961 -0
  32. data/lib/grafeas/v1/grafeas_client_config.json +96 -0
  33. data/lib/grafeas/v1/grafeas_pb.rb +163 -0
  34. data/lib/grafeas/v1/grafeas_services_pb.rb +86 -0
  35. data/lib/grafeas/v1/image_pb.rb +36 -0
  36. data/lib/grafeas/v1/package_pb.rb +59 -0
  37. data/lib/grafeas/v1/provenance_pb.rb +116 -0
  38. data/lib/grafeas/v1/vulnerability_pb.rb +81 -0
  39. data/lib/grafeas/version.rb +16 -1
  40. metadata +111 -31
  41. data/.gitignore +0 -8
  42. data/.travis.yml +0 -5
  43. data/Gemfile +0 -6
  44. data/Gemfile.lock +0 -22
  45. data/LICENSE.txt +0 -21
  46. data/Rakefile +0 -10
  47. data/bin/console +0 -14
  48. data/bin/setup +0 -8
  49. data/grafeas.gemspec +0 -26
@@ -0,0 +1,64 @@
1
+ # Copyright 2019 Google LLC
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
+ # https://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
+
15
+
16
+ module Grafeas
17
+ module V1
18
+ # An artifact that can be deployed in some runtime.
19
+ # @!attribute [rw] resource_uri
20
+ # @return [Array<String>]
21
+ # Required. Resource URI for the artifact being deployed.
22
+ class DeploymentNote; end
23
+
24
+ # The period during which some deployable was active in a runtime.
25
+ # @!attribute [rw] user_email
26
+ # @return [String]
27
+ # Identity of the user that triggered this deployment.
28
+ # @!attribute [rw] deploy_time
29
+ # @return [Google::Protobuf::Timestamp]
30
+ # Required. Beginning of the lifetime of this deployment.
31
+ # @!attribute [rw] undeploy_time
32
+ # @return [Google::Protobuf::Timestamp]
33
+ # End of the lifetime of this deployment.
34
+ # @!attribute [rw] config
35
+ # @return [String]
36
+ # Configuration used to create this deployment.
37
+ # @!attribute [rw] address
38
+ # @return [String]
39
+ # Address of the runtime element hosting this deployment.
40
+ # @!attribute [rw] resource_uri
41
+ # @return [Array<String>]
42
+ # Output only. Resource URI for the artifact being deployed taken from
43
+ # the deployable field with the same name.
44
+ # @!attribute [rw] platform
45
+ # @return [Grafeas::V1::DeploymentOccurrence::Platform]
46
+ # Platform hosting this deployment.
47
+ class DeploymentOccurrence
48
+ # Types of platforms.
49
+ module Platform
50
+ # Unknown.
51
+ PLATFORM_UNSPECIFIED = 0
52
+
53
+ # Google Container Engine.
54
+ GKE = 1
55
+
56
+ # Google App Engine: Flexible Environment.
57
+ FLEX = 2
58
+
59
+ # Custom user-defined platform.
60
+ CUSTOM = 3
61
+ end
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,76 @@
1
+ # Copyright 2019 Google LLC
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
+ # https://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
+
15
+
16
+ module Grafeas
17
+ module V1
18
+ # A note that indicates a type of analysis a provider would perform. This note
19
+ # exists in a provider's project. A `Discovery` occurrence is created in a
20
+ # consumer's project at the start of analysis.
21
+ # @!attribute [rw] analysis_kind
22
+ # @return [Grafeas::V1::NoteKind]
23
+ # Required. Immutable. The kind of analysis that is handled by this
24
+ # discovery.
25
+ class DiscoveryNote; end
26
+
27
+ # Provides information about the analysis status of a discovered resource.
28
+ # @!attribute [rw] continuous_analysis
29
+ # @return [Grafeas::V1::DiscoveryOccurrence::ContinuousAnalysis]
30
+ # Whether the resource is continuously analyzed.
31
+ # @!attribute [rw] analysis_status
32
+ # @return [Grafeas::V1::DiscoveryOccurrence::AnalysisStatus]
33
+ # The status of discovery for the resource.
34
+ # @!attribute [rw] analysis_status_error
35
+ # @return [Google::Rpc::Status]
36
+ # When an error is encountered this will contain a LocalizedMessage under
37
+ # details to show to the user. The LocalizedMessage is output only and
38
+ # populated by the API.
39
+ class DiscoveryOccurrence
40
+ # Analysis status for a resource. Currently for initial analysis only (not
41
+ # updated in continuous analysis).
42
+ module AnalysisStatus
43
+ # Unknown.
44
+ ANALYSIS_STATUS_UNSPECIFIED = 0
45
+
46
+ # Resource is known but no action has been taken yet.
47
+ PENDING = 1
48
+
49
+ # Resource is being analyzed.
50
+ SCANNING = 2
51
+
52
+ # Analysis has finished successfully.
53
+ FINISHED_SUCCESS = 3
54
+
55
+ # Analysis has finished unsuccessfully, the analysis itself is in a bad
56
+ # state.
57
+ FINISHED_FAILED = 4
58
+
59
+ # The resource is known not to be supported
60
+ FINISHED_UNSUPPORTED = 5
61
+ end
62
+
63
+ # Whether the resource is continuously analyzed.
64
+ module ContinuousAnalysis
65
+ # Unknown.
66
+ CONTINUOUS_ANALYSIS_UNSPECIFIED = 0
67
+
68
+ # The resource is continuously analyzed.
69
+ ACTIVE = 1
70
+
71
+ # The resource is ignored for continuous analysis.
72
+ INACTIVE = 2
73
+ end
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,322 @@
1
+ # Copyright 2019 Google LLC
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
+ # https://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
+
15
+
16
+ module Grafeas
17
+ module V1
18
+ # An instance of an analysis type that has been found on a resource.
19
+ # @!attribute [rw] name
20
+ # @return [String]
21
+ # Output only. The name of the occurrence in the form of
22
+ # `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
23
+ # @!attribute [rw] resource_uri
24
+ # @return [String]
25
+ # Required. Immutable. A URI that represents the resource for which the
26
+ # occurrence applies. For example,
27
+ # `https://gcr.io/project/image@sha256:123abc` for a Docker image.
28
+ # @!attribute [rw] note_name
29
+ # @return [String]
30
+ # Required. Immutable. The analysis note associated with this occurrence, in
31
+ # the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. This field can be
32
+ # used as a filter in list requests.
33
+ # @!attribute [rw] kind
34
+ # @return [Grafeas::V1::NoteKind]
35
+ # Output only. This explicitly denotes which of the occurrence details are
36
+ # specified. This field can be used as a filter in list requests.
37
+ # @!attribute [rw] remediation
38
+ # @return [String]
39
+ # A description of actions that can be taken to remedy the note.
40
+ # @!attribute [rw] create_time
41
+ # @return [Google::Protobuf::Timestamp]
42
+ # Output only. The time this occurrence was created.
43
+ # @!attribute [rw] update_time
44
+ # @return [Google::Protobuf::Timestamp]
45
+ # Output only. The time this occurrence was last updated.
46
+ # @!attribute [rw] vulnerability
47
+ # @return [Grafeas::V1::VulnerabilityOccurrence]
48
+ # Describes a security vulnerability.
49
+ # @!attribute [rw] build
50
+ # @return [Grafeas::V1::BuildOccurrence]
51
+ # Describes a verifiable build.
52
+ # @!attribute [rw] image
53
+ # @return [Grafeas::V1::ImageOccurrence]
54
+ # Describes how this resource derives from the basis in the associated
55
+ # note.
56
+ # @!attribute [rw] package
57
+ # @return [Grafeas::V1::PackageOccurrence]
58
+ # Describes the installation of a package on the linked resource.
59
+ # @!attribute [rw] deployment
60
+ # @return [Grafeas::V1::DeploymentOccurrence]
61
+ # Describes the deployment of an artifact on a runtime.
62
+ # @!attribute [rw] discovery
63
+ # @return [Grafeas::V1::DiscoveryOccurrence]
64
+ # Describes when a resource was discovered.
65
+ # @!attribute [rw] attestation
66
+ # @return [Grafeas::V1::AttestationOccurrence]
67
+ # Describes an attestation of an artifact.
68
+ class Occurrence; end
69
+
70
+ # A type of analysis that can be done for a resource.
71
+ # @!attribute [rw] name
72
+ # @return [String]
73
+ # Output only. The name of the note in the form of
74
+ # `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
75
+ # @!attribute [rw] short_description
76
+ # @return [String]
77
+ # A one sentence description of this note.
78
+ # @!attribute [rw] long_description
79
+ # @return [String]
80
+ # A detailed description of this note.
81
+ # @!attribute [rw] kind
82
+ # @return [Grafeas::V1::NoteKind]
83
+ # Output only. The type of analysis. This field can be used as a filter in
84
+ # list requests.
85
+ # @!attribute [rw] related_url
86
+ # @return [Array<Grafeas::V1::RelatedUrl>]
87
+ # URLs associated with this note.
88
+ # @!attribute [rw] expiration_time
89
+ # @return [Google::Protobuf::Timestamp]
90
+ # Time of expiration for this note. Empty if note does not expire.
91
+ # @!attribute [rw] create_time
92
+ # @return [Google::Protobuf::Timestamp]
93
+ # Output only. The time this note was created. This field can be used as a
94
+ # filter in list requests.
95
+ # @!attribute [rw] update_time
96
+ # @return [Google::Protobuf::Timestamp]
97
+ # Output only. The time this note was last updated. This field can be used as
98
+ # a filter in list requests.
99
+ # @!attribute [rw] related_note_names
100
+ # @return [Array<String>]
101
+ # Other notes related to this note.
102
+ # @!attribute [rw] vulnerability
103
+ # @return [Grafeas::V1::VulnerabilityNote]
104
+ # A note describing a package vulnerability.
105
+ # @!attribute [rw] build
106
+ # @return [Grafeas::V1::BuildNote]
107
+ # A note describing build provenance for a verifiable build.
108
+ # @!attribute [rw] image
109
+ # @return [Grafeas::V1::ImageNote]
110
+ # A note describing a base image.
111
+ # @!attribute [rw] package
112
+ # @return [Grafeas::V1::PackageNote]
113
+ # A note describing a package hosted by various package managers.
114
+ # @!attribute [rw] deployment
115
+ # @return [Grafeas::V1::DeploymentNote]
116
+ # A note describing something that can be deployed.
117
+ # @!attribute [rw] discovery
118
+ # @return [Grafeas::V1::DiscoveryNote]
119
+ # A note describing the initial analysis of a resource.
120
+ # @!attribute [rw] attestation
121
+ # @return [Grafeas::V1::AttestationNote]
122
+ # A note describing an attestation role.
123
+ class Note; end
124
+
125
+ # Request to get an occurrence.
126
+ # @!attribute [rw] name
127
+ # @return [String]
128
+ # The name of the occurrence in the form of
129
+ # `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
130
+ class GetOccurrenceRequest; end
131
+
132
+ # Request to list occurrences.
133
+ # @!attribute [rw] parent
134
+ # @return [String]
135
+ # The name of the project to list occurrences for in the form of
136
+ # `projects/[PROJECT_ID]`.
137
+ # @!attribute [rw] filter
138
+ # @return [String]
139
+ # The filter expression.
140
+ # @!attribute [rw] page_size
141
+ # @return [Integer]
142
+ # Number of occurrences to return in the list. Must be positive. Max allowed
143
+ # page size is 1000. If not specified, page size defaults to 20.
144
+ # @!attribute [rw] page_token
145
+ # @return [String]
146
+ # Token to provide to skip to a particular spot in the list.
147
+ class ListOccurrencesRequest; end
148
+
149
+ # Response for listing occurrences.
150
+ # @!attribute [rw] occurrences
151
+ # @return [Array<Grafeas::V1::Occurrence>]
152
+ # The occurrences requested.
153
+ # @!attribute [rw] next_page_token
154
+ # @return [String]
155
+ # The next pagination token in the list response. It should be used as
156
+ # `page_token` for the following request. An empty value means no more
157
+ # results.
158
+ class ListOccurrencesResponse; end
159
+
160
+ # Request to delete a occurrence.
161
+ # @!attribute [rw] name
162
+ # @return [String]
163
+ # The name of the occurrence in the form of
164
+ # `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
165
+ class DeleteOccurrenceRequest; end
166
+
167
+ # Request to create a new occurrence.
168
+ # @!attribute [rw] parent
169
+ # @return [String]
170
+ # The name of the project in the form of `projects/[PROJECT_ID]`, under which
171
+ # the occurrence is to be created.
172
+ # @!attribute [rw] occurrence
173
+ # @return [Grafeas::V1::Occurrence]
174
+ # The occurrence to create.
175
+ class CreateOccurrenceRequest; end
176
+
177
+ # Request to update an occurrence.
178
+ # @!attribute [rw] name
179
+ # @return [String]
180
+ # The name of the occurrence in the form of
181
+ # `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
182
+ # @!attribute [rw] occurrence
183
+ # @return [Grafeas::V1::Occurrence]
184
+ # The updated occurrence.
185
+ # @!attribute [rw] update_mask
186
+ # @return [Google::Protobuf::FieldMask]
187
+ # The fields to update.
188
+ class UpdateOccurrenceRequest; end
189
+
190
+ # Request to get a note.
191
+ # @!attribute [rw] name
192
+ # @return [String]
193
+ # The name of the note in the form of
194
+ # `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
195
+ class GetNoteRequest; end
196
+
197
+ # Request to get the note to which the specified occurrence is attached.
198
+ # @!attribute [rw] name
199
+ # @return [String]
200
+ # The name of the occurrence in the form of
201
+ # `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
202
+ class GetOccurrenceNoteRequest; end
203
+
204
+ # Request to list notes.
205
+ # @!attribute [rw] parent
206
+ # @return [String]
207
+ # The name of the project to list notes for in the form of
208
+ # `projects/[PROJECT_ID]`.
209
+ # @!attribute [rw] filter
210
+ # @return [String]
211
+ # The filter expression.
212
+ # @!attribute [rw] page_size
213
+ # @return [Integer]
214
+ # Number of notes to return in the list. Must be positive. Max allowed page
215
+ # size is 1000. If not specified, page size defaults to 20.
216
+ # @!attribute [rw] page_token
217
+ # @return [String]
218
+ # Token to provide to skip to a particular spot in the list.
219
+ class ListNotesRequest; end
220
+
221
+ # Response for listing notes.
222
+ # @!attribute [rw] notes
223
+ # @return [Array<Grafeas::V1::Note>]
224
+ # The notes requested.
225
+ # @!attribute [rw] next_page_token
226
+ # @return [String]
227
+ # The next pagination token in the list response. It should be used as
228
+ # `page_token` for the following request. An empty value means no more
229
+ # results.
230
+ class ListNotesResponse; end
231
+
232
+ # Request to delete a note.
233
+ # @!attribute [rw] name
234
+ # @return [String]
235
+ # The name of the note in the form of
236
+ # `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
237
+ class DeleteNoteRequest; end
238
+
239
+ # Request to create a new note.
240
+ # @!attribute [rw] parent
241
+ # @return [String]
242
+ # The name of the project in the form of `projects/[PROJECT_ID]`, under which
243
+ # the note is to be created.
244
+ # @!attribute [rw] note_id
245
+ # @return [String]
246
+ # The ID to use for this note.
247
+ # @!attribute [rw] note
248
+ # @return [Grafeas::V1::Note]
249
+ # The note to create.
250
+ class CreateNoteRequest; end
251
+
252
+ # Request to update a note.
253
+ # @!attribute [rw] name
254
+ # @return [String]
255
+ # The name of the note in the form of
256
+ # `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
257
+ # @!attribute [rw] note
258
+ # @return [Grafeas::V1::Note]
259
+ # The updated note.
260
+ # @!attribute [rw] update_mask
261
+ # @return [Google::Protobuf::FieldMask]
262
+ # The fields to update.
263
+ class UpdateNoteRequest; end
264
+
265
+ # Request to list occurrences for a note.
266
+ # @!attribute [rw] name
267
+ # @return [String]
268
+ # The name of the note to list occurrences for in the form of
269
+ # `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
270
+ # @!attribute [rw] filter
271
+ # @return [String]
272
+ # The filter expression.
273
+ # @!attribute [rw] page_size
274
+ # @return [Integer]
275
+ # Number of occurrences to return in the list.
276
+ # @!attribute [rw] page_token
277
+ # @return [String]
278
+ # Token to provide to skip to a particular spot in the list.
279
+ class ListNoteOccurrencesRequest; end
280
+
281
+ # Response for listing occurrences for a note.
282
+ # @!attribute [rw] occurrences
283
+ # @return [Array<Grafeas::V1::Occurrence>]
284
+ # The occurrences attached to the specified note.
285
+ # @!attribute [rw] next_page_token
286
+ # @return [String]
287
+ # Token to provide to skip to a particular spot in the list.
288
+ class ListNoteOccurrencesResponse; end
289
+
290
+ # Request to create notes in batch.
291
+ # @!attribute [rw] parent
292
+ # @return [String]
293
+ # The name of the project in the form of `projects/[PROJECT_ID]`, under which
294
+ # the notes are to be created.
295
+ # @!attribute [rw] notes
296
+ # @return [Hash{String => Grafeas::V1::Note}]
297
+ # The notes to create. Max allowed length is 1000.
298
+ class BatchCreateNotesRequest; end
299
+
300
+ # Response for creating notes in batch.
301
+ # @!attribute [rw] notes
302
+ # @return [Array<Grafeas::V1::Note>]
303
+ # The notes that were created.
304
+ class BatchCreateNotesResponse; end
305
+
306
+ # Request to create occurrences in batch.
307
+ # @!attribute [rw] parent
308
+ # @return [String]
309
+ # The name of the project in the form of `projects/[PROJECT_ID]`, under which
310
+ # the occurrences are to be created.
311
+ # @!attribute [rw] occurrences
312
+ # @return [Array<Grafeas::V1::Occurrence>]
313
+ # The occurrences to create. Max allowed length is 1000.
314
+ class BatchCreateOccurrencesRequest; end
315
+
316
+ # Response for creating occurrences in batch.
317
+ # @!attribute [rw] occurrences
318
+ # @return [Array<Grafeas::V1::Occurrence>]
319
+ # The occurrences that were created.
320
+ class BatchCreateOccurrencesResponse; end
321
+ end
322
+ end