grafeas-client 0.1.0 → 0.2.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.
- checksums.yaml +4 -4
- data/lib/grafeas.rb +4 -0
- data/lib/grafeas/v1.rb +8 -0
- data/lib/grafeas/v1/doc/grafeas/v1/vulnerability.rb +29 -12
- data/lib/grafeas/v1/grafeas_client.rb +8 -2
- data/lib/grafeas/v1/vulnerability_pb.rb +7 -6
- data/lib/grafeas/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fecb264dfebc85d0171dfc0f9fbeb24c960fd7514c2de60fc98fca8bcf905cef
|
4
|
+
data.tar.gz: eb2195460145d81c127506ac71965b6e5e775633017c5761980337ea73c12775
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c0d00f84dfe73bc1a4c12db3ce11abf5891dfb45f11bbdcbc2242ca84acc572cbedb3169a431f92c9c08c9e13a2294be9dd5faa1a671b0d8ce76993b930548f
|
7
|
+
data.tar.gz: 55a61693ddd623f46b9b34bc143d2a5d87d8ef0f6f0ba4f29f6b154f10531ab09a12e4c2536644948f12a214c06abd423eab6bcc1ba23168bf23cd8d50d213d3
|
data/lib/grafeas.rb
CHANGED
@@ -131,6 +131,10 @@ module Grafeas
|
|
131
131
|
# The default timeout, in seconds, for calls made through this client.
|
132
132
|
# @param metadata [Hash]
|
133
133
|
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
134
|
+
# @param service_address [String]
|
135
|
+
# Override for the service hostname, or `nil` to leave as the default.
|
136
|
+
# @param service_port [Integer]
|
137
|
+
# Override for the service port, or `nil` to leave as the default.
|
134
138
|
# @param exception_transformer [Proc]
|
135
139
|
# An optional proc that intercepts any exceptions raised during an API call to inject
|
136
140
|
# custom error handling.
|
data/lib/grafeas/v1.rb
CHANGED
@@ -119,6 +119,10 @@ module Grafeas
|
|
119
119
|
# The default timeout, in seconds, for calls made through this client.
|
120
120
|
# @param metadata [Hash]
|
121
121
|
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
122
|
+
# @param service_address [String]
|
123
|
+
# Override for the service hostname, or `nil` to leave as the default.
|
124
|
+
# @param service_port [Integer]
|
125
|
+
# Override for the service port, or `nil` to leave as the default.
|
122
126
|
# @param exception_transformer [Proc]
|
123
127
|
# An optional proc that intercepts any exceptions raised during an API call to inject
|
124
128
|
# custom error handling.
|
@@ -128,6 +132,8 @@ module Grafeas
|
|
128
132
|
client_config: nil,
|
129
133
|
timeout: nil,
|
130
134
|
metadata: nil,
|
135
|
+
service_address: nil,
|
136
|
+
service_port: nil,
|
131
137
|
exception_transformer: nil,
|
132
138
|
lib_name: nil,
|
133
139
|
lib_version: nil
|
@@ -139,6 +145,8 @@ module Grafeas
|
|
139
145
|
metadata: metadata,
|
140
146
|
exception_transformer: exception_transformer,
|
141
147
|
lib_name: lib_name,
|
148
|
+
service_address: service_address,
|
149
|
+
service_port: service_port,
|
142
150
|
lib_version: lib_version
|
143
151
|
}.select { |_, v| v != nil }
|
144
152
|
Grafeas::V1::GrafeasClient.new(**kwargs)
|
@@ -55,22 +55,39 @@ module Grafeas
|
|
55
55
|
# @!attribute [rw] affected_package
|
56
56
|
# @return [String]
|
57
57
|
# Required. The package this vulnerability affects.
|
58
|
-
# @!attribute [rw]
|
58
|
+
# @!attribute [rw] affected_version_start
|
59
59
|
# @return [Grafeas::V1::Version]
|
60
|
-
#
|
60
|
+
# The version number at the start of an interval in which this
|
61
|
+
# vulnerability exists. A vulnerability can affect a package between
|
62
|
+
# version numbers that are disjoint sets of intervals (example:
|
63
|
+
# [1.0.0-1.1.0], [2.4.6-2.4.8] and [4.5.6-4.6.8]) each of which will be
|
64
|
+
# represented in its own Detail. If a specific affected version is provided
|
65
|
+
# by a vulnerability database, affected_version_start and
|
66
|
+
# affected_version_end will be the same in that Detail.
|
67
|
+
# @!attribute [rw] affected_version_end
|
68
|
+
# @return [Grafeas::V1::Version]
|
69
|
+
# The version number at the end of an interval in which this vulnerability
|
70
|
+
# exists. A vulnerability can affect a package between version numbers
|
71
|
+
# that are disjoint sets of intervals (example: [1.0.0-1.1.0],
|
72
|
+
# [2.4.6-2.4.8] and [4.5.6-4.6.8]) each of which will be represented in its
|
73
|
+
# own Detail. If a specific affected version is provided by a vulnerability
|
74
|
+
# database, affected_version_start and affected_version_end will be the
|
75
|
+
# same in that Detail.
|
61
76
|
# @!attribute [rw] fixed_cpe_uri
|
62
77
|
# @return [String]
|
63
|
-
# The [CPE URI](https://cpe.mitre.org/specification/)
|
64
|
-
#
|
65
|
-
# affected_cpe_uri.
|
78
|
+
# The distro recommended [CPE URI](https://cpe.mitre.org/specification/)
|
79
|
+
# to update to that contains a fix for this vulnerability. It is possible
|
80
|
+
# for this to be different from the affected_cpe_uri.
|
66
81
|
# @!attribute [rw] fixed_package
|
67
82
|
# @return [String]
|
68
|
-
# The package
|
69
|
-
# be different from the
|
83
|
+
# The distro recommended package to update to that contains a fix for this
|
84
|
+
# vulnerability. It is possible for this to be different from the
|
85
|
+
# affected_package.
|
70
86
|
# @!attribute [rw] fixed_version
|
71
87
|
# @return [Grafeas::V1::Version]
|
72
|
-
#
|
73
|
-
# Setting this to VersionKind.MAXIMUM means no
|
88
|
+
# The distro recommended version to update to that contains a
|
89
|
+
# fix for this vulnerability. Setting this to VersionKind.MAXIMUM means no
|
90
|
+
# such version is yet available.
|
74
91
|
# @!attribute [rw] is_obsolete
|
75
92
|
# @return [true, false]
|
76
93
|
# Whether this detail is obsolete. Occurrences are expected not to point to
|
@@ -150,10 +167,10 @@ module Grafeas
|
|
150
167
|
# @!attribute [rw] affected_package
|
151
168
|
# @return [String]
|
152
169
|
# Required. The package this vulnerability was found in.
|
153
|
-
# @!attribute [rw]
|
170
|
+
# @!attribute [rw] affected_version
|
154
171
|
# @return [Grafeas::V1::Version]
|
155
|
-
# Required. The
|
156
|
-
#
|
172
|
+
# Required. The version of the package that is installed on the resource
|
173
|
+
# affected by this vulnerability.
|
157
174
|
# @!attribute [rw] fixed_cpe_uri
|
158
175
|
# @return [String]
|
159
176
|
# The [CPE URI](https://cpe.mitre.org/specification/) this vulnerability
|
@@ -162,6 +162,10 @@ module Grafeas
|
|
162
162
|
# The default timeout, in seconds, for calls made through this client.
|
163
163
|
# @param metadata [Hash]
|
164
164
|
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
165
|
+
# @param service_address [String]
|
166
|
+
# Override for the service hostname, or `nil` to leave as the default.
|
167
|
+
# @param service_port [Integer]
|
168
|
+
# Override for the service port, or `nil` to leave as the default.
|
165
169
|
# @param exception_transformer [Proc]
|
166
170
|
# An optional proc that intercepts any exceptions raised during an API call to inject
|
167
171
|
# custom error handling.
|
@@ -171,6 +175,8 @@ module Grafeas
|
|
171
175
|
client_config: {},
|
172
176
|
timeout: DEFAULT_TIMEOUT,
|
173
177
|
metadata: nil,
|
178
|
+
service_address: nil,
|
179
|
+
service_port: nil,
|
174
180
|
exception_transformer: nil,
|
175
181
|
lib_name: nil,
|
176
182
|
lib_version: ""
|
@@ -225,8 +231,8 @@ module Grafeas
|
|
225
231
|
end
|
226
232
|
|
227
233
|
# Allow overriding the service path/port in subclasses.
|
228
|
-
service_path = self.class::SERVICE_ADDRESS
|
229
|
-
port = self.class::DEFAULT_SERVICE_PORT
|
234
|
+
service_path = service_address || self.class::SERVICE_ADDRESS
|
235
|
+
port = service_port || self.class::DEFAULT_SERVICE_PORT
|
230
236
|
interceptors = self.class::GRPC_INTERCEPTORS
|
231
237
|
@grafeas_stub = Google::Gax::Grpc.create_stub(
|
232
238
|
service_path,
|
@@ -21,11 +21,12 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
21
21
|
optional :package_type, :string, 3
|
22
22
|
optional :affected_cpe_uri, :string, 4
|
23
23
|
optional :affected_package, :string, 5
|
24
|
-
optional :
|
25
|
-
optional :
|
26
|
-
optional :
|
27
|
-
optional :
|
28
|
-
optional :
|
24
|
+
optional :affected_version_start, :message, 6, "grafeas.v1.Version"
|
25
|
+
optional :affected_version_end, :message, 7, "grafeas.v1.Version"
|
26
|
+
optional :fixed_cpe_uri, :string, 8
|
27
|
+
optional :fixed_package, :string, 9
|
28
|
+
optional :fixed_version, :message, 10, "grafeas.v1.Version"
|
29
|
+
optional :is_obsolete, :bool, 11
|
29
30
|
end
|
30
31
|
add_message "grafeas.v1.VulnerabilityNote.WindowsDetail" do
|
31
32
|
optional :cpe_uri, :string, 1
|
@@ -51,7 +52,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
51
52
|
add_message "grafeas.v1.VulnerabilityOccurrence.PackageIssue" do
|
52
53
|
optional :affected_cpe_uri, :string, 1
|
53
54
|
optional :affected_package, :string, 2
|
54
|
-
optional :
|
55
|
+
optional :affected_version, :message, 3, "grafeas.v1.Version"
|
55
56
|
optional :fixed_cpe_uri, :string, 4
|
56
57
|
optional :fixed_package, :string, 5
|
57
58
|
optional :fixed_version, :message, 6, "grafeas.v1.Version"
|
data/lib/grafeas/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grafeas-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-gax
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.7'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
26
|
+
version: '1.7'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: grpc-google-iam-v1
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|