google-cloud-pubsub-v1 0.20.0 → 0.20.2

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: 5479709940e3c5ec0a3e6d1ed4501f5bb5bce26a606a82257b7a9c2defbb44e7
4
- data.tar.gz: 2700385f177b6d24507c97690211a89a8c0bb75afd47e53ecd799f9afd61c160
3
+ metadata.gz: 5c4ad31b7fba0941ac331f0c4dce8fce269220daa35c28319c0b47a9670ec8ce
4
+ data.tar.gz: 3d00ae547c0716674a2041a0752a3f94c190dd5ebce17c26516d95288bc10e7b
5
5
  SHA512:
6
- metadata.gz: ad29abe317f624519de2ae3b4ff3efe01def663bb1d5c0298537993fc0ea3f2bdeaa88e831bc18864fd92de26fa65edb50d07677541bcfb24cd62c81c9896fc4
7
- data.tar.gz: 99ae9125c5cebe7f28a77d3458960906e9581801a9e87b598cf8a1f52d5a90264a9c7bfb0cfa14a5d1b661954f3c9cf761f91319493ae5e961e8cf476cb1ad58
6
+ metadata.gz: e2193843c3ad756620ee68d816a760c35f81d021d9c8e5af23e8f55f5c21d706bf29d6319df492cc44de171681738560ff8ce988b7bbc71e3bb540fda2cc040b
7
+ data.tar.gz: 714c5000a89f215969db48c8d14d3728bfb1057dba8674a787e3f85e21813ce4b3345d216a57341294c41e8cdefdb72e4b5061f80482c91dca58d04b6274d5c7
@@ -32,6 +32,9 @@ module Google
32
32
  # legacy class.
33
33
  #
34
34
  class Client
35
+ # @private
36
+ DEFAULT_ENDPOINT_TEMPLATE = "pubsub.$UNIVERSE_DOMAIN$"
37
+
35
38
  # @private
36
39
  attr_reader :iam_policy_stub
37
40
 
@@ -83,8 +86,9 @@ module Google
83
86
  credentials = @config.credentials
84
87
  # Use self-signed JWT if the endpoint is unchanged from default,
85
88
  # but only if the default endpoint does not have a region prefix.
86
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
87
- !@config.endpoint.split(".").first.include?("-")
89
+ enable_self_signed_jwt = @config.endpoint.nil? ||
90
+ (@config.endpoint == Client.configure.endpoint &&
91
+ !@config.endpoint.split(".").first.include?("-"))
88
92
  credentials ||= Credentials.default scope: @config.scope,
89
93
  enable_self_signed_jwt: enable_self_signed_jwt
90
94
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -95,8 +99,10 @@ module Google
95
99
 
96
100
  @iam_policy_stub = ::Gapic::ServiceStub.new(
97
101
  ::Google::Iam::V1::IAMPolicy::Stub,
98
- credentials: credentials,
99
- endpoint: @config.endpoint,
102
+ credentials: credentials,
103
+ endpoint: @config.endpoint,
104
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
105
+ universe_domain: @config.universe_domain,
100
106
  channel_args: @config.channel_args,
101
107
  interceptors: @config.interceptors
102
108
  )
@@ -242,7 +248,7 @@ module Google
242
248
  class Configuration
243
249
  extend ::Gapic::Config
244
250
 
245
- config_attr :endpoint, "pubsub.googleapis.com", ::String
251
+ config_attr :endpoint, nil, ::String, nil
246
252
  config_attr :credentials, nil do |value|
247
253
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
248
254
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -257,6 +263,7 @@ module Google
257
263
  config_attr :metadata, nil, ::Hash, nil
258
264
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
259
265
  config_attr :quota_project, nil, ::String, nil
266
+ config_attr :universe_domain, nil, ::String, nil
260
267
 
261
268
  # @private
262
269
  def initialize parent_config = nil
@@ -193,13 +193,6 @@ module Google
193
193
  @quota_project_id = @config.quota_project
194
194
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
195
195
 
196
- @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
197
- config.credentials = credentials
198
- config.quota_project = @quota_project_id
199
- config.endpoint = @config.endpoint
200
- config.universe_domain = @config.universe_domain
201
- end
202
-
203
196
  @publisher_stub = ::Gapic::ServiceStub.new(
204
197
  ::Google::Cloud::PubSub::V1::Publisher::Stub,
205
198
  credentials: credentials,
@@ -210,6 +203,13 @@ module Google
210
203
  interceptors: @config.interceptors,
211
204
  channel_pool_config: @config.channel_pool
212
205
  )
206
+
207
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
208
+ config.credentials = credentials
209
+ config.quota_project = @quota_project_id
210
+ config.endpoint = @publisher_stub.endpoint
211
+ config.universe_domain = @publisher_stub.universe_domain
212
+ end
213
213
  end
214
214
 
215
215
  ##
@@ -197,13 +197,6 @@ module Google
197
197
  @quota_project_id = @config.quota_project
198
198
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
199
199
 
200
- @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
201
- config.credentials = credentials
202
- config.quota_project = @quota_project_id
203
- config.endpoint = @config.endpoint
204
- config.universe_domain = @config.universe_domain
205
- end
206
-
207
200
  @schema_service_stub = ::Gapic::ServiceStub.new(
208
201
  ::Google::Cloud::PubSub::V1::SchemaService::Stub,
209
202
  credentials: credentials,
@@ -214,6 +207,13 @@ module Google
214
207
  interceptors: @config.interceptors,
215
208
  channel_pool_config: @config.channel_pool
216
209
  )
210
+
211
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
212
+ config.credentials = credentials
213
+ config.quota_project = @quota_project_id
214
+ config.endpoint = @schema_service_stub.endpoint
215
+ config.universe_domain = @schema_service_stub.universe_domain
216
+ end
217
217
  end
218
218
 
219
219
  ##
@@ -229,13 +229,6 @@ module Google
229
229
  @quota_project_id = @config.quota_project
230
230
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
231
231
 
232
- @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
233
- config.credentials = credentials
234
- config.quota_project = @quota_project_id
235
- config.endpoint = @config.endpoint
236
- config.universe_domain = @config.universe_domain
237
- end
238
-
239
232
  @subscriber_stub = ::Gapic::ServiceStub.new(
240
233
  ::Google::Cloud::PubSub::V1::Subscriber::Stub,
241
234
  credentials: credentials,
@@ -246,6 +239,13 @@ module Google
246
239
  interceptors: @config.interceptors,
247
240
  channel_pool_config: @config.channel_pool
248
241
  )
242
+
243
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
244
+ config.credentials = credentials
245
+ config.quota_project = @quota_project_id
246
+ config.endpoint = @subscriber_stub.endpoint
247
+ config.universe_domain = @subscriber_stub.universe_domain
248
+ end
249
249
  end
250
250
 
251
251
  ##
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module PubSub
23
23
  module V1
24
- VERSION = "0.20.0"
24
+ VERSION = "0.20.2"
25
25
  end
26
26
  end
27
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-pubsub-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.0
4
+ version: 0.20.2
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-01-11 00:00:00.000000000 Z
11
+ date: 2024-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common