google-cloud-confidential_computing-v1 0.a → 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.
- checksums.yaml +4 -4
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +149 -0
- data/README.md +144 -8
- data/lib/google/cloud/confidential_computing/v1/bindings_override.rb +102 -0
- data/lib/google/cloud/confidential_computing/v1/confidential_computing/client.rb +517 -0
- data/lib/google/cloud/confidential_computing/v1/confidential_computing/credentials.rb +47 -0
- data/lib/google/cloud/confidential_computing/v1/confidential_computing/paths.rb +69 -0
- data/lib/google/cloud/confidential_computing/v1/confidential_computing/rest/client.rb +459 -0
- data/lib/google/cloud/confidential_computing/v1/confidential_computing/rest/service_stub.rb +168 -0
- data/lib/google/cloud/confidential_computing/v1/confidential_computing/rest.rb +53 -0
- data/lib/google/cloud/confidential_computing/v1/confidential_computing.rb +55 -0
- data/lib/google/cloud/confidential_computing/v1/rest.rb +38 -0
- data/lib/google/cloud/confidential_computing/v1/version.rb +7 -2
- data/lib/google/cloud/confidential_computing/v1.rb +45 -0
- data/lib/google/cloud/confidentialcomputing/v1/service_pb.rb +66 -0
- data/lib/google/cloud/confidentialcomputing/v1/service_services_pb.rb +47 -0
- data/lib/google-cloud-confidential_computing-v1.rb +21 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/client.rb +372 -0
- data/proto_docs/google/api/field_behavior.rb +71 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/api/resource.rb +222 -0
- data/proto_docs/google/cloud/confidentialcomputing/v1/service.rb +159 -0
- data/proto_docs/google/protobuf/any.rb +141 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/timestamp.rb +129 -0
- metadata +202 -12
@@ -0,0 +1,517 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "google/cloud/errors"
|
20
|
+
require "google/cloud/confidentialcomputing/v1/service_pb"
|
21
|
+
require "google/cloud/location"
|
22
|
+
|
23
|
+
module Google
|
24
|
+
module Cloud
|
25
|
+
module ConfidentialComputing
|
26
|
+
module V1
|
27
|
+
module ConfidentialComputing
|
28
|
+
##
|
29
|
+
# Client for the ConfidentialComputing service.
|
30
|
+
#
|
31
|
+
# Service describing handlers for resources
|
32
|
+
#
|
33
|
+
class Client
|
34
|
+
include Paths
|
35
|
+
|
36
|
+
# @private
|
37
|
+
attr_reader :confidential_computing_stub
|
38
|
+
|
39
|
+
##
|
40
|
+
# Configure the ConfidentialComputing Client class.
|
41
|
+
#
|
42
|
+
# See {::Google::Cloud::ConfidentialComputing::V1::ConfidentialComputing::Client::Configuration}
|
43
|
+
# for a description of the configuration fields.
|
44
|
+
#
|
45
|
+
# @example
|
46
|
+
#
|
47
|
+
# # Modify the configuration for all ConfidentialComputing clients
|
48
|
+
# ::Google::Cloud::ConfidentialComputing::V1::ConfidentialComputing::Client.configure do |config|
|
49
|
+
# config.timeout = 10.0
|
50
|
+
# end
|
51
|
+
#
|
52
|
+
# @yield [config] Configure the Client client.
|
53
|
+
# @yieldparam config [Client::Configuration]
|
54
|
+
#
|
55
|
+
# @return [Client::Configuration]
|
56
|
+
#
|
57
|
+
def self.configure
|
58
|
+
@configure ||= begin
|
59
|
+
namespace = ["Google", "Cloud", "ConfidentialComputing", "V1"]
|
60
|
+
parent_config = while namespace.any?
|
61
|
+
parent_name = namespace.join "::"
|
62
|
+
parent_const = const_get parent_name
|
63
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
64
|
+
namespace.pop
|
65
|
+
end
|
66
|
+
default_config = Client::Configuration.new parent_config
|
67
|
+
|
68
|
+
default_config.timeout = 60.0
|
69
|
+
|
70
|
+
default_config.rpcs.create_challenge.timeout = 60.0
|
71
|
+
default_config.rpcs.create_challenge.retry_policy = {
|
72
|
+
initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
73
|
+
}
|
74
|
+
|
75
|
+
default_config.rpcs.verify_attestation.timeout = 60.0
|
76
|
+
default_config.rpcs.verify_attestation.retry_policy = {
|
77
|
+
initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
78
|
+
}
|
79
|
+
|
80
|
+
default_config
|
81
|
+
end
|
82
|
+
yield @configure if block_given?
|
83
|
+
@configure
|
84
|
+
end
|
85
|
+
|
86
|
+
##
|
87
|
+
# Configure the ConfidentialComputing Client instance.
|
88
|
+
#
|
89
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
90
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
91
|
+
# should be made on {Client.configure}.
|
92
|
+
#
|
93
|
+
# See {::Google::Cloud::ConfidentialComputing::V1::ConfidentialComputing::Client::Configuration}
|
94
|
+
# for a description of the configuration fields.
|
95
|
+
#
|
96
|
+
# @yield [config] Configure the Client client.
|
97
|
+
# @yieldparam config [Client::Configuration]
|
98
|
+
#
|
99
|
+
# @return [Client::Configuration]
|
100
|
+
#
|
101
|
+
def configure
|
102
|
+
yield @config if block_given?
|
103
|
+
@config
|
104
|
+
end
|
105
|
+
|
106
|
+
##
|
107
|
+
# Create a new ConfidentialComputing client object.
|
108
|
+
#
|
109
|
+
# @example
|
110
|
+
#
|
111
|
+
# # Create a client using the default configuration
|
112
|
+
# client = ::Google::Cloud::ConfidentialComputing::V1::ConfidentialComputing::Client.new
|
113
|
+
#
|
114
|
+
# # Create a client using a custom configuration
|
115
|
+
# client = ::Google::Cloud::ConfidentialComputing::V1::ConfidentialComputing::Client.new do |config|
|
116
|
+
# config.timeout = 10.0
|
117
|
+
# end
|
118
|
+
#
|
119
|
+
# @yield [config] Configure the ConfidentialComputing client.
|
120
|
+
# @yieldparam config [Client::Configuration]
|
121
|
+
#
|
122
|
+
def initialize
|
123
|
+
# These require statements are intentionally placed here to initialize
|
124
|
+
# the gRPC module only when it's required.
|
125
|
+
# See https://github.com/googleapis/toolkit/issues/446
|
126
|
+
require "gapic/grpc"
|
127
|
+
require "google/cloud/confidentialcomputing/v1/service_services_pb"
|
128
|
+
|
129
|
+
# Create the configuration object
|
130
|
+
@config = Configuration.new Client.configure
|
131
|
+
|
132
|
+
# Yield the configuration if needed
|
133
|
+
yield @config if block_given?
|
134
|
+
|
135
|
+
# Create credentials
|
136
|
+
credentials = @config.credentials
|
137
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
138
|
+
# but only if the default endpoint does not have a region prefix.
|
139
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
140
|
+
!@config.endpoint.split(".").first.include?("-")
|
141
|
+
credentials ||= Credentials.default scope: @config.scope,
|
142
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
143
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
144
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
145
|
+
end
|
146
|
+
@quota_project_id = @config.quota_project
|
147
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
148
|
+
|
149
|
+
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
150
|
+
config.credentials = credentials
|
151
|
+
config.quota_project = @quota_project_id
|
152
|
+
config.endpoint = @config.endpoint
|
153
|
+
end
|
154
|
+
|
155
|
+
@confidential_computing_stub = ::Gapic::ServiceStub.new(
|
156
|
+
::Google::Cloud::ConfidentialComputing::V1::ConfidentialComputing::Stub,
|
157
|
+
credentials: credentials,
|
158
|
+
endpoint: @config.endpoint,
|
159
|
+
channel_args: @config.channel_args,
|
160
|
+
interceptors: @config.interceptors
|
161
|
+
)
|
162
|
+
end
|
163
|
+
|
164
|
+
##
|
165
|
+
# Get the associated client for mix-in of the Locations.
|
166
|
+
#
|
167
|
+
# @return [Google::Cloud::Location::Locations::Client]
|
168
|
+
#
|
169
|
+
attr_reader :location_client
|
170
|
+
|
171
|
+
# Service calls
|
172
|
+
|
173
|
+
##
|
174
|
+
# Creates a new Challenge in a given project and location.
|
175
|
+
#
|
176
|
+
# @overload create_challenge(request, options = nil)
|
177
|
+
# Pass arguments to `create_challenge` via a request object, either of type
|
178
|
+
# {::Google::Cloud::ConfidentialComputing::V1::CreateChallengeRequest} or an equivalent Hash.
|
179
|
+
#
|
180
|
+
# @param request [::Google::Cloud::ConfidentialComputing::V1::CreateChallengeRequest, ::Hash]
|
181
|
+
# A request object representing the call parameters. Required. To specify no
|
182
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
183
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
184
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
185
|
+
#
|
186
|
+
# @overload create_challenge(parent: nil, challenge: nil)
|
187
|
+
# Pass arguments to `create_challenge` via keyword arguments. Note that at
|
188
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
189
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
190
|
+
#
|
191
|
+
# @param parent [::String]
|
192
|
+
# Required. The resource name of the location where the Challenge will be
|
193
|
+
# used, in the format `projects/*/locations/*`.
|
194
|
+
# @param challenge [::Google::Cloud::ConfidentialComputing::V1::Challenge, ::Hash]
|
195
|
+
# Required. The Challenge to be created. Currently this field can be empty as
|
196
|
+
# all the Challenge fields are set by the server.
|
197
|
+
#
|
198
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
199
|
+
# @yieldparam response [::Google::Cloud::ConfidentialComputing::V1::Challenge]
|
200
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
201
|
+
#
|
202
|
+
# @return [::Google::Cloud::ConfidentialComputing::V1::Challenge]
|
203
|
+
#
|
204
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
205
|
+
#
|
206
|
+
# @example Basic example
|
207
|
+
# require "google/cloud/confidential_computing/v1"
|
208
|
+
#
|
209
|
+
# # Create a client object. The client can be reused for multiple calls.
|
210
|
+
# client = Google::Cloud::ConfidentialComputing::V1::ConfidentialComputing::Client.new
|
211
|
+
#
|
212
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
213
|
+
# request = Google::Cloud::ConfidentialComputing::V1::CreateChallengeRequest.new
|
214
|
+
#
|
215
|
+
# # Call the create_challenge method.
|
216
|
+
# result = client.create_challenge request
|
217
|
+
#
|
218
|
+
# # The returned object is of type Google::Cloud::ConfidentialComputing::V1::Challenge.
|
219
|
+
# p result
|
220
|
+
#
|
221
|
+
def create_challenge request, options = nil
|
222
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
223
|
+
|
224
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfidentialComputing::V1::CreateChallengeRequest
|
225
|
+
|
226
|
+
# Converts hash and nil to an options object
|
227
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
228
|
+
|
229
|
+
# Customize the options with defaults
|
230
|
+
metadata = @config.rpcs.create_challenge.metadata.to_h
|
231
|
+
|
232
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
233
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
234
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
235
|
+
gapic_version: ::Google::Cloud::ConfidentialComputing::V1::VERSION
|
236
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
237
|
+
|
238
|
+
header_params = {}
|
239
|
+
if request.parent
|
240
|
+
header_params["parent"] = request.parent
|
241
|
+
end
|
242
|
+
|
243
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
244
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
245
|
+
|
246
|
+
options.apply_defaults timeout: @config.rpcs.create_challenge.timeout,
|
247
|
+
metadata: metadata,
|
248
|
+
retry_policy: @config.rpcs.create_challenge.retry_policy
|
249
|
+
|
250
|
+
options.apply_defaults timeout: @config.timeout,
|
251
|
+
metadata: @config.metadata,
|
252
|
+
retry_policy: @config.retry_policy
|
253
|
+
|
254
|
+
@confidential_computing_stub.call_rpc :create_challenge, request, options: options do |response, operation|
|
255
|
+
yield response, operation if block_given?
|
256
|
+
return response
|
257
|
+
end
|
258
|
+
rescue ::GRPC::BadStatus => e
|
259
|
+
raise ::Google::Cloud::Error.from_error(e)
|
260
|
+
end
|
261
|
+
|
262
|
+
##
|
263
|
+
# Verifies the provided attestation info, returning a signed OIDC token.
|
264
|
+
#
|
265
|
+
# @overload verify_attestation(request, options = nil)
|
266
|
+
# Pass arguments to `verify_attestation` via a request object, either of type
|
267
|
+
# {::Google::Cloud::ConfidentialComputing::V1::VerifyAttestationRequest} or an equivalent Hash.
|
268
|
+
#
|
269
|
+
# @param request [::Google::Cloud::ConfidentialComputing::V1::VerifyAttestationRequest, ::Hash]
|
270
|
+
# A request object representing the call parameters. Required. To specify no
|
271
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
272
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
273
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
274
|
+
#
|
275
|
+
# @overload verify_attestation(challenge: nil, gcp_credentials: nil, tpm_attestation: nil)
|
276
|
+
# Pass arguments to `verify_attestation` via keyword arguments. Note that at
|
277
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
278
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
279
|
+
#
|
280
|
+
# @param challenge [::String]
|
281
|
+
# Required. The name of the Challenge whose nonce was used to generate the
|
282
|
+
# attestation, in the format `projects/*/locations/*/challenges/*`. The
|
283
|
+
# provided Challenge will be consumed, and cannot be used again.
|
284
|
+
# @param gcp_credentials [::Google::Cloud::ConfidentialComputing::V1::GcpCredentials, ::Hash]
|
285
|
+
# Optional. Credentials used to populate the "emails" claim in the
|
286
|
+
# claims_token.
|
287
|
+
# @param tpm_attestation [::Google::Cloud::ConfidentialComputing::V1::TpmAttestation, ::Hash]
|
288
|
+
# Required. The TPM-specific data provided by the attesting platform, used to
|
289
|
+
# populate any of the claims regarding platform state.
|
290
|
+
#
|
291
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
292
|
+
# @yieldparam response [::Google::Cloud::ConfidentialComputing::V1::VerifyAttestationResponse]
|
293
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
294
|
+
#
|
295
|
+
# @return [::Google::Cloud::ConfidentialComputing::V1::VerifyAttestationResponse]
|
296
|
+
#
|
297
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
298
|
+
#
|
299
|
+
# @example Basic example
|
300
|
+
# require "google/cloud/confidential_computing/v1"
|
301
|
+
#
|
302
|
+
# # Create a client object. The client can be reused for multiple calls.
|
303
|
+
# client = Google::Cloud::ConfidentialComputing::V1::ConfidentialComputing::Client.new
|
304
|
+
#
|
305
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
306
|
+
# request = Google::Cloud::ConfidentialComputing::V1::VerifyAttestationRequest.new
|
307
|
+
#
|
308
|
+
# # Call the verify_attestation method.
|
309
|
+
# result = client.verify_attestation request
|
310
|
+
#
|
311
|
+
# # The returned object is of type Google::Cloud::ConfidentialComputing::V1::VerifyAttestationResponse.
|
312
|
+
# p result
|
313
|
+
#
|
314
|
+
def verify_attestation request, options = nil
|
315
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
316
|
+
|
317
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfidentialComputing::V1::VerifyAttestationRequest
|
318
|
+
|
319
|
+
# Converts hash and nil to an options object
|
320
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
321
|
+
|
322
|
+
# Customize the options with defaults
|
323
|
+
metadata = @config.rpcs.verify_attestation.metadata.to_h
|
324
|
+
|
325
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
326
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
327
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
328
|
+
gapic_version: ::Google::Cloud::ConfidentialComputing::V1::VERSION
|
329
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
330
|
+
|
331
|
+
header_params = {}
|
332
|
+
if request.challenge
|
333
|
+
header_params["challenge"] = request.challenge
|
334
|
+
end
|
335
|
+
|
336
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
337
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
338
|
+
|
339
|
+
options.apply_defaults timeout: @config.rpcs.verify_attestation.timeout,
|
340
|
+
metadata: metadata,
|
341
|
+
retry_policy: @config.rpcs.verify_attestation.retry_policy
|
342
|
+
|
343
|
+
options.apply_defaults timeout: @config.timeout,
|
344
|
+
metadata: @config.metadata,
|
345
|
+
retry_policy: @config.retry_policy
|
346
|
+
|
347
|
+
@confidential_computing_stub.call_rpc :verify_attestation, request, options: options do |response, operation|
|
348
|
+
yield response, operation if block_given?
|
349
|
+
return response
|
350
|
+
end
|
351
|
+
rescue ::GRPC::BadStatus => e
|
352
|
+
raise ::Google::Cloud::Error.from_error(e)
|
353
|
+
end
|
354
|
+
|
355
|
+
##
|
356
|
+
# Configuration class for the ConfidentialComputing API.
|
357
|
+
#
|
358
|
+
# This class represents the configuration for ConfidentialComputing,
|
359
|
+
# providing control over timeouts, retry behavior, logging, transport
|
360
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
361
|
+
# applied individually to specific RPCs. See
|
362
|
+
# {::Google::Cloud::ConfidentialComputing::V1::ConfidentialComputing::Client::Configuration::Rpcs}
|
363
|
+
# for a list of RPCs that can be configured independently.
|
364
|
+
#
|
365
|
+
# Configuration can be applied globally to all clients, or to a single client
|
366
|
+
# on construction.
|
367
|
+
#
|
368
|
+
# @example
|
369
|
+
#
|
370
|
+
# # Modify the global config, setting the timeout for
|
371
|
+
# # create_challenge to 20 seconds,
|
372
|
+
# # and all remaining timeouts to 10 seconds.
|
373
|
+
# ::Google::Cloud::ConfidentialComputing::V1::ConfidentialComputing::Client.configure do |config|
|
374
|
+
# config.timeout = 10.0
|
375
|
+
# config.rpcs.create_challenge.timeout = 20.0
|
376
|
+
# end
|
377
|
+
#
|
378
|
+
# # Apply the above configuration only to a new client.
|
379
|
+
# client = ::Google::Cloud::ConfidentialComputing::V1::ConfidentialComputing::Client.new do |config|
|
380
|
+
# config.timeout = 10.0
|
381
|
+
# config.rpcs.create_challenge.timeout = 20.0
|
382
|
+
# end
|
383
|
+
#
|
384
|
+
# @!attribute [rw] endpoint
|
385
|
+
# The hostname or hostname:port of the service endpoint.
|
386
|
+
# Defaults to `"confidentialcomputing.googleapis.com"`.
|
387
|
+
# @return [::String]
|
388
|
+
# @!attribute [rw] credentials
|
389
|
+
# Credentials to send with calls. You may provide any of the following types:
|
390
|
+
# * (`String`) The path to a service account key file in JSON format
|
391
|
+
# * (`Hash`) A service account key as a Hash
|
392
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
393
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
394
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
395
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
396
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
397
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
398
|
+
# * (`nil`) indicating no credentials
|
399
|
+
# @return [::Object]
|
400
|
+
# @!attribute [rw] scope
|
401
|
+
# The OAuth scopes
|
402
|
+
# @return [::Array<::String>]
|
403
|
+
# @!attribute [rw] lib_name
|
404
|
+
# The library name as recorded in instrumentation and logging
|
405
|
+
# @return [::String]
|
406
|
+
# @!attribute [rw] lib_version
|
407
|
+
# The library version as recorded in instrumentation and logging
|
408
|
+
# @return [::String]
|
409
|
+
# @!attribute [rw] channel_args
|
410
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
411
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
412
|
+
# @return [::Hash]
|
413
|
+
# @!attribute [rw] interceptors
|
414
|
+
# An array of interceptors that are run before calls are executed.
|
415
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
416
|
+
# @!attribute [rw] timeout
|
417
|
+
# The call timeout in seconds.
|
418
|
+
# @return [::Numeric]
|
419
|
+
# @!attribute [rw] metadata
|
420
|
+
# Additional gRPC headers to be sent with the call.
|
421
|
+
# @return [::Hash{::Symbol=>::String}]
|
422
|
+
# @!attribute [rw] retry_policy
|
423
|
+
# The retry policy. The value is a hash with the following keys:
|
424
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
425
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
426
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
427
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
428
|
+
# trigger a retry.
|
429
|
+
# @return [::Hash]
|
430
|
+
# @!attribute [rw] quota_project
|
431
|
+
# A separate project against which to charge quota.
|
432
|
+
# @return [::String]
|
433
|
+
#
|
434
|
+
class Configuration
|
435
|
+
extend ::Gapic::Config
|
436
|
+
|
437
|
+
config_attr :endpoint, "confidentialcomputing.googleapis.com", ::String
|
438
|
+
config_attr :credentials, nil do |value|
|
439
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
440
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
441
|
+
allowed.any? { |klass| klass === value }
|
442
|
+
end
|
443
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
444
|
+
config_attr :lib_name, nil, ::String, nil
|
445
|
+
config_attr :lib_version, nil, ::String, nil
|
446
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
447
|
+
config_attr :interceptors, nil, ::Array, nil
|
448
|
+
config_attr :timeout, nil, ::Numeric, nil
|
449
|
+
config_attr :metadata, nil, ::Hash, nil
|
450
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
451
|
+
config_attr :quota_project, nil, ::String, nil
|
452
|
+
|
453
|
+
# @private
|
454
|
+
def initialize parent_config = nil
|
455
|
+
@parent_config = parent_config unless parent_config.nil?
|
456
|
+
|
457
|
+
yield self if block_given?
|
458
|
+
end
|
459
|
+
|
460
|
+
##
|
461
|
+
# Configurations for individual RPCs
|
462
|
+
# @return [Rpcs]
|
463
|
+
#
|
464
|
+
def rpcs
|
465
|
+
@rpcs ||= begin
|
466
|
+
parent_rpcs = nil
|
467
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
468
|
+
Rpcs.new parent_rpcs
|
469
|
+
end
|
470
|
+
end
|
471
|
+
|
472
|
+
##
|
473
|
+
# Configuration RPC class for the ConfidentialComputing API.
|
474
|
+
#
|
475
|
+
# Includes fields providing the configuration for each RPC in this service.
|
476
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
477
|
+
# the following configuration fields:
|
478
|
+
#
|
479
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
480
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
481
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
482
|
+
# include the following keys:
|
483
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
484
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
485
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
486
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
487
|
+
# trigger a retry.
|
488
|
+
#
|
489
|
+
class Rpcs
|
490
|
+
##
|
491
|
+
# RPC-specific configuration for `create_challenge`
|
492
|
+
# @return [::Gapic::Config::Method]
|
493
|
+
#
|
494
|
+
attr_reader :create_challenge
|
495
|
+
##
|
496
|
+
# RPC-specific configuration for `verify_attestation`
|
497
|
+
# @return [::Gapic::Config::Method]
|
498
|
+
#
|
499
|
+
attr_reader :verify_attestation
|
500
|
+
|
501
|
+
# @private
|
502
|
+
def initialize parent_rpcs = nil
|
503
|
+
create_challenge_config = parent_rpcs.create_challenge if parent_rpcs.respond_to? :create_challenge
|
504
|
+
@create_challenge = ::Gapic::Config::Method.new create_challenge_config
|
505
|
+
verify_attestation_config = parent_rpcs.verify_attestation if parent_rpcs.respond_to? :verify_attestation
|
506
|
+
@verify_attestation = ::Gapic::Config::Method.new verify_attestation_config
|
507
|
+
|
508
|
+
yield self if block_given?
|
509
|
+
end
|
510
|
+
end
|
511
|
+
end
|
512
|
+
end
|
513
|
+
end
|
514
|
+
end
|
515
|
+
end
|
516
|
+
end
|
517
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "googleauth"
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Cloud
|
23
|
+
module ConfidentialComputing
|
24
|
+
module V1
|
25
|
+
module ConfidentialComputing
|
26
|
+
# Credentials for the ConfidentialComputing API.
|
27
|
+
class Credentials < ::Google::Auth::Credentials
|
28
|
+
self.scope = [
|
29
|
+
"https://www.googleapis.com/auth/cloud-platform"
|
30
|
+
]
|
31
|
+
self.env_vars = [
|
32
|
+
"GOOGLE_CLOUD_CREDENTIALS",
|
33
|
+
"GOOGLE_CLOUD_KEYFILE",
|
34
|
+
"GCLOUD_KEYFILE",
|
35
|
+
"GOOGLE_CLOUD_CREDENTIALS_JSON",
|
36
|
+
"GOOGLE_CLOUD_KEYFILE_JSON",
|
37
|
+
"GCLOUD_KEYFILE_JSON"
|
38
|
+
]
|
39
|
+
self.paths = [
|
40
|
+
"~/.config/google_cloud/application_default_credentials.json"
|
41
|
+
]
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Cloud
|
22
|
+
module ConfidentialComputing
|
23
|
+
module V1
|
24
|
+
module ConfidentialComputing
|
25
|
+
# Path helper methods for the ConfidentialComputing API.
|
26
|
+
module Paths
|
27
|
+
##
|
28
|
+
# Create a fully-qualified Challenge resource string.
|
29
|
+
#
|
30
|
+
# The resource will be in the following format:
|
31
|
+
#
|
32
|
+
# `projects/{project}/locations/{location}/challenges/{uuid}`
|
33
|
+
#
|
34
|
+
# @param project [String]
|
35
|
+
# @param location [String]
|
36
|
+
# @param uuid [String]
|
37
|
+
#
|
38
|
+
# @return [::String]
|
39
|
+
def challenge_path project:, location:, uuid:
|
40
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
41
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
42
|
+
|
43
|
+
"projects/#{project}/locations/#{location}/challenges/#{uuid}"
|
44
|
+
end
|
45
|
+
|
46
|
+
##
|
47
|
+
# Create a fully-qualified Location resource string.
|
48
|
+
#
|
49
|
+
# The resource will be in the following format:
|
50
|
+
#
|
51
|
+
# `projects/{project}/locations/{location}`
|
52
|
+
#
|
53
|
+
# @param project [String]
|
54
|
+
# @param location [String]
|
55
|
+
#
|
56
|
+
# @return [::String]
|
57
|
+
def location_path project:, location:
|
58
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
59
|
+
|
60
|
+
"projects/#{project}/locations/#{location}"
|
61
|
+
end
|
62
|
+
|
63
|
+
extend self
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|