google-cloud-gke_connect-gateway-v1 0.2.0 → 0.4.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: d5bfa0b1d025932450f73fa9c2ffda0a56bf039af9c584c58238551ce056021c
4
- data.tar.gz: cf6901daedf545821cc5d75d11d78a7227648425d06213d14a78705c49bc4883
3
+ metadata.gz: 9c0fc3c2449378e0a4778e8dfcb3eff3adf19225d30a01a002cbe9822904d880
4
+ data.tar.gz: a8c831f90b7491a1c69ef3c1e5a0bb465ed1771e9ed2a129926da13e3c3349a3
5
5
  SHA512:
6
- metadata.gz: 8b2b680e9edba19669b396db848318f49e4191eb2503836721947a50a1460f8a64772544fb67b410aa61c39cc14101801831fb32ea4f89523ef56f93f30d9800
7
- data.tar.gz: 37d7ed34d52c0d4484e99a549702b8e334d0c1691b475c9886dbde1b8d36fde5cb4b3a16aa255afd51b8b09eced7adbb5540f67e0ac50b2cd6d7b3286f3dd88e
6
+ metadata.gz: 9ba6300c9b5c13586347cee6f8cd0b35205c951f536417152708bc1258b12b39f9fd9b5c8cb0db998b95136f7a8bb90798f6a99981a25e6bfb155a055cf46a00
7
+ data.tar.gz: 98d9e3ad541b3e11b60f812af1836309720d176476f6c23f507c7c4ce09dcbc64e7fd4d57b263913eaf987992ef2554b2fa27cca56d83d609698ddf0013a50bc
data/README.md CHANGED
@@ -43,6 +43,42 @@ for class and method documentation.
43
43
  See also the [Product Documentation](https://cloud.google.com/kubernetes-engine/enterprise/multicluster-management/gateway)
44
44
  for general usage information.
45
45
 
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:
73
+
74
+ ```ruby
75
+ require "google/cloud/gke_connect/gateway/v1"
76
+ require "logger"
77
+
78
+ client = ::Google::Cloud::GkeConnect::Gateway::V1::GatewayControl::Rest::Client.new do |config|
79
+ config.logger = Logger.new "my-app.log"
80
+ end
81
+ ```
46
82
 
47
83
  ## Google Cloud Samples
48
84
 
@@ -50,7 +86,7 @@ To browse ready to use code samples check [Google Cloud Samples](https://cloud.g
50
86
 
51
87
  ## Supported Ruby Versions
52
88
 
53
- This library is supported on Ruby 2.7+.
89
+ This library is supported on Ruby 3.0+.
54
90
 
55
91
  Google provides official support for Ruby versions that are actively supported
56
92
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
@@ -154,8 +154,28 @@ module Google
154
154
  endpoint: @config.endpoint,
155
155
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
156
156
  universe_domain: @config.universe_domain,
157
- credentials: credentials
157
+ credentials: credentials,
158
+ logger: @config.logger
158
159
  )
160
+
161
+ @gateway_control_stub.logger(stub: true)&.info do |entry|
162
+ entry.set_system_name
163
+ entry.set_service
164
+ entry.message = "Created client for #{entry.service}"
165
+ entry.set_credentials_fields credentials
166
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
167
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
168
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
169
+ end
170
+ end
171
+
172
+ ##
173
+ # The logger used for request/response debug logging.
174
+ #
175
+ # @return [Logger]
176
+ #
177
+ def logger
178
+ @gateway_control_stub.logger
159
179
  end
160
180
 
161
181
  # Service calls
@@ -253,7 +273,6 @@ module Google
253
273
 
254
274
  @gateway_control_stub.generate_credentials request, options do |result, operation|
255
275
  yield result, operation if block_given?
256
- return result
257
276
  end
258
277
  rescue ::Gapic::Rest::Error => e
259
278
  raise ::Google::Cloud::Error.from_error(e)
@@ -301,6 +320,13 @@ module Google
301
320
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
302
321
  # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
303
322
  # * (`nil`) indicating no credentials
323
+ #
324
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
325
+ # external source for authentication to Google Cloud, you must validate it before
326
+ # providing it to a Google API client library. Providing an unvalidated credential
327
+ # configuration to Google APIs can compromise the security of your systems and data.
328
+ # For more information, refer to [Validate credential configurations from external
329
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
304
330
  # @return [::Object]
305
331
  # @!attribute [rw] scope
306
332
  # The OAuth scopes
@@ -333,6 +359,11 @@ module Google
333
359
  # default endpoint URL. The default value of nil uses the environment
334
360
  # universe (usually the default "googleapis.com" universe).
335
361
  # @return [::String,nil]
362
+ # @!attribute [rw] logger
363
+ # A custom logger to use for request/response debug logging, or the value
364
+ # `:default` (the default) to construct a default logger, or `nil` to
365
+ # explicitly disable logging.
366
+ # @return [::Logger,:default,nil]
336
367
  #
337
368
  class Configuration
338
369
  extend ::Gapic::Config
@@ -354,6 +385,7 @@ module Google
354
385
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
355
386
  config_attr :quota_project, nil, ::String, nil
356
387
  config_attr :universe_domain, nil, ::String, nil
388
+ config_attr :logger, :default, ::Logger, nil, :default
357
389
 
358
390
  # @private
359
391
  def initialize parent_config = nil
@@ -31,7 +31,8 @@ module Google
31
31
  # including transcoding, making the REST call, and deserialing the response.
32
32
  #
33
33
  class ServiceStub
34
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
34
+ # @private
35
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
35
36
  # These require statements are intentionally placed here to initialize
36
37
  # the REST modules only when it's required.
37
38
  require "gapic/rest"
@@ -41,7 +42,9 @@ module Google
41
42
  universe_domain: universe_domain,
42
43
  credentials: credentials,
43
44
  numeric_enums: true,
44
- raise_faraday_errors: false
45
+ service_name: self.class,
46
+ raise_faraday_errors: false,
47
+ logger: logger
45
48
  end
46
49
 
47
50
  ##
@@ -62,6 +65,15 @@ module Google
62
65
  @client_stub.endpoint
63
66
  end
64
67
 
68
+ ##
69
+ # The logger used for request/response debug logging.
70
+ #
71
+ # @return [Logger]
72
+ #
73
+ def logger stub: false
74
+ stub ? @client_stub.stub_logger : @client_stub.logger
75
+ end
76
+
65
77
  ##
66
78
  # Baseline implementation for the generate_credentials REST call
67
79
  #
@@ -88,16 +100,18 @@ module Google
88
100
 
89
101
  response = @client_stub.make_http_request(
90
102
  verb,
91
- uri: uri,
92
- body: body || "",
93
- params: query_string_params,
103
+ uri: uri,
104
+ body: body || "",
105
+ params: query_string_params,
106
+ method_name: "generate_credentials",
94
107
  options: options
95
108
  )
96
109
  operation = ::Gapic::Rest::TransportOperation.new response
97
110
  result = ::Google::Cloud::GkeConnect::Gateway::V1::GenerateCredentialsResponse.decode_json response.body, ignore_unknown_fields: true
98
-
99
- yield result, operation if block_given?
100
- result
111
+ catch :response do
112
+ yield result, operation if block_given?
113
+ result
114
+ end
101
115
  end
102
116
 
103
117
  ##
@@ -22,7 +22,7 @@ module Google
22
22
  module GkeConnect
23
23
  module Gateway
24
24
  module V1
25
- VERSION = "0.2.0"
25
+ VERSION = "0.4.0"
26
26
  end
27
27
  end
28
28
  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.
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-gke_connect-gateway-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.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-11-14 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
@@ -80,7 +79,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
80
79
  licenses:
81
80
  - Apache-2.0
82
81
  metadata: {}
83
- post_install_message:
84
82
  rdoc_options: []
85
83
  require_paths:
86
84
  - lib
@@ -88,15 +86,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
88
86
  requirements:
89
87
  - - ">="
90
88
  - !ruby/object:Gem::Version
91
- version: '2.7'
89
+ version: '3.0'
92
90
  required_rubygems_version: !ruby/object:Gem::Requirement
93
91
  requirements:
94
92
  - - ">="
95
93
  - !ruby/object:Gem::Version
96
94
  version: '0'
97
95
  requirements: []
98
- rubygems_version: 3.5.22
99
- signing_key:
96
+ rubygems_version: 3.6.2
100
97
  specification_version: 4
101
98
  summary: The Connect Gateway service allows connectivity from external parties to
102
99
  connected Kubernetes clusters.