google-cloud-gke_connect-gateway-v1 0.2.0 → 0.3.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: d5bfa0b1d025932450f73fa9c2ffda0a56bf039af9c584c58238551ce056021c
4
- data.tar.gz: cf6901daedf545821cc5d75d11d78a7227648425d06213d14a78705c49bc4883
3
+ metadata.gz: bf31c06923746970373cfc469239c99aa7d21e486c32e1862f8b4003454e0548
4
+ data.tar.gz: 5235b8931325382660bfaae4e8589b588427915fc80ef063f30ecc901cb678cd
5
5
  SHA512:
6
- metadata.gz: 8b2b680e9edba19669b396db848318f49e4191eb2503836721947a50a1460f8a64772544fb67b410aa61c39cc14101801831fb32ea4f89523ef56f93f30d9800
7
- data.tar.gz: 37d7ed34d52c0d4484e99a549702b8e334d0c1691b475c9886dbde1b8d36fde5cb4b3a16aa255afd51b8b09eced7adbb5540f67e0ac50b2cd6d7b3286f3dd88e
6
+ metadata.gz: dc1bc33619d7cc41372ba19ba2220df4d0726ece51aaec2292e7ce1beba2852b8ddf8759ea0846cdf92285eba8cefee2a6b8178a51e7fe1bdb9215483548e819
7
+ data.tar.gz: c37c758dcce84781fb1a0258d08b39d0a2e2af465b40a63f8a605bb2c9169ccbd9c437c1b0d38636f03dd61e830b069f422e9924030868ea2d3df886b5ecabd5
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
 
@@ -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)
@@ -333,6 +352,11 @@ module Google
333
352
  # default endpoint URL. The default value of nil uses the environment
334
353
  # universe (usually the default "googleapis.com" universe).
335
354
  # @return [::String,nil]
355
+ # @!attribute [rw] logger
356
+ # A custom logger to use for request/response debug logging, or the value
357
+ # `:default` (the default) to construct a default logger, or `nil` to
358
+ # explicitly disable logging.
359
+ # @return [::Logger,:default,nil]
336
360
  #
337
361
  class Configuration
338
362
  extend ::Gapic::Config
@@ -354,6 +378,7 @@ module Google
354
378
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
355
379
  config_attr :quota_project, nil, ::String, nil
356
380
  config_attr :universe_domain, nil, ::String, nil
381
+ config_attr :logger, :default, ::Logger, nil, :default
357
382
 
358
383
  # @private
359
384
  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.3.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,14 @@
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.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-14 00:00:00.000000000 Z
11
+ date: 2024-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.21.1
19
+ version: 0.24.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 2.a
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 0.21.1
29
+ version: 0.24.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.a
@@ -95,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  requirements: []
98
- rubygems_version: 3.5.22
98
+ rubygems_version: 3.5.23
99
99
  signing_key:
100
100
  specification_version: 4
101
101
  summary: The Connect Gateway service allows connectivity from external parties to