@contrast/agent 4.5.1 → 4.7.1

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.
Files changed (209) hide show
  1. package/bin/VERSION +1 -1
  2. package/bin/linux/contrast-service +0 -0
  3. package/bin/mac/contrast-service +0 -0
  4. package/bin/windows/contrast-service.exe +0 -0
  5. package/lib/assess/membrane/deserialization-membrane.js +4 -5
  6. package/lib/assess/membrane/source-membrane.js +16 -33
  7. package/lib/assess/models/call-context.js +1 -1
  8. package/lib/assess/policy/propagators.json +19 -21
  9. package/lib/assess/policy/rules.json +7 -2
  10. package/lib/assess/policy/signatures.json +42 -0
  11. package/lib/assess/policy/util.js +2 -1
  12. package/lib/assess/propagators/JSON/parse.js +1 -1
  13. package/lib/assess/propagators/JSON/stringify.js +3 -3
  14. package/lib/assess/propagators/array-prototype-join.js +7 -8
  15. package/lib/assess/propagators/common.js +7 -5
  16. package/lib/assess/propagators/dustjs/escape-html.js +22 -0
  17. package/lib/assess/propagators/dustjs/escape-js.js +22 -0
  18. package/lib/assess/propagators/encode-uri/encode-uri-component.js +22 -0
  19. package/lib/assess/propagators/encode-uri/encode-uri.js +22 -0
  20. package/lib/assess/propagators/handlebars-escape-expresssion.js +1 -1
  21. package/lib/assess/propagators/index.js +0 -2
  22. package/lib/assess/propagators/joi/boolean.js +1 -1
  23. package/lib/assess/propagators/joi/expression.js +1 -1
  24. package/lib/assess/propagators/joi/number.js +1 -1
  25. package/lib/assess/propagators/joi/string-base.js +1 -1
  26. package/lib/assess/propagators/joi/string-schema.js +12 -13
  27. package/lib/assess/propagators/joi/values.js +37 -22
  28. package/lib/assess/propagators/manager.js +12 -10
  29. package/lib/assess/propagators/mongoose/helpers.js +20 -0
  30. package/lib/assess/propagators/mongoose/index.js +18 -0
  31. package/lib/assess/propagators/mongoose/map.js +74 -0
  32. package/lib/assess/propagators/mongoose/string.js +104 -0
  33. package/lib/assess/propagators/mustache/escape.js +22 -0
  34. package/lib/assess/propagators/number.js +54 -0
  35. package/lib/assess/propagators/object.js +6 -7
  36. package/lib/assess/propagators/path/basename.js +14 -13
  37. package/lib/assess/propagators/path/common.js +156 -47
  38. package/lib/assess/propagators/path/dirname.js +14 -13
  39. package/lib/assess/propagators/path/extname.js +14 -13
  40. package/lib/assess/propagators/path/join.js +5 -1
  41. package/lib/assess/propagators/path/normalize.js +1 -2
  42. package/lib/assess/propagators/path/parse.js +1 -1
  43. package/lib/assess/propagators/path/relative.js +7 -5
  44. package/lib/assess/propagators/path/resolve.js +11 -2
  45. package/lib/assess/propagators/querystring/escape.js +20 -18
  46. package/lib/assess/propagators/querystring/parse.js +7 -5
  47. package/lib/assess/propagators/querystring/stringify.js +25 -24
  48. package/lib/assess/propagators/querystring/unescape.js +20 -18
  49. package/lib/assess/propagators/sequelize/sql-string-escape.js +1 -1
  50. package/lib/assess/propagators/sequelize/sql-string-format-named-parameters.js +1 -1
  51. package/lib/assess/propagators/sequelize/sql-string-format.js +3 -3
  52. package/lib/assess/propagators/sequelize/utils.js +2 -2
  53. package/lib/assess/propagators/string-prototype-replace.js +30 -28
  54. package/lib/assess/propagators/string-prototype-split.js +36 -36
  55. package/lib/assess/propagators/string-prototype-trim.js +15 -17
  56. package/lib/assess/propagators/string.js +12 -16
  57. package/lib/assess/propagators/template-escape.js +87 -0
  58. package/lib/assess/propagators/templates.js +10 -11
  59. package/lib/assess/propagators/url/url-prototype-parse.js +5 -6
  60. package/lib/assess/propagators/url/url-url.js +51 -43
  61. package/lib/assess/propagators/util/format.js +1 -1
  62. package/lib/assess/propagators/v8/init-hooks.js +3 -3
  63. package/lib/assess/propagators/validator/init-hooks.js +22 -22
  64. package/lib/assess/sinks/common.js +10 -5
  65. package/lib/assess/sinks/dustjs-linkedin-xss.js +131 -0
  66. package/lib/assess/sinks/libxmljs-xxe.js +1 -1
  67. package/lib/assess/sinks/mongodb.js +2 -1
  68. package/lib/assess/sinks/ssrf-url.js +1 -1
  69. package/lib/constants.js +4 -1
  70. package/lib/core/arch-components/dynamodb.js +1 -2
  71. package/lib/core/arch-components/dynamodbv3.js +44 -0
  72. package/lib/core/arch-components/index.js +1 -0
  73. package/lib/core/arch-components/rethinkdb.js +53 -0
  74. package/lib/core/config/options.js +3 -2
  75. package/lib/core/rewrite/injections.js +8 -0
  76. package/lib/core/stacktrace.js +2 -1
  77. package/lib/feature-set.js +1 -1
  78. package/lib/hooks/frameworks/base.js +8 -2
  79. package/lib/hooks/frameworks/http.js +23 -16
  80. package/lib/hooks/frameworks/http2.js +73 -0
  81. package/lib/hooks/frameworks/index.js +8 -3
  82. package/lib/hooks/http.js +112 -128
  83. package/lib/hooks/object-to-primitive.js +6 -7
  84. package/lib/hooks/patcher.js +75 -44
  85. package/lib/hooks/require.js +16 -22
  86. package/lib/instrumentation.js +0 -3
  87. package/lib/protect/rules/nosqli/nosql-injection-rule.js +228 -0
  88. package/lib/protect/rules/rule-factory.js +2 -2
  89. package/lib/protect/service.js +23 -11
  90. package/lib/protect/sinks/mongodb.js +56 -55
  91. package/lib/reporter/translations/to-protobuf/dtm/index.js +1 -1
  92. package/lib/reporter/translations/to-protobuf/dtm/ip-denylist-details.js +1 -1
  93. package/lib/reporter/translations/to-protobuf/dtm/rasp-rule-sample.js +1 -1
  94. package/lib/reporter/translations/to-protobuf/settings/defend-features.js +8 -6
  95. package/lib/reporter/translations/to-protobuf/settings/exclusions.js +5 -4
  96. package/lib/tracker.js +13 -65
  97. package/lib/util/some.js +27 -0
  98. package/lib/util/source-map.js +1 -1
  99. package/package.json +15 -16
  100. package/lib/hooks/frameworks/https.js +0 -42
  101. package/lib/protect/rules/nosqli/no-sql-injection-rule.js +0 -109
  102. package/node_modules/bindings/LICENSE.md +0 -22
  103. package/node_modules/bindings/README.md +0 -98
  104. package/node_modules/bindings/bindings.js +0 -221
  105. package/node_modules/bindings/package.json +0 -32
  106. package/node_modules/file-uri-to-path/.npmignore +0 -1
  107. package/node_modules/file-uri-to-path/.travis.yml +0 -30
  108. package/node_modules/file-uri-to-path/History.md +0 -21
  109. package/node_modules/file-uri-to-path/LICENSE +0 -20
  110. package/node_modules/file-uri-to-path/README.md +0 -74
  111. package/node_modules/file-uri-to-path/index.d.ts +0 -2
  112. package/node_modules/file-uri-to-path/index.js +0 -66
  113. package/node_modules/file-uri-to-path/package.json +0 -36
  114. package/node_modules/file-uri-to-path/test/test.js +0 -24
  115. package/node_modules/file-uri-to-path/test/tests.json +0 -13
  116. package/node_modules/glossy/LICENSE +0 -19
  117. package/node_modules/glossy/README.md +0 -129
  118. package/node_modules/glossy/index.js +0 -12
  119. package/node_modules/glossy/lib/glossy/parse.js +0 -520
  120. package/node_modules/glossy/lib/glossy/produce.js +0 -459
  121. package/node_modules/glossy/package.json +0 -47
  122. package/node_modules/glossy/test/decide.js +0 -7
  123. package/node_modules/glossy/test/decode_pri.js +0 -24
  124. package/node_modules/glossy/test/parse_3164.js +0 -104
  125. package/node_modules/glossy/test/parse_5424.js +0 -106
  126. package/node_modules/glossy/test/parse_5848.js +0 -40
  127. package/node_modules/glossy/test/parse_8601.js +0 -14
  128. package/node_modules/glossy/test/parse_rfc3339.js +0 -9
  129. package/node_modules/glossy/test/produce.js +0 -162
  130. package/node_modules/glossy/test/runner.js +0 -40
  131. package/node_modules/glossy/test/structure_data.js +0 -24
  132. package/node_modules/nan/CHANGELOG.md +0 -537
  133. package/node_modules/nan/LICENSE.md +0 -13
  134. package/node_modules/nan/README.md +0 -455
  135. package/node_modules/nan/doc/asyncworker.md +0 -146
  136. package/node_modules/nan/doc/buffers.md +0 -54
  137. package/node_modules/nan/doc/callback.md +0 -76
  138. package/node_modules/nan/doc/converters.md +0 -41
  139. package/node_modules/nan/doc/errors.md +0 -226
  140. package/node_modules/nan/doc/json.md +0 -62
  141. package/node_modules/nan/doc/maybe_types.md +0 -583
  142. package/node_modules/nan/doc/methods.md +0 -664
  143. package/node_modules/nan/doc/new.md +0 -147
  144. package/node_modules/nan/doc/node_misc.md +0 -123
  145. package/node_modules/nan/doc/object_wrappers.md +0 -263
  146. package/node_modules/nan/doc/persistent.md +0 -296
  147. package/node_modules/nan/doc/scopes.md +0 -73
  148. package/node_modules/nan/doc/script.md +0 -38
  149. package/node_modules/nan/doc/string_bytes.md +0 -62
  150. package/node_modules/nan/doc/v8_internals.md +0 -199
  151. package/node_modules/nan/doc/v8_misc.md +0 -85
  152. package/node_modules/nan/include_dirs.js +0 -1
  153. package/node_modules/nan/nan.h +0 -2898
  154. package/node_modules/nan/nan_callbacks.h +0 -88
  155. package/node_modules/nan/nan_callbacks_12_inl.h +0 -514
  156. package/node_modules/nan/nan_callbacks_pre_12_inl.h +0 -520
  157. package/node_modules/nan/nan_converters.h +0 -72
  158. package/node_modules/nan/nan_converters_43_inl.h +0 -68
  159. package/node_modules/nan/nan_converters_pre_43_inl.h +0 -42
  160. package/node_modules/nan/nan_define_own_property_helper.h +0 -29
  161. package/node_modules/nan/nan_implementation_12_inl.h +0 -430
  162. package/node_modules/nan/nan_implementation_pre_12_inl.h +0 -263
  163. package/node_modules/nan/nan_json.h +0 -166
  164. package/node_modules/nan/nan_maybe_43_inl.h +0 -356
  165. package/node_modules/nan/nan_maybe_pre_43_inl.h +0 -268
  166. package/node_modules/nan/nan_new.h +0 -340
  167. package/node_modules/nan/nan_object_wrap.h +0 -156
  168. package/node_modules/nan/nan_persistent_12_inl.h +0 -132
  169. package/node_modules/nan/nan_persistent_pre_12_inl.h +0 -242
  170. package/node_modules/nan/nan_private.h +0 -73
  171. package/node_modules/nan/nan_string_bytes.h +0 -305
  172. package/node_modules/nan/nan_typedarray_contents.h +0 -96
  173. package/node_modules/nan/nan_weak.h +0 -437
  174. package/node_modules/nan/package.json +0 -41
  175. package/node_modules/nan/tools/1to2.js +0 -412
  176. package/node_modules/nan/tools/README.md +0 -14
  177. package/node_modules/nan/tools/package.json +0 -19
  178. package/node_modules/unix-dgram/LICENSE +0 -13
  179. package/node_modules/unix-dgram/README.md +0 -107
  180. package/node_modules/unix-dgram/binding.gyp +0 -20
  181. package/node_modules/unix-dgram/build/Makefile +0 -324
  182. package/node_modules/unix-dgram/build/Release/.deps/Release/obj.target/unix_dgram/src/unix_dgram.o.d +0 -58
  183. package/node_modules/unix-dgram/build/Release/.deps/Release/obj.target/unix_dgram.node.d +0 -1
  184. package/node_modules/unix-dgram/build/Release/.deps/Release/unix_dgram.node.d +0 -1
  185. package/node_modules/unix-dgram/build/Release/obj.target/unix_dgram/src/unix_dgram.o +0 -0
  186. package/node_modules/unix-dgram/build/Release/obj.target/unix_dgram.node +0 -0
  187. package/node_modules/unix-dgram/build/Release/unix_dgram.node +0 -0
  188. package/node_modules/unix-dgram/build/binding.Makefile +0 -6
  189. package/node_modules/unix-dgram/build/config.gypi +0 -213
  190. package/node_modules/unix-dgram/build/unix_dgram.target.mk +0 -159
  191. package/node_modules/unix-dgram/lib/unix_dgram.js +0 -168
  192. package/node_modules/unix-dgram/package.json +0 -36
  193. package/node_modules/unix-dgram/src/unix_dgram.cc +0 -404
  194. package/node_modules/unix-dgram/src/win_dummy.cc +0 -7
  195. package/node_modules/unix-dgram/test/test-connect-callback.js +0 -68
  196. package/node_modules/unix-dgram/test/test-connect.js +0 -53
  197. package/node_modules/unix-dgram/test/test-dgram-unix.js +0 -58
  198. package/node_modules/unix-dgram/test/test-send-error.js +0 -26
  199. package/node_modules/winston-syslog/.eslintrc +0 -7
  200. package/node_modules/winston-syslog/.travis.yml +0 -14
  201. package/node_modules/winston-syslog/CHANGELOG.md +0 -9
  202. package/node_modules/winston-syslog/LICENSE +0 -20
  203. package/node_modules/winston-syslog/README.md +0 -135
  204. package/node_modules/winston-syslog/lib/utils.js +0 -26
  205. package/node_modules/winston-syslog/lib/winston-syslog.js +0 -385
  206. package/node_modules/winston-syslog/package.json +0 -56
  207. package/node_modules/winston-syslog/test/format-test.js +0 -122
  208. package/node_modules/winston-syslog/test/syslog-test.js +0 -95
  209. package/node_modules/winston-syslog/test/unix-connect-test.js +0 -133
@@ -1,122 +0,0 @@
1
- 'use strict';
2
-
3
- const vows = require('vows');
4
- const assert = require('assert');
5
- const winston = require('winston');
6
- const dgram = require('dgram');
7
- const parser = require('glossy').Parse;
8
-
9
- const PORT = 11229;
10
- let server;
11
- let transport;
12
-
13
- const { MESSAGE, LEVEL } = require('triple-beam');
14
-
15
- vows.describe('syslog messages').addBatch({
16
- 'opening fake syslog server': {
17
- 'topic': function () {
18
- const self = this;
19
- server = dgram.createSocket('udp4');
20
- server.on('listening', function () {
21
- self.callback();
22
- });
23
-
24
- server.bind(PORT);
25
- },
26
- 'default format': {
27
- 'topic': function () {
28
- const self = this;
29
- server.once('message', function (msg) {
30
- parser.parse(msg, function (d) {
31
- self.callback(null, d);
32
- });
33
- });
34
-
35
- transport = new winston.transports.Syslog({
36
- port: PORT
37
- });
38
- transport.log({ [LEVEL]: 'debug', [MESSAGE]: 'ping' }, function (err) {
39
- assert.ifError(err);
40
- });
41
- },
42
- 'should have host field set to localhost': function (msg) {
43
- assert.equal(msg.host, 'localhost');
44
- transport.close();
45
- },
46
- 'setting locahost option to a different falsy value (null)': {
47
- 'topic': function () {
48
- const self = this;
49
- server.once('message', function (msg) {
50
- parser.parse(msg, function (d) {
51
- self.callback(null, d);
52
- });
53
- });
54
-
55
- transport = new winston.transports.Syslog({
56
- port: PORT,
57
- localhost: null
58
- });
59
-
60
- transport.log({ [LEVEL]: 'debug', [MESSAGE]: 'ping2' }, function (err) {
61
- assert.ifError(err);
62
- });
63
- },
64
- 'should have host different from localhost': function (msg) {
65
- assert.notEqual(msg.host, 'localhost');
66
- transport.close();
67
- },
68
- 'setting appName option to hello': {
69
- 'topic': function () {
70
- const self = this;
71
- server.once('message', function (msg) {
72
- parser.parse(msg, function (d) {
73
- self.callback(null, d);
74
- });
75
- });
76
-
77
- transport = new winston.transports.Syslog({
78
- port: PORT,
79
- type: '5424',
80
- appName: 'hello'
81
- });
82
-
83
- transport.log({ [LEVEL]: 'debug', [MESSAGE]: 'app name test' }, function (err) {
84
- assert.ifError(err);
85
- });
86
- },
87
- 'should have appName field set to hello': function (msg) {
88
- assert.equal(msg.appName, 'hello');
89
- transport.close();
90
- },
91
- 'setting app_name option to hello': {
92
- 'topic': function () {
93
- const self = this;
94
- server.once('message', function (msg) {
95
- parser.parse(msg, function (d) {
96
- self.callback(null, d);
97
- });
98
- });
99
-
100
- transport = new winston.transports.Syslog({
101
- port: PORT,
102
- type: '5424',
103
- app_name: 'hello'
104
- });
105
-
106
- transport.log({ [LEVEL]: 'debug', [MESSAGE]: 'app name test' }, function (err) {
107
- assert.ifError(err);
108
- });
109
- },
110
- 'should have appName field set to hello': function (msg) {
111
- assert.equal(msg.appName, 'hello');
112
- transport.close();
113
- }
114
- }
115
- }
116
- }
117
- },
118
- 'teardown': function () {
119
- server.close();
120
- }
121
- }
122
- }).export(module);
@@ -1,95 +0,0 @@
1
- /* eslint new-cap: ["error", { "newIsCapExceptions": ["createLogger"] }] */
2
- /*
3
- * syslog-test.js: Tests for instances of the Syslog transport
4
- *
5
- * (C) 2010 Charlie Robbins
6
- * MIT LICENSE
7
- *
8
- */
9
-
10
- const vows = require('vows');
11
- const assert = require('assert');
12
- const winston = require('winston');
13
- const Syslog = require('../lib/winston-syslog').Syslog;
14
-
15
- function assertSyslog(transport) {
16
- assert.instanceOf(transport, Syslog);
17
- assert.isFunction(transport.log);
18
- assert.isFunction(transport.connect);
19
- }
20
-
21
- function closeTopicInfo() {
22
- const transport = new winston.transports.Syslog();
23
- const logger = new winston.createLogger({ transports: [transport] });
24
-
25
- logger.log('info', 'Test message to actually use socket');
26
- logger.remove(transport);
27
-
28
- return transport;
29
- }
30
-
31
- function closeTopicDebug() {
32
- const transport = new winston.transports.Syslog();
33
- const logger = new winston.createLogger({ transports: [transport] });
34
-
35
- logger.log('debug', 'Test message to actually use socket');
36
- logger.remove(transport);
37
-
38
- return transport;
39
- }
40
-
41
- const transport = new Syslog();
42
-
43
- vows.describe('winston-syslog').addBatch({
44
- 'An instance of the Syslog Transport': {
45
- 'should have the proper methods defined': function () {
46
- assertSyslog(transport);
47
- },
48
- 'teardown': function () {
49
- transport.close();
50
- },
51
- 'on close after not really writing': {
52
- topic: closeTopicDebug,
53
- on: {
54
- closed: {
55
- 'closes the socket': function (socket) {
56
- assert.isNull(socket);
57
- }
58
- }
59
- }
60
- },
61
- 'on close after really writing': {
62
- topic: closeTopicInfo,
63
- on: {
64
- closed: {
65
- 'closes the socket': function (socket) {
66
- assert.isNull(socket._handle);
67
- }
68
- }
69
- }
70
- },
71
- 'localhost option': {
72
- 'should default to localhost': function () {
73
- const transportLocal = new winston.transports.Syslog();
74
- assert.equal(transportLocal.localhost, 'localhost');
75
- transportLocal.close();
76
- },
77
- 'should accept other falsy entries as valid': function () {
78
- let transportNotLocal = new winston.transports.Syslog({ localhost: null });
79
- assert.isNull(transportNotLocal.localhost);
80
- transportNotLocal.close();
81
- transportNotLocal = new winston.transports.Syslog({ localhost: false });
82
- assert.equal(transportNotLocal.localhost, false);
83
- transportNotLocal.close();
84
- }
85
- },
86
- 'adding / removing transport to syslog': {
87
- 'should just work': function () {
88
- winston.add(new winston.transports.Syslog());
89
- winston.remove(new winston.transports.Syslog());
90
- winston.add(new winston.transports.Syslog());
91
- winston.remove(new winston.transports.Syslog());
92
- }
93
- }
94
- }
95
- }).export(module);
@@ -1,133 +0,0 @@
1
- /* eslint no-sync: "off" */
2
-
3
- const fs = require('fs');
4
- const vows = require('vows');
5
- const assert = require('assert');
6
- const unix = require('unix-dgram');
7
- const parser = require('glossy').Parse;
8
- const Syslog = require('../lib/winston-syslog').Syslog;
9
-
10
- const { MESSAGE, LEVEL } = require('triple-beam');
11
-
12
- const SOCKNAME = '/tmp/unix_dgram.sock';
13
-
14
- const transport = new Syslog({
15
- protocol: 'unix-connect',
16
- path: SOCKNAME
17
- });
18
-
19
- try {
20
- fs.unlinkSync(SOCKNAME);
21
- } catch (e) {
22
- /* swallow */
23
- }
24
-
25
- let times = 0;
26
- let server;
27
-
28
- vows.describe('unix-connect').addBatch({
29
- 'Trying to log to a non-existant log server': {
30
- 'topic': function () {
31
- const self = this;
32
- transport.once('error', function (err) {
33
- self.callback(null, err);
34
- });
35
-
36
- transport.log({ [LEVEL]: 'debug', [MESSAGE]: `data${++times}` }, function (err) {
37
- assert(err);
38
- assert.equal(err.syscall, 'connect');
39
- assert.equal(transport.queue.length, 1);
40
- });
41
- },
42
- 'should enqueue the log message': function (err) {
43
- assert(err);
44
- assert.equal(err.syscall, 'connect');
45
- }
46
- }
47
- }).addBatch({
48
- 'Logging when log server is up': {
49
- 'topic': function () {
50
- const self = this;
51
- let n = 0;
52
- server = unix.createSocket('unix_dgram', function (buf) {
53
- parser.parse(buf, function (d) {
54
- ++n;
55
- assert(n <= 2);
56
- assert.equal(d.message, 'node[' + process.pid + ']: data' + n);
57
- assert.equal(d.severity, 'debug');
58
- if (n === 2) {
59
- self.callback();
60
- }
61
- });
62
- });
63
-
64
- server.bind(SOCKNAME);
65
- transport.log({ [LEVEL]: 'debug', [MESSAGE]: `data${++times}` }, function (err) {
66
- assert.ifError(err);
67
- });
68
- },
69
- 'should print both the enqueed and the new msg': function (err) {
70
- assert.ifError(err);
71
- }
72
- }
73
- }).addBatch({
74
- 'Logging if server goes down again': {
75
- 'topic': function () {
76
- const self = this;
77
- transport.once('error', function (err) {
78
- self.callback(null, err);
79
- });
80
-
81
- server.close();
82
-
83
- transport.log({ [LEVEL]: 'debug', [MESSAGE]: `data${++times}` }, function (err) {
84
- assert.ifError(err);
85
- assert.equal(transport.queue.length, 1);
86
- });
87
- },
88
- 'should enqueue the log message': function (err) {
89
- assert(err);
90
- assert.equal(err.syscall, 'send');
91
- transport.close();
92
- }
93
- }
94
- }).addBatch({
95
- 'Logging works if server comes up again': {
96
- 'topic': function () {
97
- const self = this;
98
- transport.once('error', function (err) {
99
- // Ignore error -- server hasn't come up yet, that's fine/expected
100
- assert(err);
101
- assert.equal(err.syscall, 'send');
102
- });
103
- let n = 2;
104
- try {
105
- fs.unlinkSync(SOCKNAME);
106
- } catch (e) {
107
- /* swallow */
108
- }
109
- server = unix.createSocket('unix_dgram', function (buf) {
110
- parser.parse(buf, function (d) {
111
- ++n;
112
- assert(n <= 4);
113
- assert.equal(d.message, 'node[' + process.pid + ']: data' + n);
114
- if (n === 4) {
115
- self.callback();
116
- }
117
- });
118
- });
119
-
120
- server.bind(SOCKNAME);
121
- transport.log({ [LEVEL]: 'debug', [MESSAGE]: `data${++times}` }, function (err) {
122
- assert.ifError(err);
123
- });
124
- return null;
125
- },
126
- 'should print both the enqueed and the new msg': function (err) {
127
- assert.ifError(err);
128
- server.close();
129
- return null;
130
- }
131
- }
132
-
133
- }).export(module);