@contrast/agent-bundle 5.40.0 → 5.41.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/node_modules/@contrast/agent/package.json +11 -11
- package/node_modules/@contrast/agent-swc-plugin/index.js +9 -3
- package/node_modules/@contrast/agent-swc-plugin/methods.js +15 -1
- package/node_modules/@contrast/agent-swc-plugin/package.json +5 -8
- package/node_modules/@contrast/agent-swc-plugin/rewriter.wasm +0 -0
- package/node_modules/@contrast/agentify/lib/index.js +2 -2
- package/node_modules/@contrast/agentify/package.json +15 -14
- package/node_modules/@contrast/architecture-components/package.json +5 -5
- package/node_modules/@contrast/assess/lib/dataflow/propagation/install/util-format.js +44 -21
- package/node_modules/@contrast/assess/lib/dataflow/sources/install/body-parser.js +1 -1
- package/node_modules/@contrast/assess/lib/dataflow/sources/install/koa/koa-bodyparsers.js +3 -1
- package/node_modules/@contrast/assess/lib/dataflow/sources/install/qs6.js +5 -5
- package/node_modules/@contrast/assess/lib/dataflow/sources/install/querystring.js +2 -1
- package/node_modules/@contrast/assess/lib/index.d.ts +0 -1
- package/node_modules/@contrast/assess/lib/make-source-context.js +7 -37
- package/node_modules/@contrast/assess/lib/sampler/common.js +7 -11
- package/node_modules/@contrast/assess/package.json +12 -11
- package/node_modules/@contrast/common/lib/types.d.ts +7 -1
- package/node_modules/@contrast/common/package.json +1 -1
- package/node_modules/@contrast/config/lib/common.js +1 -1
- package/node_modules/@contrast/config/lib/config.js +49 -27
- package/node_modules/@contrast/config/lib/index.d.ts +2 -2
- package/node_modules/@contrast/config/lib/options.js +4 -4
- package/node_modules/@contrast/config/package.json +4 -3
- package/node_modules/@contrast/core/lib/sensitive-data-masking/protect-listener.js +15 -15
- package/node_modules/@contrast/core/package.json +6 -6
- package/node_modules/@contrast/deadzones/package.json +5 -5
- package/node_modules/@contrast/dep-hooks/package.json +3 -3
- package/node_modules/@contrast/esm-hooks/package.json +6 -6
- package/node_modules/@contrast/instrumentation/lib/index.js +0 -1
- package/node_modules/@contrast/instrumentation/package.json +5 -5
- package/node_modules/@contrast/library-analysis/lib/install/library-reporting/dep.json +298 -148
- package/node_modules/@contrast/library-analysis/package.json +4 -4
- package/node_modules/@contrast/logger/lib/serializers.js +2 -2
- package/node_modules/@contrast/logger/package.json +3 -3
- package/node_modules/@contrast/metrics/package.json +6 -6
- package/node_modules/@contrast/patcher/package.json +2 -2
- package/node_modules/@contrast/protect/lib/get-source-context.js +3 -1
- package/node_modules/@contrast/protect/lib/index.js +6 -1
- package/node_modules/@contrast/protect/lib/input-analysis/handlers.js +7 -9
- package/node_modules/@contrast/protect/lib/input-analysis/install/http.js +18 -19
- package/node_modules/@contrast/protect/lib/input-analysis/install/qs6.js +18 -17
- package/node_modules/@contrast/protect/lib/input-analysis/install/universal-cookie4.js +2 -3
- package/node_modules/@contrast/protect/lib/make-source-context.js +22 -66
- package/node_modules/@contrast/protect/lib/semantic-analysis/handlers.js +73 -72
- package/node_modules/@contrast/protect/package.json +11 -11
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/application-activity/index.js +7 -7
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/application-activity/translations.d.ts +3 -3
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/application-activity/translations.js +24 -21
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/index.js +1 -1
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/translations.d.ts +1 -2
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/translations.js +8 -2
- package/node_modules/@contrast/reporter/lib/reporters/security-logger/index.d.ts +2 -2
- package/node_modules/@contrast/reporter/lib/reporters/security-logger/index.js +22 -20
- package/node_modules/@contrast/reporter/package.json +7 -7
- package/node_modules/@contrast/rewriter/lib/index.js +2 -2
- package/node_modules/@contrast/rewriter/package.json +6 -6
- package/node_modules/@contrast/route-coverage/lib/index.js +1 -9
- package/node_modules/@contrast/route-coverage/lib/install/express/express5.js +17 -19
- package/node_modules/@contrast/route-coverage/package.json +8 -8
- package/node_modules/@contrast/scopes/package.json +5 -5
- package/node_modules/@contrast/sec-obs/lib/traces/http.js +2 -2
- package/node_modules/@contrast/sec-obs/lib/traces/http.test.js +17 -0
- package/node_modules/@contrast/sec-obs/lib/traces/outbound-service-call.js +2 -2
- package/node_modules/@contrast/sec-obs/lib/traces/outbound-service-call.test.js +17 -0
- package/node_modules/@contrast/sec-obs/package.json +9 -9
- package/node_modules/@contrast/sources/lib/index.js +109 -0
- package/node_modules/@contrast/sources/lib/index.test.js +120 -0
- package/node_modules/@contrast/{route-coverage/lib/normalized-url-mapper.js → sources/lib/normalized-uri-mapper.js} +10 -3
- package/node_modules/@contrast/sources/lib/normalized-uri-mapper.test.js +59 -0
- package/node_modules/@contrast/{sec-obs/node_modules/@contrast/core/lib/sensitive-data-masking/constants.js → sources/lib/req-data.js} +0 -6
- package/node_modules/@contrast/sources/lib/source-info.js +183 -0
- package/node_modules/@contrast/sources/lib/source-info.test.js +68 -0
- package/node_modules/@contrast/sources/package.json +16 -0
- package/node_modules/@contrast/telemetry/package.json +6 -6
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.d.ts +2831 -77
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.js +2831 -77
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.d.ts +415 -98
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.js +415 -98
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.d.ts +106 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js +106 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/version.d.ts +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/version.js +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/version.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.d.ts +2831 -77
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.js +2831 -77
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.d.ts +415 -98
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.js +415 -98
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.d.ts +106 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.js +106 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/version.d.ts +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/version.js +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/version.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.d.ts +2831 -77
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.js +2858 -103
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.d.ts +415 -98
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.js +420 -102
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.d.ts +106 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js +106 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/src/version.d.ts +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/src/version.js +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/src/version.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/package.json +3 -3
- package/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/node/fs.d.ts +13 -1
- package/node_modules/@types/node/http.d.ts +4 -19
- package/node_modules/@types/node/inspector.d.ts +53 -0
- package/node_modules/@types/node/package.json +2 -82
- package/node_modules/axios/CHANGELOG.md +17 -0
- package/node_modules/axios/README.md +1 -4
- package/node_modules/axios/dist/axios.js +39 -5
- package/node_modules/axios/dist/axios.js.map +1 -1
- package/node_modules/axios/dist/axios.min.js +2 -2
- package/node_modules/axios/dist/axios.min.js.map +1 -1
- package/node_modules/axios/dist/browser/axios.cjs +46 -9
- package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
- package/node_modules/axios/dist/esm/axios.js +46 -9
- package/node_modules/axios/dist/esm/axios.js.map +1 -1
- package/node_modules/axios/dist/esm/axios.min.js +2 -2
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
- package/node_modules/axios/dist/node/axios.cjs +46 -9
- package/node_modules/axios/dist/node/axios.cjs.map +1 -1
- package/node_modules/axios/index.d.cts +13 -2
- package/node_modules/axios/lib/core/Axios.js +2 -2
- package/node_modules/axios/lib/core/mergeConfig.js +1 -1
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/throttle.js +1 -1
- package/node_modules/axios/lib/helpers/toURLEncodedForm.js +4 -3
- package/node_modules/axios/lib/utils.js +36 -0
- package/node_modules/axios/package.json +5 -5
- package/node_modules/deepmerge/.editorconfig +7 -0
- package/node_modules/deepmerge/.eslintcache +1 -0
- package/node_modules/deepmerge/changelog.md +167 -0
- package/node_modules/deepmerge/dist/cjs.js +133 -0
- package/node_modules/deepmerge/dist/umd.js +139 -0
- package/node_modules/deepmerge/index.d.ts +20 -0
- package/node_modules/deepmerge/index.js +106 -0
- package/node_modules/deepmerge/license.txt +21 -0
- package/node_modules/deepmerge/package.json +42 -0
- package/node_modules/deepmerge/readme.md +264 -0
- package/node_modules/deepmerge/rollup.config.js +22 -0
- package/node_modules/follow-redirects/package.json +1 -1
- package/node_modules/form-data/CHANGELOG.md +601 -0
- package/node_modules/form-data/{Readme.md → README.md} +4 -4
- package/node_modules/form-data/lib/form_data.js +2 -6
- package/node_modules/form-data/package.json +22 -6
- package/node_modules/nan/.github/workflows/ci.yml +8 -10
- package/node_modules/nan/.pre-commit-config.yaml +8 -0
- package/node_modules/nan/CHANGELOG.md +5 -1
- package/node_modules/nan/README.md +4 -4
- package/node_modules/nan/nan.h +16 -12
- package/node_modules/nan/nan_callbacks.h +13 -0
- package/node_modules/nan/nan_callbacks_12_inl.h +16 -2
- package/node_modules/nan/nan_callbacks_pre_12_inl.h +6 -2
- package/node_modules/nan/nan_maybe_43_inl.h +1 -1
- package/node_modules/nan/nan_maybe_pre_43_inl.h +1 -1
- package/node_modules/nan/nan_scriptorigin.h +11 -9
- package/node_modules/nan/nan_typedarray_contents.h +1 -1
- package/node_modules/nan/package.json +2 -2
- package/package.json +2 -2
- package/node_modules/@contrast/agentify/lib/sources.js +0 -95
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/LICENSE +0 -12
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/constants.d.ts +0 -385
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/constants.js +0 -270
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/index.d.ts +0 -40
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/index.js +0 -228
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/primordials.d.ts +0 -65
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/primordials.js +0 -66
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/types.d.ts +0 -383
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/types.js +0 -30
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/package.json +0 -23
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/LICENSE +0 -12
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/README.md +0 -44
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/lib/common.js +0 -131
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/lib/config.js +0 -290
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/lib/index.d.ts +0 -328
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/lib/index.js +0 -29
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/lib/options.js +0 -836
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/lib/validators.js +0 -23
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/package.json +0 -27
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/LICENSE +0 -12
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/README.md +0 -98
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/agent-info.js +0 -36
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/app-info.js +0 -233
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/build-id.js +0 -51
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/capture-stacktrace.js +0 -256
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/contrast-methods.js +0 -155
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/index.d.ts +0 -52
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/ioc/core.js +0 -95
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/is-agent-path.js +0 -37
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/messages.js +0 -28
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/sensitive-data-masking/index.js +0 -63
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/sensitive-data-masking/protect-listener.js +0 -111
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/sensitive-data-masking/server-settings-listener.js +0 -44
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/system-info/cloud-provider-metadata.js +0 -146
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/system-info/index.js +0 -225
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/system-info/linux-os-info.js +0 -137
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/system-info/utils.js +0 -35
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/package.json +0 -33
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/LICENSE +0 -12
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/README.md +0 -94
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/export-handler-registry.d.ts +0 -121
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/export-handler-registry.js +0 -206
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/export-hook-descriptor.d.ts +0 -72
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/export-hook-descriptor.js +0 -88
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/handler-invoker.d.ts +0 -46
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/handler-invoker.js +0 -106
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/helpers.d.ts +0 -28
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/helpers.js +0 -66
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/index.d.ts +0 -115
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/index.js +0 -208
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/package-finder.d.ts +0 -43
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/package-finder.js +0 -79
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/package.json +0 -29
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/LICENSE +0 -12
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/README.md +0 -270
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/lib/index.d.ts +0 -16
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/lib/index.js +0 -132
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/lib/serializers.d.ts +0 -33
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/lib/serializers.js +0 -75
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/lib/utils.d.ts +0 -15
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/lib/utils.js +0 -34
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/package.json +0 -28
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/patcher/LICENSE +0 -12
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/patcher/README.md +0 -51
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/patcher/lib/index.d.ts +0 -101
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/patcher/lib/index.js +0 -544
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/patcher/package.json +0 -25
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/rewriter/LICENSE +0 -12
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/rewriter/README.md +0 -6
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/rewriter/lib/cache.js +0 -318
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/rewriter/lib/index.js +0 -216
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/rewriter/lib/rewrite-is-deadzoned.js +0 -143
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/rewriter/package.json +0 -30
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/LICENSE +0 -12
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/constants.js +0 -26
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/index.d.ts +0 -46
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/index.js +0 -70
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/bluebird.js +0 -128
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/index.js +0 -34
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/mongodb-core.js +0 -83
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/mongodb3.js +0 -89
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/mongodb4.js +0 -80
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/mongodb6.js +0 -46
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/mysql.js +0 -151
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/redis.js +0 -79
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/utils.js +0 -35
- package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/package.json +0 -28
- package/node_modules/form-data/README.md.bak +0 -355
|
@@ -8,6 +8,7 @@ var https = require('https');
|
|
|
8
8
|
var parseUrl = require('url').parse;
|
|
9
9
|
var fs = require('fs');
|
|
10
10
|
var Stream = require('stream').Stream;
|
|
11
|
+
var crypto = require('crypto');
|
|
11
12
|
var mime = require('mime-types');
|
|
12
13
|
var asynckit = require('asynckit');
|
|
13
14
|
var setToStringTag = require('es-set-tostringtag');
|
|
@@ -345,12 +346,7 @@ FormData.prototype._generateBoundary = function () {
|
|
|
345
346
|
// This generates a 50 character boundary similar to those used by Firefox.
|
|
346
347
|
|
|
347
348
|
// They are optimized for boyer-moore parsing.
|
|
348
|
-
|
|
349
|
-
for (var i = 0; i < 24; i++) {
|
|
350
|
-
boundary += Math.floor(Math.random() * 10).toString(16);
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
this._boundary = boundary;
|
|
349
|
+
this._boundary = '--------------------------' + crypto.randomBytes(12).toString('hex');
|
|
354
350
|
};
|
|
355
351
|
|
|
356
352
|
// Note: getLengthSync DOESN'T calculate streams length
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"author": "Felix Geisendörfer <felix@debuggable.com> (http://debuggable.com/)",
|
|
3
3
|
"name": "form-data",
|
|
4
4
|
"description": "A library to create readable \"multipart/form-data\" streams. Can be used to submit forms and file uploads to other web applications.",
|
|
5
|
-
"version": "4.0.
|
|
5
|
+
"version": "4.0.4",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git://github.com/form-data/form-data.git"
|
|
@@ -28,10 +28,13 @@
|
|
|
28
28
|
"files": "pkgfiles --sort=name",
|
|
29
29
|
"get-version": "node -e \"console.log(require('./package.json').version)\"",
|
|
30
30
|
"update-readme": "sed -i.bak 's/\\/master\\.svg/\\/v'$(npm --silent run get-version)'.svg/g' README.md",
|
|
31
|
-
"
|
|
31
|
+
"postupdate-readme": "mv README.md.bak READ.ME.md.bak",
|
|
32
|
+
"restore-readme": "mv READ.ME.md.bak README.md",
|
|
32
33
|
"prepublish": "not-in-publish || npm run prepublishOnly",
|
|
33
|
-
"
|
|
34
|
-
"
|
|
34
|
+
"prepack": "npm run update-readme",
|
|
35
|
+
"postpack": "npm run restore-readme",
|
|
36
|
+
"version": "auto-changelog && git add CHANGELOG.md",
|
|
37
|
+
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
|
|
35
38
|
},
|
|
36
39
|
"engines": {
|
|
37
40
|
"node": ">= 6"
|
|
@@ -44,7 +47,8 @@
|
|
|
44
47
|
"mime-types": "^2.1.12"
|
|
45
48
|
},
|
|
46
49
|
"devDependencies": {
|
|
47
|
-
"@ljharb/eslint-config": "^21.
|
|
50
|
+
"@ljharb/eslint-config": "^21.2.0",
|
|
51
|
+
"auto-changelog": "^2.5.0",
|
|
48
52
|
"browserify": "^13.3.0",
|
|
49
53
|
"browserify-istanbul": "^2.0.0",
|
|
50
54
|
"coveralls": "^3.1.1",
|
|
@@ -58,9 +62,21 @@
|
|
|
58
62
|
"istanbul": "^0.4.5",
|
|
59
63
|
"obake": "^0.1.2",
|
|
60
64
|
"pkgfiles": "^2.3.2",
|
|
65
|
+
"pre-commit": "^1.2.2",
|
|
66
|
+
"predict-v8-randomness": "^1.0.35",
|
|
67
|
+
"puppeteer": "^1.20.0",
|
|
61
68
|
"request": "~2.87.0",
|
|
62
69
|
"rimraf": "^2.7.1",
|
|
70
|
+
"semver": "^6.3.1",
|
|
63
71
|
"tape": "^5.9.0"
|
|
64
72
|
},
|
|
65
|
-
"license": "MIT"
|
|
73
|
+
"license": "MIT",
|
|
74
|
+
"auto-changelog": {
|
|
75
|
+
"output": "CHANGELOG.md",
|
|
76
|
+
"template": "keepachangelog",
|
|
77
|
+
"unreleased": false,
|
|
78
|
+
"commitLimit": false,
|
|
79
|
+
"backfillLimit": false,
|
|
80
|
+
"hideCredit": true
|
|
81
|
+
}
|
|
66
82
|
}
|
|
@@ -12,11 +12,17 @@ on:
|
|
|
12
12
|
permissions:
|
|
13
13
|
contents: read
|
|
14
14
|
jobs:
|
|
15
|
+
pre-commit:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
- uses: pre-commit/action@v3.0.1
|
|
20
|
+
|
|
15
21
|
ci:
|
|
16
22
|
strategy:
|
|
17
23
|
fail-fast: false
|
|
18
|
-
matrix:
|
|
19
|
-
node-version: [22.x, 21.x, 20.x, 19.x, 18.x, 17.x, 16.x]
|
|
24
|
+
matrix:
|
|
25
|
+
node-version: [24.x, 23.x, 22.x, 21.x, 20.x, 19.x, 18.x, 17.x, 16.x]
|
|
20
26
|
os: [windows-latest]
|
|
21
27
|
include:
|
|
22
28
|
- node-version: lts/*
|
|
@@ -29,14 +35,6 @@ jobs:
|
|
|
29
35
|
os: ubuntu-24.04-arm # Linux on arm64
|
|
30
36
|
- node-version: lts/*
|
|
31
37
|
os: windows-2025
|
|
32
|
-
- node-version: 14.x
|
|
33
|
-
os: windows-2019
|
|
34
|
-
- node-version: 12.x
|
|
35
|
-
os: windows-2019
|
|
36
|
-
- node-version: 10.x
|
|
37
|
-
os: windows-2019
|
|
38
|
-
- node-version: 8.x
|
|
39
|
-
os: windows-2019
|
|
40
38
|
runs-on: ${{ matrix.os }}
|
|
41
39
|
steps:
|
|
42
40
|
- uses: actions/checkout@v4
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
# NAN ChangeLog
|
|
2
2
|
|
|
3
|
-
**Version 2.
|
|
3
|
+
**Version 2.23.0: current Node 24.4.0, Node 0.12: 0.12.18, Node 0.10: 0.10.48, iojs: 3.3.1**
|
|
4
|
+
|
|
5
|
+
### 2.23.0 Jul 10 2025
|
|
6
|
+
|
|
7
|
+
- Feature: Support Node 23 (#979) 59ab6d03d5d68554290ee9f34003cd90aa92c185
|
|
4
8
|
|
|
5
9
|
### 2.22.2 Feb 26 2025
|
|
6
10
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Native Abstractions for Node.js
|
|
2
2
|
===============================
|
|
3
3
|
|
|
4
|
-
**A header file filled with macro and utility goodness for making add-on development for Node.js easier across versions 8, 10, 12, 14, 16, 17, 18, 19, 20, 21, and
|
|
4
|
+
**A header file filled with macro and utility goodness for making add-on development for Node.js easier across versions 8, 10, 12, 14, 16, 17, 18, 19, 20, 21, 22, 23 and 24.**
|
|
5
5
|
|
|
6
|
-
***Current version: 2.
|
|
6
|
+
***Current version: 2.23.0***
|
|
7
7
|
|
|
8
8
|
*(See [CHANGELOG.md](https://github.com/nodejs/nan/blob/master/CHANGELOG.md) for complete ChangeLog)*
|
|
9
9
|
|
|
@@ -31,10 +31,10 @@ This project also contains some helper utilities that make addon development a b
|
|
|
31
31
|
|
|
32
32
|
## Usage
|
|
33
33
|
|
|
34
|
-
Simply add **NAN** as a dependency
|
|
34
|
+
Simply add **NAN** as a dependency using a package manager like npm, yarn, or bun:
|
|
35
35
|
|
|
36
36
|
``` bash
|
|
37
|
-
$ npm install
|
|
37
|
+
$ npm install nan
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
Pull in the path to **NAN** in your *binding.gyp* so that you can use `#include <nan.h>` in your *.cpp* files:
|
package/node_modules/nan/nan.h
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
|
|
15
15
|
*
|
|
16
|
-
* Version 2.
|
|
16
|
+
* Version 2.23.0: current Node 24.4.0, Node 0.12: 0.12.18, Node 0.10: 0.10.48, iojs: 3.3.1
|
|
17
17
|
*
|
|
18
18
|
* See https://github.com/nodejs/nan for the latest update to this file
|
|
19
19
|
**********************************************************************************/
|
|
@@ -179,7 +179,7 @@ namespace Nan {
|
|
|
179
179
|
|
|
180
180
|
//=== CallbackInfo =============================================================
|
|
181
181
|
|
|
182
|
-
#include "nan_callbacks.h" // NOLINT(build/
|
|
182
|
+
#include "nan_callbacks.h" // NOLINT(build/include_subdir)
|
|
183
183
|
|
|
184
184
|
//==============================================================================
|
|
185
185
|
|
|
@@ -304,8 +304,8 @@ inline Maybe<T> Just(const T& t) {
|
|
|
304
304
|
# include "nan_maybe_pre_43_inl.h" // NOLINT(build/include)
|
|
305
305
|
#endif
|
|
306
306
|
|
|
307
|
-
#include "nan_converters.h" // NOLINT(build/
|
|
308
|
-
#include "nan_new.h" // NOLINT(build/
|
|
307
|
+
#include "nan_converters.h" // NOLINT(build/include_subdir)
|
|
308
|
+
#include "nan_new.h" // NOLINT(build/include_subdir)
|
|
309
309
|
|
|
310
310
|
#if NAUV_UVVERSION < 0x000b17
|
|
311
311
|
#define NAUV_WORK_CB(func) \
|
|
@@ -2615,7 +2615,9 @@ NAN_DEPRECATED inline void SetAccessor(
|
|
|
2615
2615
|
obj->SetInternalField(imp::kDataIndex, data);
|
|
2616
2616
|
}
|
|
2617
2617
|
|
|
2618
|
-
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 12
|
|
2618
|
+
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 12 \
|
|
2619
|
+
|| (V8_MAJOR_VERSION == 12 && defined(V8_MINOR_VERSION) \
|
|
2620
|
+
&& V8_MINOR_VERSION >= 5))
|
|
2619
2621
|
tpl->SetNativeDataProperty(
|
|
2620
2622
|
#else
|
|
2621
2623
|
tpl->SetAccessor(
|
|
@@ -2667,7 +2669,9 @@ inline void SetAccessor(
|
|
|
2667
2669
|
obj->SetInternalField(imp::kDataIndex, data);
|
|
2668
2670
|
}
|
|
2669
2671
|
|
|
2670
|
-
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 12
|
|
2672
|
+
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 12 \
|
|
2673
|
+
|| (V8_MAJOR_VERSION == 12 && defined(V8_MINOR_VERSION) \
|
|
2674
|
+
&& V8_MINOR_VERSION >= 5))
|
|
2671
2675
|
tpl->SetNativeDataProperty(
|
|
2672
2676
|
#else
|
|
2673
2677
|
tpl->SetAccessor(
|
|
@@ -2934,15 +2938,15 @@ inline void SetCallAsFunctionHandler(
|
|
|
2934
2938
|
|
|
2935
2939
|
//=== Weak Persistent Handling =================================================
|
|
2936
2940
|
|
|
2937
|
-
#include "nan_weak.h" // NOLINT(build/
|
|
2941
|
+
#include "nan_weak.h" // NOLINT(build/include_subdir)
|
|
2938
2942
|
|
|
2939
2943
|
//=== ObjectWrap ===============================================================
|
|
2940
2944
|
|
|
2941
|
-
#include "nan_object_wrap.h" // NOLINT(build/
|
|
2945
|
+
#include "nan_object_wrap.h" // NOLINT(build/include_subdir)
|
|
2942
2946
|
|
|
2943
2947
|
//=== HiddenValue/Private ======================================================
|
|
2944
2948
|
|
|
2945
|
-
#include "nan_private.h" // NOLINT(build/
|
|
2949
|
+
#include "nan_private.h" // NOLINT(build/include_subdir)
|
|
2946
2950
|
|
|
2947
2951
|
//=== Export ==================================================================
|
|
2948
2952
|
|
|
@@ -3034,15 +3038,15 @@ MakeMaybe(MaybeMaybe<T> v) {
|
|
|
3034
3038
|
|
|
3035
3039
|
//=== TypedArrayContents =======================================================
|
|
3036
3040
|
|
|
3037
|
-
#include "nan_typedarray_contents.h" // NOLINT(build/
|
|
3041
|
+
#include "nan_typedarray_contents.h" // NOLINT(build/include_subdir)
|
|
3038
3042
|
|
|
3039
3043
|
//=== JSON =====================================================================
|
|
3040
3044
|
|
|
3041
|
-
#include "nan_json.h" // NOLINT(build/
|
|
3045
|
+
#include "nan_json.h" // NOLINT(build/include_subdir)
|
|
3042
3046
|
|
|
3043
3047
|
//=== ScriptOrigin =============================================================
|
|
3044
3048
|
|
|
3045
|
-
#include "nan_scriptorigin.h" // NOLINT(build/
|
|
3049
|
+
#include "nan_scriptorigin.h" // NOLINT(build/include_subdir)
|
|
3046
3050
|
|
|
3047
3051
|
} // end of namespace Nan
|
|
3048
3052
|
|
|
@@ -13,6 +13,19 @@ template<typename T> class FunctionCallbackInfo;
|
|
|
13
13
|
template<typename T> class PropertyCallbackInfo;
|
|
14
14
|
template<typename T> class Global;
|
|
15
15
|
|
|
16
|
+
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 12 || \
|
|
17
|
+
(V8_MAJOR_VERSION == 12 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION > 4))
|
|
18
|
+
namespace Intercepted {
|
|
19
|
+
constexpr v8::Intercepted No() { return v8::Intercepted::kNo; }
|
|
20
|
+
constexpr v8::Intercepted Yes() { return v8::Intercepted::kYes; }
|
|
21
|
+
};
|
|
22
|
+
#else
|
|
23
|
+
namespace Intercepted {
|
|
24
|
+
inline void No() {}
|
|
25
|
+
inline void Yes() {}
|
|
26
|
+
};
|
|
27
|
+
#endif
|
|
28
|
+
|
|
16
29
|
typedef void(*FunctionCallback)(const FunctionCallbackInfo<v8::Value>&);
|
|
17
30
|
typedef void(*GetterCallback)
|
|
18
31
|
(v8::Local<v8::String>, const PropertyCallbackInfo<v8::Value>&);
|
|
@@ -106,10 +106,24 @@ class FunctionCallbackInfo {
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
#if NODE_MAJOR_VERSION < 10
|
|
109
|
-
inline v8::Local<v8::Function> Callee() const {
|
|
109
|
+
NAN_DEPRECATED inline v8::Local<v8::Function> Callee() const {
|
|
110
|
+
return info_.Callee();
|
|
111
|
+
}
|
|
110
112
|
#endif
|
|
111
113
|
inline v8::Local<v8::Value> Data() const { return data_; }
|
|
112
|
-
inline v8::Local<v8::Object> Holder() const {
|
|
114
|
+
inline v8::Local<v8::Object> Holder() const {
|
|
115
|
+
#if defined(V8_MAJOR_VERSION) && \
|
|
116
|
+
(V8_MAJOR_VERSION > 12 || \
|
|
117
|
+
(V8_MAJOR_VERSION == 12 && \
|
|
118
|
+
(defined(V8_MINOR_VERSION) && \
|
|
119
|
+
(V8_MINOR_VERSION > 5 || \
|
|
120
|
+
(V8_MINOR_VERSION == 5 && defined(V8_BUILD_NUMBER) && \
|
|
121
|
+
V8_BUILD_NUMBER >= 214)))))
|
|
122
|
+
return info_.This();
|
|
123
|
+
#else
|
|
124
|
+
return info_.Holder();
|
|
125
|
+
#endif
|
|
126
|
+
}
|
|
113
127
|
inline bool IsConstructCall() const { return info_.IsConstructCall(); }
|
|
114
128
|
inline int Length() const { return info_.Length(); }
|
|
115
129
|
inline v8::Local<v8::Value> operator[](int i) const { return info_[i]; }
|
|
@@ -136,9 +136,13 @@ class FunctionCallbackInfo {
|
|
|
136
136
|
return ReturnValue<T>(return_value_);
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
inline v8::Local<v8::Function> Callee() const {
|
|
139
|
+
NAN_DEPRECATED inline v8::Local<v8::Function> Callee() const {
|
|
140
|
+
return args_.Callee();
|
|
141
|
+
}
|
|
140
142
|
inline v8::Local<v8::Value> Data() const { return data_; }
|
|
141
|
-
inline v8::Local<v8::Object> Holder() const {
|
|
143
|
+
inline v8::Local<v8::Object> Holder() const {
|
|
144
|
+
return args_.Holder();
|
|
145
|
+
}
|
|
142
146
|
inline bool IsConstructCall() const { return args_.IsConstructCall(); }
|
|
143
147
|
inline int Length() const { return args_.Length(); }
|
|
144
148
|
inline v8::Local<v8::Value> operator[](int i) const { return args_[i]; }
|
|
@@ -90,7 +90,7 @@ inline Maybe<bool> Set(
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
#if NODE_MODULE_VERSION < NODE_4_0_MODULE_VERSION
|
|
93
|
-
#include "nan_define_own_property_helper.h" // NOLINT(build/
|
|
93
|
+
#include "nan_define_own_property_helper.h" // NOLINT(build/include_subdir)
|
|
94
94
|
#endif
|
|
95
95
|
|
|
96
96
|
inline Maybe<bool> DefineOwnProperty(
|
|
@@ -100,7 +100,7 @@ inline Maybe<bool> Set(
|
|
|
100
100
|
return Just<bool>(obj->Set(index, value));
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
#include "nan_define_own_property_helper.h" // NOLINT(build/
|
|
103
|
+
#include "nan_define_own_property_helper.h" // NOLINT(build/include_subdir)
|
|
104
104
|
|
|
105
105
|
inline Maybe<bool> DefineOwnProperty(
|
|
106
106
|
v8::Handle<v8::Object> obj
|
|
@@ -11,26 +11,28 @@
|
|
|
11
11
|
|
|
12
12
|
class ScriptOrigin : public v8::ScriptOrigin {
|
|
13
13
|
public:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
#if defined(V8_MAJOR_VERSION) && \
|
|
15
|
+
(V8_MAJOR_VERSION > 12 || \
|
|
16
|
+
(V8_MAJOR_VERSION == 12 && \
|
|
17
|
+
(defined(V8_MINOR_VERSION) && \
|
|
18
|
+
(V8_MINOR_VERSION > 6 || \
|
|
19
|
+
(V8_MINOR_VERSION == 6 && defined(V8_BUILD_NUMBER) && \
|
|
20
|
+
V8_BUILD_NUMBER >= 175)))))
|
|
19
21
|
explicit ScriptOrigin(v8::Local<v8::Value> name) :
|
|
20
22
|
v8::ScriptOrigin(name) {}
|
|
21
23
|
|
|
22
24
|
ScriptOrigin(v8::Local<v8::Value> name
|
|
23
25
|
, v8::Local<v8::Integer> line) :
|
|
24
26
|
v8::ScriptOrigin(name
|
|
25
|
-
|
|
27
|
+
, To<int32_t>(line).FromMaybe(0)) {}
|
|
26
28
|
|
|
27
29
|
ScriptOrigin(v8::Local<v8::Value> name
|
|
28
30
|
, v8::Local<v8::Integer> line
|
|
29
31
|
, v8::Local<v8::Integer> column) :
|
|
30
32
|
v8::ScriptOrigin(name
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
#elif defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 9 ||
|
|
33
|
+
, To<int32_t>(line).FromMaybe(0)
|
|
34
|
+
, To<int32_t>(column).FromMaybe(0)) {}
|
|
35
|
+
#elif defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 9 || \
|
|
34
36
|
(V8_MAJOR_VERSION == 9 && (defined(V8_MINOR_VERSION) && (V8_MINOR_VERSION > 0\
|
|
35
37
|
|| (V8_MINOR_VERSION == 0 && defined(V8_BUILD_NUMBER) \
|
|
36
38
|
&& V8_BUILD_NUMBER >= 1)))))
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nan",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "Native Abstractions for Node.js: C++ header for Node 0.8 ->
|
|
3
|
+
"version": "2.23.0",
|
|
4
|
+
"description": "Native Abstractions for Node.js: C++ header for Node 0.8 -> 24 compatibility",
|
|
5
5
|
"main": "include_dirs.js",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrast/agent-bundle",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.41.0",
|
|
4
4
|
"description": "Contrast Security Node.js Agent bundle with all dependencies included",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"test": "bash ../scripts/test.sh"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@contrast/agent": "5.
|
|
29
|
+
"@contrast/agent": "5.41.0"
|
|
30
30
|
},
|
|
31
31
|
"bundleDependencies": [
|
|
32
32
|
"@contrast/agent"
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright: 2025 Contrast Security, Inc
|
|
3
|
-
* Contact: support@contrastsecurity.com
|
|
4
|
-
* License: Commercial
|
|
5
|
-
|
|
6
|
-
* NOTICE: This Software and the patented inventions embodied within may only be
|
|
7
|
-
* used as part of Contrast Security’s commercial offerings. Even though it is
|
|
8
|
-
* made available through public repositories, use of this Software is subject to
|
|
9
|
-
* the applicable End User Licensing Agreement found at
|
|
10
|
-
* https://www.contrastsecurity.com/enduser-terms-0317a or as otherwise agreed
|
|
11
|
-
* between Contrast Security and the End User. The Software may not be reverse
|
|
12
|
-
* engineered, modified, repackaged, sold, redistributed or otherwise used in a
|
|
13
|
-
* way not consistent with the End User License Agreement.
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
'use strict';
|
|
17
|
-
|
|
18
|
-
const { EventEmitter } = require('events');
|
|
19
|
-
const onFinished = require('on-finished');
|
|
20
|
-
const { Event, primordials: { StringPrototypeToLowerCase } } = require('@contrast/common');
|
|
21
|
-
|
|
22
|
-
module.exports = function(core) {
|
|
23
|
-
const {
|
|
24
|
-
messages,
|
|
25
|
-
instrumentation: { instrument },
|
|
26
|
-
scopes: { sources: sourcesStorage }
|
|
27
|
-
} = core;
|
|
28
|
-
|
|
29
|
-
const _hooks = new EventEmitter();
|
|
30
|
-
|
|
31
|
-
function aroundHook(serverType) {
|
|
32
|
-
return function around(next, data) {
|
|
33
|
-
const { args: [event, req, res] } = data;
|
|
34
|
-
|
|
35
|
-
if (event !== 'request') {
|
|
36
|
-
if (event === 'listening') {
|
|
37
|
-
// take a snapshot of Perf.all at this point. this will get logged
|
|
38
|
-
// at some point on the perf interval timer.
|
|
39
|
-
core.Perf.mark('listening');
|
|
40
|
-
messages.emit(Event.SERVER_LISTENING, { type: serverType, server: data.obj });
|
|
41
|
-
}
|
|
42
|
-
return next();
|
|
43
|
-
}
|
|
44
|
-
// let's count requests.
|
|
45
|
-
core.Perf.requestCount += 1;
|
|
46
|
-
|
|
47
|
-
const store = {
|
|
48
|
-
sourceInfo: {
|
|
49
|
-
port: req.socket.address?.()?.port || 0,
|
|
50
|
-
protocol: serverType === 'http' ? 'http' : 'https',
|
|
51
|
-
serverType,
|
|
52
|
-
time: Date.now(),
|
|
53
|
-
method: StringPrototypeToLowerCase.call(req.method),
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
if (_hooks._events.onSource) {
|
|
58
|
-
_hooks.emit('onSource', {
|
|
59
|
-
// future: non-http sources will have their own type
|
|
60
|
-
sourceType: 'HTTP',
|
|
61
|
-
store,
|
|
62
|
-
incomingMessage: req,
|
|
63
|
-
serverResponse: res,
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
onFinished(res, (/* err, req */) => {
|
|
68
|
-
messages.emit(Event.RESPONSE_FINISH, store);
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
return sourcesStorage.run(store, next);
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function install() {
|
|
76
|
-
['http', 'https', 'spdy', 'http2'].forEach((moduleName) => {
|
|
77
|
-
instrument({
|
|
78
|
-
moduleName,
|
|
79
|
-
patchObjects: [{
|
|
80
|
-
name: 'Server.prototype',
|
|
81
|
-
methods: ['emit'],
|
|
82
|
-
patchType: 'sources',
|
|
83
|
-
around: aroundHook(moduleName)
|
|
84
|
-
}]
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
return core.sources = {
|
|
89
|
-
install,
|
|
90
|
-
addHook(name, handler) {
|
|
91
|
-
if (name === 'onSource') _hooks.on(name, handler);
|
|
92
|
-
},
|
|
93
|
-
aroundHook
|
|
94
|
-
};
|
|
95
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
Copyright: 2025 Contrast Security, Inc
|
|
2
|
-
Contact: support@contrastsecurity.com
|
|
3
|
-
License: Commercial
|
|
4
|
-
|
|
5
|
-
NOTICE: This Software and the patented inventions embodied within may only be
|
|
6
|
-
used as part of Contrast Security’s commercial offerings. Even though it is
|
|
7
|
-
made available through public repositories, use of this Software is subject to
|
|
8
|
-
the applicable End User Licensing Agreement found at
|
|
9
|
-
https://www.contrastsecurity.com/enduser-terms-0317a or as otherwise agreed
|
|
10
|
-
between Contrast Security and the End User. The Software may not be reverse
|
|
11
|
-
engineered, modified, repackaged, sold, redistributed or otherwise used in a
|
|
12
|
-
way not consistent with the End User License Agreement.
|