Skip to content

Commit 12d54cd

Browse files
authored
Upgrade to sailor 2.6.18-dev (#75)
* Upgrade to sailor 2.6.18 * Annual code audit to check if any potentially sensitive data is logged
1 parent 2af4f83 commit 12d54cd

File tree

9 files changed

+176
-35
lines changed

9 files changed

+176
-35
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.1.5 (October 30, 2020)
2+
3+
Upgrade to sailor 2.6.18
4+
15
## 2.1.4 (August 21, 2020)
26

37
Minor asynchronicity improvement.

lib/actions/write.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,13 @@ async function init(cfg) {
3333

3434
if (cfg.writer.columns) {
3535
const columns = Object.keys(_.keyBy(cfg.writer.columns, 'property'));
36-
37-
logger.trace('Configured column names:', columns);
3836
options.columns = columns;
3937
}
4038

4139
stringifier = csv.stringify(options);
4240
signedUrl = await client.resources.storage.createSignedUrl();
4341
putUrl = signedUrl.put_url;
44-
logger.trace('CSV file to be uploaded file to uri=%s', putUrl);
42+
logger.trace('Uploading CSV file');
4543
ax = axios.create();
4644
util.addRetryCountInterceptorToAxios(ax);
4745
readyFlag = true;
@@ -86,18 +84,16 @@ async function ProcessAction(msg, cfg) {
8684
};
8785
signedUrl = null;
8886
rowCount = 0;
89-
self.logger.trace('Emitting message %j', messageToEmit);
87+
self.logger.trace('Emitting message');
9088
await self.emit('data', messageToEmit);
9189
await init(cfg);
9290
}, TIMEOUT_BETWEEN_EVENTS);
9391

9492
let row = msg.body.writer;
95-
self.logger.trace(`Incoming data: ${JSON.stringify(row)}`);
9693
if (cfg.writer.columns) {
9794
const columns = Object.keys(_.keyBy(cfg.writer.columns, 'property'));
9895
row = _.pick(row, columns);
9996
}
100-
self.logger.trace(`Writing Row: ${JSON.stringify(row)}`);
10197
stringifier.write(row);
10298
rowCount += 1;
10399

lib/actions/writeFromArray.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ async function init(cfg) {
5252
stringifier = csv.stringify(options);
5353
signedUrl = await client.resources.storage.createSignedUrl();
5454
putUrl = signedUrl.put_url;
55-
logger.trace('CSV file to be uploaded file to uri=%s', putUrl);
55+
logger.trace('Uploading CSV file');
5656
ax = axios.create();
5757
util.addRetryCountInterceptorToAxios(ax);
5858
}
@@ -66,7 +66,6 @@ async function ProcessAction(msg) {
6666

6767
const columns = Object.keys(inputArray[0]);
6868
rowCount = inputArray.length;
69-
logger.trace('Configured column names:', columns);
7069
let row = {};
7170

7271
await _.each(inputArray, async (item) => {
@@ -114,7 +113,7 @@ async function ProcessAction(msg) {
114113
'content-type': 'text/csv',
115114
url: signedUrl.get_url,
116115
};
117-
self.logger.trace('Emitting message %j', messageToEmit);
116+
self.logger.trace('Emitting message');
118117
await self.emit('data', messageToEmit);
119118
await self.emit('end');
120119
}

lib/actions/writeFromJson.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ async function init(cfg) {
5656
stringifier = csv.stringify(options);
5757
signedUrl = await client.resources.storage.createSignedUrl();
5858
putUrl = signedUrl.put_url;
59-
logger.trace('CSV file to be uploaded file to uri=%s', putUrl);
59+
logger.trace('Uploading CSV file');
6060
ax = axios.create();
6161
util.addRetryCountInterceptorToAxios(ax);
6262
readyFlag = true;
@@ -68,8 +68,6 @@ async function ProcessAction(msg, cfg) {
6868
const { inputObject } = msg.body;
6969

7070
const columns = Object.keys(inputObject);
71-
logger.trace('Configured column names:', columns);
72-
7371
const values = Object.values(inputObject);
7472
// eslint-disable-next-line no-restricted-syntax
7573
for (const value of values) {
@@ -114,16 +112,13 @@ async function ProcessAction(msg, cfg) {
114112
};
115113
signedUrl = null;
116114
rowCount = 0;
117-
self.logger.trace('Emitting message %j', messageToEmit);
115+
self.logger.trace('Emitting message');
118116
await self.emit('data', messageToEmit);
119117
await init(cfg);
120118
}, TIMEOUT_BETWEEN_EVENTS);
121119

122120
let row = inputObject;
123-
self.logger.trace(`Incoming data: ${JSON.stringify(row)}`);
124121
row = _.pick(row, columns);
125-
126-
self.logger.trace(`Writing Row: ${JSON.stringify(row)}`);
127122
stringifier.write(row);
128123
rowCount += 1;
129124

lib/triggers/read.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,11 @@ async function ProcessRead(msg, cfg) {
6262
let index = 0;
6363
const separator = cfg.reader ? cfg.reader.separator || ',' : ',';
6464
const startRow = cfg.reader ? cfg.reader.startRow || 0 : 0;
65-
that.logger.trace('Incoming message is %j', msg);
6665
if (!csvURL || csvURL.length === 0) {
6766
// Now let's check for the attachment
6867
if (msg && msg.attachments && Object.keys(msg.attachments).length > 0) {
6968
const key = Object.keys(msg.attachments)[0];
70-
that.logger.trace('Found attachment key=%s attachment=%j', key, msg.attachments[key]);
69+
that.logger.trace('Attachment found');
7170
csvURL = msg.attachments[key].url;
7271
} else {
7372
that.logger.error('URL of the CSV is missing');
@@ -121,7 +120,7 @@ async function ProcessRead(msg, cfg) {
121120
const writer = new CsvWriter();
122121
writer.logger = that.logger;
123122

124-
that.logger.debug('Sending GET request to url=%s', csvURL);
123+
that.logger.debug('Sending GET request to csv url');
125124
const ax = axios.create();
126125
util.addRetryCountInterceptorToAxios(ax);
127126
const response = await ax({
@@ -132,7 +131,7 @@ async function ProcessRead(msg, cfg) {
132131
retry: REQUEST_MAX_RETRY,
133132
delay: REQUEST_RETRY_DELAY,
134133
});
135-
that.logger.debug('Have got response status=%s headers=%j', response.status, response.headers);
134+
that.logger.debug('Have got response status=%s', response.status);
136135
if (response.status !== 200) {
137136
await that.emit('error', `Unexpected response code code=${response.status}`);
138137
ended = true;

package-lock.json

Lines changed: 157 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)