pusher-js 7.5.0 → 7.6.0
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.
- package/.github/workflows/run-tests.yml +27 -3
- package/CHANGELOG.md +4 -0
- package/Makefile +1 -0
- package/README.md +11 -3
- package/dist/node/pusher.js +92 -28
- package/dist/node/pusher.js.map +1 -1
- package/dist/react-native/pusher.js +4 -4
- package/dist/react-native/pusher.js.map +1 -1
- package/dist/web/pusher-with-encryption.js +36 -9
- package/dist/web/pusher-with-encryption.js.map +1 -1
- package/dist/web/pusher-with-encryption.min.js +2 -2
- package/dist/web/pusher-with-encryption.min.js.map +1 -1
- package/dist/web/pusher.js +36 -9
- package/dist/web/pusher.js.map +1 -1
- package/dist/web/pusher.min.js +2 -2
- package/dist/web/pusher.min.js.map +1 -1
- package/dist/worker/pusher-with-encryption.worker.js +34 -8
- package/dist/worker/pusher-with-encryption.worker.js.map +1 -1
- package/dist/worker/pusher-with-encryption.worker.min.js +2 -2
- package/dist/worker/pusher-with-encryption.worker.min.js.map +1 -1
- package/dist/worker/pusher.worker.js +34 -8
- package/dist/worker/pusher.worker.js.map +1 -1
- package/dist/worker/pusher.worker.min.js +2 -2
- package/dist/worker/pusher.worker.min.js.map +1 -1
- package/integration_tests_server/index.js +176 -0
- package/integration_tests_server/package-lock.json +1177 -0
- package/integration_tests_server/package.json +15 -0
- package/package.json +6 -5
- package/spec/config/karma/config.common.js +1 -2
- package/spec/javascripts/helpers/node/integration.js +2 -2
- package/spec/javascripts/helpers/web/integration.js +2 -2
- package/spec/javascripts/integration/core/cluster_config_spec.js +1 -1
- package/spec/javascripts/integration/core/pusher_spec/test_builder.js +13 -43
- package/spec/javascripts/integration/web/dom/jsonp_spec.js +2 -2
- package/spec/javascripts/unit/core/config_spec.js +91 -3
- package/spec/javascripts/unit/core/connection/connection_manager_spec.js +11 -1
- package/spec/javascripts/unit/core/http/http_request_spec.js +0 -6
- package/spec/javascripts/unit/core/transports/transport_connection_spec.js +5 -0
- package/spec/javascripts/unit/core/utils/timers_spec.js +0 -4
- package/spec/javascripts/unit/core_with_runtime/auth/channel_authorizer_spec.js +82 -0
- package/spec/javascripts/unit/core_with_runtime/auth/user_authorizer_spec.js +76 -0
- package/spec/javascripts/unit/web/pusher_authorizer_spec.js +28 -0
- package/spec/javascripts/unit/worker/channel_authorizer_spec.js +46 -0
- package/src/core/auth/channel_authorizer.ts +14 -3
- package/src/core/auth/options.ts +4 -0
- package/src/core/auth/user_authenticator.ts +14 -3
- package/src/runtimes/isomorphic/auth/xhr_auth.ts +6 -0
- package/src/runtimes/web/auth/jsonp_auth.ts +4 -1
- package/src/runtimes/worker/auth/fetch_auth.ts +7 -0
- package/types/src/core/auth/options.d.ts +4 -0
|
@@ -20,8 +20,20 @@ jobs:
|
|
|
20
20
|
- run: npm install
|
|
21
21
|
- run: npm run check-format
|
|
22
22
|
- run: make web_unit
|
|
23
|
-
-
|
|
23
|
+
- name: make web_integration
|
|
24
|
+
run: |
|
|
25
|
+
cd integration_tests_server
|
|
26
|
+
npm install
|
|
27
|
+
node index.js&
|
|
28
|
+
cd ..
|
|
29
|
+
make web_integration
|
|
24
30
|
env:
|
|
31
|
+
INTEGRATION_TESTS_APP_MT1_APP_ID: ${{ secrets.INTEGRATION_TESTS_APP_MT1_APP_ID }}
|
|
32
|
+
INTEGRATION_TESTS_APP_MT1_KEY: ${{ secrets.INTEGRATION_TESTS_APP_MT1_KEY }}
|
|
33
|
+
INTEGRATION_TESTS_APP_MT1_SECRET: ${{ secrets.INTEGRATION_TESTS_APP_MT1_SECRET }}
|
|
34
|
+
INTEGRATION_TESTS_APP_EU_APP_ID: ${{ secrets.INTEGRATION_TESTS_APP_EU_APP_ID }}
|
|
35
|
+
INTEGRATION_TESTS_APP_EU_KEY: ${{ secrets.INTEGRATION_TESTS_APP_EU_KEY }}
|
|
36
|
+
INTEGRATION_TESTS_APP_EU_SECRET: ${{ secrets.INTEGRATION_TESTS_APP_EU_SECRET }}
|
|
25
37
|
BROWSER_STACK_ACCESS_KEY: ${{ secrets.BROWSER_STACK_ACCESS_KEY }}
|
|
26
38
|
BROWSER_STACK_USERNAME: ${{ secrets.BROWSER_STACK_USERNAME }}
|
|
27
39
|
run-node-tests:
|
|
@@ -34,5 +46,17 @@ jobs:
|
|
|
34
46
|
- run: npm install
|
|
35
47
|
- run: npm run check-format
|
|
36
48
|
- run: make node_unit
|
|
37
|
-
-
|
|
38
|
-
|
|
49
|
+
- name: make node_integration
|
|
50
|
+
run: |
|
|
51
|
+
cd integration_tests_server
|
|
52
|
+
npm install
|
|
53
|
+
node index.js&
|
|
54
|
+
cd ..
|
|
55
|
+
make node_integration
|
|
56
|
+
env:
|
|
57
|
+
INTEGRATION_TESTS_APP_MT1_APP_ID: ${{ secrets.INTEGRATION_TESTS_APP_MT1_APP_ID }}
|
|
58
|
+
INTEGRATION_TESTS_APP_MT1_KEY: ${{ secrets.INTEGRATION_TESTS_APP_MT1_KEY }}
|
|
59
|
+
INTEGRATION_TESTS_APP_MT1_SECRET: ${{ secrets.INTEGRATION_TESTS_APP_MT1_SECRET }}
|
|
60
|
+
INTEGRATION_TESTS_APP_EU_APP_ID: ${{ secrets.INTEGRATION_TESTS_APP_EU_APP_ID }}
|
|
61
|
+
INTEGRATION_TESTS_APP_EU_KEY: ${{ secrets.INTEGRATION_TESTS_APP_EU_KEY }}
|
|
62
|
+
INTEGRATION_TESTS_APP_EU_SECRET: ${{ secrets.INTEGRATION_TESTS_APP_EU_SECRET }}
|
package/CHANGELOG.md
CHANGED
package/Makefile
CHANGED
package/README.md
CHANGED
|
@@ -144,10 +144,10 @@ var presenceChannel: PusherTypes.PresenceChannel;
|
|
|
144
144
|
|
|
145
145
|
### React Native
|
|
146
146
|
|
|
147
|
-
> **⚠️ Important notice**
|
|
147
|
+
> **⚠️ Important notice**
|
|
148
|
+
>
|
|
149
|
+
> React Native support has been **deprecated** and soon will be removed from this repository.
|
|
148
150
|
>
|
|
149
|
-
> React Native support has been **deprecated** and soon will be removed from this repository.
|
|
150
|
-
>
|
|
151
151
|
> Please, use our official [React Native SDK](https://github.com/pusher/pusher-websocket-react-native) instead.
|
|
152
152
|
|
|
153
153
|
### Web Workers
|
|
@@ -232,6 +232,10 @@ Object containing the configuration for user authentication. Valid keys are:
|
|
|
232
232
|
|
|
233
233
|
* `headers` (Object) - Only applied when using `ajax` as authentication transport. Provides the ability to pass additional HTTP Headers to the user authentication endpoint. This can be useful with some web application frameworks that guard against CSRF CSRF (Cross-site request forgery).
|
|
234
234
|
|
|
235
|
+
* `paramsProvider` (Function) - When present, this function is called to get additional parameters to be sent when the user authentication endpoint is called. This is equivalent to passing them on the params key, but allows for the parameters to be retrieved dynamically at the time of the request.
|
|
236
|
+
|
|
237
|
+
* `headersProvider` (Function) - When present, this function is called to get additional headers to be sent when the user authentication endpoint is called. This is equivalent to passing them on the headers key, but allows for the headers to be retrieved dynamically at the time of the request.
|
|
238
|
+
|
|
235
239
|
* `customHandler` (Function) - When present, this function is called instead of a request being made to the endpoint specified by `userAuthentication.endpoint`.
|
|
236
240
|
|
|
237
241
|
|
|
@@ -252,6 +256,10 @@ Object containing the configuration for user authorization. Valid keys are:
|
|
|
252
256
|
|
|
253
257
|
* `headers` (Object) - Only applied when using `ajax` as authorizing transport. Provides the ability to pass additional HTTP Headers to the user authorization endpoint. This can be useful with some web application frameworks that guard against CSRF CSRF (Cross-site request forgery).
|
|
254
258
|
|
|
259
|
+
* `paramsProvider` (Function) - When present, this function is called to get additional parameters to be sent when the user authentication endpoint is called. This is equivalent to passing them on the params key, but allows for the parameters to be retrieved dynamically at the time of the request.
|
|
260
|
+
|
|
261
|
+
* `headersProvider` (Function) - When present, this function is called to get additional headers to be sent when the user authentication endpoint is called. This is equivalent to passing them on the headers key, but allows for the headers to be retrieved dynamically at the time of the request.
|
|
262
|
+
|
|
255
263
|
* `customHandler` (Function) - When present, this function is called instead of a request being made to the endpoint specified by `channelAuthorization.endpoint`.
|
|
256
264
|
|
|
257
265
|
|
package/dist/node/pusher.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Pusher JavaScript Library v7.
|
|
2
|
+
* Pusher JavaScript Library v7.6.0
|
|
3
3
|
* https://pusher.com/
|
|
4
4
|
*
|
|
5
5
|
* Copyright 2020, Pusher
|
|
@@ -897,9 +897,9 @@ HttpParser.METHODS = {
|
|
|
897
897
|
32: 'UNLINK'
|
|
898
898
|
};
|
|
899
899
|
|
|
900
|
-
var VERSION =
|
|
901
|
-
|
|
902
|
-
|
|
900
|
+
var VERSION = process.version
|
|
901
|
+
? process.version.match(/[0-9]+/g).map(function(n) { return parseInt(n, 10) })
|
|
902
|
+
: [];
|
|
903
903
|
|
|
904
904
|
if (VERSION[0] === 0 && VERSION[1] === 12) {
|
|
905
905
|
HttpParser.METHODS[16] = 'REPORT';
|
|
@@ -5553,6 +5553,15 @@ var assert = __webpack_require__(28);
|
|
|
5553
5553
|
|
|
5554
5554
|
exports.HTTPParser = HTTPParser;
|
|
5555
5555
|
function HTTPParser(type) {
|
|
5556
|
+
assert.ok(type === HTTPParser.REQUEST || type === HTTPParser.RESPONSE || type === undefined);
|
|
5557
|
+
if (type === undefined) {
|
|
5558
|
+
// Node v12+
|
|
5559
|
+
} else {
|
|
5560
|
+
this.initialize(type);
|
|
5561
|
+
}
|
|
5562
|
+
this.maxHeaderSize=HTTPParser.maxHeaderSize
|
|
5563
|
+
}
|
|
5564
|
+
HTTPParser.prototype.initialize = function (type, async_resource) {
|
|
5556
5565
|
assert.ok(type === HTTPParser.REQUEST || type === HTTPParser.RESPONSE);
|
|
5557
5566
|
this.type = type;
|
|
5558
5567
|
this.state = type + '_LINE';
|
|
@@ -5568,14 +5577,19 @@ function HTTPParser(type) {
|
|
|
5568
5577
|
this.body_bytes = null;
|
|
5569
5578
|
this.isUserCall = false;
|
|
5570
5579
|
this.hadError = false;
|
|
5571
|
-
}
|
|
5580
|
+
};
|
|
5581
|
+
|
|
5582
|
+
HTTPParser.encoding = 'ascii';
|
|
5572
5583
|
HTTPParser.maxHeaderSize = 80 * 1024; // maxHeaderSize (in bytes) is configurable, but 80kb by default;
|
|
5573
5584
|
HTTPParser.REQUEST = 'REQUEST';
|
|
5574
5585
|
HTTPParser.RESPONSE = 'RESPONSE';
|
|
5575
|
-
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
var
|
|
5586
|
+
|
|
5587
|
+
// Note: *not* starting with kOnHeaders=0 line the Node parser, because any
|
|
5588
|
+
// newly added constants (kOnTimeout in Node v12.19.0) will overwrite 0!
|
|
5589
|
+
var kOnHeaders = HTTPParser.kOnHeaders = 1;
|
|
5590
|
+
var kOnHeadersComplete = HTTPParser.kOnHeadersComplete = 2;
|
|
5591
|
+
var kOnBody = HTTPParser.kOnBody = 3;
|
|
5592
|
+
var kOnMessageComplete = HTTPParser.kOnMessageComplete = 4;
|
|
5579
5593
|
|
|
5580
5594
|
// Some handler stubs, needed for compatibility
|
|
5581
5595
|
HTTPParser.prototype[kOnHeaders] =
|
|
@@ -5588,7 +5602,7 @@ Object.defineProperty(HTTPParser, 'kOnExecute', {
|
|
|
5588
5602
|
get: function () {
|
|
5589
5603
|
// hack for backward compatibility
|
|
5590
5604
|
compatMode0_12 = false;
|
|
5591
|
-
return
|
|
5605
|
+
return 99;
|
|
5592
5606
|
}
|
|
5593
5607
|
});
|
|
5594
5608
|
|
|
@@ -5625,8 +5639,10 @@ var methods = exports.methods = HTTPParser.methods = [
|
|
|
5625
5639
|
'PURGE',
|
|
5626
5640
|
'MKCALENDAR',
|
|
5627
5641
|
'LINK',
|
|
5628
|
-
'UNLINK'
|
|
5642
|
+
'UNLINK',
|
|
5643
|
+
'SOURCE',
|
|
5629
5644
|
];
|
|
5645
|
+
var method_connect = methods.indexOf('CONNECT');
|
|
5630
5646
|
HTTPParser.prototype.reinitialize = HTTPParser;
|
|
5631
5647
|
HTTPParser.prototype.close =
|
|
5632
5648
|
HTTPParser.prototype.pause =
|
|
@@ -5670,7 +5686,7 @@ HTTPParser.prototype.execute = function (chunk, start, length) {
|
|
|
5670
5686
|
length = this.offset - start;
|
|
5671
5687
|
if (headerState[this.state]) {
|
|
5672
5688
|
this.headerSize += length;
|
|
5673
|
-
if (this.headerSize > HTTPParser.maxHeaderSize) {
|
|
5689
|
+
if (this.headerSize > (this.maxHeaderSize||HTTPParser.maxHeaderSize)) {
|
|
5674
5690
|
return new Error('max header size exceeded');
|
|
5675
5691
|
}
|
|
5676
5692
|
}
|
|
@@ -5722,7 +5738,7 @@ HTTPParser.prototype.consumeLine = function () {
|
|
|
5722
5738
|
chunk = this.chunk;
|
|
5723
5739
|
for (var i = this.offset; i < end; i++) {
|
|
5724
5740
|
if (chunk[i] === 0x0a) { // \n
|
|
5725
|
-
var line = this.line + chunk.toString(
|
|
5741
|
+
var line = this.line + chunk.toString(HTTPParser.encoding, this.offset, i);
|
|
5726
5742
|
if (line.charAt(line.length - 1) === '\r') {
|
|
5727
5743
|
line = line.substr(0, line.length - 1);
|
|
5728
5744
|
}
|
|
@@ -5732,7 +5748,7 @@ HTTPParser.prototype.consumeLine = function () {
|
|
|
5732
5748
|
}
|
|
5733
5749
|
}
|
|
5734
5750
|
//line split over multiple chunks
|
|
5735
|
-
this.line += chunk.toString(
|
|
5751
|
+
this.line += chunk.toString(HTTPParser.encoding, this.offset, this.end);
|
|
5736
5752
|
this.offset = this.end;
|
|
5737
5753
|
};
|
|
5738
5754
|
|
|
@@ -5773,9 +5789,6 @@ HTTPParser.prototype.REQUEST_LINE = function () {
|
|
|
5773
5789
|
if (this.info.method === -1) {
|
|
5774
5790
|
throw new Error('invalid request method');
|
|
5775
5791
|
}
|
|
5776
|
-
if (match[1] === 'CONNECT') {
|
|
5777
|
-
this.info.upgrade = true;
|
|
5778
|
-
}
|
|
5779
5792
|
this.info.url = match[2];
|
|
5780
5793
|
this.info.versionMajor = +match[3];
|
|
5781
5794
|
this.info.versionMinor = +match[4];
|
|
@@ -5830,6 +5843,7 @@ HTTPParser.prototype.HEADER = function () {
|
|
|
5830
5843
|
var headers = info.headers;
|
|
5831
5844
|
var hasContentLength = false;
|
|
5832
5845
|
var currentContentLengthValue;
|
|
5846
|
+
var hasUpgradeHeader = false;
|
|
5833
5847
|
for (var i = 0; i < headers.length; i += 2) {
|
|
5834
5848
|
switch (headers[i].toLowerCase()) {
|
|
5835
5849
|
case 'transfer-encoding':
|
|
@@ -5855,13 +5869,33 @@ HTTPParser.prototype.HEADER = function () {
|
|
|
5855
5869
|
this.connection += headers[i + 1].toLowerCase();
|
|
5856
5870
|
break;
|
|
5857
5871
|
case 'upgrade':
|
|
5858
|
-
|
|
5872
|
+
hasUpgradeHeader = true;
|
|
5859
5873
|
break;
|
|
5860
5874
|
}
|
|
5861
5875
|
}
|
|
5862
5876
|
|
|
5877
|
+
// if both isChunked and hasContentLength, isChunked wins
|
|
5878
|
+
// This is required so the body is parsed using the chunked method, and matches
|
|
5879
|
+
// Chrome's behavior. We could, maybe, ignore them both (would get chunked
|
|
5880
|
+
// encoding into the body), and/or disable shouldKeepAlive to be more
|
|
5881
|
+
// resilient.
|
|
5863
5882
|
if (this.isChunked && hasContentLength) {
|
|
5864
|
-
|
|
5883
|
+
hasContentLength = false;
|
|
5884
|
+
this.body_bytes = null;
|
|
5885
|
+
}
|
|
5886
|
+
|
|
5887
|
+
// Logic from https://github.com/nodejs/http-parser/blob/921d5585515a153fa00e411cf144280c59b41f90/http_parser.c#L1727-L1737
|
|
5888
|
+
// "For responses, "Upgrade: foo" and "Connection: upgrade" are
|
|
5889
|
+
// mandatory only when it is a 101 Switching Protocols response,
|
|
5890
|
+
// otherwise it is purely informational, to announce support.
|
|
5891
|
+
if (hasUpgradeHeader && this.connection.indexOf('upgrade') != -1) {
|
|
5892
|
+
info.upgrade = this.type === HTTPParser.REQUEST || info.statusCode === 101;
|
|
5893
|
+
} else {
|
|
5894
|
+
info.upgrade = info.method === method_connect;
|
|
5895
|
+
}
|
|
5896
|
+
|
|
5897
|
+
if (this.isChunked && info.upgrade) {
|
|
5898
|
+
this.isChunked = false;
|
|
5865
5899
|
}
|
|
5866
5900
|
|
|
5867
5901
|
info.shouldKeepAlive = this.shouldKeepAlive();
|
|
@@ -5874,13 +5908,16 @@ HTTPParser.prototype.HEADER = function () {
|
|
|
5874
5908
|
info.versionMinor, info.headers, info.method, info.url, info.statusCode,
|
|
5875
5909
|
info.statusMessage, info.upgrade, info.shouldKeepAlive));
|
|
5876
5910
|
}
|
|
5877
|
-
if (
|
|
5911
|
+
if (skipBody === 2) {
|
|
5878
5912
|
this.nextRequest();
|
|
5879
5913
|
return true;
|
|
5880
5914
|
} else if (this.isChunked && !skipBody) {
|
|
5881
5915
|
this.state = 'BODY_CHUNKHEAD';
|
|
5882
5916
|
} else if (skipBody || this.body_bytes === 0) {
|
|
5883
5917
|
this.nextRequest();
|
|
5918
|
+
// For older versions of node (v6.x and older?), that return skipBody=1 or skipBody=true,
|
|
5919
|
+
// need this "return true;" if it's an upgrade request.
|
|
5920
|
+
return info.upgrade;
|
|
5884
5921
|
} else if (this.body_bytes === null) {
|
|
5885
5922
|
this.state = 'BODY_RAW';
|
|
5886
5923
|
} else {
|
|
@@ -5962,6 +5999,7 @@ HTTPParser.prototype.BODY_SIZED = function () {
|
|
|
5962
5999
|
set: function (to) {
|
|
5963
6000
|
// hack for backward compatibility
|
|
5964
6001
|
this._compatMode0_11 = true;
|
|
6002
|
+
method_connect = 'CONNECT';
|
|
5965
6003
|
return (this[k] = to);
|
|
5966
6004
|
}
|
|
5967
6005
|
});
|
|
@@ -6648,7 +6686,7 @@ var Server = function(options) {
|
|
|
6648
6686
|
util.inherits(Server, Base);
|
|
6649
6687
|
|
|
6650
6688
|
var instance = {
|
|
6651
|
-
EVENTS: ['open', 'message', 'error', 'close'],
|
|
6689
|
+
EVENTS: ['open', 'message', 'error', 'close', 'ping', 'pong'],
|
|
6652
6690
|
|
|
6653
6691
|
_bindEventListeners: function() {
|
|
6654
6692
|
this.messages.on('error', function() {});
|
|
@@ -7487,7 +7525,7 @@ function safeJSONStringify(source) {
|
|
|
7487
7525
|
|
|
7488
7526
|
// CONCATENATED MODULE: ./src/core/defaults.ts
|
|
7489
7527
|
var Defaults = {
|
|
7490
|
-
VERSION: "7.
|
|
7528
|
+
VERSION: "7.6.0",
|
|
7491
7529
|
PROTOCOL: 7,
|
|
7492
7530
|
wsPort: 80,
|
|
7493
7531
|
wssPort: 443,
|
|
@@ -10233,6 +10271,12 @@ var ajax = function (context, query, authOptions, authRequestType, callback) {
|
|
|
10233
10271
|
for (var headerName in authOptions.headers) {
|
|
10234
10272
|
xhr.setRequestHeader(headerName, authOptions.headers[headerName]);
|
|
10235
10273
|
}
|
|
10274
|
+
if (authOptions.headersProvider != null) {
|
|
10275
|
+
var dynamicHeaders = authOptions.headersProvider();
|
|
10276
|
+
for (var headerName in dynamicHeaders) {
|
|
10277
|
+
xhr.setRequestHeader(headerName, dynamicHeaders[headerName]);
|
|
10278
|
+
}
|
|
10279
|
+
}
|
|
10236
10280
|
xhr.onreadystatechange = function () {
|
|
10237
10281
|
if (xhr.readyState === 4) {
|
|
10238
10282
|
if (xhr.status === 200) {
|
|
@@ -10575,12 +10619,22 @@ var strategy_builder_UnsupportedStrategy = {
|
|
|
10575
10619
|
|
|
10576
10620
|
var composeChannelQuery = function (params, authOptions) {
|
|
10577
10621
|
var query = 'socket_id=' + encodeURIComponent(params.socketId);
|
|
10578
|
-
for (var
|
|
10622
|
+
for (var key in authOptions.params) {
|
|
10579
10623
|
query +=
|
|
10580
10624
|
'&' +
|
|
10581
|
-
encodeURIComponent(
|
|
10625
|
+
encodeURIComponent(key) +
|
|
10582
10626
|
'=' +
|
|
10583
|
-
encodeURIComponent(authOptions.params[
|
|
10627
|
+
encodeURIComponent(authOptions.params[key]);
|
|
10628
|
+
}
|
|
10629
|
+
if (authOptions.paramsProvider != null) {
|
|
10630
|
+
var dynamicParams = authOptions.paramsProvider();
|
|
10631
|
+
for (var key in dynamicParams) {
|
|
10632
|
+
query +=
|
|
10633
|
+
'&' +
|
|
10634
|
+
encodeURIComponent(key) +
|
|
10635
|
+
'=' +
|
|
10636
|
+
encodeURIComponent(dynamicParams[key]);
|
|
10637
|
+
}
|
|
10584
10638
|
}
|
|
10585
10639
|
return query;
|
|
10586
10640
|
};
|
|
@@ -10601,12 +10655,22 @@ var UserAuthenticator = function (authOptions) {
|
|
|
10601
10655
|
var channel_authorizer_composeChannelQuery = function (params, authOptions) {
|
|
10602
10656
|
var query = 'socket_id=' + encodeURIComponent(params.socketId);
|
|
10603
10657
|
query += '&channel_name=' + encodeURIComponent(params.channelName);
|
|
10604
|
-
for (var
|
|
10658
|
+
for (var key in authOptions.params) {
|
|
10605
10659
|
query +=
|
|
10606
10660
|
'&' +
|
|
10607
|
-
encodeURIComponent(
|
|
10661
|
+
encodeURIComponent(key) +
|
|
10608
10662
|
'=' +
|
|
10609
|
-
encodeURIComponent(authOptions.params[
|
|
10663
|
+
encodeURIComponent(authOptions.params[key]);
|
|
10664
|
+
}
|
|
10665
|
+
if (authOptions.paramsProvider != null) {
|
|
10666
|
+
var dynamicParams = authOptions.paramsProvider();
|
|
10667
|
+
for (var key in dynamicParams) {
|
|
10668
|
+
query +=
|
|
10669
|
+
'&' +
|
|
10670
|
+
encodeURIComponent(key) +
|
|
10671
|
+
'=' +
|
|
10672
|
+
encodeURIComponent(dynamicParams[key]);
|
|
10673
|
+
}
|
|
10610
10674
|
}
|
|
10611
10675
|
return query;
|
|
10612
10676
|
};
|