google-cloud-pubsub 2.15.5 → 2.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/google/cloud/pubsub/project.rb +9 -0
- data/lib/google/cloud/pubsub/service.rb +16 -8
- data/lib/google/cloud/pubsub/version.rb +1 -1
- data/lib/google/cloud/pubsub.rb +18 -15
- data/lib/google-cloud-pubsub.rb +3 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35cc037d6f0aede3871e054b4e0b9a1e05cee0423b88bf690fc86b9fc8f1aade
|
4
|
+
data.tar.gz: 0d2f6d0b84f496f18772b7437e611d0f28c615e063ad6ef2ec7f0d0d5ddb6d13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95e2bd59d4810cf9db705f5a3078d75950c2ceae5908a8d43613f1fc0d0dcf68beb8d13fdef39584ef00bd14b3cb1201327a87b07bbbfe9a5d684c12e6902248
|
7
|
+
data.tar.gz: c50f46c0f07df73a2e3c4490c91a35fae5380c48276bc5513860ec9401dedf7c5ed0415e9375adc7b17259f6e84c0e8f76ede1162f649a7c8cf8b2bf7aceefb3
|
data/CHANGELOG.md
CHANGED
@@ -37,14 +37,17 @@ module Google
|
|
37
37
|
# value to be replaced for unit testing.
|
38
38
|
attr_accessor :client_id
|
39
39
|
|
40
|
+
attr_reader :universe_domain
|
41
|
+
|
40
42
|
##
|
41
43
|
# Creates a new Service instance.
|
42
|
-
def initialize project, credentials, host: nil, timeout: nil
|
44
|
+
def initialize project, credentials, host: nil, timeout: nil, universe_domain: nil
|
43
45
|
@project = project
|
44
46
|
@credentials = credentials
|
45
47
|
@host = host
|
46
48
|
@timeout = timeout
|
47
49
|
@client_id = SecureRandom.uuid.freeze
|
50
|
+
@universe_domain = universe_domain || ENV["GOOGLE_CLOUD_UNIVERSE_DOMAIN"] || "googleapis.com"
|
48
51
|
end
|
49
52
|
|
50
53
|
def subscriber
|
@@ -53,6 +56,7 @@ module Google
|
|
53
56
|
config.credentials = credentials if credentials
|
54
57
|
override_client_config_timeouts config if timeout
|
55
58
|
config.endpoint = host if host
|
59
|
+
config.universe_domain = universe_domain
|
56
60
|
config.lib_name = "gccl"
|
57
61
|
config.lib_version = Google::Cloud::PubSub::VERSION
|
58
62
|
config.metadata = { "google-cloud-resource-prefix": "projects/#{@project}" }
|
@@ -66,6 +70,7 @@ module Google
|
|
66
70
|
config.credentials = credentials if credentials
|
67
71
|
override_client_config_timeouts config if timeout
|
68
72
|
config.endpoint = host if host
|
73
|
+
config.universe_domain = universe_domain
|
69
74
|
config.lib_name = "gccl"
|
70
75
|
config.lib_version = Google::Cloud::PubSub::VERSION
|
71
76
|
config.metadata = { "google-cloud-resource-prefix": "projects/#{@project}" }
|
@@ -75,13 +80,15 @@ module Google
|
|
75
80
|
|
76
81
|
def iam
|
77
82
|
return mocked_iam if mocked_iam
|
78
|
-
@iam ||=
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
83
|
+
@iam ||= begin
|
84
|
+
iam = (@publisher || @subscriber || @schemas || subscriber).iam_policy_client
|
85
|
+
iam.configure do |config|
|
86
|
+
override_client_config_timeouts config if timeout
|
87
|
+
config.lib_name = "gccl"
|
88
|
+
config.lib_version = Google::Cloud::PubSub::VERSION
|
89
|
+
config.metadata = { "google-cloud-resource-prefix": "projects/#{@project}" }
|
90
|
+
end
|
91
|
+
iam
|
85
92
|
end
|
86
93
|
end
|
87
94
|
attr_accessor :mocked_iam
|
@@ -92,6 +99,7 @@ module Google
|
|
92
99
|
config.credentials = credentials if credentials
|
93
100
|
override_client_config_timeouts config if timeout
|
94
101
|
config.endpoint = host if host
|
102
|
+
config.universe_domain = universe_domain
|
95
103
|
config.lib_name = "gccl"
|
96
104
|
config.lib_version = Google::Cloud::PubSub::VERSION
|
97
105
|
config.metadata = { "google-cloud-resource-prefix": "projects/#{@project}" }
|
data/lib/google/cloud/pubsub.rb
CHANGED
@@ -62,6 +62,7 @@ module Google
|
|
62
62
|
# @param [String] project Alias for the `project_id` argument. Deprecated.
|
63
63
|
# @param [String] keyfile Alias for the `credentials` argument.
|
64
64
|
# Deprecated.
|
65
|
+
# @param universe_domain [String] A custom universe domain. Optional.
|
65
66
|
#
|
66
67
|
# @return [Google::Cloud::PubSub::Project]
|
67
68
|
#
|
@@ -77,34 +78,36 @@ module Google
|
|
77
78
|
credentials: nil,
|
78
79
|
scope: nil,
|
79
80
|
timeout: nil,
|
81
|
+
universe_domain: nil,
|
80
82
|
endpoint: nil,
|
81
83
|
emulator_host: nil,
|
82
84
|
project: nil,
|
83
85
|
keyfile: nil
|
84
|
-
project_id
|
85
|
-
scope
|
86
|
-
timeout
|
87
|
-
endpoint
|
86
|
+
project_id ||= (project || default_project_id)
|
87
|
+
scope ||= configure.scope
|
88
|
+
timeout ||= configure.timeout
|
89
|
+
endpoint ||= configure.endpoint
|
90
|
+
universe_domain ||= configure.universe_domain
|
88
91
|
emulator_host ||= configure.emulator_host
|
89
92
|
|
90
93
|
if emulator_host
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
credentials ||= (keyfile || default_credentials(scope: scope))
|
99
|
-
unless credentials.is_a? Google::Auth::Credentials
|
100
|
-
credentials = PubSub::Credentials.new credentials, scope: scope
|
94
|
+
credentials = :this_channel_is_insecure
|
95
|
+
endpoint = emulator_host
|
96
|
+
else
|
97
|
+
credentials ||= (keyfile || default_credentials(scope: scope))
|
98
|
+
unless credentials.is_a? Google::Auth::Credentials
|
99
|
+
credentials = PubSub::Credentials.new credentials, scope: scope
|
100
|
+
end
|
101
101
|
end
|
102
102
|
|
103
103
|
project_id ||= credentials.project_id if credentials.respond_to? :project_id
|
104
104
|
project_id = project_id.to_s # Always cast to a string
|
105
105
|
raise ArgumentError, "project_id is missing" if project_id.empty?
|
106
106
|
|
107
|
-
service = PubSub::Service.new project_id, credentials,
|
107
|
+
service = PubSub::Service.new project_id, credentials,
|
108
|
+
host: endpoint,
|
109
|
+
timeout: timeout,
|
110
|
+
universe_domain: universe_domain
|
108
111
|
PubSub::Project.new service
|
109
112
|
end
|
110
113
|
|
data/lib/google-cloud-pubsub.rb
CHANGED
@@ -110,7 +110,7 @@ module Google
|
|
110
110
|
end
|
111
111
|
|
112
112
|
# Set the default pubsub configuration
|
113
|
-
Google::Cloud.configure.add_config! :pubsub do |config|
|
113
|
+
Google::Cloud.configure.add_config! :pubsub do |config| # rubocop:disable Metrics/BlockLength
|
114
114
|
default_project = Google::Cloud::Config.deferred do
|
115
115
|
ENV["PUBSUB_PROJECT"]
|
116
116
|
end
|
@@ -136,5 +136,6 @@ Google::Cloud.configure.add_config! :pubsub do |config|
|
|
136
136
|
config.add_field! :timeout, nil, match: Numeric
|
137
137
|
config.add_field! :emulator_host, default_emulator, match: String, allow_nil: true
|
138
138
|
config.add_field! :on_error, nil, match: Proc
|
139
|
-
config.add_field! :endpoint,
|
139
|
+
config.add_field! :endpoint, nil, match: String
|
140
|
+
config.add_field! :universe_domain, nil, match: String
|
140
141
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-pubsub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.16.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Moore
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-01-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: concurrent-ruby
|
@@ -45,14 +45,14 @@ dependencies:
|
|
45
45
|
requirements:
|
46
46
|
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: '0.
|
48
|
+
version: '0.20'
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: '0.
|
55
|
+
version: '0.20'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: retriable
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -291,7 +291,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
291
291
|
- !ruby/object:Gem::Version
|
292
292
|
version: '0'
|
293
293
|
requirements: []
|
294
|
-
rubygems_version: 3.
|
294
|
+
rubygems_version: 3.5.3
|
295
295
|
signing_key:
|
296
296
|
specification_version: 4
|
297
297
|
summary: API Client library for Google Cloud Pub/Sub
|