pusher 1.4.0 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d9eaaf4fa5fbc3d5223411cb0e1375ccee4f93275f27c20cb7bdd8f31e371fa1
4
- data.tar.gz: be5be46dc24a06be058606742ee56497a6128e39af6cf7f03ddaadc86ac95f12
3
+ metadata.gz: 7959d744c39cb5d96cd4eccba32dc72c288661b5c4013c7e067671e150cfca99
4
+ data.tar.gz: 7ebff63e5c0962778fde1e00245c1194304a7ad6c3c2b0f7303cd41bae405ad6
5
5
  SHA512:
6
- metadata.gz: bd778cf80415b3d2af763583ebf41a4b1164339d0a458203cb55225aab078bdcfe4bf8801a824eeb6802a2f2b12db49df00569ceb631eb3ca20251ead29d3987
7
- data.tar.gz: 187c968e1d1afef5a572bfe4bc22929843ef2843969fef9ac89862ff77b0d415b50cae82daa1b0d992374be2749053c0d8d52c1f1efa22ce7412e3c727c3edee
6
+ metadata.gz: 94532ecd7bce4bf3c4452f44e9b33b39e813addd7b85b17bad3a594cb47f01f5470b379141c2d1a80fd7778ed086c14760a6e80f1791cceffdd2556c88a73d16
7
+ data.tar.gz: 5329924d0af3530d62fed7b0470b9a82db6904eb5c48b29d93ceb7556e4559aa8770f627244687ba8b22595624ea02241172ee5e83272c6adc1567714335512b
@@ -1,4 +1,10 @@
1
- 1.4.0 / 2020-09-29
1
+ 1.4.1 / 2020-10-05
2
+ ==================
3
+
4
+ * Remove rbnacl from dependencies so we don't get errors when it isn't
5
+ required. Thanks @y-yagi!
6
+
7
+ 1.4.0 / 2020-09-29
2
8
  ==================
3
9
 
4
10
  * Support for end-to-end encryption.
data/README.md CHANGED
@@ -252,11 +252,13 @@ end
252
252
 
253
253
  This library supports [end-to-end encrypted channels](https://pusher.com/docs/channels/using_channels/encrypted-channels). This means that only you and your connected clients will be able to read your messages. Pusher cannot decrypt them. You can enable this feature by following these steps:
254
254
 
255
- 1. Install [Libsodium](https://github.com/jedisct1/libsodium), which we rely on to do the heavy lifting. [Follow the installation instructions for your platform.](https://github.com/RubyCrypto/rbnacl/wiki/Installing-libsodium)
255
+ 1. Add the `rbnacl` gem to your Gemfile (it's not a gem dependency).
256
256
 
257
- 2. Encrypted channel subscriptions must be authenticated in the exact same way as private channels. You should therefore [create an authentication endpoint on your server](https://pusher.com/docs/authenticating_users).
257
+ 2. Install [Libsodium](https://github.com/jedisct1/libsodium), which we rely on to do the heavy lifting. [Follow the installation instructions for your platform.](https://github.com/RubyCrypto/rbnacl/wiki/Installing-libsodium)
258
258
 
259
- 3. Next, generate your 32 byte master encryption key, encode it as base64 and pass it to the Pusher constructor.
259
+ 3. Encrypted channel subscriptions must be authenticated in the exact same way as private channels. You should therefore [create an authentication endpoint on your server](https://pusher.com/docs/authenticating_users).
260
+
261
+ 4. Next, generate your 32 byte master encryption key, encode it as base64 and pass it to the Pusher constructor.
260
262
 
261
263
  This is secret and you should never share this with anyone.
262
264
  Not even Pusher.
@@ -276,9 +278,9 @@ This library supports [end-to-end encrypted channels](https://pusher.com/docs/ch
276
278
  });
277
279
  ```
278
280
 
279
- 4. Channels where you wish to use end-to-end encryption should be prefixed with `private-encrypted-`.
281
+ 5. Channels where you wish to use end-to-end encryption should be prefixed with `private-encrypted-`.
280
282
 
281
- 5. Subscribe to these channels in your client, and you're done! You can verify it is working by checking out the debug console on the [https://dashboard.pusher.com/](dashboard) and seeing the scrambled ciphertext.
283
+ 6. Subscribe to these channels in your client, and you're done! You can verify it is working by checking out the debug console on the [https://dashboard.pusher.com/](dashboard) and seeing the scrambled ciphertext.
282
284
 
283
285
  **Important note: This will __not__ encrypt messages on channels that are not prefixed by `private-encrypted-`.**
284
286
 
@@ -467,7 +467,7 @@ module Pusher
467
467
 
468
468
  # Only now load rbnacl, so that people that aren't using it don't need to
469
469
  # install libsodium
470
- require 'rbnacl'
470
+ require_rbnacl
471
471
 
472
472
  secret_box = RbNaCl::SecretBox.new(
473
473
  RbNaCl::Hash.sha256(channel + @encryption_master_key)
@@ -485,5 +485,12 @@ module Pusher
485
485
  def configured?
486
486
  host && scheme && key && secret && app_id
487
487
  end
488
+
489
+ def require_rbnacl
490
+ require 'rbnacl'
491
+ rescue LoadError => e
492
+ $stderr.puts "You don't have rbnacl installed in your application. Please add it to your Gemfile and run bundle install"
493
+ raise e
494
+ end
488
495
  end
489
496
  end
@@ -1,3 +1,3 @@
1
1
  module Pusher
2
- VERSION = '1.4.0'
2
+ VERSION = '1.4.1'
3
3
  end
@@ -17,7 +17,6 @@ Gem::Specification.new do |s|
17
17
  s.add_dependency 'pusher-signature', "~> 0.1.8"
18
18
  s.add_dependency "httpclient", "~> 2.8"
19
19
  s.add_dependency "jruby-openssl" if defined?(JRUBY_VERSION)
20
- s.add_dependency "rbnacl", "~> 7.1"
21
20
 
22
21
  s.add_development_dependency "rspec", "~> 3.9"
23
22
  s.add_development_dependency "webmock", "~> 3.9"
@@ -26,6 +25,7 @@ Gem::Specification.new do |s|
26
25
  s.add_development_dependency "rake", "~> 13.0"
27
26
  s.add_development_dependency "rack", "~> 2.2"
28
27
  s.add_development_dependency "json", "~> 2.3"
28
+ s.add_development_dependency "rbnacl", "~> 7.1"
29
29
 
30
30
  s.files = `git ls-files`.split("\n")
31
31
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pusher
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pusher
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-02 00:00:00.000000000 Z
11
+ date: 2020-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '2.8'
55
- - !ruby/object:Gem::Dependency
56
- name: rbnacl
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '7.1'
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '7.1'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: rspec
71
57
  requirement: !ruby/object:Gem::Requirement
@@ -164,6 +150,20 @@ dependencies:
164
150
  - - "~>"
165
151
  - !ruby/object:Gem::Version
166
152
  version: '2.3'
153
+ - !ruby/object:Gem::Dependency
154
+ name: rbnacl
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '7.1'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '7.1'
167
167
  description: 'Wrapper for Pusher Channels REST api: : https://pusher.com/channels'
168
168
  email:
169
169
  - support@pusher.com