pubnub 5.3.1 → 5.3.2

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: 7b811bcac62af8b07a13d11b2ddcc4d2ab8f58410e1b3ac3112aa2221aa7445c
4
- data.tar.gz: 337be3ead454cc2a8ea9c29b14c6dfd07ba0eee5b801d1f7ea8dc9cb0c94c140
3
+ metadata.gz: e9c887ab663f1e0dc8c245c8a62677a371dc46a9454c3f5371159f951ddb78d9
4
+ data.tar.gz: 21dd9cd7754f3ecc8a9dcc38b23a30504381ef543ce0e01a33b51af9ba727d59
5
5
  SHA512:
6
- metadata.gz: 6d8f8f6307e338a94479d0b571c63f2232a8682b0f1f616b3d9b2ebcc3eb1ebf815104b2f769a71ea04a40bf87a2f4901153cd13f70e611ed229432a60b34ed7
7
- data.tar.gz: 82431be095bed63b13960c42dcaf3831fff1e569f6ebb77f84dec7a757e4a26a825ca5a26f34ee1ad611452541c8c153c2f841231cd490498caaea1f21e58c62
6
+ metadata.gz: 6626ad1366f8208953e322fdeda90eda491178fbadf7e522164c56fcedac64c7724badf2a7f770778c5fe16a8859c26fccac4c340755c7b5ee4f7416d5914df5
7
+ data.tar.gz: 3afeba49eb145bb0fad19fac7bae013323d7d24f7c2bc905a9d2a23483e7bad5280cd28bb26926284ccf0d187d69a90711af80f15a6f16932a1f518b64b6b25c
data/.pubnub.yml CHANGED
@@ -1,6 +1,11 @@
1
1
  ---
2
- version: "5.3.1"
2
+ version: "5.3.2"
3
3
  changelog:
4
+ - date: 2023-11-23
5
+ version: v5.3.2
6
+ changes:
7
+ - type: improvement
8
+ text: "Return source event data when a client configured with crypto is unable to decrypt it (can be not encrypted data or encrypted with different options)."
4
9
  - date: 2023-11-03
5
10
  version: v5.3.1
6
11
  changes:
@@ -675,7 +680,7 @@ sdks:
675
680
  - x86-64
676
681
  - distribution-type: package
677
682
  distribution-repository: RubyGems
678
- package-name: pubnub-5.3.1.gem
683
+ package-name: pubnub-5.3.2.gem
679
684
  location: https://rubygems.org/gems/pubnub
680
685
  requires:
681
686
  - name: addressable
@@ -780,8 +785,8 @@ sdks:
780
785
  - x86-64
781
786
  - distribution-type: library
782
787
  distribution-repository: GitHub release
783
- package-name: pubnub-5.3.1.gem
784
- location: https://github.com/pubnub/ruby/releases/download/v5.3.1/pubnub-5.3.1.gem
788
+ package-name: pubnub-5.3.2.gem
789
+ location: https://github.com/pubnub/ruby/releases/download/v5.3.2/pubnub-5.3.2.gem
785
790
  requires:
786
791
  - name: addressable
787
792
  min-version: 2.0.0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## v5.3.2
2
+ November 23 2023
3
+
4
+ #### Modified
5
+ - Return source event data when a client configured with crypto is unable to decrypt it (can be not encrypted data or encrypted with different options).
6
+
1
7
  ## v5.3.1
2
8
  November 03 2023
3
9
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pubnub (5.3.1)
4
+ pubnub (5.3.2)
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
@@ -1,8 +1,6 @@
1
1
  # PubNub Ruby SDK
2
2
 
3
- [![Codacy Badge](https://api.codacy.com/project/badge/Grade/b744287bb0324e2883f95525b12cf19f)](https://www.codacy.com/app/blazeroot/ruby?utm_source=github.com&utm_medium=referral&utm_content=pubnub/ruby&utm_campaign=badger)
4
- [![Codacy Badge](https://api.codacy.com/project/badge/Coverage/b744287bb0324e2883f95525b12cf19f)](https://www.codacy.com/app/blazeroot/ruby?utm_source=github.com&utm_medium=referral&utm_content=pubnub/ruby&utm_campaign=Badge_Coverage)
5
- [![Build Status](https://travis-ci.org/pubnub/ruby.svg?branch=master)](https://travis-ci.org/pubnub/ruby)
3
+ ![Tests Status](https://github.com/pubnub/ruby/actions/workflows/run-tests.yml/badge.svg)
6
4
 
7
5
  This is the official PubNub Ruby SDK repository.
8
6
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 5.3.1
1
+ 5.3.2
@@ -68,30 +68,26 @@ module Pubnub
68
68
 
69
69
  def decrypt_history(message, crypto)
70
70
  if @include_token || @include_meta
71
- encrypted_message = Base64.decode64(message['message'])
71
+ encrypted_message = Base64.strict_decode64(message['message'])
72
72
  message['message'] = JSON.parse(crypto.decrypt(encrypted_message), quirks_mode: true)
73
-
74
73
  message
75
74
  else
76
- encrypted_message = Base64.decode64(message)
75
+ encrypted_message = Base64.strict_decode64(message)
77
76
  JSON.parse(crypto.decrypt(encrypted_message), quirks_mode: true)
78
77
  end
78
+ rescue StandardError => e
79
+ puts "Pubnub :: DECRYPTION ERROR: #{e}"
80
+ message['decrypt_error'] = true if @include_token || @include_meta
81
+ message
79
82
  end
80
83
 
81
84
  def valid_envelope(parsed_response, req_res_objects)
82
85
  messages = parsed_response[0]
83
86
 
84
- # TODO: Uncomment code below when cryptor implementations will be added.
85
87
  if crypto_module && messages
86
88
  crypto = crypto_module
87
89
  messages = messages.map { |message| decrypt_history(message, crypto) }
88
90
  end
89
- # if (@cipher_key || @app.env[:cipher_key] || @cipher_key_selector || @app.env[:cipher_key_selector]) && messages
90
- # cipher_key = compute_cipher_key(parsed_response)
91
- # random_iv = compute_random_iv(parsed_response)
92
- # crypto = Crypto.new(cipher_key, random_iv)
93
- # messages = messages.map { |message| decrypt_history(message, crypto) }
94
- # end
95
91
 
96
92
  start = parsed_response[1]
97
93
  finish = parsed_response[2]
@@ -41,7 +41,6 @@ module Pubnub
41
41
  end
42
42
  end
43
43
 
44
- # TODO: Uncomment code below when cryptor implementations will be added.
45
44
  # Transforms message to json and encode it.
46
45
  #
47
46
  # @param message [Hash, String, Integer, Boolean] Message data which
@@ -33,10 +33,9 @@ module Pubnub
33
33
  end
34
34
 
35
35
  def decipher_payload(message)
36
- # TODO: Uncomment code below when cryptor implementations will be added.
37
36
  return message[:payload] if message[:channel].end_with?('-pnpres') || crypto_module.nil?
38
37
 
39
- encrypted_message = Base64.decode64(message[:payload])
38
+ encrypted_message = Base64.strict_decode64(message[:payload])
40
39
  JSON.parse(crypto_module.decrypt(encrypted_message), quirks_mode: true)
41
40
  rescue StandardError, UnknownCryptorError
42
41
  message[:payload]
@@ -1,4 +1,4 @@
1
1
  # Toplevel Pubnub module.
2
2
  module Pubnub
3
- VERSION = '5.3.1'.freeze
3
+ VERSION = '5.3.2'.freeze
4
4
  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: 5.3.1
4
+ version: 5.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - PubNub
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-03 00:00:00.000000000 Z
11
+ date: 2023-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable