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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fa14ebbc97363da750a96e9a675bd03f8a7308668eb6d6972385348f2fe2a95a
4
- data.tar.gz: f5ea4a167bb214814186aa1dd58fc7685bce1c412d4c6d575a92ca6ba17ddf6a
3
+ metadata.gz: ef6491f2d829934feacac03a8192e26bce46d1ed38950164483faf6d054e64ea
4
+ data.tar.gz: beb9e7159e876988a396e788ab20dd17cf9cb0dd0fd4ef6e2b50b1f9d33248ac
5
5
  SHA512:
6
- metadata.gz: 69688095fd04c3832b6c07fa2ecc734c7f4f6503f85cfdc15138cc3c5e19b1c74b57e2e11fb6545e1f3f4d949360f9ac0618b71348d2751209f2e01c05dc2d2e
7
- data.tar.gz: 54aae0e25031a5b5b3daed2ba4ad2385b9697482e7e515576175621bbacf66c32ee022ec7e91d67e1b26801454cc55896e49ea8caefbb21d32e2cbf682c1dfaa
6
+ metadata.gz: febf9f7e1a4b782f8d2751dc69905e88ad95a0ddf475db19389e805d75bf86ca194c1bd017dbdb15bb3f31b991d615c9a0d37aba532da06c11e197d31d6dd463
7
+ data.tar.gz: fb3ec9dfa9cac1b1c556a3e71d99b7879831fc5153a5c8ebb5f6081d80468fbde4208ad02e9ee87d3543008599ec6f31c7a5063148dbbb4e3e08b4d1534611bb
@@ -1,6 +1,13 @@
1
1
  ---
2
- version: "4.2.7"
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.2.7"
57
+ version: "4.3.0"
51
58
  -
52
59
  changes:
53
60
  -
@@ -1,3 +1,7 @@
1
+ ##### v4.3.0
2
+
3
+ - Add `delete` permission for `channel` to Grant.
4
+
1
5
  ##### v4.2.7
2
6
 
3
7
  - Don't suppress runtime errors.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pubnub (4.2.7)
4
+ pubnub (4.3.0)
5
5
  addressable (>= 2.0.0)
6
6
  concurrent-ruby (~> 1.1.5)
7
7
  concurrent-ruby-edge (~> 0.5.0)
data/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  # Complete Documentation
8
8
  Available at https://www.pubnub.com/docs/ruby/pubnub-ruby-sdk-v4 **v4.x**
9
9
 
10
- ## PubNub Gem version 4.2.7
10
+ ## PubNub Gem version 4.3.0
11
11
 
12
12
  ##### YOU MUST HAVE A PUBNUB ACCOUNT TO USE THE API.
13
13
  ##### http://www.pubnub.com/account
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.2.7
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?auth=ruby-authkey&channel-group=demo&m=0&pnsdk=PubNub-Ruby/4.1.0&r=0&signature=A-WxhJHtpV3FC6lGbyV7BaVjjLsYRW1PzXWKQ3Bn9Jc=&timestamp=1464188864&ttl=0&uuid=ruby-test-uuid-client-one&w=0
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=&timestamp=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.0, ruby 2.3.0 (2015-12-25))
11
+ - HTTPClient/1.0 (2.8.3, ruby 2.6.3 (2019-04-16))
12
12
  Accept:
13
13
  - "*/*"
14
14
  Date:
15
- - Wed, 25 May 2016 15:07:44 GMT
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
- - Wed, 25 May 2016 15:07:44 GMT
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
- - '240'
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-group+auth","subscribe_key":"sub-a-mock-key","ttl":1,"channel-groups":"demo","auths":{"ruby-authkey":{"r":0,"w":0,"m":0}}},"service":"Access
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
- http_version:
42
- recorded_at: Wed, 25 May 2016 15:07:44 GMT
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?auth=ruby-authkey&channel-group=demo&m=0&pnsdk=PubNub-Ruby/4.1.0&r=0&signature=PLlctDYsUKC1BKPfL8lzMJj_PeNz6WTsrPH00SX1CnI=&timestamp=1464188865&ttl=0&uuid=ruby-test-uuid-client-one&w=0
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=&timestamp=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.0, ruby 2.3.0 (2015-12-25))
11
+ - HTTPClient/1.0 (2.8.3, ruby 2.6.3 (2019-04-16))
12
12
  Accept:
13
13
  - "*/*"
14
14
  Date:
15
- - Wed, 25 May 2016 15:07:45 GMT
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
- - Wed, 25 May 2016 15:07:45 GMT
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
- - '240'
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-group+auth","subscribe_key":"sub-a-mock-key","ttl":1,"channel-groups":"demo","auths":{"ruby-authkey":{"r":0,"w":0,"m":0}}},"service":"Access
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
- http_version:
42
- recorded_at: Wed, 25 May 2016 15:07:45 GMT
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
@@ -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]
@@ -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
 
@@ -1,4 +1,4 @@
1
1
  # Toplevel Pubnub module.
2
2
  module Pubnub
3
- VERSION = '4.2.7'.freeze
3
+ VERSION = '4.3.0'.freeze
4
4
  end
@@ -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.2.7
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-09-14 00:00:00.000000000 Z
11
+ date: 2020-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable