google-cloud-security-private_ca-v1beta1 0.9.1 → 0.11.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 829a90f1d1c2307435c0a3a58016b3df1ced76b979d664348f641d87200b090d
4
- data.tar.gz: adac115ea5daaf08982deb4271fe7475c5aa8ee61f9c5c5c377dbd3c91959697
3
+ metadata.gz: 8d28a7d2d97df7892345256c737d78a559877b07d0c9bf566dc7a3c00a55c7c5
4
+ data.tar.gz: 8de20ba5dc64488fd32e90ff297e0154fd4f87b93e9d525e7f0c9b9864c282e4
5
5
  SHA512:
6
- metadata.gz: 15383a7a4435e98c6fa5b5daf72251fb4d83c23b3f35c9c819613e42a3c2582a6289ea57af284cf5ed110b03b854d221e9e7ab33ad2bcdccfdf1733d46937675
7
- data.tar.gz: 322eb8cdf8624ccd33e32c823367dd0a1102bf9db624c45db5859eb1fdd24dd2b70c3fd95bc24e55b65903b3a76d9ab7c5fdee8a0dc2e0d5f6a432d564758db1
6
+ metadata.gz: 9a57713d0b0e260126dfa6ac678b676ea6326868a733b0e690daaac4dd88c0bfded89b3d8ff2f32fdd9c651b44d32ea2fb7df6b3d31c851e99fb065706137324
7
+ data.tar.gz: 6d614d07dfd75869c0e16a133a91e95f6949f3f333a26a48235de583a0a4fdf248ce15250238cdf0c915acfeaf233b6f6a008dfb9a7c36c1d41d503e55baf8a0
data/README.md CHANGED
@@ -43,40 +43,50 @@ for class and method documentation.
43
43
  See also the [Product Documentation](https://cloud.google.com/certificate-authority-service/)
44
44
  for general usage information.
45
45
 
46
- ## Enabling Logging
47
-
48
- To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
49
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
50
- or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
51
- 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)
52
- and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
53
-
54
- Configuring a Ruby stdlib logger:
46
+ ## Debug Logging
47
+
48
+ This library comes with opt-in Debug Logging that can help you troubleshoot
49
+ your application's integration with the API. When logging is activated, key
50
+ events such as requests and responses, along with data payloads and metadata
51
+ such as headers and client configuration, are logged to the standard error
52
+ stream.
53
+
54
+ **WARNING:** Client Library Debug Logging includes your data payloads in
55
+ plaintext, which could include sensitive data such as PII for yourself or your
56
+ customers, private keys, or other security data that could be compromising if
57
+ leaked. Always practice good data hygiene with your application logs, and follow
58
+ the principle of least access. Google also recommends that Client Library Debug
59
+ Logging be enabled only temporarily during active debugging, and not used
60
+ permanently in production.
61
+
62
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
63
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
64
+ list of client library gem names. This will select the default logging behavior,
65
+ which writes logs to the standard error stream. On a local workstation, this may
66
+ result in logs appearing on the console. When running on a Google Cloud hosting
67
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
68
+ results in logs appearing alongside your application logs in the
69
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
70
+
71
+ You can customize logging by modifying the `logger` configuration when
72
+ constructing a client object. For example:
55
73
 
56
74
  ```ruby
75
+ require "google/cloud/security/private_ca/v1beta1"
57
76
  require "logger"
58
77
 
59
- module MyLogger
60
- LOGGER = Logger.new $stderr, level: Logger::WARN
61
- def logger
62
- LOGGER
63
- end
64
- end
65
-
66
- # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
67
- module GRPC
68
- extend MyLogger
78
+ client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config|
79
+ config.logger = Logger.new "my-app.log"
69
80
  end
70
81
  ```
71
82
 
72
-
73
83
  ## Google Cloud Samples
74
84
 
75
85
  To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
76
86
 
77
87
  ## Supported Ruby Versions
78
88
 
79
- This library is supported on Ruby 2.7+.
89
+ This library is supported on Ruby 3.0+.
80
90
 
81
91
  Google provides official support for Ruby versions that are actively supported
82
92
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
@@ -171,8 +171,19 @@ module Google
171
171
  universe_domain: @config.universe_domain,
172
172
  channel_args: @config.channel_args,
173
173
  interceptors: @config.interceptors,
174
- channel_pool_config: @config.channel_pool
174
+ channel_pool_config: @config.channel_pool,
175
+ logger: @config.logger
175
176
  )
177
+
178
+ @certificate_authority_service_stub.stub_logger&.info do |entry|
179
+ entry.set_system_name
180
+ entry.set_service
181
+ entry.message = "Created client for #{entry.service}"
182
+ entry.set_credentials_fields credentials
183
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
184
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
185
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
186
+ end
176
187
  end
177
188
 
178
189
  ##
@@ -182,6 +193,15 @@ module Google
182
193
  #
183
194
  attr_reader :operations_client
184
195
 
196
+ ##
197
+ # The logger used for request/response debug logging.
198
+ #
199
+ # @return [Logger]
200
+ #
201
+ def logger
202
+ @certificate_authority_service_stub.logger
203
+ end
204
+
185
205
  # Service calls
186
206
 
187
207
  ##
@@ -288,7 +308,6 @@ module Google
288
308
 
289
309
  @certificate_authority_service_stub.call_rpc :create_certificate, request, options: options do |response, operation|
290
310
  yield response, operation if block_given?
291
- return response
292
311
  end
293
312
  rescue ::GRPC::BadStatus => e
294
313
  raise ::Google::Cloud::Error.from_error(e)
@@ -374,7 +393,6 @@ module Google
374
393
 
375
394
  @certificate_authority_service_stub.call_rpc :get_certificate, request, options: options do |response, operation|
376
395
  yield response, operation if block_given?
377
- return response
378
396
  end
379
397
  rescue ::GRPC::BadStatus => e
380
398
  raise ::Google::Cloud::Error.from_error(e)
@@ -485,7 +503,7 @@ module Google
485
503
  @certificate_authority_service_stub.call_rpc :list_certificates, request, options: options do |response, operation|
486
504
  response = ::Gapic::PagedEnumerable.new @certificate_authority_service_stub, :list_certificates, request, response, operation, options
487
505
  yield response, operation if block_given?
488
- return response
506
+ throw :response, response
489
507
  end
490
508
  rescue ::GRPC::BadStatus => e
491
509
  raise ::Google::Cloud::Error.from_error(e)
@@ -588,7 +606,6 @@ module Google
588
606
 
589
607
  @certificate_authority_service_stub.call_rpc :revoke_certificate, request, options: options do |response, operation|
590
608
  yield response, operation if block_given?
591
- return response
592
609
  end
593
610
  rescue ::GRPC::BadStatus => e
594
611
  raise ::Google::Cloud::Error.from_error(e)
@@ -691,7 +708,6 @@ module Google
691
708
 
692
709
  @certificate_authority_service_stub.call_rpc :update_certificate, request, options: options do |response, operation|
693
710
  yield response, operation if block_given?
694
- return response
695
711
  end
696
712
  rescue ::GRPC::BadStatus => e
697
713
  raise ::Google::Cloud::Error.from_error(e)
@@ -811,7 +827,7 @@ module Google
811
827
  @certificate_authority_service_stub.call_rpc :activate_certificate_authority, request, options: options do |response, operation|
812
828
  response = ::Gapic::Operation.new response, @operations_client, options: options
813
829
  yield response, operation if block_given?
814
- return response
830
+ throw :response, response
815
831
  end
816
832
  rescue ::GRPC::BadStatus => e
817
833
  raise ::Google::Cloud::Error.from_error(e)
@@ -926,7 +942,7 @@ module Google
926
942
  @certificate_authority_service_stub.call_rpc :create_certificate_authority, request, options: options do |response, operation|
927
943
  response = ::Gapic::Operation.new response, @operations_client, options: options
928
944
  yield response, operation if block_given?
929
- return response
945
+ throw :response, response
930
946
  end
931
947
  rescue ::GRPC::BadStatus => e
932
948
  raise ::Google::Cloud::Error.from_error(e)
@@ -1035,7 +1051,7 @@ module Google
1035
1051
  @certificate_authority_service_stub.call_rpc :disable_certificate_authority, request, options: options do |response, operation|
1036
1052
  response = ::Gapic::Operation.new response, @operations_client, options: options
1037
1053
  yield response, operation if block_given?
1038
- return response
1054
+ throw :response, response
1039
1055
  end
1040
1056
  rescue ::GRPC::BadStatus => e
1041
1057
  raise ::Google::Cloud::Error.from_error(e)
@@ -1144,7 +1160,7 @@ module Google
1144
1160
  @certificate_authority_service_stub.call_rpc :enable_certificate_authority, request, options: options do |response, operation|
1145
1161
  response = ::Gapic::Operation.new response, @operations_client, options: options
1146
1162
  yield response, operation if block_given?
1147
- return response
1163
+ throw :response, response
1148
1164
  end
1149
1165
  rescue ::GRPC::BadStatus => e
1150
1166
  raise ::Google::Cloud::Error.from_error(e)
@@ -1237,7 +1253,6 @@ module Google
1237
1253
 
1238
1254
  @certificate_authority_service_stub.call_rpc :fetch_certificate_authority_csr, request, options: options do |response, operation|
1239
1255
  yield response, operation if block_given?
1240
- return response
1241
1256
  end
1242
1257
  rescue ::GRPC::BadStatus => e
1243
1258
  raise ::Google::Cloud::Error.from_error(e)
@@ -1324,7 +1339,6 @@ module Google
1324
1339
 
1325
1340
  @certificate_authority_service_stub.call_rpc :get_certificate_authority, request, options: options do |response, operation|
1326
1341
  yield response, operation if block_given?
1327
- return response
1328
1342
  end
1329
1343
  rescue ::GRPC::BadStatus => e
1330
1344
  raise ::Google::Cloud::Error.from_error(e)
@@ -1431,7 +1445,7 @@ module Google
1431
1445
  @certificate_authority_service_stub.call_rpc :list_certificate_authorities, request, options: options do |response, operation|
1432
1446
  response = ::Gapic::PagedEnumerable.new @certificate_authority_service_stub, :list_certificate_authorities, request, response, operation, options
1433
1447
  yield response, operation if block_given?
1434
- return response
1448
+ throw :response, response
1435
1449
  end
1436
1450
  rescue ::GRPC::BadStatus => e
1437
1451
  raise ::Google::Cloud::Error.from_error(e)
@@ -1540,7 +1554,7 @@ module Google
1540
1554
  @certificate_authority_service_stub.call_rpc :restore_certificate_authority, request, options: options do |response, operation|
1541
1555
  response = ::Gapic::Operation.new response, @operations_client, options: options
1542
1556
  yield response, operation if block_given?
1543
- return response
1557
+ throw :response, response
1544
1558
  end
1545
1559
  rescue ::GRPC::BadStatus => e
1546
1560
  raise ::Google::Cloud::Error.from_error(e)
@@ -1649,7 +1663,7 @@ module Google
1649
1663
  @certificate_authority_service_stub.call_rpc :schedule_delete_certificate_authority, request, options: options do |response, operation|
1650
1664
  response = ::Gapic::Operation.new response, @operations_client, options: options
1651
1665
  yield response, operation if block_given?
1652
- return response
1666
+ throw :response, response
1653
1667
  end
1654
1668
  rescue ::GRPC::BadStatus => e
1655
1669
  raise ::Google::Cloud::Error.from_error(e)
@@ -1759,7 +1773,7 @@ module Google
1759
1773
  @certificate_authority_service_stub.call_rpc :update_certificate_authority, request, options: options do |response, operation|
1760
1774
  response = ::Gapic::Operation.new response, @operations_client, options: options
1761
1775
  yield response, operation if block_given?
1762
- return response
1776
+ throw :response, response
1763
1777
  end
1764
1778
  rescue ::GRPC::BadStatus => e
1765
1779
  raise ::Google::Cloud::Error.from_error(e)
@@ -1846,7 +1860,6 @@ module Google
1846
1860
 
1847
1861
  @certificate_authority_service_stub.call_rpc :get_certificate_revocation_list, request, options: options do |response, operation|
1848
1862
  yield response, operation if block_given?
1849
- return response
1850
1863
  end
1851
1864
  rescue ::GRPC::BadStatus => e
1852
1865
  raise ::Google::Cloud::Error.from_error(e)
@@ -1953,7 +1966,7 @@ module Google
1953
1966
  @certificate_authority_service_stub.call_rpc :list_certificate_revocation_lists, request, options: options do |response, operation|
1954
1967
  response = ::Gapic::PagedEnumerable.new @certificate_authority_service_stub, :list_certificate_revocation_lists, request, response, operation, options
1955
1968
  yield response, operation if block_given?
1956
- return response
1969
+ throw :response, response
1957
1970
  end
1958
1971
  rescue ::GRPC::BadStatus => e
1959
1972
  raise ::Google::Cloud::Error.from_error(e)
@@ -2063,7 +2076,7 @@ module Google
2063
2076
  @certificate_authority_service_stub.call_rpc :update_certificate_revocation_list, request, options: options do |response, operation|
2064
2077
  response = ::Gapic::Operation.new response, @operations_client, options: options
2065
2078
  yield response, operation if block_given?
2066
- return response
2079
+ throw :response, response
2067
2080
  end
2068
2081
  rescue ::GRPC::BadStatus => e
2069
2082
  raise ::Google::Cloud::Error.from_error(e)
@@ -2149,7 +2162,6 @@ module Google
2149
2162
 
2150
2163
  @certificate_authority_service_stub.call_rpc :get_reusable_config, request, options: options do |response, operation|
2151
2164
  yield response, operation if block_given?
2152
- return response
2153
2165
  end
2154
2166
  rescue ::GRPC::BadStatus => e
2155
2167
  raise ::Google::Cloud::Error.from_error(e)
@@ -2256,7 +2268,7 @@ module Google
2256
2268
  @certificate_authority_service_stub.call_rpc :list_reusable_configs, request, options: options do |response, operation|
2257
2269
  response = ::Gapic::PagedEnumerable.new @certificate_authority_service_stub, :list_reusable_configs, request, response, operation, options
2258
2270
  yield response, operation if block_given?
2259
- return response
2271
+ throw :response, response
2260
2272
  end
2261
2273
  rescue ::GRPC::BadStatus => e
2262
2274
  raise ::Google::Cloud::Error.from_error(e)
@@ -2306,6 +2318,13 @@ module Google
2306
2318
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
2307
2319
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
2308
2320
  # * (`nil`) indicating no credentials
2321
+ #
2322
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
2323
+ # external source for authentication to Google Cloud, you must validate it before
2324
+ # providing it to a Google API client library. Providing an unvalidated credential
2325
+ # configuration to Google APIs can compromise the security of your systems and data.
2326
+ # For more information, refer to [Validate credential configurations from external
2327
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
2309
2328
  # @return [::Object]
2310
2329
  # @!attribute [rw] scope
2311
2330
  # The OAuth scopes
@@ -2345,6 +2364,11 @@ module Google
2345
2364
  # default endpoint URL. The default value of nil uses the environment
2346
2365
  # universe (usually the default "googleapis.com" universe).
2347
2366
  # @return [::String,nil]
2367
+ # @!attribute [rw] logger
2368
+ # A custom logger to use for request/response debug logging, or the value
2369
+ # `:default` (the default) to construct a default logger, or `nil` to
2370
+ # explicitly disable logging.
2371
+ # @return [::Logger,:default,nil]
2348
2372
  #
2349
2373
  class Configuration
2350
2374
  extend ::Gapic::Config
@@ -2369,6 +2393,7 @@ module Google
2369
2393
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2370
2394
  config_attr :quota_project, nil, ::String, nil
2371
2395
  config_attr :universe_domain, nil, ::String, nil
2396
+ config_attr :logger, :default, ::Logger, nil, :default
2372
2397
 
2373
2398
  # @private
2374
2399
  def initialize parent_config = nil
@@ -125,14 +125,6 @@ module Google
125
125
  # Lists operations that match the specified filter in the request. If the
126
126
  # server doesn't support this method, it returns `UNIMPLEMENTED`.
127
127
  #
128
- # NOTE: the `name` binding allows API services to override the binding
129
- # to use different resource name schemes, such as `users/*/operations`. To
130
- # override the binding, API services can add a binding such as
131
- # `"/v1/{name=users/*}/operations"` to their service configuration.
132
- # For backwards compatibility, the default name includes the operations
133
- # collection id, however overriding users must ensure the name binding
134
- # is the parent resource, without the operations collection id.
135
- #
136
128
  # @overload list_operations(request, options = nil)
137
129
  # Pass arguments to `list_operations` via a request object, either of type
138
130
  # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
@@ -222,7 +214,7 @@ module Google
222
214
  wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
223
215
  response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
224
216
  yield response, operation if block_given?
225
- return response
217
+ throw :response, response
226
218
  end
227
219
  rescue ::GRPC::BadStatus => e
228
220
  raise ::Google::Cloud::Error.from_error(e)
@@ -318,7 +310,7 @@ module Google
318
310
  @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
319
311
  response = ::Gapic::Operation.new response, @operations_client, options: options
320
312
  yield response, operation if block_given?
321
- return response
313
+ throw :response, response
322
314
  end
323
315
  rescue ::GRPC::BadStatus => e
324
316
  raise ::Google::Cloud::Error.from_error(e)
@@ -407,7 +399,6 @@ module Google
407
399
 
408
400
  @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
409
401
  yield response, operation if block_given?
410
- return response
411
402
  end
412
403
  rescue ::GRPC::BadStatus => e
413
404
  raise ::Google::Cloud::Error.from_error(e)
@@ -422,8 +413,9 @@ module Google
422
413
  # other methods to check whether the cancellation succeeded or whether the
423
414
  # operation completed despite cancellation. On successful cancellation,
424
415
  # the operation is not deleted; instead, it becomes an operation with
425
- # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
426
- # corresponding to `Code.CANCELLED`.
416
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a
417
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
418
+ # `Code.CANCELLED`.
427
419
  #
428
420
  # @overload cancel_operation(request, options = nil)
429
421
  # Pass arguments to `cancel_operation` via a request object, either of type
@@ -502,7 +494,6 @@ module Google
502
494
 
503
495
  @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
504
496
  yield response, operation if block_given?
505
- return response
506
497
  end
507
498
  rescue ::GRPC::BadStatus => e
508
499
  raise ::Google::Cloud::Error.from_error(e)
@@ -600,7 +591,7 @@ module Google
600
591
  @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
601
592
  response = ::Gapic::Operation.new response, @operations_client, options: options
602
593
  yield response, operation if block_given?
603
- return response
594
+ throw :response, response
604
595
  end
605
596
  rescue ::GRPC::BadStatus => e
606
597
  raise ::Google::Cloud::Error.from_error(e)
@@ -650,6 +641,13 @@ module Google
650
641
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
651
642
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
652
643
  # * (`nil`) indicating no credentials
644
+ #
645
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
646
+ # external source for authentication to Google Cloud, you must validate it before
647
+ # providing it to a Google API client library. Providing an unvalidated credential
648
+ # configuration to Google APIs can compromise the security of your systems and data.
649
+ # For more information, refer to [Validate credential configurations from external
650
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
653
651
  # @return [::Object]
654
652
  # @!attribute [rw] scope
655
653
  # The OAuth scopes
@@ -689,6 +687,11 @@ module Google
689
687
  # default endpoint URL. The default value of nil uses the environment
690
688
  # universe (usually the default "googleapis.com" universe).
691
689
  # @return [::String,nil]
690
+ # @!attribute [rw] logger
691
+ # A custom logger to use for request/response debug logging, or the value
692
+ # `:default` (the default) to construct a default logger, or `nil` to
693
+ # explicitly disable logging.
694
+ # @return [::Logger,:default,nil]
692
695
  #
693
696
  class Configuration
694
697
  extend ::Gapic::Config
@@ -713,6 +716,7 @@ module Google
713
716
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
714
717
  config_attr :quota_project, nil, ::String, nil
715
718
  config_attr :universe_domain, nil, ::String, nil
719
+ config_attr :logger, :default, ::Logger, nil, :default
716
720
 
717
721
  # @private
718
722
  def initialize parent_config = nil
@@ -164,8 +164,19 @@ module Google
164
164
  endpoint: @config.endpoint,
165
165
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
166
166
  universe_domain: @config.universe_domain,
167
- credentials: credentials
167
+ credentials: credentials,
168
+ logger: @config.logger
168
169
  )
170
+
171
+ @certificate_authority_service_stub.logger(stub: true)&.info do |entry|
172
+ entry.set_system_name
173
+ entry.set_service
174
+ entry.message = "Created client for #{entry.service}"
175
+ entry.set_credentials_fields credentials
176
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
177
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
178
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
179
+ end
169
180
  end
170
181
 
171
182
  ##
@@ -175,6 +186,15 @@ module Google
175
186
  #
176
187
  attr_reader :operations_client
177
188
 
189
+ ##
190
+ # The logger used for request/response debug logging.
191
+ #
192
+ # @return [Logger]
193
+ #
194
+ def logger
195
+ @certificate_authority_service_stub.logger
196
+ end
197
+
178
198
  # Service calls
179
199
 
180
200
  ##
@@ -274,7 +294,6 @@ module Google
274
294
 
275
295
  @certificate_authority_service_stub.create_certificate request, options do |result, operation|
276
296
  yield result, operation if block_given?
277
- return result
278
297
  end
279
298
  rescue ::Gapic::Rest::Error => e
280
299
  raise ::Google::Cloud::Error.from_error(e)
@@ -353,7 +372,6 @@ module Google
353
372
 
354
373
  @certificate_authority_service_stub.get_certificate request, options do |result, operation|
355
374
  yield result, operation if block_given?
356
- return result
357
375
  end
358
376
  rescue ::Gapic::Rest::Error => e
359
377
  raise ::Google::Cloud::Error.from_error(e)
@@ -456,7 +474,6 @@ module Google
456
474
 
457
475
  @certificate_authority_service_stub.list_certificates request, options do |result, operation|
458
476
  yield result, operation if block_given?
459
- return result
460
477
  end
461
478
  rescue ::Gapic::Rest::Error => e
462
479
  raise ::Google::Cloud::Error.from_error(e)
@@ -552,7 +569,6 @@ module Google
552
569
 
553
570
  @certificate_authority_service_stub.revoke_certificate request, options do |result, operation|
554
571
  yield result, operation if block_given?
555
- return result
556
572
  end
557
573
  rescue ::Gapic::Rest::Error => e
558
574
  raise ::Google::Cloud::Error.from_error(e)
@@ -648,7 +664,6 @@ module Google
648
664
 
649
665
  @certificate_authority_service_stub.update_certificate request, options do |result, operation|
650
666
  yield result, operation if block_given?
651
- return result
652
667
  end
653
668
  rescue ::Gapic::Rest::Error => e
654
669
  raise ::Google::Cloud::Error.from_error(e)
@@ -761,7 +776,7 @@ module Google
761
776
  @certificate_authority_service_stub.activate_certificate_authority request, options do |result, operation|
762
777
  result = ::Gapic::Operation.new result, @operations_client, options: options
763
778
  yield result, operation if block_given?
764
- return result
779
+ throw :response, result
765
780
  end
766
781
  rescue ::Gapic::Rest::Error => e
767
782
  raise ::Google::Cloud::Error.from_error(e)
@@ -869,7 +884,7 @@ module Google
869
884
  @certificate_authority_service_stub.create_certificate_authority request, options do |result, operation|
870
885
  result = ::Gapic::Operation.new result, @operations_client, options: options
871
886
  yield result, operation if block_given?
872
- return result
887
+ throw :response, result
873
888
  end
874
889
  rescue ::Gapic::Rest::Error => e
875
890
  raise ::Google::Cloud::Error.from_error(e)
@@ -971,7 +986,7 @@ module Google
971
986
  @certificate_authority_service_stub.disable_certificate_authority request, options do |result, operation|
972
987
  result = ::Gapic::Operation.new result, @operations_client, options: options
973
988
  yield result, operation if block_given?
974
- return result
989
+ throw :response, result
975
990
  end
976
991
  rescue ::Gapic::Rest::Error => e
977
992
  raise ::Google::Cloud::Error.from_error(e)
@@ -1073,7 +1088,7 @@ module Google
1073
1088
  @certificate_authority_service_stub.enable_certificate_authority request, options do |result, operation|
1074
1089
  result = ::Gapic::Operation.new result, @operations_client, options: options
1075
1090
  yield result, operation if block_given?
1076
- return result
1091
+ throw :response, result
1077
1092
  end
1078
1093
  rescue ::Gapic::Rest::Error => e
1079
1094
  raise ::Google::Cloud::Error.from_error(e)
@@ -1159,7 +1174,6 @@ module Google
1159
1174
 
1160
1175
  @certificate_authority_service_stub.fetch_certificate_authority_csr request, options do |result, operation|
1161
1176
  yield result, operation if block_given?
1162
- return result
1163
1177
  end
1164
1178
  rescue ::Gapic::Rest::Error => e
1165
1179
  raise ::Google::Cloud::Error.from_error(e)
@@ -1239,7 +1253,6 @@ module Google
1239
1253
 
1240
1254
  @certificate_authority_service_stub.get_certificate_authority request, options do |result, operation|
1241
1255
  yield result, operation if block_given?
1242
- return result
1243
1256
  end
1244
1257
  rescue ::Gapic::Rest::Error => e
1245
1258
  raise ::Google::Cloud::Error.from_error(e)
@@ -1338,7 +1351,6 @@ module Google
1338
1351
 
1339
1352
  @certificate_authority_service_stub.list_certificate_authorities request, options do |result, operation|
1340
1353
  yield result, operation if block_given?
1341
- return result
1342
1354
  end
1343
1355
  rescue ::Gapic::Rest::Error => e
1344
1356
  raise ::Google::Cloud::Error.from_error(e)
@@ -1440,7 +1452,7 @@ module Google
1440
1452
  @certificate_authority_service_stub.restore_certificate_authority request, options do |result, operation|
1441
1453
  result = ::Gapic::Operation.new result, @operations_client, options: options
1442
1454
  yield result, operation if block_given?
1443
- return result
1455
+ throw :response, result
1444
1456
  end
1445
1457
  rescue ::Gapic::Rest::Error => e
1446
1458
  raise ::Google::Cloud::Error.from_error(e)
@@ -1542,7 +1554,7 @@ module Google
1542
1554
  @certificate_authority_service_stub.schedule_delete_certificate_authority request, options do |result, operation|
1543
1555
  result = ::Gapic::Operation.new result, @operations_client, options: options
1544
1556
  yield result, operation if block_given?
1545
- return result
1557
+ throw :response, result
1546
1558
  end
1547
1559
  rescue ::Gapic::Rest::Error => e
1548
1560
  raise ::Google::Cloud::Error.from_error(e)
@@ -1645,7 +1657,7 @@ module Google
1645
1657
  @certificate_authority_service_stub.update_certificate_authority request, options do |result, operation|
1646
1658
  result = ::Gapic::Operation.new result, @operations_client, options: options
1647
1659
  yield result, operation if block_given?
1648
- return result
1660
+ throw :response, result
1649
1661
  end
1650
1662
  rescue ::Gapic::Rest::Error => e
1651
1663
  raise ::Google::Cloud::Error.from_error(e)
@@ -1725,7 +1737,6 @@ module Google
1725
1737
 
1726
1738
  @certificate_authority_service_stub.get_certificate_revocation_list request, options do |result, operation|
1727
1739
  yield result, operation if block_given?
1728
- return result
1729
1740
  end
1730
1741
  rescue ::Gapic::Rest::Error => e
1731
1742
  raise ::Google::Cloud::Error.from_error(e)
@@ -1824,7 +1835,6 @@ module Google
1824
1835
 
1825
1836
  @certificate_authority_service_stub.list_certificate_revocation_lists request, options do |result, operation|
1826
1837
  yield result, operation if block_given?
1827
- return result
1828
1838
  end
1829
1839
  rescue ::Gapic::Rest::Error => e
1830
1840
  raise ::Google::Cloud::Error.from_error(e)
@@ -1927,7 +1937,7 @@ module Google
1927
1937
  @certificate_authority_service_stub.update_certificate_revocation_list request, options do |result, operation|
1928
1938
  result = ::Gapic::Operation.new result, @operations_client, options: options
1929
1939
  yield result, operation if block_given?
1930
- return result
1940
+ throw :response, result
1931
1941
  end
1932
1942
  rescue ::Gapic::Rest::Error => e
1933
1943
  raise ::Google::Cloud::Error.from_error(e)
@@ -2006,7 +2016,6 @@ module Google
2006
2016
 
2007
2017
  @certificate_authority_service_stub.get_reusable_config request, options do |result, operation|
2008
2018
  yield result, operation if block_given?
2009
- return result
2010
2019
  end
2011
2020
  rescue ::Gapic::Rest::Error => e
2012
2021
  raise ::Google::Cloud::Error.from_error(e)
@@ -2105,7 +2114,6 @@ module Google
2105
2114
 
2106
2115
  @certificate_authority_service_stub.list_reusable_configs request, options do |result, operation|
2107
2116
  yield result, operation if block_given?
2108
- return result
2109
2117
  end
2110
2118
  rescue ::Gapic::Rest::Error => e
2111
2119
  raise ::Google::Cloud::Error.from_error(e)
@@ -2153,6 +2161,13 @@ module Google
2153
2161
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
2154
2162
  # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
2155
2163
  # * (`nil`) indicating no credentials
2164
+ #
2165
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
2166
+ # external source for authentication to Google Cloud, you must validate it before
2167
+ # providing it to a Google API client library. Providing an unvalidated credential
2168
+ # configuration to Google APIs can compromise the security of your systems and data.
2169
+ # For more information, refer to [Validate credential configurations from external
2170
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
2156
2171
  # @return [::Object]
2157
2172
  # @!attribute [rw] scope
2158
2173
  # The OAuth scopes
@@ -2185,6 +2200,11 @@ module Google
2185
2200
  # default endpoint URL. The default value of nil uses the environment
2186
2201
  # universe (usually the default "googleapis.com" universe).
2187
2202
  # @return [::String,nil]
2203
+ # @!attribute [rw] logger
2204
+ # A custom logger to use for request/response debug logging, or the value
2205
+ # `:default` (the default) to construct a default logger, or `nil` to
2206
+ # explicitly disable logging.
2207
+ # @return [::Logger,:default,nil]
2188
2208
  #
2189
2209
  class Configuration
2190
2210
  extend ::Gapic::Config
@@ -2206,6 +2226,7 @@ module Google
2206
2226
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2207
2227
  config_attr :quota_project, nil, ::String, nil
2208
2228
  config_attr :universe_domain, nil, ::String, nil
2229
+ config_attr :logger, :default, ::Logger, nil, :default
2209
2230
 
2210
2231
  # @private
2211
2232
  def initialize parent_config = nil