pubnub 4.2.7 → 4.3.0
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/.pubnub.yml +9 -2
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/VERSION +1 -1
- data/fixtures/vcr_cassettes/examples/grant/1944.yml +8 -9
- data/fixtures/vcr_cassettes/examples/grant/1945.yml +8 -9
- data/lib/pubnub/event.rb +1 -1
- data/lib/pubnub/events/grant.rb +7 -0
- data/lib/pubnub/version.rb +1 -1
- data/spec/examples/grant_examples_spec.rb +36 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef6491f2d829934feacac03a8192e26bce46d1ed38950164483faf6d054e64ea
|
4
|
+
data.tar.gz: beb9e7159e876988a396e788ab20dd17cf9cb0dd0fd4ef6e2b50b1f9d33248ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: febf9f7e1a4b782f8d2751dc69905e88ad95a0ddf475db19389e805d75bf86ca194c1bd017dbdb15bb3f31b991d615c9a0d37aba532da06c11e197d31d6dd463
|
7
|
+
data.tar.gz: fb3ec9dfa9cac1b1c556a3e71d99b7879831fc5153a5c8ebb5f6081d80468fbde4208ad02e9ee87d3543008599ec6f31c7a5063148dbbb4e3e08b4d1534611bb
|
data/.pubnub.yml
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
---
|
2
|
-
version: "4.
|
2
|
+
version: "4.3.0"
|
3
3
|
changelog:
|
4
|
+
-
|
5
|
+
changes:
|
6
|
+
-
|
7
|
+
text: "Add `delete` permission for `channel` to Grant."
|
8
|
+
type: feature
|
9
|
+
date: 18-10-2020
|
10
|
+
version: v4.3.0
|
4
11
|
-
|
5
12
|
changes:
|
6
13
|
-
|
@@ -47,7 +54,7 @@ changelog:
|
|
47
54
|
text: "Resolved issue with subscribe loop where the connection was reinitiated after receiving a 4xx error code from the server"
|
48
55
|
type: bugfix
|
49
56
|
date: 14-02-2020
|
50
|
-
version: "4.
|
57
|
+
version: "4.3.0"
|
51
58
|
-
|
52
59
|
changes:
|
53
60
|
-
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
4.
|
1
|
+
4.3.0
|
@@ -2,28 +2,28 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: http://ps.pndsn.com/v2/auth/grant/sub-key/sub-a-mock-key?
|
5
|
+
uri: http://ps.pndsn.com/v2/auth/grant/sub-key/sub-a-mock-key?channel=demo&d=1&m=1&pnsdk=PubNub-Ruby/4.2.7&r=1&signature=6_P9JKXY2G7gIdjuRsAhAgcHOcp5tgZt1VUiILsyim8=×tamp=1601665764&ttl=1440&uuid=ruby-test-uuid-client-one&w=1
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: ''
|
9
9
|
headers:
|
10
10
|
User-Agent:
|
11
|
-
- HTTPClient/1.0 (2.8.
|
11
|
+
- HTTPClient/1.0 (2.8.3, ruby 2.6.3 (2019-04-16))
|
12
12
|
Accept:
|
13
13
|
- "*/*"
|
14
14
|
Date:
|
15
|
-
-
|
15
|
+
- Fri, 02 Oct 2020 19:09:24 GMT
|
16
16
|
response:
|
17
17
|
status:
|
18
18
|
code: 200
|
19
19
|
message: OK
|
20
20
|
headers:
|
21
21
|
Date:
|
22
|
-
-
|
22
|
+
- Fri, 02 Oct 2020 19:09:24 GMT
|
23
23
|
Content-Type:
|
24
24
|
- text/javascript; charset=UTF-8
|
25
25
|
Content-Length:
|
26
|
-
- '
|
26
|
+
- '227'
|
27
27
|
Connection:
|
28
28
|
- keep-alive
|
29
29
|
Access-Control-Allow-Origin:
|
@@ -36,8 +36,7 @@ http_interactions:
|
|
36
36
|
- no-cache, no-store, must-revalidate
|
37
37
|
body:
|
38
38
|
encoding: UTF-8
|
39
|
-
string: '{"message":"Success","payload":{"level":"channel
|
39
|
+
string: '{"message":"Success","payload":{"level":"channel","subscribe_key":"sub-a-mock-key","ttl":1440,"channels":{"demo":{"r":1,"w":1,"m":1,"d":1,"g":0,"u":0,"j":0}}},"service":"Access
|
40
40
|
Manager","status":200}'
|
41
|
-
|
42
|
-
|
43
|
-
recorded_with: VCR 3.0.1
|
41
|
+
recorded_at: Fri, 02 Oct 2020 19:09:24 GMT
|
42
|
+
recorded_with: VCR 6.0.0
|
@@ -2,28 +2,28 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: http://ps.pndsn.com/v2/auth/grant/sub-key/sub-a-mock-key?
|
5
|
+
uri: http://ps.pndsn.com/v2/auth/grant/sub-key/sub-a-mock-key?channel=demo&m=1&pnsdk=PubNub-Ruby/4.2.7&r=1&signature=sff6s-w30otIKUPo2hOmMs7GHloZ1cfBy1_5GhzW8HM=×tamp=1601667045&ttl=1440&uuid=ruby-test-uuid-client-one&w=1
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: ''
|
9
9
|
headers:
|
10
10
|
User-Agent:
|
11
|
-
- HTTPClient/1.0 (2.8.
|
11
|
+
- HTTPClient/1.0 (2.8.3, ruby 2.6.3 (2019-04-16))
|
12
12
|
Accept:
|
13
13
|
- "*/*"
|
14
14
|
Date:
|
15
|
-
-
|
15
|
+
- Fri, 02 Oct 2020 19:30:45 GMT
|
16
16
|
response:
|
17
17
|
status:
|
18
18
|
code: 200
|
19
19
|
message: OK
|
20
20
|
headers:
|
21
21
|
Date:
|
22
|
-
-
|
22
|
+
- Fri, 02 Oct 2020 19:30:45 GMT
|
23
23
|
Content-Type:
|
24
24
|
- text/javascript; charset=UTF-8
|
25
25
|
Content-Length:
|
26
|
-
- '
|
26
|
+
- '227'
|
27
27
|
Connection:
|
28
28
|
- keep-alive
|
29
29
|
Access-Control-Allow-Origin:
|
@@ -36,8 +36,7 @@ http_interactions:
|
|
36
36
|
- no-cache, no-store, must-revalidate
|
37
37
|
body:
|
38
38
|
encoding: UTF-8
|
39
|
-
string: '{"message":"Success","payload":{"level":"channel
|
39
|
+
string: '{"message":"Success","payload":{"level":"channel","subscribe_key":"sub-a-mock-key","ttl":1440,"channels":{"demo":{"r":1,"w":1,"m":1,"d":0,"g":0,"u":0,"j":0}}},"service":"Access
|
40
40
|
Manager","status":200}'
|
41
|
-
|
42
|
-
|
43
|
-
recorded_with: VCR 3.0.1
|
41
|
+
recorded_at: Fri, 02 Oct 2020 19:30:45 GMT
|
42
|
+
recorded_with: VCR 6.0.0
|
data/lib/pubnub/event.rb
CHANGED
@@ -146,7 +146,7 @@ module Pubnub
|
|
146
146
|
ssl cipher_key secret_key auth_key
|
147
147
|
publish_key subscribe_key timetoken
|
148
148
|
open_timeout read_timeout idle_timeout heartbeat
|
149
|
-
group action read write manage ttl presence start
|
149
|
+
group action read write delete manage ttl presence start
|
150
150
|
end count reverse presence_callback store skip_validate
|
151
151
|
state channel_group channel_groups compressed meta customs include_token
|
152
152
|
replicate with_presence cipher_key_selector include_meta]
|
data/lib/pubnub/events/grant.rb
CHANGED
@@ -22,10 +22,17 @@ module Pubnub
|
|
22
22
|
read = [0, '0', false].include?(@read) ? 0 : 1
|
23
23
|
manage = [0, '0', false].include?(@manage) ? 0 : 1 # unless @group.blank?
|
24
24
|
|
25
|
+
if @delete.blank?
|
26
|
+
delete = nil
|
27
|
+
else
|
28
|
+
delete = [0, '0', false].include?(@delete) ? 0 : 1
|
29
|
+
end
|
30
|
+
|
25
31
|
{ timestamp: @timestamp,
|
26
32
|
w: write,
|
27
33
|
r: read,
|
28
34
|
m: manage,
|
35
|
+
d: delete,
|
29
36
|
ttl: @ttl }.delete_if { |_k, v| v.nil? }.merge(super(signature))
|
30
37
|
end
|
31
38
|
|
data/lib/pubnub/version.rb
CHANGED
@@ -35982,4 +35982,40 @@ describe Pubnub::Grant do
|
|
35982
35982
|
expect(envelope.result[:data]).to eq({"level" => "channel", "subscribe_key" => "sub-a-mock-key", "ttl" => 1440, "channels" => {"demo" => {"r" => 1, "w" => 1, "m" => 1}}})
|
35983
35983
|
end
|
35984
35984
|
end
|
35985
|
+
|
35986
|
+
it "__channel___demo___group__nil___read__true___write__true___manage__nil___delete__true___ttl__nil___auth_key__nil___http_sync__true___callback__nil_" do
|
35987
|
+
VCR.use_cassette("examples/grant/1944", record: :none) do
|
35988
|
+
Pubnub::Grant.any_instance.stub(:current_time).and_return "1601665764"
|
35989
|
+
Pubnub::Grant.any_instance.stub(:signature).and_return "6_P9JKXY2G7gIdjuRsAhAgcHOcp5tgZt1VUiILsyim8="
|
35990
|
+
envelope = @pubnub.grant(channel: :demo, read: true, write: true, delete: true, http_sync: true)
|
35991
|
+
expect(envelope.is_a?(Pubnub::Envelope)).to eq true
|
35992
|
+
expect(envelope.error?).to eq false
|
35993
|
+
|
35994
|
+
expect(envelope.status[:code]).to eq(200)
|
35995
|
+
expect(envelope.status[:category]).to eq(:ack)
|
35996
|
+
expect(envelope.status[:config]).to eq({:tls => false, :uuid => "ruby-test-uuid-client-one", :auth_key => "ruby-test-auth-client-one", :origin => "ps.pndsn.com"})
|
35997
|
+
|
35998
|
+
expect(envelope.result[:code]).to eq(200)
|
35999
|
+
expect(envelope.result[:operation]).to eq(:grant)
|
36000
|
+
expect(envelope.result[:data]).to eq({"level" => "channel", "subscribe_key" => "sub-a-mock-key", "ttl" => 1440, "channels" => {"demo" => {"r" => 1, "w" => 1, "m" => 1, "d" => 1, "g" => 0, "u" => 0, "j" => 0}}})
|
36001
|
+
end
|
36002
|
+
end
|
36003
|
+
|
36004
|
+
it "__channel___demo___group__nil___read__true___write__true___manage__nil___delete__false___ttl__nil___auth_key__nil___http_sync__true___callback__nil_" do
|
36005
|
+
VCR.use_cassette("examples/grant/1945", record: :none) do
|
36006
|
+
Pubnub::Grant.any_instance.stub(:current_time).and_return "1601667045"
|
36007
|
+
Pubnub::Grant.any_instance.stub(:signature).and_return "sff6s-w30otIKUPo2hOmMs7GHloZ1cfBy1_5GhzW8HM="
|
36008
|
+
envelope = @pubnub.grant(channel: :demo, read: true, write: true, delete: false, http_sync: true)
|
36009
|
+
expect(envelope.is_a?(Pubnub::Envelope)).to eq true
|
36010
|
+
expect(envelope.error?).to eq false
|
36011
|
+
|
36012
|
+
expect(envelope.status[:code]).to eq(200)
|
36013
|
+
expect(envelope.status[:category]).to eq(:ack)
|
36014
|
+
expect(envelope.status[:config]).to eq({:tls => false, :uuid => "ruby-test-uuid-client-one", :auth_key => "ruby-test-auth-client-one", :origin => "ps.pndsn.com"})
|
36015
|
+
|
36016
|
+
expect(envelope.result[:code]).to eq(200)
|
36017
|
+
expect(envelope.result[:operation]).to eq(:grant)
|
36018
|
+
expect(envelope.result[:data]).to eq({"level" => "channel", "subscribe_key" => "sub-a-mock-key", "ttl" => 1440, "channels" => {"demo" => {"r" => 1, "w" => 1, "m" => 1, "d" => 0, "g" => 0, "u" => 0, "j" => 0}}})
|
36019
|
+
end
|
36020
|
+
end
|
35985
36021
|
end
|
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: 4.
|
4
|
+
version: 4.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PubNub
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|