pubnub 5.0.0 → 5.1.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of pubnub might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.github/workflows/commands-handler.yml +2 -2
- data/.github/workflows/release.yml +2 -2
- data/.github/workflows/run_acceptance_tests.yml +4 -4
- data/.github/workflows/validate-pubnub-yml.yml +1 -1
- data/.pubnub.yml +16 -5
- data/.tool-versions +1 -0
- data/.travis.yml +1 -1
- data/CHANGELOG.md +13 -0
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/lib/pubnub/client/events.rb +3 -1
- data/lib/pubnub/client/getters_setters.rb +38 -6
- data/lib/pubnub/client.rb +7 -3
- data/lib/pubnub/event.rb +3 -3
- data/lib/pubnub/events/get_memberships.rb +1 -1
- data/lib/pubnub/events/get_uuid_metadata.rb +1 -1
- data/lib/pubnub/events/grant_token.rb +15 -6
- data/lib/pubnub/events/remove_memberships.rb +1 -1
- data/lib/pubnub/events/remove_uuid_metadata.rb +1 -1
- data/lib/pubnub/events/set_memberships.rb +1 -1
- data/lib/pubnub/events/set_state.rb +1 -1
- data/lib/pubnub/events/set_uuid_metadata.rb +1 -1
- data/lib/pubnub/events/state.rb +1 -1
- data/lib/pubnub/events/where_now.rb +1 -1
- data/lib/pubnub/subscriber.rb +1 -1
- data/lib/pubnub/validators/client.rb +1 -1
- data/lib/pubnub/validators/common_validator.rb +6 -7
- data/lib/pubnub/validators/grant_token.rb +14 -0
- data/lib/pubnub/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d70695efe21884b16439d5da8f0f79bf6b109b11ada3bfae03b845ab24de5c2
|
4
|
+
data.tar.gz: ca0dd0fb96e5996e4fae11e8c17e0650db7e349f0e4efd26224bdcd5400294f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78c9e309072c4f9260671678f8da2300b9939e9a2a0e98d156c89bc461d31dc266150e92ef672b5d3875442c1070fac16bcfbea218021b307257679e0fbe1d79
|
7
|
+
data.tar.gz: e7a4ada62d551ebc5fe04b5d3474b9c04b30bb0b0414f7c629b85a0dc30906a57dca45f38364e47ffc2da6f4a51d747312e1307a81b1617bfa824b4aec20d789
|
@@ -11,9 +11,9 @@ jobs:
|
|
11
11
|
runs-on: ubuntu-latest
|
12
12
|
steps:
|
13
13
|
- name: Checkout repository
|
14
|
-
uses: actions/checkout@
|
14
|
+
uses: actions/checkout@v3
|
15
15
|
- name: Checkout release actions
|
16
|
-
uses: actions/checkout@
|
16
|
+
uses: actions/checkout@v3
|
17
17
|
with:
|
18
18
|
repository: pubnub/client-engineering-deployment-tools
|
19
19
|
ref: v1
|
@@ -33,12 +33,12 @@ jobs:
|
|
33
33
|
if: ${{ needs.check-release.outputs.release == 'true' }}
|
34
34
|
steps:
|
35
35
|
- name: Checkout repository
|
36
|
-
uses: actions/checkout@
|
36
|
+
uses: actions/checkout@v3
|
37
37
|
with:
|
38
38
|
# This should be the same as the one specified for on.pull_request.branches
|
39
39
|
ref: master
|
40
40
|
- name: Checkout actions
|
41
|
-
uses: actions/checkout@
|
41
|
+
uses: actions/checkout@v3
|
42
42
|
with:
|
43
43
|
repository: pubnub/client-engineering-deployment-tools
|
44
44
|
ref: v1
|
@@ -8,12 +8,12 @@ jobs:
|
|
8
8
|
runs-on: ubuntu-latest
|
9
9
|
steps:
|
10
10
|
- name: Checkout project
|
11
|
-
uses: actions/checkout@
|
11
|
+
uses: actions/checkout@v3
|
12
12
|
- name: Checkout mock-server action
|
13
|
-
uses: actions/checkout@
|
13
|
+
uses: actions/checkout@v3
|
14
14
|
with:
|
15
15
|
repository: pubnub/client-engineering-deployment-tools
|
16
|
-
ref:
|
16
|
+
ref: v1
|
17
17
|
token: ${{ secrets.GH_TOKEN }}
|
18
18
|
path: client-engineering-deployment-tools
|
19
19
|
- name: Run mock server action
|
@@ -36,7 +36,7 @@ jobs:
|
|
36
36
|
jrm ./main.xml "./main/**/*.xml" &&
|
37
37
|
jrm ./beta.xml "./beta/**/*.xml"
|
38
38
|
- name: Expose main report
|
39
|
-
uses: actions/upload-artifact@
|
39
|
+
uses: actions/upload-artifact@v3
|
40
40
|
if: always()
|
41
41
|
with:
|
42
42
|
name: acceptance-test-reports
|
data/.pubnub.yml
CHANGED
@@ -1,6 +1,18 @@
|
|
1
1
|
---
|
2
|
-
version: "5.
|
2
|
+
version: "5.1.1"
|
3
3
|
changelog:
|
4
|
+
- date: 2022-10-26
|
5
|
+
version: v5.1.1
|
6
|
+
changes:
|
7
|
+
- type: bug
|
8
|
+
text: "Fix issue because of which `callback` and `http_sync` provided during client configuration not used when missing in method call."
|
9
|
+
- date: 2022-07-26
|
10
|
+
version: v5.1.0
|
11
|
+
changes:
|
12
|
+
- type: feature
|
13
|
+
text: "Add support for spaces and users permissions in grant_token."
|
14
|
+
- type: feature
|
15
|
+
text: "Add user_id and deprecate uuid when creating new pubnub instance."
|
4
16
|
- date: 2022-01-13
|
5
17
|
version: v5.0.0
|
6
18
|
changes:
|
@@ -447,7 +459,6 @@ features:
|
|
447
459
|
- PUSH-TYPE-APNS
|
448
460
|
- PUSH-TYPE-APNS2
|
449
461
|
- PUSH-TYPE-FCM
|
450
|
-
- PUSH-TYPE-MPNS
|
451
462
|
storage:
|
452
463
|
- STORAGE-REVERSE
|
453
464
|
- STORAGE-INCLUDE-TIMETOKEN
|
@@ -626,7 +637,7 @@ sdks:
|
|
626
637
|
- x86-64
|
627
638
|
- distribution-type: package
|
628
639
|
distribution-repository: RubyGems
|
629
|
-
package-name: pubnub-5.
|
640
|
+
package-name: pubnub-5.1.1.gem
|
630
641
|
location: https://rubygems.org/gems/pubnub
|
631
642
|
requires:
|
632
643
|
- name: addressable
|
@@ -731,8 +742,8 @@ sdks:
|
|
731
742
|
- x86-64
|
732
743
|
- distribution-type: library
|
733
744
|
distribution-repository: GitHub release
|
734
|
-
package-name: pubnub-5.
|
735
|
-
location: https://github.com/pubnub/ruby/releases/download/v5.
|
745
|
+
package-name: pubnub-5.1.1.gem
|
746
|
+
location: https://github.com/pubnub/ruby/releases/download/v5.1.1/pubnub-5.1.1.gem
|
736
747
|
requires:
|
737
748
|
- name: addressable
|
738
749
|
min-version: 2.0.0
|
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 2.7.6
|
data/.travis.yml
CHANGED
@@ -26,7 +26,7 @@ jobs:
|
|
26
26
|
rvm: '2.7.1'
|
27
27
|
script: bundle exec rspec
|
28
28
|
- name: 'Ruby JRuby'
|
29
|
-
rvm: 'jruby-
|
29
|
+
rvm: 'jruby-9.3.4.0'
|
30
30
|
env: JRUBY_TEST=true NO_COVERAGE=true JRUBY_OPTS="--server -J-Xms2048m -J-Xmx2048m -J-XX:-UseGCOverheadLimit -J-XX:+CMSClassUnloadingEnabled"
|
31
31
|
jdk: oraclejdk11
|
32
32
|
script:
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
## v5.1.1
|
2
|
+
October 26 2022
|
3
|
+
|
4
|
+
#### Fixed
|
5
|
+
- Fix issue because of which `callback` and `http_sync` provided during client configuration not used when missing in method call.
|
6
|
+
|
7
|
+
## v5.1.0
|
8
|
+
July 26 2022
|
9
|
+
|
10
|
+
#### Added
|
11
|
+
- Add support for spaces and users permissions in grant_token.
|
12
|
+
- Add user_id and deprecate uuid when creating new pubnub instance.
|
13
|
+
|
1
14
|
## v5.0.0
|
2
15
|
January 13 2022
|
3
16
|
|
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
5.
|
1
|
+
5.1.1
|
data/lib/pubnub/client/events.rb
CHANGED
@@ -15,11 +15,13 @@ module Pubnub
|
|
15
15
|
EVENTS.each do |event_name|
|
16
16
|
define_method event_name do |options = {}, &block|
|
17
17
|
options[:callback] = block if options[:callback].nil?
|
18
|
+
# Use constructor-provided :callback if nothing passed to method call.
|
19
|
+
options[:callback] = self.env[:callback] if options[:callback].nil?
|
18
20
|
event = Pubnub.const_get(
|
19
21
|
Formatter.classify_method(event_name)
|
20
22
|
).new(options, self)
|
21
23
|
|
22
|
-
if
|
24
|
+
if event.sync?
|
23
25
|
event.fire
|
24
26
|
elsif event.is_a? SubscribeEvent
|
25
27
|
@subscriber.add_subscription(event)
|
@@ -7,6 +7,8 @@ module Pubnub
|
|
7
7
|
# Module that holds some getters and setters
|
8
8
|
module GettersSetters
|
9
9
|
|
10
|
+
extend Gem::Deprecate
|
11
|
+
|
10
12
|
def sdk_version
|
11
13
|
"PubNub-Ruby/#{Pubnub::VERSION}"
|
12
14
|
end
|
@@ -15,7 +17,7 @@ module Pubnub
|
|
15
17
|
# ===========
|
16
18
|
# <dl>
|
17
19
|
# <dt>uuid</dt>
|
18
|
-
# <dd>New uuid to be set
|
20
|
+
# <dd>New uuid to be set. Note that this will override user_id value</dd>
|
19
21
|
# </dl>
|
20
22
|
#
|
21
23
|
# Returns:
|
@@ -26,16 +28,38 @@ module Pubnub
|
|
26
28
|
# ==============
|
27
29
|
# Can't change uuid while subscribed. You have to leave every subscribed channel.
|
28
30
|
def change_uuid(uuid)
|
29
|
-
|
30
|
-
|
31
|
-
|
31
|
+
change_user_id(uuid)
|
32
|
+
end
|
33
|
+
deprecate :change_uuid, :change_user_id, 2023, 1
|
32
34
|
|
33
|
-
|
35
|
+
# Parameters:
|
36
|
+
# ===========
|
37
|
+
# <dl>
|
38
|
+
# <dt>user_id</dt>
|
39
|
+
# <dd>New user_id to be set. Note that this will override uuid value</dd>
|
40
|
+
# </dl>
|
41
|
+
#
|
42
|
+
# Returns:
|
43
|
+
# ========
|
44
|
+
# New user_id.
|
45
|
+
#
|
46
|
+
# Functionality:
|
47
|
+
# ==============
|
48
|
+
# Can't change user_id while subscribed. You have to leave every subscribed channel.
|
49
|
+
def change_user_id(user_id)
|
50
|
+
Pubnub.logger.debug('Pubnub::Client') { 'Changing user_id' }
|
51
|
+
raise('Cannot change user_id while subscribed.') if subscribed?
|
52
|
+
Validator::Client.validate_user_id user_id
|
53
|
+
|
54
|
+
@env[:user_id] = user_id
|
34
55
|
end
|
35
56
|
|
36
57
|
alias session_uuid= change_uuid
|
37
58
|
alias uuid= change_uuid
|
38
59
|
alias set_uuid= change_uuid
|
60
|
+
alias session_user_id= change_user_id
|
61
|
+
alias user_id= change_user_id
|
62
|
+
alias set_user_id= change_user_id
|
39
63
|
|
40
64
|
# Returns:
|
41
65
|
# ========
|
@@ -97,7 +121,15 @@ module Pubnub
|
|
97
121
|
# ========
|
98
122
|
# Current uuid.
|
99
123
|
def uuid
|
100
|
-
|
124
|
+
user_id
|
125
|
+
end
|
126
|
+
deprecate :uuid, :user_id, 2023, 1
|
127
|
+
|
128
|
+
# Returns:
|
129
|
+
# ========
|
130
|
+
# Current user_id.
|
131
|
+
def user_id
|
132
|
+
@env[:user_id]
|
101
133
|
end
|
102
134
|
|
103
135
|
# Returns:
|
data/lib/pubnub/client.rb
CHANGED
@@ -111,7 +111,10 @@ module Pubnub
|
|
111
111
|
# <dd><b>optional.</b> Required to encrypt messages.</dd>
|
112
112
|
#
|
113
113
|
# <dt>uuid</dt>
|
114
|
-
# <dd><b>optional.</b> Sets given uuid as client uuid, does not generates random uuid on init as usually
|
114
|
+
# <dd><b>optional.</b> <b>Deprecated.</b> Sets given uuid as client uuid, does not generates random uuid on init as usually</dd>
|
115
|
+
#
|
116
|
+
# <dt>user_id</dt>
|
117
|
+
# <dd><b>required.</b> Sets given user_id as client user_id.</dd>
|
115
118
|
#
|
116
119
|
# <dt>origin</dt>
|
117
120
|
# <dd><b>optional.</b> Specifies the fully qualified domain name of the PubNub origin.
|
@@ -155,7 +158,7 @@ module Pubnub
|
|
155
158
|
# publish_key: :demo,
|
156
159
|
# secret_key: :secret,
|
157
160
|
# cipher_key: :other_secret,
|
158
|
-
#
|
161
|
+
# user_id: :mad_max,
|
159
162
|
# origin: 'custom.pubnub.com',
|
160
163
|
# callback: ->(envelope) { puts envelope.message },
|
161
164
|
# connect_callback: ->(message) { puts message },
|
@@ -289,7 +292,7 @@ module Pubnub
|
|
289
292
|
|
290
293
|
def sequence_number_for_publish!
|
291
294
|
@env[:sequence_number_for_publish] += 1
|
292
|
-
@env[:sequence_number_for_publish] % 2**32
|
295
|
+
@env[:sequence_number_for_publish] % 2 ** 32
|
293
296
|
end
|
294
297
|
|
295
298
|
def apply_state(event)
|
@@ -379,6 +382,7 @@ module Pubnub
|
|
379
382
|
Pubnub.logger = options[:logger] || Logger.new('pubnub.log')
|
380
383
|
Concurrent.global_logger = Pubnub.logger
|
381
384
|
@subscriber = Subscriber.new(self)
|
385
|
+
options[:user_id] = options[:uuid] if options[:user_id].nil?
|
382
386
|
@env = options
|
383
387
|
end
|
384
388
|
|
data/lib/pubnub/event.rb
CHANGED
@@ -148,7 +148,7 @@ module Pubnub
|
|
148
148
|
token = @app.env[:token]
|
149
149
|
empty_if_blank = {
|
150
150
|
auth: token ? token : @auth_key,
|
151
|
-
uuid: @app.
|
151
|
+
uuid: @app.user_id,
|
152
152
|
@telemetry_name => @current_telemetry
|
153
153
|
}
|
154
154
|
|
@@ -175,7 +175,7 @@ module Pubnub
|
|
175
175
|
state channel_group channel_groups compressed meta customs include_token
|
176
176
|
replicate with_presence cipher_key_selector include_meta join update get
|
177
177
|
add remove push_token push_gateway environment topic authorized_uuid
|
178
|
-
token
|
178
|
+
authorized_user_id token
|
179
179
|
]
|
180
180
|
|
181
181
|
options = options.each_with_object({}) { |option, obj| obj[option.first.to_sym] = option.last }
|
@@ -223,7 +223,7 @@ module Pubnub
|
|
223
223
|
def get_config
|
224
224
|
{
|
225
225
|
tls: @app.env[:ssl],
|
226
|
-
uuid: @app.
|
226
|
+
uuid: @app.user_id,
|
227
227
|
auth_key: @app.env[:auth_key],
|
228
228
|
origin: @app.current_origin
|
229
229
|
}
|
@@ -10,7 +10,7 @@ module Pubnub
|
|
10
10
|
def initialize(options, app)
|
11
11
|
@event = current_operation
|
12
12
|
@telemetry_name = :l_obj
|
13
|
-
@uuid = options[:uuid].nil? ? app.
|
13
|
+
@uuid = options[:uuid].nil? ? app.user_id : options[:uuid]
|
14
14
|
@limit = [options[:limit], 100].min unless options[:limit].nil?
|
15
15
|
@sort = options[:sort].join(",") if options[:sort] && !options[:sort].empty?
|
16
16
|
@filter = options[:filter] if options[:filter] && !options[:filter].empty?
|
@@ -10,7 +10,7 @@ module Pubnub
|
|
10
10
|
def initialize(options, app)
|
11
11
|
@event = current_operation
|
12
12
|
@telemetry_name = :l_obj
|
13
|
-
@uuid = options[:uuid].nil? ? app.
|
13
|
+
@uuid = options[:uuid].nil? ? app.user_id : options[:uuid]
|
14
14
|
|
15
15
|
if options[:include]
|
16
16
|
@include = "custom" unless [0, '0', false].include?(options[:include][:custom])
|
@@ -10,19 +10,28 @@ module Pubnub
|
|
10
10
|
@uuids = options[:uuids] || {}
|
11
11
|
options[:channels] = options[:channels] || {}
|
12
12
|
options[:channel_groups] = options[:channel_groups] || {}
|
13
|
+
@spaces_permissions = options[:spaces_permissions] || {}
|
14
|
+
@users_permissions = options[:users_permissions] || {}
|
13
15
|
super
|
14
16
|
end
|
15
17
|
|
16
18
|
def fire
|
17
19
|
Pubnub.logger.debug('Pubnub::GrantToken') { "Fired event #{self.class}" }
|
20
|
+
if @authorized_user_id != nil
|
21
|
+
uuid = @authorized_user_id
|
22
|
+
elsif @authorized_uuid != nil
|
23
|
+
uuid = @authorized_uuid
|
24
|
+
else
|
25
|
+
uuid = nil
|
26
|
+
end
|
18
27
|
|
19
28
|
raw_body = {
|
20
29
|
ttl: @ttl,
|
21
30
|
permissions: {
|
22
31
|
meta: @meta,
|
23
|
-
uuid:
|
24
|
-
resources: prepare_permissions(:resource, @channels, @channel_groups, @uuids),
|
25
|
-
patterns: prepare_permissions(:pattern, @channels, @channel_groups, @uuids)
|
32
|
+
uuid: uuid,
|
33
|
+
resources: prepare_permissions(:resource, @channels, @channel_groups, @uuids, @spaces_permissions, @users_permissions),
|
34
|
+
patterns: prepare_permissions(:pattern, @channels, @channel_groups, @uuids, @spaces_permissions, @users_permissions)
|
26
35
|
}.select { |_, v| v }
|
27
36
|
}
|
28
37
|
body = Formatter.format_message(raw_body, "", false, false)
|
@@ -47,11 +56,11 @@ module Pubnub
|
|
47
56
|
Pubnub::Constants::OPERATION_GRANT_TOKEN
|
48
57
|
end
|
49
58
|
|
50
|
-
def prepare_permissions(type, channels, groups, uuids)
|
59
|
+
def prepare_permissions(type, channels, groups, uuids, spaces_permissions, users_permissions)
|
51
60
|
{
|
52
|
-
channels: prepare_single_permissions(type, channels),
|
61
|
+
channels: prepare_single_permissions(type, channels).merge!(prepare_single_permissions(type, spaces_permissions)),
|
53
62
|
groups: prepare_single_permissions(type, groups),
|
54
|
-
uuids: prepare_single_permissions(type, uuids)
|
63
|
+
uuids: prepare_single_permissions(type, uuids).merge!(prepare_single_permissions(type, users_permissions))
|
55
64
|
}
|
56
65
|
end
|
57
66
|
|
@@ -10,7 +10,7 @@ module Pubnub
|
|
10
10
|
def initialize(options, app)
|
11
11
|
@event = current_operation
|
12
12
|
@telemetry_name = :l_obj
|
13
|
-
@uuid = options[:uuid].nil? ? app.
|
13
|
+
@uuid = options[:uuid].nil? ? app.user_id : options[:uuid]
|
14
14
|
@limit = [options[:limit], 100].min unless options[:limit].nil?
|
15
15
|
@sort = options[:sort].join(",") if options[:sort] && !options[:sort].empty?
|
16
16
|
@filter = options[:filter] if options[:filter] && !options[:filter].empty?
|
@@ -10,7 +10,7 @@ module Pubnub
|
|
10
10
|
def initialize(options, app)
|
11
11
|
@event = current_operation
|
12
12
|
@telemetry_name = :l_obj
|
13
|
-
@uuid = options[:uuid].nil? ? app.
|
13
|
+
@uuid = options[:uuid].nil? ? app.user_id : options[:uuid]
|
14
14
|
@limit = [options[:limit], 100].min unless options[:limit].nil?
|
15
15
|
@sort = options[:sort].join(",") if options[:sort] && !options[:sort].empty?
|
16
16
|
@filter = options[:filter] if options[:filter] && !options[:filter].empty?
|
@@ -10,7 +10,7 @@ module Pubnub
|
|
10
10
|
def initialize(options, app)
|
11
11
|
@event = current_operation
|
12
12
|
@telemetry_name = :l_obj
|
13
|
-
@uuid = options[:uuid].nil? ? app.
|
13
|
+
@uuid = options[:uuid].nil? ? app.user_id : options[:uuid]
|
14
14
|
|
15
15
|
# Clean up user-provided metadata object from nils.
|
16
16
|
@metadata = options[:metadata].delete_if { |_k, v| v.blank? } unless options[:metadata].nil?
|
data/lib/pubnub/events/state.rb
CHANGED
data/lib/pubnub/subscriber.rb
CHANGED
@@ -11,7 +11,7 @@ module Pubnub
|
|
11
11
|
validate_origin parameters[:origin], true
|
12
12
|
validate_subscribe_key parameters[:subscribe_key], true
|
13
13
|
validate_publish_key parameters[:publish_key]
|
14
|
-
|
14
|
+
validate_user_id parameters[:user_id]
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
@@ -53,18 +53,17 @@ module Pubnub
|
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
|
-
|
57
|
-
|
58
|
-
if !uuid || uuid.blank?
|
56
|
+
def validate_user_id(user_id)
|
57
|
+
if !user_id || user_id.blank?
|
59
58
|
raise(
|
60
59
|
InitializationError.new,
|
61
|
-
'Missing required :
|
60
|
+
'Missing required :user_id parameter.'
|
62
61
|
)
|
63
|
-
elsif !([String, Symbol].include?(
|
64
|
-
|
62
|
+
elsif !([String, Symbol].include?(user_id.class) ||
|
63
|
+
user_id.blank?)
|
65
64
|
raise(
|
66
65
|
InitializationError.new,
|
67
|
-
'
|
66
|
+
'user_id parameter is not valid. \
|
68
67
|
Should be type of String or Symbol.'
|
69
68
|
)
|
70
69
|
end
|
@@ -12,6 +12,7 @@ module Pubnub
|
|
12
12
|
validate_permissions!(@uuids, ":uuids")
|
13
13
|
validate_permissions!(@channels, ":channels")
|
14
14
|
validate_permissions!(@channel_groups, ":uuids")
|
15
|
+
validate_objects_entities_separation!
|
15
16
|
end
|
16
17
|
|
17
18
|
private
|
@@ -45,6 +46,19 @@ module Pubnub
|
|
45
46
|
":#{name} has to be kind of Hash for grant token event."
|
46
47
|
) unless arg.is_a?(Hash)
|
47
48
|
end
|
49
|
+
|
50
|
+
def validate_objects_entities_separation!
|
51
|
+
entities_set = !@spaces_permissions.empty? ||
|
52
|
+
!@users_permissions.empty?
|
53
|
+
objects_set = !@channels.empty? ||
|
54
|
+
!@channel_groups.empty? ||
|
55
|
+
!@uuids.empty?
|
56
|
+
|
57
|
+
raise(
|
58
|
+
ArgumentError.new(object: self, message: "Can't mix entities and objects"),
|
59
|
+
"Can't mix entities and objects"
|
60
|
+
) if (entities_set && objects_set)
|
61
|
+
end
|
48
62
|
end
|
49
63
|
end
|
50
64
|
end
|
data/lib/pubnub/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pubnub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PubNub
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -139,6 +139,7 @@ files:
|
|
139
139
|
- ".gitignore"
|
140
140
|
- ".pubnub.yml"
|
141
141
|
- ".rubocop.yml"
|
142
|
+
- ".tool-versions"
|
142
143
|
- ".travis.yml"
|
143
144
|
- ".yardopts"
|
144
145
|
- CHANGELOG.md
|