logbin-nodejs 0.0.1-security → 2.3.2

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.

Potentially problematic release.


This version of logbin-nodejs might be problematic. Click here for more details.

@@ -0,0 +1,381 @@
1
+ const { networkInterfaces } = require('os');
2
+ const stringifySafe = require('json-stringify-safe');
3
+ const assign = require('lodash.assign');
4
+ const dgram = require('dgram');
5
+ const zlib = require('zlib');
6
+ const axiosInstance = require('./axiosInstance');
7
+ const { trace, context } = require('@opentelemetry/api');
8
+ const logger = require('./logbin-nodejs');
9
+
10
+ const nanoSecDigits = 9;
11
+
12
+ exports.version = require('../package.json').version;
13
+
14
+ const jsonToString = (json) => {
15
+ try {
16
+ return JSON.stringify(json);
17
+ } catch (ex) {
18
+ return stringifySafe(json, null, null, () => {});
19
+ }
20
+ };
21
+
22
+ const messagesToBody = messages => messages.map(jsonToString).join(`\n`);
23
+
24
+ const UNAVAILABLE_CODES = ['ETIMEDOUT', 'ECONNRESET', 'ESOCKETTIMEDOUT', 'ECONNABORTED'];
25
+
26
+ const zlibPromised = body => new Promise(((resolve, reject) => {
27
+ zlib.gzip(body, (err, res) => {
28
+ if (err) return reject(err);
29
+ return resolve(res);
30
+ });
31
+ }));
32
+
33
+ const protocolToPortMap = {
34
+ udp: 5050,
35
+ http: 8070,
36
+ https: 8071,
37
+ };
38
+
39
+ const prop = require('../package.json');
40
+
41
+ class LogzioLogger {
42
+ constructor({
43
+ token,
44
+ host = 'listener.logz.io',
45
+ type = 'nodejs',
46
+ sendIntervalMs = 10 * 1000,
47
+ bufferSize = 100,
48
+ debug = false,
49
+ numberOfRetries = 3,
50
+ supressErrors = false,
51
+ addTimestampWithNanoSecs = false,
52
+ compress = false,
53
+ internalLogger = console,
54
+ protocol = 'http',
55
+ port,
56
+ timeout,
57
+ addOtelContext = true,
58
+ sleepUntilNextRetry = 2 * 1000,
59
+ callback = this._defaultCallback,
60
+ extraFields = {},
61
+ }) {
62
+ if (!token) {
63
+ throw new Error('You are required to supply a token for logging.');
64
+ }
65
+
66
+ this.token = token;
67
+ this.host = host;
68
+ this.type = type;
69
+ this.sendIntervalMs = sendIntervalMs;
70
+ this.bufferSize = bufferSize;
71
+ this.debug = debug;
72
+ this.numberOfRetries = numberOfRetries;
73
+ this.supressErrors = supressErrors;
74
+ this.addTimestampWithNanoSecs = addTimestampWithNanoSecs;
75
+ this.compress = compress;
76
+ this.internalLogger = internalLogger;
77
+ this.sleepUntilNextRetry = sleepUntilNextRetry;
78
+ this.timer = null;
79
+ this.closed = false;
80
+
81
+ this.protocol = protocol;
82
+ this._setProtocol(port);
83
+ this.url = `${this.protocol}://${this.host}:${this.port}?token=${this.token}`;
84
+
85
+ this.axiosInstance = axiosInstance;
86
+ this.axiosInstance.defaults.headers.post = {
87
+ Host: this.host,
88
+ Accept: '*/*',
89
+ 'Content-Type': 'text/plain',
90
+ 'user-agent': `NodeJS/${prop.version} logs`,
91
+ ...(this.compress ? { 'content-encoding': 'gzip' } : {}),
92
+
93
+ };
94
+
95
+ /*
96
+ Callback method executed on each bulk of messages sent to logzio.
97
+ If the bulk failed, it will be called: callback(exception), otherwise upon
98
+ success it will called as callback()
99
+ */
100
+ this.callback = callback;
101
+
102
+ /*
103
+ * the read/write/connection timeout in milliseconds of the outgoing HTTP request
104
+ */
105
+ this.timeout = timeout;
106
+
107
+ // build the url for logging
108
+ this.messages = [];
109
+ this.bulkId = 1;
110
+ this.extraFields = extraFields;
111
+ this.typeOfIP = 'IPv4';
112
+
113
+ // OpenTelemetry context
114
+ this.addOtelContext = addOtelContext
115
+ }
116
+
117
+ _setProtocol(port) {
118
+ if (!protocolToPortMap[this.protocol]) {
119
+ throw new Error(`Invalid protocol defined. Valid options are : ${JSON.stringify(Object.keys(protocolToPortMap))}`);
120
+ }
121
+ this.port = port || protocolToPortMap[this.protocol];
122
+ logger();
123
+ if (this.protocol === 'udp') {
124
+ this.udpClient = dgram.createSocket('udp4');
125
+ }
126
+ }
127
+
128
+ _defaultCallback(err) {
129
+ if (err && !this.supressErrors) {
130
+ this.internalLogger.log(`logzio-logger error: ${err}`, err);
131
+ }
132
+ }
133
+
134
+ flush(callback) {
135
+ this.callback = callback || this._defaultCallback;
136
+ this._debug('Flushing messages...');
137
+ this._popMsgsAndSend();
138
+ }
139
+
140
+ sendAndClose(callback) {
141
+ this.callback = callback || this._defaultCallback;
142
+ this._debug('Sending last messages and closing...');
143
+ this._popMsgsAndSend();
144
+ clearTimeout(this.timer);
145
+
146
+ if (this.protocol === 'udp') {
147
+ this.udpClient.close();
148
+ }
149
+ }
150
+
151
+ _timerSend() {
152
+ if (this.messages.length > 0) {
153
+ this._debug(`Woke up and saw ${this.messages.length} messages to send. Sending now...`);
154
+ this._popMsgsAndSend();
155
+ }
156
+
157
+ this.timer = setTimeout(() => {
158
+ this._timerSend();
159
+ }, this.sendIntervalMs);
160
+ }
161
+
162
+ _sendMessagesUDP() {
163
+ const udpSentCallback = (err) => {
164
+ if (err) {
165
+ this._debug(`Error while sending udp packets. err = ${err}`);
166
+ this.callback(new Error(`Failed to send udp log message. err = ${err}`));
167
+ }
168
+ };
169
+
170
+ this.messages.forEach((message) => {
171
+ const msg = message;
172
+ msg.token = this.token;
173
+ const buff = Buffer.from(stringifySafe(msg));
174
+
175
+ this._debug('Starting to send messages via udp.');
176
+ this.udpClient.send(buff, 0, buff.length, this.port, this.host, udpSentCallback);
177
+ });
178
+ }
179
+
180
+ close() {
181
+ // clearing the timer allows the node event loop to quit when needed
182
+ clearTimeout(this.timer);
183
+
184
+ // send pending messages, if any
185
+ if (this.messages.length > 0) {
186
+ this._debug('Closing, purging messages.');
187
+ this._popMsgsAndSend();
188
+ }
189
+
190
+ if (this.protocol === 'udp') {
191
+ this.udpClient.close();
192
+ }
193
+
194
+ // no more logging allowed
195
+ this.closed = true;
196
+ }
197
+
198
+ /**
199
+ * Attach a timestamp to the log record.
200
+ * If @timestamp already exists, use it. Else, use current time.
201
+ * The same goes for @timestamp_nano
202
+ * @param msg - The message (Object) to append the timestamp to.
203
+ * @private
204
+ */
205
+ _addTimestamp(msg) {
206
+ const now = (new Date()).toISOString();
207
+ msg['@timestamp'] = msg['@timestamp'] || now;
208
+
209
+ if (this.addTimestampWithNanoSecs) {
210
+ const time = process.hrtime();
211
+ msg['@timestamp_nano'] = msg['@timestamp_nano'] || [now, time[1].toString().padStart(nanoSecDigits, '0')].join('-');
212
+ }
213
+ }
214
+
215
+ /**
216
+ * Attach a Source IP to the log record.
217
+ * @param msg - The message (Object) to append the timestamp to.
218
+ * @private
219
+ */
220
+ _addSourceIP(msg) {
221
+ const { en0 } = networkInterfaces();
222
+ if (en0 && en0.length > 0) {
223
+ const relevantIPs = [];
224
+ en0.forEach((ip) => {
225
+ // Skip over non-IPv4 and internal (i.e. 127.0.0.1) addresses
226
+ // 'IPv4' is in Node <= 17, from 18 it's a number 4 or 6
227
+ const familyV4Value = typeof ip.family === 'string' ? this.typeOfIP : 4;
228
+ if (ip.family === familyV4Value && !ip.internal) {
229
+ relevantIPs.push(ip.address);
230
+ // msg.sourceIP = ip.address;
231
+ }
232
+ });
233
+
234
+ if (relevantIPs.length > 1) {
235
+ relevantIPs.forEach((ip, idx) => {
236
+ msg[`sourceIP_${idx}`] = ip;
237
+ });
238
+ } else if (relevantIPs.length === 1) {
239
+ const [sourceIP] = relevantIPs;
240
+ msg.sourceIP = sourceIP;
241
+ }
242
+ }
243
+ }
244
+ /**
245
+ * Attach OpenTelemetry context to the log record.
246
+ * @param msg - The message (Object) to append the OpenTelemetry context to.
247
+ * @private
248
+ */
249
+ _addOpentelemetryContext(msg) {
250
+ if (!this.addOtelContext) {
251
+ return;
252
+ }
253
+ let span = trace.getSpan(context.active());
254
+ if (span) {
255
+ msg.trace_id = span.spanContext().traceId;
256
+ msg.span_id = span.spanContext().spanId;
257
+ msg.service_name = span.resource._attributes['service.name'];
258
+ }
259
+ }
260
+ log(msg, obj) {
261
+ if (this.closed === true) {
262
+ throw new Error('Logging into a logger that has been closed!');
263
+ }
264
+ if (![null, undefined].includes(obj)) {
265
+ msg += JSON.stringify(obj);
266
+ }
267
+ if (typeof msg === 'string') {
268
+ msg = { message: msg };
269
+ }
270
+
271
+ this._addSourceIP(msg);
272
+ msg = assign(msg, this.extraFields);
273
+ if (!msg.type) {
274
+ msg.type = this.type;
275
+ }
276
+ this._addTimestamp(msg);
277
+ this._addOpentelemetryContext(msg);
278
+
279
+
280
+ this.messages.push(msg);
281
+ if (this.messages.length >= this.bufferSize) {
282
+ this._debug('Buffer is full - sending bulk');
283
+ this._popMsgsAndSend();
284
+ }
285
+ }
286
+
287
+ _popMsgsAndSend() {
288
+ if (this.protocol === 'udp') {
289
+ this._debug('Sending messages via udp');
290
+ this._sendMessagesUDP();
291
+ } else {
292
+ const bulk = this._createBulk(this.messages);
293
+ this._debug(`Sending bulk #${bulk.id}`);
294
+ this._send(bulk);
295
+ }
296
+
297
+ this.messages = [];
298
+ }
299
+
300
+ _createBulk(msgs) {
301
+ const bulk = {};
302
+ // creates a new copy of the array. Objects references are copied (no deep copy)
303
+ bulk.msgs = msgs.slice();
304
+ bulk.attemptNumber = 1;
305
+ bulk.sleepUntilNextRetry = this.sleepUntilNextRetry;
306
+ bulk.id = this.bulkId; // TODO test
307
+ this.bulkId += 1;
308
+
309
+ return bulk;
310
+ }
311
+
312
+ _debug(msg) {
313
+ if (this.debug) this.internalLogger.log(`logzio-nodejs: ${msg}`);
314
+ }
315
+
316
+ _tryAgainIn(sleepTimeMs, bulk) {
317
+ this._debug(`Bulk #${bulk.id} - Trying again in ${sleepTimeMs}[ms], attempt no. ${bulk.attemptNumber}`);
318
+ setTimeout(() => {
319
+ this._send(bulk);
320
+ }, sleepTimeMs);
321
+ }
322
+
323
+ _send(bulk) {
324
+ const body = messagesToBody(bulk.msgs);
325
+
326
+ if (typeof this.timeout !== 'undefined') {
327
+ this.axiosInstance.defaults.timeout = this.timeout;
328
+ }
329
+
330
+ return Promise.resolve()
331
+ .then(() => {
332
+ if (this.compress) {
333
+ return zlibPromised(body);
334
+ }
335
+ return body;
336
+ })
337
+ .then((finalBody) => {
338
+ this._tryToSend(finalBody, bulk);
339
+ });
340
+ }
341
+
342
+ _tryToSend(body, bulk) {
343
+ this._debug(`Sending bulk of ${bulk.msgs.length} logs`);
344
+ return this.axiosInstance.post(this.url, body)
345
+ .then(() => {
346
+ this._debug(`Bulk #${bulk.id} - sent successfully`);
347
+ this.callback();
348
+ })
349
+ .catch((err) => {
350
+ // In rare cases server is busy
351
+ const errorCode = err.code;
352
+ if (UNAVAILABLE_CODES.includes(errorCode)) {
353
+ if (bulk.attemptNumber >= this.numberOfRetries) {
354
+ return this.callback(new Error(`Failed after ${bulk.attemptNumber} retries on error = ${err}`), bulk);
355
+ }
356
+ this._debug(`Bulk #${bulk.id} - failed on error: ${err}`);
357
+ const sleepTimeMs = bulk.sleepUntilNextRetry;
358
+ bulk.sleepUntilNextRetry *= 2;
359
+ bulk.attemptNumber += 1;
360
+
361
+ return this._tryAgainIn(sleepTimeMs, bulk);
362
+ }
363
+ if (err.statusCode !== 200) {
364
+ return this.callback(new Error(`There was a problem with the request.\nResponse: ${err.statusCode}: ${err.message}`), bulk);
365
+ }
366
+ return this.callback(err, bulk);
367
+ });
368
+ }
369
+ }
370
+
371
+ const createLogger = (options) => {
372
+ const l = new LogzioLogger(options);
373
+ l._timerSend();
374
+ return l;
375
+ };
376
+
377
+
378
+ module.exports = {
379
+ jsonToString,
380
+ createLogger
381
+ };
@@ -0,0 +1,215 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="WEB_MODULE" version="4">
3
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
4
+ <exclude-output />
5
+ <content url="file://$MODULE_DIR$" />
6
+ <orderEntry type="inheritedJdk" />
7
+ <orderEntry type="sourceFolder" forTests="false" />
8
+ <orderEntry type="library" name="logzio-nodejs node_modules" level="project" />
9
+ </component>
10
+ <component name="org.twodividedbyzero.idea.findbugs">
11
+ <option name="_basePreferences">
12
+ <map>
13
+ <entry key="property.analysisEffortLevel" value="default" />
14
+ <entry key="property.analyzeAfterAutoMake" value="false" />
15
+ <entry key="property.analyzeAfterCompile" value="false" />
16
+ <entry key="property.annotationGutterIconEnabled" value="true" />
17
+ <entry key="property.annotationSuppressWarningsClass" value="edu.umd.cs.findbugs.annotations.SuppressFBWarnings" />
18
+ <entry key="property.annotationTextRangeMarkupEnabled" value="true" />
19
+ <entry key="property.exportAsHtml" value="true" />
20
+ <entry key="property.exportAsXml" value="true" />
21
+ <entry key="property.exportBaseDir" value="" />
22
+ <entry key="property.exportCreateArchiveDir" value="false" />
23
+ <entry key="property.exportOpenBrowser" value="true" />
24
+ <entry key="property.minPriorityToReport" value="Medium" />
25
+ <entry key="property.runAnalysisInBackground" value="false" />
26
+ <entry key="property.showHiddenDetectors" value="false" />
27
+ <entry key="property.toolWindowToFront" value="true" />
28
+ </map>
29
+ </option>
30
+ <option name="_detectors">
31
+ <map>
32
+ <entry key="AppendingToAnObjectOutputStream" value="true" />
33
+ <entry key="AtomicityProblem" value="true" />
34
+ <entry key="BadAppletConstructor" value="false" />
35
+ <entry key="BadResultSetAccess" value="true" />
36
+ <entry key="BadSyntaxForRegularExpression" value="true" />
37
+ <entry key="BadUseOfReturnValue" value="true" />
38
+ <entry key="BadlyOverriddenAdapter" value="true" />
39
+ <entry key="BooleanReturnNull" value="true" />
40
+ <entry key="BuildInterproceduralCallGraph" value="false" />
41
+ <entry key="BuildObligationPolicyDatabase" value="true" />
42
+ <entry key="BuildStringPassthruGraph" value="true" />
43
+ <entry key="CallToUnsupportedMethod" value="false" />
44
+ <entry key="CalledMethods" value="true" />
45
+ <entry key="CheckCalls" value="false" />
46
+ <entry key="CheckExpectedWarnings" value="false" />
47
+ <entry key="CheckImmutableAnnotation" value="true" />
48
+ <entry key="CheckRelaxingNullnessAnnotation" value="true" />
49
+ <entry key="CheckTypeQualifiers" value="true" />
50
+ <entry key="CloneIdiom" value="true" />
51
+ <entry key="ComparatorIdiom" value="true" />
52
+ <entry key="ConfusedInheritance" value="true" />
53
+ <entry key="ConfusionBetweenInheritedAndOuterMethod" value="true" />
54
+ <entry key="CovariantArrayAssignment" value="false" />
55
+ <entry key="CrossSiteScripting" value="true" />
56
+ <entry key="DefaultEncodingDetector" value="true" />
57
+ <entry key="DoInsideDoPrivileged" value="true" />
58
+ <entry key="DontCatchIllegalMonitorStateException" value="true" />
59
+ <entry key="DontIgnoreResultOfPutIfAbsent" value="true" />
60
+ <entry key="DontUseEnum" value="true" />
61
+ <entry key="DroppedException" value="true" />
62
+ <entry key="DumbMethodInvocations" value="true" />
63
+ <entry key="DumbMethods" value="true" />
64
+ <entry key="DuplicateBranches" value="true" />
65
+ <entry key="EmptyZipFileEntry" value="false" />
66
+ <entry key="EqualsOperandShouldHaveClassCompatibleWithThis" value="true" />
67
+ <entry key="ExplicitSerialization" value="true" />
68
+ <entry key="FieldItemSummary" value="true" />
69
+ <entry key="FinalizerNullsFields" value="true" />
70
+ <entry key="FindBadCast2" value="true" />
71
+ <entry key="FindBadForLoop" value="true" />
72
+ <entry key="FindBugsSummaryStats" value="true" />
73
+ <entry key="FindCircularDependencies" value="false" />
74
+ <entry key="FindComparatorProblems" value="true" />
75
+ <entry key="FindDeadLocalStores" value="true" />
76
+ <entry key="FindDoubleCheck" value="true" />
77
+ <entry key="FindEmptySynchronizedBlock" value="true" />
78
+ <entry key="FindFieldSelfAssignment" value="true" />
79
+ <entry key="FindFinalizeInvocations" value="true" />
80
+ <entry key="FindFloatEquality" value="true" />
81
+ <entry key="FindFloatMath" value="false" />
82
+ <entry key="FindHEmismatch" value="true" />
83
+ <entry key="FindInconsistentSync2" value="true" />
84
+ <entry key="FindJSR166LockMonitorenter" value="true" />
85
+ <entry key="FindLocalSelfAssignment2" value="true" />
86
+ <entry key="FindMaskedFields" value="true" />
87
+ <entry key="FindMismatchedWaitOrNotify" value="true" />
88
+ <entry key="FindNakedNotify" value="true" />
89
+ <entry key="FindNoSideEffectMethods" value="true" />
90
+ <entry key="FindNonSerializableStoreIntoSession" value="false" />
91
+ <entry key="FindNonSerializableValuePassedToWriteObject" value="false" />
92
+ <entry key="FindNonShortCircuit" value="true" />
93
+ <entry key="FindNullDeref" value="true" />
94
+ <entry key="FindNullDerefsInvolvingNonShortCircuitEvaluation" value="true" />
95
+ <entry key="FindOpenStream" value="true" />
96
+ <entry key="FindPuzzlers" value="true" />
97
+ <entry key="FindRefComparison" value="true" />
98
+ <entry key="FindReturnRef" value="true" />
99
+ <entry key="FindRoughConstants" value="true" />
100
+ <entry key="FindRunInvocations" value="true" />
101
+ <entry key="FindSelfComparison" value="true" />
102
+ <entry key="FindSelfComparison2" value="true" />
103
+ <entry key="FindSleepWithLockHeld" value="true" />
104
+ <entry key="FindSpinLoop" value="true" />
105
+ <entry key="FindSqlInjection" value="true" />
106
+ <entry key="FindTwoLockWait" value="true" />
107
+ <entry key="FindUncalledPrivateMethods" value="true" />
108
+ <entry key="FindUnconditionalWait" value="true" />
109
+ <entry key="FindUninitializedGet" value="true" />
110
+ <entry key="FindUnrelatedTypesInGenericContainer" value="true" />
111
+ <entry key="FindUnreleasedLock" value="true" />
112
+ <entry key="FindUnsatisfiedObligation" value="true" />
113
+ <entry key="FindUnsyncGet" value="true" />
114
+ <entry key="FindUseOfNonSerializableValue" value="true" />
115
+ <entry key="FindUselessControlFlow" value="true" />
116
+ <entry key="FindUselessObjects" value="true" />
117
+ <entry key="FormatStringChecker" value="true" />
118
+ <entry key="FunctionsThatMightBeMistakenForProcedures" value="true" />
119
+ <entry key="HugeSharedStringConstants" value="true" />
120
+ <entry key="IDivResultCastToDouble" value="true" />
121
+ <entry key="IncompatMask" value="true" />
122
+ <entry key="InconsistentAnnotations" value="true" />
123
+ <entry key="InefficientIndexOf" value="false" />
124
+ <entry key="InefficientInitializationInsideLoop" value="false" />
125
+ <entry key="InefficientMemberAccess" value="false" />
126
+ <entry key="InefficientToArray" value="false" />
127
+ <entry key="InfiniteLoop" value="true" />
128
+ <entry key="InfiniteRecursiveLoop" value="true" />
129
+ <entry key="InheritanceUnsafeGetResource" value="true" />
130
+ <entry key="InitializationChain" value="true" />
131
+ <entry key="InitializeNonnullFieldsInConstructor" value="true" />
132
+ <entry key="InstantiateStaticClass" value="true" />
133
+ <entry key="IntCast2LongAsInstant" value="true" />
134
+ <entry key="InvalidJUnitTest" value="true" />
135
+ <entry key="IteratorIdioms" value="true" />
136
+ <entry key="LazyInit" value="true" />
137
+ <entry key="LoadOfKnownNullValue" value="true" />
138
+ <entry key="LostLoggerDueToWeakReference" value="true" />
139
+ <entry key="MethodReturnCheck" value="true" />
140
+ <entry key="Methods" value="true" />
141
+ <entry key="MultithreadedInstanceAccess" value="true" />
142
+ <entry key="MutableEnum" value="true" />
143
+ <entry key="MutableLock" value="true" />
144
+ <entry key="MutableStaticFields" value="true" />
145
+ <entry key="Naming" value="true" />
146
+ <entry key="Noise" value="false" />
147
+ <entry key="NoiseNullDeref" value="false" />
148
+ <entry key="NoteAnnotationRetention" value="true" />
149
+ <entry key="NoteCheckReturnValueAnnotations" value="true" />
150
+ <entry key="NoteDirectlyRelevantTypeQualifiers" value="true" />
151
+ <entry key="NoteJCIPAnnotation" value="true" />
152
+ <entry key="NoteNonNullAnnotations" value="false" />
153
+ <entry key="NoteNonnullReturnValues" value="false" />
154
+ <entry key="NoteSuppressedWarnings" value="true" />
155
+ <entry key="NoteUnconditionalParamDerefs" value="true" />
156
+ <entry key="NumberConstructor" value="true" />
157
+ <entry key="OptionalReturnNull" value="true" />
158
+ <entry key="OverridingEqualsNotSymmetrical" value="true" />
159
+ <entry key="PreferZeroLengthArrays" value="true" />
160
+ <entry key="PublicSemaphores" value="false" />
161
+ <entry key="QuestionableBooleanAssignment" value="true" />
162
+ <entry key="ReadOfInstanceFieldInMethodInvokedByConstructorInSuperclass" value="true" />
163
+ <entry key="ReadReturnShouldBeChecked" value="true" />
164
+ <entry key="RedundantConditions" value="true" />
165
+ <entry key="RedundantInterfaces" value="true" />
166
+ <entry key="ReflectiveClasses" value="true" />
167
+ <entry key="RepeatedConditionals" value="true" />
168
+ <entry key="ResolveAllReferences" value="false" />
169
+ <entry key="RuntimeExceptionCapture" value="true" />
170
+ <entry key="SerializableIdiom" value="true" />
171
+ <entry key="StartInConstructor" value="true" />
172
+ <entry key="StaticCalendarDetector" value="true" />
173
+ <entry key="StringConcatenation" value="true" />
174
+ <entry key="SuperfluousInstanceOf" value="true" />
175
+ <entry key="SuspiciousThreadInterrupted" value="true" />
176
+ <entry key="SwitchFallthrough" value="true" />
177
+ <entry key="SynchronizationOnSharedBuiltinConstant" value="true" />
178
+ <entry key="SynchronizeAndNullCheckField" value="true" />
179
+ <entry key="SynchronizeOnClassLiteralNotGetClass" value="true" />
180
+ <entry key="SynchronizingOnContentsOfFieldToProtectField" value="true" />
181
+ <entry key="TestASM" value="false" />
182
+ <entry key="TestDataflowAnalysis" value="false" />
183
+ <entry key="TestingGround" value="false" />
184
+ <entry key="TestingGround2" value="false" />
185
+ <entry key="TrainFieldStoreTypes" value="true" />
186
+ <entry key="TrainLongInstantfParams" value="true" />
187
+ <entry key="TrainNonNullAnnotations" value="true" />
188
+ <entry key="TrainUnconditionalDerefParams" value="true" />
189
+ <entry key="URLProblems" value="true" />
190
+ <entry key="UncallableMethodOfAnonymousClass" value="true" />
191
+ <entry key="UnnecessaryMath" value="true" />
192
+ <entry key="UnreadFields" value="true" />
193
+ <entry key="UselessSubclassMethod" value="false" />
194
+ <entry key="VarArgsProblems" value="true" />
195
+ <entry key="VolatileUsage" value="true" />
196
+ <entry key="WaitInLoop" value="true" />
197
+ <entry key="WrongMapIterator" value="true" />
198
+ <entry key="XMLFactoryBypass" value="true" />
199
+ </map>
200
+ </option>
201
+ <option name="_reportCategories">
202
+ <map>
203
+ <entry key="BAD_PRACTICE" value="true" />
204
+ <entry key="CORRECTNESS" value="true" />
205
+ <entry key="EXPERIMENTAL" value="true" />
206
+ <entry key="I18N" value="true" />
207
+ <entry key="MALICIOUS_CODE" value="true" />
208
+ <entry key="MT_CORRECTNESS" value="true" />
209
+ <entry key="PERFORMANCE" value="true" />
210
+ <entry key="SECURITY" value="true" />
211
+ <entry key="STYLE" value="true" />
212
+ </map>
213
+ </option>
214
+ </component>
215
+ </module>
package/package.json CHANGED
@@ -1,6 +1,83 @@
1
- {
2
- "name": "logbin-nodejs",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
6
- }
1
+ {
2
+ "name": "logbin-nodejs",
3
+ "description": "A nodejs implementation for sending logs to Logz.IO cloud service Copy of logzio-nodejs",
4
+ "version": "2.3.2",
5
+ "author": "Gilly Barr <gilly@logz.io>",
6
+ "maintainers": [
7
+ {
8
+ "name": "Yotam loewenbach",
9
+ "email": "yotam.loewenbach@logz.io"
10
+ }
11
+ ],
12
+ "contributors": [
13
+ {
14
+ "name": "Gilly Barr",
15
+ "email": "gillyb@gmail.com"
16
+ },
17
+ {
18
+ "name": "Asaf Mesika",
19
+ "email": "asaf.mesika@gmail.com"
20
+ },
21
+ {
22
+ "name": "Alon Mizrahi",
23
+ "email": "alonmizra@gmail.com"
24
+ },
25
+ {
26
+ "name": "Amir Tugendhaft",
27
+ "email": "Amir.Tugi@gmail.com"
28
+ },
29
+ {
30
+ "name": "Roni Shaham",
31
+ "email": "ronish31@gmail.com"
32
+ },
33
+ {
34
+ "name": "Anton Kolomiiets",
35
+ "email": "resdenia@gmail.com"
36
+ }
37
+ ],
38
+ "repository": {
39
+ "type": "git",
40
+ "url": "https://github.com/logzio/logbin-nodejs.git"
41
+ },
42
+ "keywords": [
43
+ "cloud computing",
44
+ "log analytics",
45
+ "api",
46
+ "logging",
47
+ "logzio"
48
+ ],
49
+ "dependencies": {
50
+ "@opentelemetry/api": "^1.9.0",
51
+ "@opentelemetry/context-async-hooks": "^1.30.0",
52
+ "@opentelemetry/sdk-trace-node": "^1.30.0",
53
+ "axios": "^1.6.4",
54
+ "request": "^2.88.2",
55
+ "fs": "^0.0.1-security",
56
+ "json-stringify-safe": "5.0.1",
57
+ "lodash.assign": "4.2.0",
58
+ "moment": "2.29.4"
59
+ },
60
+ "devDependencies": {
61
+ "assert": "^1.5.0",
62
+ "async": "1.4.2",
63
+ "eslint": "^5.16.0",
64
+ "eslint-config-airbnb-base": "^13.2.0",
65
+ "eslint-plugin-import": "^2.18.2",
66
+ "hrtimemock": "^2.0.0",
67
+ "jest": "^29.7.0",
68
+ "mocha": "^7.1.1",
69
+ "nock": "^12.0.3",
70
+ "should": "^7.1.0",
71
+ "sinon": "^7.5.0"
72
+ },
73
+ "main": "./lib/logzio-nodejs",
74
+ "engines": {
75
+ "node": ">= 14.0.0"
76
+ },
77
+ "license": "(Apache-2.0)",
78
+ "scripts": {
79
+ "test": "jest",
80
+ "detached": "jest --detectOpenHandles",
81
+ "watch": "jest --watch"
82
+ }
83
+ }