sockudo 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df118e329c06d4ea98bd91c7c8bd83acb02d71e298b7ab9ae221951dfb13e5cc
4
- data.tar.gz: 68c93f6cb05098c675aa8d5f2fef62073dbb8b3494084f49fc7e7cc4e1969cd7
3
+ metadata.gz: a69c1173084795c41b60abf8ebce95fe00d5cb6d550a960be09ec5a4b683723c
4
+ data.tar.gz: 111fa3673255c2e094fccf7817f63f4f11a8d1710289a7090d8860b9a737df50
5
5
  SHA512:
6
- metadata.gz: 0fddc588e36a86757e096fa8fa632cdd250e581dc566b9d0b386ddb31d34fca047f132b49cdc341876da20227c57fb51e52879afef60612707156fb00fb73012
7
- data.tar.gz: f2b7d1566c2f14b01b5b43071f0093b4bd50d0efa79a4b2f9426111eb3802de773e8aa03ff8ee2f0aad618b0e5b52b4a8a84b4d9524646496d8e42530f0b5a52
6
+ metadata.gz: bc5d7704e10cc78efac6c5d23d1cb9335f8363bd0a43e88ac74ac0668d97ab3563d8a77cb5b211b60244c8def5799a3607e2873ce46bbc1d31ffc1597233ccaa
7
+ data.tar.gz: ffe8ce27b66c03cbd2c1369c4a5fe9813a6b0e6f3a88a695ede5809421babb89277a8bb3b779eec19d10e6fd9ec06fbd194d92408874acb66c1ac3b0288cdf82
data/CHANGELOG.md CHANGED
@@ -1,20 +1,8 @@
1
1
  # Changelog
2
2
 
3
- ## 2.0.4
4
-
5
- * [ADDED] Add `authenticate_user` method for user authentication flow
6
-
7
- ## 2.0.3
8
-
9
- * [FIXED] Corrected the channels limit when publishing events. Upped from 10 to 100.
10
-
11
- ## 2.0.2
12
-
13
- * [CHANGED] made encryption_master_key_base64 globally configurable
14
-
15
3
  ## 2.0.1
16
4
 
17
- * [CHANGED] Only include lib and essential docs in gem.
5
+ * [FIXED] multi_json deprecation warning.
18
6
 
19
7
  ## 2.0.0
20
8
 
@@ -23,6 +11,10 @@
23
11
  * [FIXED] Handle empty or nil configuration.
24
12
  * [REMOVED] Legacy Push Notification integration.
25
13
  * [ADDED] Stalebot and Github actions.
14
+ * [CHANGED] Only include lib and essential docs in gem.
15
+ * [CHANGED] made encryption_master_key_base64 globally configurable
16
+ * [FIXED] Corrected the channels limit when publishing events. Upped from 10 to 100.
17
+ * [ADDED] Add `authenticate_user` method for user authentication flow
26
18
 
27
19
  ## 1.4.3
28
20
 
@@ -230,7 +230,7 @@ module Sockudo
230
230
  # @private Custom data is sent to server as JSON-encoded string
231
231
  #
232
232
  def authenticate(socket_id, custom_data = nil)
233
- custom_data = MultiJson.encode(custom_data) if custom_data
233
+ custom_data = MultiJson.dump(custom_data) if custom_data
234
234
  auth = authentication_string(socket_id, custom_data)
235
235
  r = { auth: auth }
236
236
  r[:channel_data] = custom_data if custom_data
@@ -593,7 +593,7 @@ module Sockudo
593
593
  def authenticate_user(socket_id, user_data)
594
594
  validate_user_data(user_data)
595
595
 
596
- custom_data = MultiJson.encode(user_data)
596
+ custom_data = MultiJson.dump(user_data)
597
597
  auth = authentication_string(socket_id, custom_data)
598
598
 
599
599
  { auth: auth, user_data: custom_data }
@@ -729,7 +729,7 @@ module Sockudo
729
729
  def encode_data(data)
730
730
  return data if data.is_a? String
731
731
 
732
- MultiJson.encode(data)
732
+ MultiJson.dump(data)
733
733
  end
734
734
 
735
735
  # Encrypts a message with a key derived from the master key and channel
@@ -748,10 +748,10 @@ module Sockudo
748
748
  nonce = RbNaCl::Random.random_bytes(secret_box.nonce_bytes)
749
749
  ciphertext = secret_box.encrypt(nonce, encoded_data)
750
750
 
751
- MultiJson.encode({
752
- 'nonce' => Base64.strict_encode64(nonce),
753
- 'ciphertext' => Base64.strict_encode64(ciphertext)
754
- })
751
+ MultiJson.dump({
752
+ 'nonce' => Base64.strict_encode64(nonce),
753
+ 'ciphertext' => Base64.strict_encode64(ciphertext)
754
+ })
755
755
  end
756
756
 
757
757
  def configured?
@@ -105,9 +105,9 @@ module Sockudo
105
105
  def handle_response(status_code, body)
106
106
  case status_code
107
107
  when 200, 201
108
- symbolize_first_level(MultiJson.decode(body))
108
+ symbolize_first_level(MultiJson.load(body))
109
109
  when 202
110
- body.empty? || symbolize_first_level(MultiJson.decode(body))
110
+ body.empty? || symbolize_first_level(MultiJson.load(body))
111
111
  when 204
112
112
  {}
113
113
  when 400
@@ -16,12 +16,12 @@ module Sockudo
16
16
  end
17
17
 
18
18
  def post(params, headers = {})
19
- body = MultiJson.encode(params)
19
+ body = MultiJson.dump(params)
20
20
  create_request(:post, {}, body, headers).send_sync
21
21
  end
22
22
 
23
23
  def post_async(params, headers = {})
24
- body = MultiJson.encode(params)
24
+ body = MultiJson.dump(params)
25
25
  create_request(:post, {}, body, headers).send_async
26
26
  end
27
27
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sockudo
4
- VERSION = '2.0.0'
4
+ VERSION = '2.0.1'
5
5
  end
@@ -88,7 +88,7 @@ module Sockudo
88
88
  def data
89
89
  @data ||= case @content_type
90
90
  when 'application/json'
91
- MultiJson.decode(@body)
91
+ MultiJson.load(@body)
92
92
  else
93
93
  raise "Unknown Content-Type (#{@content_type})"
94
94
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sockudo
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sockudo
@@ -43,14 +43,14 @@ dependencies:
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '1.15'
46
+ version: 1.21.1
47
47
  type: :runtime
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '1.15'
53
+ version: 1.21.1
54
54
  - !ruby/object:Gem::Dependency
55
55
  name: pusher-signature
56
56
  requirement: !ruby/object:Gem::Requirement