elasticio-sailor-nodejs 3.0.0-sailor-proxy-dev9 → 3.0.0-sailor-proxy-dev10
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/lib/encryptor.js +1 -0
- package/lib/proxy-client.js +6 -1
- package/package.json +1 -1
- package/postpublish.js +3 -0
package/lib/encryptor.js
CHANGED
package/lib/proxy-client.js
CHANGED
|
@@ -457,7 +457,7 @@ class ProxyClient {
|
|
|
457
457
|
});
|
|
458
458
|
|
|
459
459
|
const proxyHeaders = this._extractProxyHeaders(headers);
|
|
460
|
-
const message = this._decodeMessage(body,
|
|
460
|
+
const message = this._decodeMessage(body, proxyHeaders);
|
|
461
461
|
log.debug({ proxyHeaders, message }, 'Processing received message');
|
|
462
462
|
await messageHandler(proxyHeaders, message);
|
|
463
463
|
}));
|
|
@@ -595,7 +595,9 @@ class ProxyClient {
|
|
|
595
595
|
}
|
|
596
596
|
|
|
597
597
|
_decodeDefaultMessage(originalMessage, headers) {
|
|
598
|
+
log.debug({ headers }, 'Decoding default message format');
|
|
598
599
|
const protocolVersion = Number(headers.protocolVersion || 1);
|
|
600
|
+
log.debug({ protocolVersion }, 'Decoding message with protocol version');
|
|
599
601
|
return this._encryptor.decryptMessageContent(
|
|
600
602
|
originalMessage,
|
|
601
603
|
protocolVersion < 2 ? 'base64' : undefined
|
|
@@ -603,6 +605,7 @@ class ProxyClient {
|
|
|
603
605
|
}
|
|
604
606
|
|
|
605
607
|
_decodeErrorMessage(originalMessage, headers) {
|
|
608
|
+
log.debug({ headers }, 'Decoding error message format');
|
|
606
609
|
const errorBody = JSON.parse(originalMessage.toString());
|
|
607
610
|
// NOTICE both error and errorInput are transferred as base64 encoded.
|
|
608
611
|
// this does not depend on protocolVersion header of message (see _decodeDefaultMessage)
|
|
@@ -661,6 +664,7 @@ class ProxyClient {
|
|
|
661
664
|
}
|
|
662
665
|
|
|
663
666
|
encryptMessageContent(body, protocolVersion = 1) {
|
|
667
|
+
log.debug({ protocolVersion }, 'Encrypting message content with protocol version');
|
|
664
668
|
return this._encryptor.encryptMessageContent(
|
|
665
669
|
body,
|
|
666
670
|
protocolVersion < 2
|
|
@@ -689,6 +693,7 @@ class ProxyClient {
|
|
|
689
693
|
'base64'
|
|
690
694
|
).toString();
|
|
691
695
|
} else {
|
|
696
|
+
// TODO: encrypt errorInput
|
|
692
697
|
payload.errorInput = originalMessage;
|
|
693
698
|
}
|
|
694
699
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "elasticio-sailor-nodejs",
|
|
3
3
|
"description": "The official elastic.io library for bootstrapping and executing for Node.js connectors",
|
|
4
|
-
"version": "3.0.0-sailor-proxy-
|
|
4
|
+
"version": "3.0.0-sailor-proxy-dev10",
|
|
5
5
|
"main": "run.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "tsc",
|
package/postpublish.js
CHANGED
|
@@ -7,6 +7,9 @@ var version = require('./package.json').version;
|
|
|
7
7
|
if (!version) {
|
|
8
8
|
console.error('Can not determine current version');
|
|
9
9
|
process.exit(0);
|
|
10
|
+
} else if (version.indexOf('dev') > -1) {
|
|
11
|
+
console.info('Current version is a development version, skipping tag creation');
|
|
12
|
+
process.exit(0);
|
|
10
13
|
}
|
|
11
14
|
|
|
12
15
|
var tag = 'v' + version;
|