pubnub 4.1.2 → 4.1.5
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 +5 -5
- data/.pubnub.yml +8 -1
- data/.rubocop.yml +3 -1
- data/.travis.yml +2 -1
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +74 -68
- data/README.md +1 -1
- data/VERSION +1 -2
- data/lib/pubnub/events/add_channels_to_push.rb +3 -2
- data/lib/pubnub/events/list_push_provisions.rb +2 -2
- data/lib/pubnub/events/remove_channels_from_push.rb +3 -2
- data/lib/pubnub/events/remove_device_from_push.rb +2 -2
- data/lib/pubnub/schemas/envelope_schema.rb +54 -27
- data/lib/pubnub/subscribe_event/formatter.rb +2 -2
- data/lib/pubnub/validators/push.rb +5 -5
- data/lib/pubnub/version.rb +1 -1
- data/pubnub.gemspec +6 -5
- data/spec/examples/audit_examples_spec.rb +1 -1
- data/spec/examples/grant_examples_spec.rb +1 -1
- data/spec/examples/publish_with_ttl_spec.rb +2 -2
- data/spec/examples/revoke_examples_spec.rb +1 -1
- data/spec/lib/custom_retries_examples_spec.rb +1 -1
- data/spec/lib/events/audit_spec.rb +7 -7
- data/spec/lib/events/channel_registration_spec.rb +3 -3
- data/spec/lib/events/delete_messages_spec.rb +2 -2
- data/spec/lib/events/grant_spec.rb +6 -6
- data/spec/lib/events/heartbeat_spec.rb +2 -2
- data/spec/lib/events/here_now_spec.rb +3 -3
- data/spec/lib/events/history_spec.rb +3 -3
- data/spec/lib/events/leave_spec.rb +2 -2
- data/spec/lib/events/presence_spec.rb +5 -5
- data/spec/lib/events/publish_spec.rb +2 -2
- data/spec/lib/events/revoke_spec.rb +5 -5
- data/spec/lib/events/state_spec.rb +3 -3
- data/spec/lib/events/subscribe_spec.rb +12 -12
- data/spec/lib/events/time_spec.rb +2 -2
- data/spec/lib/events/timeout_handling_spec.rb +1 -1
- data/spec/lib/events/where_now_spec.rb +3 -3
- data/spec/lib/signatures_spec.rb +13 -13
- data/spec/lib/ssl_error_spec.rb +1 -1
- data/spec/lib/super_admin_spec.rb +1 -1
- data/spec/spec_expectations.rb +12 -1
- metadata +14 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 242c68a87d13a592b515cb79a777a446dd116c1c695572ff380f6cf4dad7cfa3
|
4
|
+
data.tar.gz: bced3ce328f2d1f5c19c99c07046d55805a9d2518b812c42a77b629e6094eb61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c99236e15a94867504dd45f3992d1cc5fb7dacd8bba2a81ec69c8cb5cec15b6a62c14a0116e439ce25a840f624299fdde1a41ab999547493fd12bfb9312d284a
|
7
|
+
data.tar.gz: 71d4d5f51af2032fa75a93e0541bc4dc3e17cf60309c54ec49f852d7dd61166988888e68948e06b2aef5500902dfd260d05bbbd2219d25d6845c5c83cb8b9842
|
data/.pubnub.yml
CHANGED
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
@@ -6,6 +6,7 @@ addons:
|
|
6
6
|
|
7
7
|
before_install:
|
8
8
|
# See https://github.com/travis-ci/travis-ci/issues/5861
|
9
|
+
- gem update --system
|
9
10
|
- gem install bundler
|
10
11
|
- gem update bundler
|
11
12
|
|
@@ -14,9 +15,9 @@ bundler_args: --without development
|
|
14
15
|
script: bundle exec rspec
|
15
16
|
|
16
17
|
rvm:
|
18
|
+
- 2.6.3
|
17
19
|
- 2.5.1
|
18
20
|
- 2.4.4
|
19
|
-
- 2.3.7
|
20
21
|
|
21
22
|
matrix:
|
22
23
|
include:
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,131 +1,137 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
pubnub (4.1.
|
5
|
-
concurrent-ruby (~> 1.
|
6
|
-
concurrent-ruby-edge (~> 0.
|
7
|
-
dry-validation (~> 0
|
4
|
+
pubnub (4.1.5)
|
5
|
+
concurrent-ruby (~> 1.1.5)
|
6
|
+
concurrent-ruby-edge (~> 0.5.0)
|
7
|
+
dry-validation (~> 1.0)
|
8
8
|
httpclient (~> 2.8, >= 2.8.3)
|
9
|
-
json (>=
|
10
|
-
timers (>= 4.
|
9
|
+
json (>= 2.2.0, < 3)
|
10
|
+
timers (>= 4.3.0)
|
11
11
|
|
12
12
|
GEM
|
13
13
|
remote: https://rubygems.org/
|
14
14
|
specs:
|
15
|
-
addressable (2.
|
15
|
+
addressable (2.6.0)
|
16
16
|
public_suffix (>= 2.0.2, < 4.0)
|
17
17
|
ast (2.4.0)
|
18
18
|
awesome_print (1.8.0)
|
19
19
|
binding_of_caller (0.8.0)
|
20
20
|
debug_inspector (>= 0.0.1)
|
21
|
-
codacy-coverage (
|
21
|
+
codacy-coverage (2.1.0)
|
22
22
|
simplecov
|
23
23
|
coderay (1.1.2)
|
24
|
-
concurrent-ruby (1.
|
25
|
-
concurrent-ruby-edge (0.
|
26
|
-
concurrent-ruby (
|
24
|
+
concurrent-ruby (1.1.5)
|
25
|
+
concurrent-ruby-edge (0.5.0)
|
26
|
+
concurrent-ruby (~> 1.1.5)
|
27
27
|
crack (0.4.3)
|
28
28
|
safe_yaml (~> 1.0.0)
|
29
29
|
debug_inspector (0.0.3)
|
30
30
|
diff-lcs (1.3)
|
31
|
-
docile (1.3.
|
32
|
-
dry-configurable (0.
|
31
|
+
docile (1.3.2)
|
32
|
+
dry-configurable (0.8.3)
|
33
33
|
concurrent-ruby (~> 1.0)
|
34
|
-
|
34
|
+
dry-core (~> 0.4, >= 0.4.7)
|
35
|
+
dry-container (0.7.2)
|
35
36
|
concurrent-ruby (~> 1.0)
|
36
37
|
dry-configurable (~> 0.1, >= 0.1.3)
|
37
|
-
dry-core (0.4.
|
38
|
+
dry-core (0.4.8)
|
38
39
|
concurrent-ruby (~> 1.0)
|
39
|
-
dry-equalizer (0.2.
|
40
|
+
dry-equalizer (0.2.2)
|
40
41
|
dry-inflector (0.1.2)
|
41
|
-
dry-
|
42
|
-
|
42
|
+
dry-initializer (3.0.1)
|
43
|
+
dry-logic (1.0.2)
|
44
|
+
concurrent-ruby (~> 1.0)
|
43
45
|
dry-core (~> 0.2)
|
44
46
|
dry-equalizer (~> 0.2)
|
45
|
-
dry-
|
47
|
+
dry-schema (1.3.1)
|
48
|
+
concurrent-ruby (~> 1.0)
|
49
|
+
dry-configurable (~> 0.8, >= 0.8.3)
|
50
|
+
dry-core (~> 0.4)
|
51
|
+
dry-equalizer (~> 0.2)
|
52
|
+
dry-initializer (~> 3.0)
|
53
|
+
dry-logic (~> 1.0)
|
54
|
+
dry-types (~> 1.0)
|
55
|
+
dry-types (1.1.0)
|
46
56
|
concurrent-ruby (~> 1.0)
|
47
57
|
dry-container (~> 0.3)
|
48
58
|
dry-core (~> 0.4, >= 0.4.4)
|
49
|
-
dry-equalizer (~> 0.2)
|
59
|
+
dry-equalizer (~> 0.2, >= 0.2.2)
|
50
60
|
dry-inflector (~> 0.1, >= 0.1.2)
|
51
|
-
dry-logic (~> 0
|
52
|
-
dry-validation (
|
61
|
+
dry-logic (~> 1.0, >= 1.0.2)
|
62
|
+
dry-validation (1.2.1)
|
53
63
|
concurrent-ruby (~> 1.0)
|
54
|
-
dry-
|
55
|
-
dry-core (~> 0.
|
64
|
+
dry-container (~> 0.7, >= 0.7.1)
|
65
|
+
dry-core (~> 0.4)
|
56
66
|
dry-equalizer (~> 0.2)
|
57
|
-
dry-
|
58
|
-
dry-
|
59
|
-
ffi (1.
|
60
|
-
hashdiff (0.
|
61
|
-
hitimes (1.3.0)
|
67
|
+
dry-initializer (~> 3.0)
|
68
|
+
dry-schema (~> 1.0, >= 1.3.1)
|
69
|
+
ffi (1.11.1-java)
|
70
|
+
hashdiff (1.0.0)
|
62
71
|
httpclient (2.8.3)
|
63
72
|
interception (0.5)
|
64
|
-
jaro_winkler (1.5.
|
65
|
-
jaro_winkler (1.5.
|
66
|
-
json (2.
|
67
|
-
json (2.
|
68
|
-
method_source (0.9.
|
69
|
-
parallel (1.
|
70
|
-
parser (2.
|
73
|
+
jaro_winkler (1.5.3)
|
74
|
+
jaro_winkler (1.5.3-java)
|
75
|
+
json (2.2.0)
|
76
|
+
json (2.2.0-java)
|
77
|
+
method_source (0.9.2)
|
78
|
+
parallel (1.17.0)
|
79
|
+
parser (2.6.3.0)
|
71
80
|
ast (~> 2.4.0)
|
72
|
-
|
73
|
-
pry (0.11.3)
|
81
|
+
pry (0.12.2)
|
74
82
|
coderay (~> 1.1.0)
|
75
83
|
method_source (~> 0.9.0)
|
76
|
-
pry (0.
|
84
|
+
pry (0.12.2-java)
|
77
85
|
coderay (~> 1.1.0)
|
78
86
|
method_source (~> 0.9.0)
|
79
87
|
spoon (~> 0.0)
|
80
|
-
pry-rescue (1.
|
88
|
+
pry-rescue (1.5.0)
|
81
89
|
interception (>= 0.5)
|
82
|
-
pry
|
83
|
-
pry-stack_explorer (0.4.9.
|
90
|
+
pry (>= 0.12.0)
|
91
|
+
pry-stack_explorer (0.4.9.3)
|
84
92
|
binding_of_caller (>= 0.7)
|
85
93
|
pry (>= 0.9.11)
|
86
|
-
public_suffix (3.
|
94
|
+
public_suffix (3.1.1)
|
87
95
|
rainbow (3.0.0)
|
88
96
|
rr (1.2.1)
|
89
|
-
rspec (3.
|
90
|
-
rspec-core (~> 3.
|
91
|
-
rspec-expectations (~> 3.
|
92
|
-
rspec-mocks (~> 3.
|
93
|
-
rspec-core (3.
|
94
|
-
rspec-support (~> 3.
|
95
|
-
rspec-expectations (3.
|
97
|
+
rspec (3.8.0)
|
98
|
+
rspec-core (~> 3.8.0)
|
99
|
+
rspec-expectations (~> 3.8.0)
|
100
|
+
rspec-mocks (~> 3.8.0)
|
101
|
+
rspec-core (3.8.2)
|
102
|
+
rspec-support (~> 3.8.0)
|
103
|
+
rspec-expectations (3.8.4)
|
96
104
|
diff-lcs (>= 1.2.0, < 2.0)
|
97
|
-
rspec-support (~> 3.
|
98
|
-
rspec-mocks (3.
|
105
|
+
rspec-support (~> 3.8.0)
|
106
|
+
rspec-mocks (3.8.1)
|
99
107
|
diff-lcs (>= 1.2.0, < 2.0)
|
100
|
-
rspec-support (~> 3.
|
108
|
+
rspec-support (~> 3.8.0)
|
101
109
|
rspec-retry (0.6.1)
|
102
110
|
rspec-core (> 3.3)
|
103
|
-
rspec-support (3.
|
104
|
-
rubocop (0.
|
111
|
+
rspec-support (3.8.2)
|
112
|
+
rubocop (0.73.0)
|
105
113
|
jaro_winkler (~> 1.5.1)
|
106
114
|
parallel (~> 1.10)
|
107
|
-
parser (>= 2.
|
108
|
-
powerpack (~> 0.1)
|
115
|
+
parser (>= 2.6)
|
109
116
|
rainbow (>= 2.2.2, < 4.0)
|
110
117
|
ruby-progressbar (~> 1.7)
|
111
|
-
unicode-display_width (
|
112
|
-
ruby-progressbar (1.
|
113
|
-
safe_yaml (1.0.
|
114
|
-
simplecov (0.
|
118
|
+
unicode-display_width (>= 1.4.0, < 1.7)
|
119
|
+
ruby-progressbar (1.10.1)
|
120
|
+
safe_yaml (1.0.5)
|
121
|
+
simplecov (0.17.0)
|
115
122
|
docile (~> 1.1)
|
116
123
|
json (>= 1.8, < 3)
|
117
124
|
simplecov-html (~> 0.10.0)
|
118
125
|
simplecov-html (0.10.2)
|
119
126
|
spoon (0.0.6)
|
120
127
|
ffi
|
121
|
-
timers (4.
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
webmock (3.4.2)
|
128
|
+
timers (4.3.0)
|
129
|
+
unicode-display_width (1.6.0)
|
130
|
+
vcr (5.0.0)
|
131
|
+
webmock (3.6.0)
|
126
132
|
addressable (>= 2.3.6)
|
127
133
|
crack (>= 0.3.2)
|
128
|
-
hashdiff
|
134
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
129
135
|
|
130
136
|
PLATFORMS
|
131
137
|
java
|
@@ -149,4 +155,4 @@ DEPENDENCIES
|
|
149
155
|
webmock
|
150
156
|
|
151
157
|
BUNDLED WITH
|
152
|
-
1.
|
158
|
+
1.17.2
|
data/README.md
CHANGED
data/VERSION
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
4.1.
|
2
|
-
|
1
|
+
4.1.5
|
@@ -1,57 +1,84 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Pubnub
|
2
4
|
module Schemas
|
3
5
|
module Envelope
|
4
|
-
DataSchema = Dry::
|
6
|
+
DataSchema = Dry::Schema.Params do
|
5
7
|
required(:message)
|
6
8
|
required(:subscribed_channel).filled(:str?)
|
7
9
|
required(:actual_channel).filled(:str?)
|
8
10
|
optional(:publish_time_object).maybe(:hash?)
|
9
11
|
optional(:message_meta_data).maybe(:hash?)
|
10
12
|
optional(:presence_event).maybe(:str?)
|
11
|
-
optional(:presence).maybe
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
optional(:presence).maybe do
|
14
|
+
hash do
|
15
|
+
optional(:uuid).filled(:str?)
|
16
|
+
optional(:timestamp).filled(:int?)
|
17
|
+
optional(:state).maybe(:hash?)
|
18
|
+
optional(:occupancy).filled(:int?)
|
19
|
+
end
|
16
20
|
end
|
17
21
|
end
|
18
22
|
|
19
|
-
|
23
|
+
PresenceSchema = Dry::Schema.Params do
|
24
|
+
required(:channels).maybe(:array?)
|
25
|
+
end
|
26
|
+
|
27
|
+
ConfigSchema = Dry::Schema.Params do
|
20
28
|
required(:tls).filled(:bool?)
|
21
29
|
required(:uuid).filled(:str?)
|
22
30
|
optional(:auth_key).maybe(:str?)
|
23
31
|
required(:origin).filled(:str?)
|
24
32
|
end
|
25
33
|
|
26
|
-
|
27
|
-
required(:code).filled(:int?)
|
28
|
-
required(:client_request).filled
|
29
|
-
required(:server_response).filled
|
30
|
-
optional(:data).maybe
|
34
|
+
CategorySchema = Dry::Schema.Params do
|
31
35
|
required(:category).filled
|
32
36
|
required(:error).filled(:bool?)
|
33
|
-
|
37
|
+
end
|
34
38
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
+
# The schema for status response on subscribe listener
|
40
|
+
class StatusSchema < Dry::Validation::Contract
|
41
|
+
params do
|
42
|
+
required(:code).filled(:int?)
|
43
|
+
required(:category).filled
|
44
|
+
required(:error).filled(:bool?)
|
45
|
+
required(:client_request).filled
|
46
|
+
required(:server_response).filled
|
47
|
+
required(:auto_retried).filled(:bool?)
|
39
48
|
|
40
|
-
|
49
|
+
optional(:data).maybe(:hash?)
|
50
|
+
optional(:current_timetoken).maybe(:int?)
|
51
|
+
optional(:last_timetoken).maybe(:int?)
|
52
|
+
optional(:subscribed_channels).maybe(:array?)
|
53
|
+
optional(:subscribed_channel_groups).maybe(:array?)
|
41
54
|
|
42
|
-
|
43
|
-
|
44
|
-
|
55
|
+
required(:config).hash(ConfigSchema)
|
56
|
+
end
|
57
|
+
|
58
|
+
rule(:category, :error) do
|
59
|
+
key.failure('Invalid error category') if values[:error] && Pubnub::Constants::STATUS_CATEGORY_ERRORS.include?(values[:category].to_s)
|
60
|
+
key.failure('Invalid success category') if !values[:error] && Pubnub::Constants::STATUS_CATEGORY_SUCCESSES.include?(values[:category].to_s)
|
45
61
|
end
|
46
62
|
end
|
47
63
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
64
|
+
# The schema for the publish result on a subscribe listener
|
65
|
+
class ResultSchema < Dry::Validation::Contract
|
66
|
+
params do
|
67
|
+
required(:code).filled(:int?)
|
68
|
+
required(:operation) { included_in?(Pubnub::Constants::OPERATIONS) }
|
69
|
+
required(:client_request).filled
|
70
|
+
required(:server_response).filled
|
71
|
+
|
72
|
+
optional(:data).maybe(:hash?)
|
73
|
+
end
|
53
74
|
|
54
|
-
|
75
|
+
rule(:operation, :data) do
|
76
|
+
if values[:operation] == Pubnub::Constants::OPERATION_PRESENCE
|
77
|
+
PresenceSchema.call(values[:data])
|
78
|
+
else
|
79
|
+
DataSchema.call(values[:data])
|
80
|
+
end
|
81
|
+
end
|
55
82
|
end
|
56
83
|
end
|
57
84
|
end
|