Comparing version 4.9.0 to 4.9.1
## [v4.9.1](https://github.com/pubnub/javascript/tree/v4.9.1) | ||
[Full Changelog](https://github.com/pubnub/javascript/compare/v4.9.0...v4.9.1) | ||
- 🌟add support custom encryption and decryption | ||
## [v4.9.0](https://github.com/pubnub/javascript/tree/v4.9.0) | ||
[Full Changelog](https://github.com/pubnub/javascript/compare/v4.8.0...v4.9.0) | ||
- 🌟integrate fetch for react-native SDK | ||
- ⭐announce when subscription get reactivated | ||
- ⭐stop heartbeats for responses with status PNBadRequestCategory | ||
## [v4.8.0](https://github.com/pubnub/javascript/tree/v4.8.0) | ||
@@ -3,0 +29,0 @@ |
@@ -171,3 +171,3 @@ 'use strict'; | ||
value: function getVersion() { | ||
return '4.9.0'; | ||
return '4.9.1'; | ||
} | ||
@@ -174,0 +174,0 @@ }, { |
@@ -230,4 +230,4 @@ 'use strict'; | ||
this.encrypt = crypto.pnEncrypt.bind(crypto); | ||
this.decrypt = crypto.pnDecrypt.bind(crypto); | ||
this.encrypt = crypto.encrypt.bind(crypto); | ||
this.decrypt = crypto.decrypt.bind(crypto); | ||
@@ -234,0 +234,0 @@ this.getAuthKey = modules.config.getAuthKey.bind(modules.config); |
{ | ||
"name": "pubnub", | ||
"version": "4.9.0", | ||
"version": "4.9.1", | ||
"author": "PubNub <support@pubnub.com>", | ||
@@ -58,3 +58,3 @@ "description": "Publish & Subscribe Real-time Messaging with PubNub", | ||
"gulp-istanbul": "^1.1.1", | ||
"gulp-mocha": "^4.3.0", | ||
"gulp-mocha": "^3.0.1", | ||
"gulp-rename": "^1.2.2", | ||
@@ -87,3 +87,3 @@ "gulp-sourcemaps": "^2.4.0", | ||
"underscore": "^1.8.3", | ||
"webpack": "^1.14.0", | ||
"webpack": "^2.4.1", | ||
"webpack-dev-server": "^1.16.2", | ||
@@ -97,2 +97,2 @@ "webpack-stream": "^3.2.0" | ||
} | ||
} | ||
} |
@@ -22,3 +22,3 @@ # PubNub JavaScript SDK (V4) | ||
## CDN Links | ||
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.9.0.min.js | ||
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.9.0.js | ||
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.9.1.min.js | ||
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.9.1.js |
@@ -208,3 +208,3 @@ /* @flow */ | ||
getVersion(): string { | ||
return '4.9.0'; | ||
return '4.9.1'; | ||
} | ||
@@ -211,0 +211,0 @@ |
@@ -108,3 +108,3 @@ /* @flow */ | ||
decrypt(data: string, customCipherKey: ?string, options: ?Object): Object | string | null { | ||
decrypt(data: Object, customCipherKey: ?string, options: ?Object): Object | string | null { | ||
if (this._config.customDecrypt) { | ||
@@ -111,0 +111,0 @@ return this._config.customDecrypt(data); |
@@ -416,2 +416,6 @@ /* @flow */ | ||
if (message.userMetadata) { | ||
announce.userMetadata = message.userMetadata; | ||
} | ||
if (this._config.cipherKey) { | ||
@@ -418,0 +422,0 @@ announce.message = this._crypto.decrypt(message.payload); |
@@ -74,2 +74,3 @@ /* @flow */ | ||
originationTimetoken: rawMessage.o, | ||
userMetadata: rawMessage.u, | ||
publishMetaData | ||
@@ -76,0 +77,0 @@ }; |
@@ -195,4 +195,4 @@ /* @flow */ | ||
// mount crypto | ||
this.encrypt = crypto.pnEncrypt.bind(crypto); | ||
this.decrypt = crypto.pnDecrypt.bind(crypto); | ||
this.encrypt = crypto.encrypt.bind(crypto); | ||
this.decrypt = crypto.decrypt.bind(crypto); | ||
@@ -199,0 +199,0 @@ /** config **/ |
@@ -48,3 +48,3 @@ /* global describe, beforeEach, it, before, afterEach, after */ | ||
.query({ pnsdk: `PubNub-JS-Nodejs/${pubnub.getVersion()}`, uuid: 'myUUID', heartbeat: 300, tt: 10, tr: 1 }) | ||
.reply(200, '{"t":{"t":"20","r":1},"m":[{"a":"4","f":0,"i":"Client-g5d4g","p":{"t":"14607577960925503","r":1},"i": "client3", "k":"sub-c-4cec9f8e-01fa-11e6-8180-0619f8945a4f","c":"coolChannel","d":{"text":"Message10"},"b":"coolChan-bnel"}]}'); | ||
.reply(200, '{"t":{"t":"20","r":1},"m":[{"a":"4","f":0,"i":"Client-g5d4g","p":{"t":"14607577960925503","r":1},"i": "client3", "k":"sub-c-4cec9f8e-01fa-11e6-8180-0619f8945a4f","c":"coolChannel","d":{"text":"Message10"},"b":"coolChan-bnel", "u": {"cool": "meta"}}]}'); | ||
@@ -89,2 +89,5 @@ let incomingPayloads = []; | ||
}, | ||
userMetadata: { | ||
cool: 'meta' | ||
}, | ||
subscribedChannel: 'coolChan-bnel', | ||
@@ -91,0 +94,0 @@ channel: 'coolChannel', |
@@ -7,2 +7,3 @@ /* global describe, beforeEach, it, before, afterEach, after */ | ||
import PubNub from '../../src/node/index'; | ||
import CryptoJS from '../../src/core/components/cryptography/hmac-sha256'; | ||
@@ -47,2 +48,19 @@ describe('#core / mounting point', () => { | ||
it('supports custom encryption/decryption', () => { | ||
let customEncrypt = (data) => { | ||
let cipher = CryptoJS.AES.encrypt(JSON.stringify(data), 'customKey'); | ||
return cipher.toString(); | ||
}; | ||
let customDecrypt = (data) => { | ||
let bytes = CryptoJS.AES.decrypt(data, 'customKey'); | ||
return JSON.parse(bytes.toString(CryptoJS.enc.Utf8)); | ||
}; | ||
let pn = new PubNub({ customEncrypt, customDecrypt }); | ||
let ciphertext = pn.encrypt({ hi: 'there' }); | ||
assert.deepEqual(pn.decrypt(ciphertext), { hi: 'there' }); | ||
}); | ||
}); |
@@ -25,5 +25,3 @@ let webpack = require('webpack'); | ||
plugins: [ | ||
new webpack.BannerPlugin(`${packageJSON.version} / Consumer `, { | ||
raw: false, entryOnly: true, | ||
}), | ||
new webpack.BannerPlugin({ banner: `${packageJSON.version} / Consumer `, raw: false }), | ||
new StatsPlugin('stats.json', { | ||
@@ -30,0 +28,0 @@ chunkModules: true, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
1
4
1666700
180
17845