google-iam-v1 1.1.0 → 1.3.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: 5691f21b8f59f8e214278a8b4dd03fa0412703fe4b09589a23743abd6e4964ab
4
- data.tar.gz: a33921f6372f7447275be16120c3cce1a50e80a8814958e7057baac0e02947ac
3
+ metadata.gz: c8626555eec191d5723d2f6d5da770d77856eca9ed63f404cd469593faa3292c
4
+ data.tar.gz: 756904dd4cac6fa57e52ec23cca1944bd9d142990937298acfa57fc94b59ae51
5
5
  SHA512:
6
- metadata.gz: 1ab192d99f5e3b3d5aaa9bae73c0f6add1a8c6c84fcbcb72162105540f6b4c5d1a2b76b965240623813ec568fd11dc6c2eb384615889f540a08ed404335a41c4
7
- data.tar.gz: 7d6c80c950b7b523372becd9cfe921ec29ae777f458c9438fe86df7a6497deeec5c4ab87a8791eab8a328bccd2d6c1ffe060482b60a506718c64012cd2367a7b
6
+ metadata.gz: '0831e33ef91804f731790420afd8c7fe38c137750d230c3277af314ae2b691cb4a73ee449c1f89257801c244a335e9bb7866a68942d0fe0e712152365316c7cc'
7
+ data.tar.gz: 9dec0646bf8d732515cf29a75e9b910e19ca4ec102c39b326dfb4f13b6a30f39bcf0b1409b4d4f076615c6dc9e65168bfc1e8ee1e8c9ff208478962cef87c225
@@ -178,8 +178,28 @@ module Google
178
178
  universe_domain: @config.universe_domain,
179
179
  channel_args: @config.channel_args,
180
180
  interceptors: @config.interceptors,
181
- channel_pool_config: @config.channel_pool
181
+ channel_pool_config: @config.channel_pool,
182
+ logger: @config.logger
182
183
  )
184
+
185
+ @iam_policy_stub.stub_logger&.info do |entry|
186
+ entry.set_system_name
187
+ entry.set_service
188
+ entry.message = "Created client for #{entry.service}"
189
+ entry.set_credentials_fields credentials
190
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
191
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
192
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
193
+ end
194
+ end
195
+
196
+ ##
197
+ # The logger used for request/response debug logging.
198
+ #
199
+ # @return [Logger]
200
+ #
201
+ def logger
202
+ @iam_policy_stub.logger
183
203
  end
184
204
 
185
205
  # Service calls
@@ -279,7 +299,6 @@ module Google
279
299
 
280
300
  @iam_policy_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
281
301
  yield response, operation if block_given?
282
- return response
283
302
  end
284
303
  rescue ::GRPC::BadStatus => e
285
304
  raise ::Google::Cloud::Error.from_error(e)
@@ -371,7 +390,6 @@ module Google
371
390
 
372
391
  @iam_policy_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
373
392
  yield response, operation if block_given?
374
- return response
375
393
  end
376
394
  rescue ::GRPC::BadStatus => e
377
395
  raise ::Google::Cloud::Error.from_error(e)
@@ -469,7 +487,6 @@ module Google
469
487
 
470
488
  @iam_policy_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
471
489
  yield response, operation if block_given?
472
- return response
473
490
  end
474
491
  rescue ::GRPC::BadStatus => e
475
492
  raise ::Google::Cloud::Error.from_error(e)
@@ -519,6 +536,13 @@ module Google
519
536
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
520
537
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
521
538
  # * (`nil`) indicating no credentials
539
+ #
540
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
541
+ # external source for authentication to Google Cloud, you must validate it before
542
+ # providing it to a Google API client library. Providing an unvalidated credential
543
+ # configuration to Google APIs can compromise the security of your systems and data.
544
+ # For more information, refer to [Validate credential configurations from external
545
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
522
546
  # @return [::Object]
523
547
  # @!attribute [rw] scope
524
548
  # The OAuth scopes
@@ -558,6 +582,11 @@ module Google
558
582
  # default endpoint URL. The default value of nil uses the environment
559
583
  # universe (usually the default "googleapis.com" universe).
560
584
  # @return [::String,nil]
585
+ # @!attribute [rw] logger
586
+ # A custom logger to use for request/response debug logging, or the value
587
+ # `:default` (the default) to construct a default logger, or `nil` to
588
+ # explicitly disable logging.
589
+ # @return [::Logger,:default,nil]
561
590
  #
562
591
  class Configuration
563
592
  extend ::Gapic::Config
@@ -582,6 +611,7 @@ module Google
582
611
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
583
612
  config_attr :quota_project, nil, ::String, nil
584
613
  config_attr :universe_domain, nil, ::String, nil
614
+ config_attr :logger, :default, ::Logger, nil, :default
585
615
 
586
616
  # @private
587
617
  def initialize parent_config = nil
@@ -171,8 +171,28 @@ module Google
171
171
  endpoint: @config.endpoint,
172
172
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
173
173
  universe_domain: @config.universe_domain,
174
- credentials: credentials
174
+ credentials: credentials,
175
+ logger: @config.logger
175
176
  )
177
+
178
+ @iam_policy_stub.logger(stub: true)&.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
187
+ end
188
+
189
+ ##
190
+ # The logger used for request/response debug logging.
191
+ #
192
+ # @return [Logger]
193
+ #
194
+ def logger
195
+ @iam_policy_stub.logger
176
196
  end
177
197
 
178
198
  # Service calls
@@ -267,7 +287,6 @@ module Google
267
287
 
268
288
  @iam_policy_stub.set_iam_policy request, options, bindings_override: bindings_override do |result, operation|
269
289
  yield result, operation if block_given?
270
- return result
271
290
  end
272
291
  rescue ::Gapic::Rest::Error => e
273
292
  raise ::Google::Cloud::Error.from_error(e)
@@ -354,7 +373,6 @@ module Google
354
373
 
355
374
  @iam_policy_stub.get_iam_policy request, options, bindings_override: bindings_override do |result, operation|
356
375
  yield result, operation if block_given?
357
- return result
358
376
  end
359
377
  rescue ::Gapic::Rest::Error => e
360
378
  raise ::Google::Cloud::Error.from_error(e)
@@ -447,7 +465,6 @@ module Google
447
465
 
448
466
  @iam_policy_stub.test_iam_permissions request, options, bindings_override: bindings_override do |result, operation|
449
467
  yield result, operation if block_given?
450
- return result
451
468
  end
452
469
  rescue ::Gapic::Rest::Error => e
453
470
  raise ::Google::Cloud::Error.from_error(e)
@@ -495,6 +512,13 @@ module Google
495
512
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
496
513
  # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
497
514
  # * (`nil`) indicating no credentials
515
+ #
516
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
517
+ # external source for authentication to Google Cloud, you must validate it before
518
+ # providing it to a Google API client library. Providing an unvalidated credential
519
+ # configuration to Google APIs can compromise the security of your systems and data.
520
+ # For more information, refer to [Validate credential configurations from external
521
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
498
522
  # @return [::Object]
499
523
  # @!attribute [rw] scope
500
524
  # The OAuth scopes
@@ -527,6 +551,11 @@ module Google
527
551
  # default endpoint URL. The default value of nil uses the environment
528
552
  # universe (usually the default "googleapis.com" universe).
529
553
  # @return [::String,nil]
554
+ # @!attribute [rw] logger
555
+ # A custom logger to use for request/response debug logging, or the value
556
+ # `:default` (the default) to construct a default logger, or `nil` to
557
+ # explicitly disable logging.
558
+ # @return [::Logger,:default,nil]
530
559
  #
531
560
  class Configuration
532
561
  extend ::Gapic::Config
@@ -555,6 +584,7 @@ module Google
555
584
  # by the host service.
556
585
  # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
557
586
  config_attr :bindings_override, {}, ::Hash, nil
587
+ config_attr :logger, :default, ::Logger, nil, :default
558
588
 
559
589
  # @private
560
590
  def initialize parent_config = nil
@@ -29,7 +29,8 @@ module Google
29
29
  # including transcoding, making the REST call, and deserialing the response.
30
30
  #
31
31
  class ServiceStub
32
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
32
+ # @private
33
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
33
34
  # These require statements are intentionally placed here to initialize
34
35
  # the REST modules only when it's required.
35
36
  require "gapic/rest"
@@ -39,7 +40,9 @@ module Google
39
40
  universe_domain: universe_domain,
40
41
  credentials: credentials,
41
42
  numeric_enums: false,
42
- raise_faraday_errors: false
43
+ service_name: self.class,
44
+ raise_faraday_errors: false,
45
+ logger: logger
43
46
  end
44
47
 
45
48
  ##
@@ -60,6 +63,15 @@ module Google
60
63
  @client_stub.endpoint
61
64
  end
62
65
 
66
+ ##
67
+ # The logger used for request/response debug logging.
68
+ #
69
+ # @return [Logger]
70
+ #
71
+ def logger stub: false
72
+ stub ? @client_stub.stub_logger : @client_stub.logger
73
+ end
74
+
63
75
  ##
64
76
  # Baseline implementation for the set_iam_policy REST call
65
77
  #
@@ -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: "set_iam_policy",
94
107
  options: options
95
108
  )
96
109
  operation = ::Gapic::Rest::TransportOperation.new response
97
110
  result = ::Google::Iam::V1::Policy.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
  ##
@@ -128,16 +142,18 @@ module Google
128
142
 
129
143
  response = @client_stub.make_http_request(
130
144
  verb,
131
- uri: uri,
132
- body: body || "",
133
- params: query_string_params,
145
+ uri: uri,
146
+ body: body || "",
147
+ params: query_string_params,
148
+ method_name: "get_iam_policy",
134
149
  options: options
135
150
  )
136
151
  operation = ::Gapic::Rest::TransportOperation.new response
137
152
  result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true
138
-
139
- yield result, operation if block_given?
140
- result
153
+ catch :response do
154
+ yield result, operation if block_given?
155
+ result
156
+ end
141
157
  end
142
158
 
143
159
  ##
@@ -168,16 +184,18 @@ module Google
168
184
 
169
185
  response = @client_stub.make_http_request(
170
186
  verb,
171
- uri: uri,
172
- body: body || "",
173
- params: query_string_params,
187
+ uri: uri,
188
+ body: body || "",
189
+ params: query_string_params,
190
+ method_name: "test_iam_permissions",
174
191
  options: options
175
192
  )
176
193
  operation = ::Gapic::Rest::TransportOperation.new response
177
194
  result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true
178
-
179
- yield result, operation if block_given?
180
- result
195
+ catch :response do
196
+ yield result, operation if block_given?
197
+ result
198
+ end
181
199
  end
182
200
 
183
201
  ##
@@ -20,7 +20,7 @@
20
20
  module Google
21
21
  module Iam
22
22
  module V1
23
- VERSION = "1.1.0"
23
+ VERSION = "1.3.0"
24
24
  end
25
25
  end
26
26
  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-iam-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.3.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
@@ -102,7 +101,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
102
101
  licenses:
103
102
  - Apache-2.0
104
103
  metadata: {}
105
- post_install_message:
106
104
  rdoc_options: []
107
105
  require_paths:
108
106
  - lib
@@ -110,15 +108,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
110
108
  requirements:
111
109
  - - ">="
112
110
  - !ruby/object:Gem::Version
113
- version: '2.7'
111
+ version: '3.0'
114
112
  required_rubygems_version: !ruby/object:Gem::Requirement
115
113
  requirements:
116
114
  - - ">="
117
115
  - !ruby/object:Gem::Version
118
116
  version: '0'
119
117
  requirements: []
120
- rubygems_version: 3.5.22
121
- signing_key:
118
+ rubygems_version: 3.6.2
122
119
  specification_version: 4
123
120
  summary: Manages access control for Google Cloud Platform resources.
124
121
  test_files: []