google-cloud-confidential_computing-v1 1.2.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7d6cb6f45afcee01df52b5d3647530f48326518d3c6198e42faa67d74a50fd8c
4
- data.tar.gz: 0d3b72403cabcd74bacb22586e53a896c9f90a671817aab98eb504f7ea1209a9
3
+ metadata.gz: c950bfd2db670f1c8019b285f44faebe042ed46cc58b5493781fc0f9655cc984
4
+ data.tar.gz: 5b4e0121358facbd0d5c4ee4b4b10b91efd1ceb7a5b49f5a2e09f34caba2a60a
5
5
  SHA512:
6
- metadata.gz: 0de4c6ebe465a4063f38a696e602176b32e46c9c1ef6f64e61865eb663bb1304a0f8fb83079932aedfbfc7269243bfc59d83565c6451f408d8859c5a1063661d
7
- data.tar.gz: 56f58921cca4622341d6543f4dda0489725f393a3058e5391f6de6f1e456b6d1f8be9f1ad00cc02fb048a21d2f8c44b4a04d89352411fec1dd40f472e73457ed
6
+ metadata.gz: 91cfc15248f36a8b5c727825774be43e224d2c95afaa8b7d3e33425cad8c503f8c47a32f2fceb1398ca72435f18c67aca1eb845d91fb7483b2ec84be17873bbe
7
+ data.tar.gz: 562a6c442e3ea6360e3721c32a8638e8b611fb5297b1641b59caf8a7a58c55ad21a69c2bbb00b68869397dbab256ce4c20fc28fea258c74ae6da418afca33fcf
data/README.md CHANGED
@@ -42,40 +42,50 @@ for class and method documentation.
42
42
  See also the [Product Documentation](https://cloud.google.com/confidential-computing)
43
43
  for general usage information.
44
44
 
45
- ## Enabling Logging
46
-
47
- To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
48
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
49
- or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
50
- that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
51
- and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
52
-
53
- Configuring a Ruby stdlib logger:
45
+ ## Debug Logging
46
+
47
+ This library comes with opt-in Debug Logging that can help you troubleshoot
48
+ your application's integration with the API. When logging is activated, key
49
+ events such as requests and responses, along with data payloads and metadata
50
+ such as headers and client configuration, are logged to the standard error
51
+ stream.
52
+
53
+ **WARNING:** Client Library Debug Logging includes your data payloads in
54
+ plaintext, which could include sensitive data such as PII for yourself or your
55
+ customers, private keys, or other security data that could be compromising if
56
+ leaked. Always practice good data hygiene with your application logs, and follow
57
+ the principle of least access. Google also recommends that Client Library Debug
58
+ Logging be enabled only temporarily during active debugging, and not used
59
+ permanently in production.
60
+
61
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
62
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
63
+ list of client library gem names. This will select the default logging behavior,
64
+ which writes logs to the standard error stream. On a local workstation, this may
65
+ result in logs appearing on the console. When running on a Google Cloud hosting
66
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
67
+ results in logs appearing alongside your application logs in the
68
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
69
+
70
+ You can customize logging by modifying the `logger` configuration when
71
+ constructing a client object. For example:
54
72
 
55
73
  ```ruby
74
+ require "google/cloud/confidential_computing/v1"
56
75
  require "logger"
57
76
 
58
- module MyLogger
59
- LOGGER = Logger.new $stderr, level: Logger::WARN
60
- def logger
61
- LOGGER
62
- end
63
- end
64
-
65
- # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
66
- module GRPC
67
- extend MyLogger
77
+ client = ::Google::Cloud::ConfidentialComputing::V1::ConfidentialComputing::Client.new do |config|
78
+ config.logger = Logger.new "my-app.log"
68
79
  end
69
80
  ```
70
81
 
71
-
72
82
  ## Google Cloud Samples
73
83
 
74
84
  To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
75
85
 
76
86
  ## Supported Ruby Versions
77
87
 
78
- This library is supported on Ruby 2.7+.
88
+ This library is supported on Ruby 3.0+.
79
89
 
80
90
  Google provides official support for Ruby versions that are actively supported
81
91
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
@@ -170,14 +170,26 @@ module Google
170
170
  universe_domain: @config.universe_domain,
171
171
  channel_args: @config.channel_args,
172
172
  interceptors: @config.interceptors,
173
- channel_pool_config: @config.channel_pool
173
+ channel_pool_config: @config.channel_pool,
174
+ logger: @config.logger
174
175
  )
175
176
 
177
+ @confidential_computing_stub.stub_logger&.info do |entry|
178
+ entry.set_system_name
179
+ entry.set_service
180
+ entry.message = "Created client for #{entry.service}"
181
+ entry.set_credentials_fields credentials
182
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
183
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
184
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
185
+ end
186
+
176
187
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
177
188
  config.credentials = credentials
178
189
  config.quota_project = @quota_project_id
179
190
  config.endpoint = @confidential_computing_stub.endpoint
180
191
  config.universe_domain = @confidential_computing_stub.universe_domain
192
+ config.logger = @confidential_computing_stub.logger if config.respond_to? :logger=
181
193
  end
182
194
  end
183
195
 
@@ -188,6 +200,15 @@ module Google
188
200
  #
189
201
  attr_reader :location_client
190
202
 
203
+ ##
204
+ # The logger used for request/response debug logging.
205
+ #
206
+ # @return [Logger]
207
+ #
208
+ def logger
209
+ @confidential_computing_stub.logger
210
+ end
211
+
191
212
  # Service calls
192
213
 
193
214
  ##
@@ -274,7 +295,6 @@ module Google
274
295
 
275
296
  @confidential_computing_stub.call_rpc :create_challenge, request, options: options do |response, operation|
276
297
  yield response, operation if block_given?
277
- return response
278
298
  end
279
299
  rescue ::GRPC::BadStatus => e
280
300
  raise ::Google::Cloud::Error.from_error(e)
@@ -300,8 +320,12 @@ module Google
300
320
  #
301
321
  # @param td_ccel [::Google::Cloud::ConfidentialComputing::V1::TdxCcelAttestation, ::Hash]
302
322
  # Optional. A TDX with CCEL and RTMR Attestation Quote.
323
+ #
324
+ # Note: The following fields are mutually exclusive: `td_ccel`, `sev_snp_attestation`. If a field in that set is populated, all other fields in the set will automatically be cleared.
303
325
  # @param sev_snp_attestation [::Google::Cloud::ConfidentialComputing::V1::SevSnpAttestation, ::Hash]
304
326
  # Optional. An SEV-SNP Attestation Report.
327
+ #
328
+ # Note: The following fields are mutually exclusive: `sev_snp_attestation`, `td_ccel`. If a field in that set is populated, all other fields in the set will automatically be cleared.
305
329
  # @param challenge [::String]
306
330
  # Required. The name of the Challenge whose nonce was used to generate the
307
331
  # attestation, in the format `projects/*/locations/*/challenges/*`. The
@@ -377,7 +401,6 @@ module Google
377
401
 
378
402
  @confidential_computing_stub.call_rpc :verify_attestation, request, options: options do |response, operation|
379
403
  yield response, operation if block_given?
380
- return response
381
404
  end
382
405
  rescue ::GRPC::BadStatus => e
383
406
  raise ::Google::Cloud::Error.from_error(e)
@@ -427,6 +450,13 @@ module Google
427
450
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
428
451
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
429
452
  # * (`nil`) indicating no credentials
453
+ #
454
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
455
+ # external source for authentication to Google Cloud, you must validate it before
456
+ # providing it to a Google API client library. Providing an unvalidated credential
457
+ # configuration to Google APIs can compromise the security of your systems and data.
458
+ # For more information, refer to [Validate credential configurations from external
459
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
430
460
  # @return [::Object]
431
461
  # @!attribute [rw] scope
432
462
  # The OAuth scopes
@@ -466,6 +496,11 @@ module Google
466
496
  # default endpoint URL. The default value of nil uses the environment
467
497
  # universe (usually the default "googleapis.com" universe).
468
498
  # @return [::String,nil]
499
+ # @!attribute [rw] logger
500
+ # A custom logger to use for request/response debug logging, or the value
501
+ # `:default` (the default) to construct a default logger, or `nil` to
502
+ # explicitly disable logging.
503
+ # @return [::Logger,:default,nil]
469
504
  #
470
505
  class Configuration
471
506
  extend ::Gapic::Config
@@ -490,6 +525,7 @@ module Google
490
525
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
491
526
  config_attr :quota_project, nil, ::String, nil
492
527
  config_attr :universe_domain, nil, ::String, nil
528
+ config_attr :logger, :default, ::Logger, nil, :default
493
529
 
494
530
  # @private
495
531
  def initialize parent_config = nil
@@ -163,15 +163,27 @@ module Google
163
163
  endpoint: @config.endpoint,
164
164
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
165
165
  universe_domain: @config.universe_domain,
166
- credentials: credentials
166
+ credentials: credentials,
167
+ logger: @config.logger
167
168
  )
168
169
 
170
+ @confidential_computing_stub.logger(stub: true)&.info do |entry|
171
+ entry.set_system_name
172
+ entry.set_service
173
+ entry.message = "Created client for #{entry.service}"
174
+ entry.set_credentials_fields credentials
175
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
176
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
177
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
178
+ end
179
+
169
180
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
170
181
  config.credentials = credentials
171
182
  config.quota_project = @quota_project_id
172
183
  config.endpoint = @confidential_computing_stub.endpoint
173
184
  config.universe_domain = @confidential_computing_stub.universe_domain
174
185
  config.bindings_override = @config.bindings_override
186
+ config.logger = @confidential_computing_stub.logger if config.respond_to? :logger=
175
187
  end
176
188
  end
177
189
 
@@ -182,6 +194,15 @@ module Google
182
194
  #
183
195
  attr_reader :location_client
184
196
 
197
+ ##
198
+ # The logger used for request/response debug logging.
199
+ #
200
+ # @return [Logger]
201
+ #
202
+ def logger
203
+ @confidential_computing_stub.logger
204
+ end
205
+
185
206
  # Service calls
186
207
 
187
208
  ##
@@ -261,7 +282,6 @@ module Google
261
282
 
262
283
  @confidential_computing_stub.create_challenge request, options do |result, operation|
263
284
  yield result, operation if block_given?
264
- return result
265
285
  end
266
286
  rescue ::Gapic::Rest::Error => e
267
287
  raise ::Google::Cloud::Error.from_error(e)
@@ -287,8 +307,12 @@ module Google
287
307
  #
288
308
  # @param td_ccel [::Google::Cloud::ConfidentialComputing::V1::TdxCcelAttestation, ::Hash]
289
309
  # Optional. A TDX with CCEL and RTMR Attestation Quote.
310
+ #
311
+ # Note: The following fields are mutually exclusive: `td_ccel`, `sev_snp_attestation`. If a field in that set is populated, all other fields in the set will automatically be cleared.
290
312
  # @param sev_snp_attestation [::Google::Cloud::ConfidentialComputing::V1::SevSnpAttestation, ::Hash]
291
313
  # Optional. An SEV-SNP Attestation Report.
314
+ #
315
+ # Note: The following fields are mutually exclusive: `sev_snp_attestation`, `td_ccel`. If a field in that set is populated, all other fields in the set will automatically be cleared.
292
316
  # @param challenge [::String]
293
317
  # Required. The name of the Challenge whose nonce was used to generate the
294
318
  # attestation, in the format `projects/*/locations/*/challenges/*`. The
@@ -357,7 +381,6 @@ module Google
357
381
 
358
382
  @confidential_computing_stub.verify_attestation request, options do |result, operation|
359
383
  yield result, operation if block_given?
360
- return result
361
384
  end
362
385
  rescue ::Gapic::Rest::Error => e
363
386
  raise ::Google::Cloud::Error.from_error(e)
@@ -405,6 +428,13 @@ module Google
405
428
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
406
429
  # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
407
430
  # * (`nil`) indicating no credentials
431
+ #
432
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
433
+ # external source for authentication to Google Cloud, you must validate it before
434
+ # providing it to a Google API client library. Providing an unvalidated credential
435
+ # configuration to Google APIs can compromise the security of your systems and data.
436
+ # For more information, refer to [Validate credential configurations from external
437
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
408
438
  # @return [::Object]
409
439
  # @!attribute [rw] scope
410
440
  # The OAuth scopes
@@ -437,6 +467,11 @@ module Google
437
467
  # default endpoint URL. The default value of nil uses the environment
438
468
  # universe (usually the default "googleapis.com" universe).
439
469
  # @return [::String,nil]
470
+ # @!attribute [rw] logger
471
+ # A custom logger to use for request/response debug logging, or the value
472
+ # `:default` (the default) to construct a default logger, or `nil` to
473
+ # explicitly disable logging.
474
+ # @return [::Logger,:default,nil]
440
475
  #
441
476
  class Configuration
442
477
  extend ::Gapic::Config
@@ -465,6 +500,7 @@ module Google
465
500
  # by the host service.
466
501
  # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
467
502
  config_attr :bindings_override, {}, ::Hash, nil
503
+ config_attr :logger, :default, ::Logger, nil, :default
468
504
 
469
505
  # @private
470
506
  def initialize parent_config = nil
@@ -30,7 +30,8 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
33
+ # @private
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
34
35
  # These require statements are intentionally placed here to initialize
35
36
  # the REST modules only when it's required.
36
37
  require "gapic/rest"
@@ -40,7 +41,9 @@ module Google
40
41
  universe_domain: universe_domain,
41
42
  credentials: credentials,
42
43
  numeric_enums: true,
43
- raise_faraday_errors: false
44
+ service_name: self.class,
45
+ raise_faraday_errors: false,
46
+ logger: logger
44
47
  end
45
48
 
46
49
  ##
@@ -61,6 +64,15 @@ module Google
61
64
  @client_stub.endpoint
62
65
  end
63
66
 
67
+ ##
68
+ # The logger used for request/response debug logging.
69
+ #
70
+ # @return [Logger]
71
+ #
72
+ def logger stub: false
73
+ stub ? @client_stub.stub_logger : @client_stub.logger
74
+ end
75
+
64
76
  ##
65
77
  # Baseline implementation for the create_challenge REST call
66
78
  #
@@ -87,16 +99,18 @@ module Google
87
99
 
88
100
  response = @client_stub.make_http_request(
89
101
  verb,
90
- uri: uri,
91
- body: body || "",
92
- params: query_string_params,
102
+ uri: uri,
103
+ body: body || "",
104
+ params: query_string_params,
105
+ method_name: "create_challenge",
93
106
  options: options
94
107
  )
95
108
  operation = ::Gapic::Rest::TransportOperation.new response
96
109
  result = ::Google::Cloud::ConfidentialComputing::V1::Challenge.decode_json response.body, ignore_unknown_fields: true
97
-
98
- yield result, operation if block_given?
99
- result
110
+ catch :response do
111
+ yield result, operation if block_given?
112
+ result
113
+ end
100
114
  end
101
115
 
102
116
  ##
@@ -125,16 +139,18 @@ module Google
125
139
 
126
140
  response = @client_stub.make_http_request(
127
141
  verb,
128
- uri: uri,
129
- body: body || "",
130
- params: query_string_params,
142
+ uri: uri,
143
+ body: body || "",
144
+ params: query_string_params,
145
+ method_name: "verify_attestation",
131
146
  options: options
132
147
  )
133
148
  operation = ::Gapic::Rest::TransportOperation.new response
134
149
  result = ::Google::Cloud::ConfidentialComputing::V1::VerifyAttestationResponse.decode_json response.body, ignore_unknown_fields: true
135
-
136
- yield result, operation if block_given?
137
- result
150
+ catch :response do
151
+ yield result, operation if block_given?
152
+ result
153
+ end
138
154
  end
139
155
 
140
156
  ##
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module ConfidentialComputing
23
23
  module V1
24
- VERSION = "1.2.0"
24
+ VERSION = "1.4.0"
25
25
  end
26
26
  end
27
27
  end
@@ -306,9 +306,28 @@ module Google
306
306
  # @!attribute [rw] common
307
307
  # @return [::Google::Api::CommonLanguageSettings]
308
308
  # Some settings.
309
+ # @!attribute [rw] renamed_services
310
+ # @return [::Google::Protobuf::Map{::String => ::String}]
311
+ # Map of service names to renamed services. Keys are the package relative
312
+ # service names and values are the name to be used for the service client
313
+ # and call options.
314
+ #
315
+ # publishing:
316
+ # go_settings:
317
+ # renamed_services:
318
+ # Publisher: TopicAdmin
309
319
  class GoSettings
310
320
  include ::Google::Protobuf::MessageExts
311
321
  extend ::Google::Protobuf::MessageExts::ClassMethods
322
+
323
+ # @!attribute [rw] key
324
+ # @return [::String]
325
+ # @!attribute [rw] value
326
+ # @return [::String]
327
+ class RenamedServicesEntry
328
+ include ::Google::Protobuf::MessageExts
329
+ extend ::Google::Protobuf::MessageExts::ClassMethods
330
+ end
312
331
  end
313
332
 
314
333
  # Describes the generator configuration for a method.
@@ -63,9 +63,13 @@ module Google
63
63
  # @!attribute [rw] td_ccel
64
64
  # @return [::Google::Cloud::ConfidentialComputing::V1::TdxCcelAttestation]
65
65
  # Optional. A TDX with CCEL and RTMR Attestation Quote.
66
+ #
67
+ # Note: The following fields are mutually exclusive: `td_ccel`, `sev_snp_attestation`. If a field in that set is populated, all other fields in the set will automatically be cleared.
66
68
  # @!attribute [rw] sev_snp_attestation
67
69
  # @return [::Google::Cloud::ConfidentialComputing::V1::SevSnpAttestation]
68
70
  # Optional. An SEV-SNP Attestation Report.
71
+ #
72
+ # Note: The following fields are mutually exclusive: `sev_snp_attestation`, `td_ccel`. If a field in that set is populated, all other fields in the set will automatically be cleared.
69
73
  # @!attribute [rw] challenge
70
74
  # @return [::String]
71
75
  # Required. The name of the Challenge whose nonce was used to generate the
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-confidential_computing-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-12-04 00:00:00.000000000 Z
10
+ date: 2025-01-29 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: gapic-common
@@ -16,7 +15,7 @@ dependencies:
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: 0.21.1
18
+ version: 0.25.0
20
19
  - - "<"
21
20
  - !ruby/object:Gem::Version
22
21
  version: 2.a
@@ -26,7 +25,7 @@ dependencies:
26
25
  requirements:
27
26
  - - ">="
28
27
  - !ruby/object:Gem::Version
29
- version: 0.21.1
28
+ version: 0.25.0
30
29
  - - "<"
31
30
  - !ruby/object:Gem::Version
32
31
  version: 2.a
@@ -105,7 +104,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
105
104
  licenses:
106
105
  - Apache-2.0
107
106
  metadata: {}
108
- post_install_message:
109
107
  rdoc_options: []
110
108
  require_paths:
111
109
  - lib
@@ -113,15 +111,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
113
111
  requirements:
114
112
  - - ">="
115
113
  - !ruby/object:Gem::Version
116
- version: '2.7'
114
+ version: '3.0'
117
115
  required_rubygems_version: !ruby/object:Gem::Requirement
118
116
  requirements:
119
117
  - - ">="
120
118
  - !ruby/object:Gem::Version
121
119
  version: '0'
122
120
  requirements: []
123
- rubygems_version: 3.5.22
124
- signing_key:
121
+ rubygems_version: 3.6.2
125
122
  specification_version: 4
126
123
  summary: Attestation verifier for Confidential Space.
127
124
  test_files: []