@contrast/agent-bundle 5.39.1 → 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/lib/start-agent.js +50 -40
- 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/string/replace.js +6 -3
- package/node_modules/@contrast/assess/lib/dataflow/propagation/install/util-format.js +44 -21
- package/node_modules/@contrast/assess/lib/dataflow/sources/index.js +1 -1
- package/node_modules/@contrast/assess/lib/dataflow/sources/install/{body-parser1.js → body-parser.js} +2 -2
- 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/constants.d.ts +6 -0
- package/node_modules/@contrast/common/lib/constants.js +8 -1
- 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 +3 -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 +300 -152
- package/node_modules/@contrast/library-analysis/lib/install/library-reporting/index.js +9 -2
- package/node_modules/@contrast/library-analysis/lib/install/library-reporting/utils.js +54 -43
- 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/index.js +1 -1
- package/node_modules/@contrast/protect/lib/input-analysis/install/{body-parser1.js → body-parser.js} +1 -1
- 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/routes-observed.js +2 -1
- 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.d.ts +2 -0
- package/node_modules/@contrast/route-coverage/lib/index.js +15 -17
- package/node_modules/@contrast/route-coverage/lib/install/express/express5.js +489 -202
- package/node_modules/@contrast/route-coverage/package.json +9 -9
- 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/buffer.d.ts +5 -0
- package/node_modules/@types/node/dns/promises.d.ts +11 -10
- package/node_modules/@types/node/dns.d.ts +18 -19
- 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/@types/node/stream/web.d.ts +4 -0
- 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/{path-to-regexp/LICENSE → deepmerge/license.txt} +1 -1
- 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 +5 -3
- package/node_modules/@contrast/agentify/lib/sources.js +0 -94
- package/node_modules/@contrast/route-coverage/lib/install/http.js +0 -44
- 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
- package/node_modules/path-to-regexp/Readme.md +0 -216
- package/node_modules/path-to-regexp/dist/index.d.ts +0 -136
- package/node_modules/path-to-regexp/dist/index.js +0 -403
- package/node_modules/path-to-regexp/dist/index.js.map +0 -1
- package/node_modules/path-to-regexp/package.json +0 -62
|
@@ -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.
|
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
# `@contrast/logger`
|
|
2
|
-
|
|
3
|
-
- [Usage](#usage)
|
|
4
|
-
- [Structured Logging](#structured-logging)
|
|
5
|
-
- [Filtering](#filtering)
|
|
6
|
-
- [Best Practices](#best-practices)
|
|
7
|
-
- [Errors](#errors)
|
|
8
|
-
- [Objects](#objects)
|
|
9
|
-
|
|
10
|
-
## Usage
|
|
11
|
-
|
|
12
|
-
```ts
|
|
13
|
-
import install from '@contrast/logger';
|
|
14
|
-
// or
|
|
15
|
-
const { default: install } = require('@contrast/logger');
|
|
16
|
-
|
|
17
|
-
const logger = install(core);
|
|
18
|
-
|
|
19
|
-
logger.info({ foo, bar }, 'message with %s, %d', 'string', 123);
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
See [Pino](https://github.com/pinojs/pino/blob/master/docs/api.md#logger-instance)
|
|
23
|
-
documentation for the logger's API.
|
|
24
|
-
|
|
25
|
-
## Structured Logging
|
|
26
|
-
|
|
27
|
-
Pino logs as JSON, so it is particularly good at logging JavaScript objects.
|
|
28
|
-
|
|
29
|
-
Given:
|
|
30
|
-
|
|
31
|
-
```ts
|
|
32
|
-
logger.info('hello world');
|
|
33
|
-
logger.error('this is at error level');
|
|
34
|
-
logger.info('the answer is %d', 42);
|
|
35
|
-
logger.info({ obj: 42 }, 'hello world');
|
|
36
|
-
logger.info({ obj: 42, b: 2 }, 'hello world');
|
|
37
|
-
logger.info({ nested: { obj: 42 } }, 'nested');
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
Log output looks like the following:
|
|
41
|
-
|
|
42
|
-
```json
|
|
43
|
-
{"level":30,"time":1649266923912,"pid":12345,"hostname":"foo","msg":"hello world"}
|
|
44
|
-
{"level":50,"time":1649266923913,"pid":12345,"hostname":"foo","msg":"this is at error level"}
|
|
45
|
-
{"level":30,"time":1649266923913,"pid":12345,"hostname":"foo","msg":"the answer is 42"}
|
|
46
|
-
{"level":30,"time":1649266923913,"pid":12345,"hostname":"foo","obj":42,"msg":"hello world"}
|
|
47
|
-
{"level":30,"time":1649266923913,"pid":12345,"hostname":"foo","obj":42,"b":2,"msg":"hello world"}
|
|
48
|
-
{"level":30,"time":1649266923913,"pid":12345,"hostname":"foo","nested":{"obj":42},"msg":"nested"}
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
You can use [`pino-pretty`](https://github.com/pinojs/pino-pretty) to format
|
|
52
|
-
logs during development.
|
|
53
|
-
The previous lines, when passed to pino-pretty, will
|
|
54
|
-
format to the following:
|
|
55
|
-
|
|
56
|
-
```sh
|
|
57
|
-
node example.js | npx pino-pretty
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
```
|
|
61
|
-
[1649266998216] INFO (12345 on foo): hello world
|
|
62
|
-
[1649266998216] ERROR (12345 on foo): this is at error level
|
|
63
|
-
[1649266998216] INFO (12345 on foo): the answer is 42
|
|
64
|
-
[1649266998216] INFO (12345 on foo): hello world
|
|
65
|
-
obj: 42
|
|
66
|
-
[1649266998216] INFO (12345 on foo): hello world
|
|
67
|
-
obj: 42
|
|
68
|
-
b: 2
|
|
69
|
-
[1649266998216] INFO (12345 on foo): nested
|
|
70
|
-
nested: {
|
|
71
|
-
"obj": 42
|
|
72
|
-
}
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### Filtering
|
|
76
|
-
|
|
77
|
-
In addition to being easier to read when pretty-printed, JSON logging also allows
|
|
78
|
-
us to filter with utilities like [`jq`](https://stedolan.github.io/jq/).
|
|
79
|
-
|
|
80
|
-
For example, we can filter only error messages:
|
|
81
|
-
|
|
82
|
-
```sh
|
|
83
|
-
node example.js | jq "select(.level == 50)"
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
<details>
|
|
87
|
-
<summary>Output (click to expand)</summary>
|
|
88
|
-
|
|
89
|
-
```json
|
|
90
|
-
{
|
|
91
|
-
"level": 50,
|
|
92
|
-
"time": 1649268122322,
|
|
93
|
-
"pid": 12345,
|
|
94
|
-
"hostname": "foo",
|
|
95
|
-
"msg": "this is at error level"
|
|
96
|
-
}
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
</details>
|
|
100
|
-
|
|
101
|
-
Or, we can look up only log entries with the `obj` property:
|
|
102
|
-
|
|
103
|
-
```sh
|
|
104
|
-
node example.js | jq "select(.obj)"
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
<details>
|
|
108
|
-
<summary>Output (click to expand)</summary>
|
|
109
|
-
|
|
110
|
-
```json
|
|
111
|
-
{
|
|
112
|
-
"level": 30,
|
|
113
|
-
"time": 1649268235040,
|
|
114
|
-
"pid": 12345,
|
|
115
|
-
"hostname": "foo",
|
|
116
|
-
"obj": 42,
|
|
117
|
-
"msg": "hello world"
|
|
118
|
-
}
|
|
119
|
-
{
|
|
120
|
-
"level": 30,
|
|
121
|
-
"time": 1649268235040,
|
|
122
|
-
"pid": 12345,
|
|
123
|
-
"hostname": "foo",
|
|
124
|
-
"obj": 42,
|
|
125
|
-
"b": 2,
|
|
126
|
-
"msg": "hello world"
|
|
127
|
-
}
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
</details>
|
|
131
|
-
|
|
132
|
-
See `jq`'s [tutorial](https://stedolan.github.io/jq/tutorial/) and
|
|
133
|
-
[manual](https://stedolan.github.io/jq/manual/v1.6/) for examples on just how
|
|
134
|
-
powerful JSON processing can be!
|
|
135
|
-
|
|
136
|
-
## Best Practices
|
|
137
|
-
|
|
138
|
-
### Errors
|
|
139
|
-
|
|
140
|
-
Pino handles errors specially when they are passed as `err` _or_ when passed
|
|
141
|
-
as the first argument.
|
|
142
|
-
See: https://github.com/pinojs/pino/blob/master/docs/api.md#serializers-object
|
|
143
|
-
|
|
144
|
-
For example, when handling an error we should use the following pattern(s):
|
|
145
|
-
|
|
146
|
-
```ts
|
|
147
|
-
try {
|
|
148
|
-
// ...something that throws
|
|
149
|
-
} catch (err) {
|
|
150
|
-
logger.warn(err);
|
|
151
|
-
// if we want to customize the message:
|
|
152
|
-
logger.warn(err, 'something bad happened');
|
|
153
|
-
// or if we need to provide additional data:
|
|
154
|
-
logger.warn({ err, data }, 'something broke when handling %s', filename);
|
|
155
|
-
}
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
<details>
|
|
159
|
-
<summary>Output (click to expand)</summary>
|
|
160
|
-
|
|
161
|
-
```
|
|
162
|
-
[1649264653814] WARN (12345 on foo): yikes!
|
|
163
|
-
err: {
|
|
164
|
-
"type": "Error",
|
|
165
|
-
"message": "yikes!",
|
|
166
|
-
"stack":
|
|
167
|
-
Error: yikes!
|
|
168
|
-
at Object.<anonymous> (/path/to/file.js:5:13)
|
|
169
|
-
at Module._compile (internal/modules/cjs/loader.js:1085:14)
|
|
170
|
-
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
|
|
171
|
-
at Module.load (internal/modules/cjs/loader.js:950:32)
|
|
172
|
-
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
|
|
173
|
-
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12)
|
|
174
|
-
at internal/main/run_main_module.js:17:47
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
[1649264653814] WARN (12345 on foo): something bad happened
|
|
178
|
-
err: {
|
|
179
|
-
"type": "Error",
|
|
180
|
-
"message": "yikes!",
|
|
181
|
-
"stack":
|
|
182
|
-
Error: yikes!
|
|
183
|
-
at Object.<anonymous> (/path/to/file.js:5:13)
|
|
184
|
-
at Module._compile (internal/modules/cjs/loader.js:1085:14)
|
|
185
|
-
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
|
|
186
|
-
at Module.load (internal/modules/cjs/loader.js:950:32)
|
|
187
|
-
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
|
|
188
|
-
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12)
|
|
189
|
-
at internal/main/run_main_module.js:17:47
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
[1649264653814] WARN (12345 on foo): something broke when handling foo.js
|
|
193
|
-
data: {
|
|
194
|
-
"foo": "bar"
|
|
195
|
-
}
|
|
196
|
-
err: {
|
|
197
|
-
"type": "Error",
|
|
198
|
-
"message": "yikes!",
|
|
199
|
-
"stack":
|
|
200
|
-
Error: yikes!
|
|
201
|
-
at Object.<anonymous> (/path/to/file.js:5:13)
|
|
202
|
-
at Module._compile (internal/modules/cjs/loader.js:1085:14)
|
|
203
|
-
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
|
|
204
|
-
at Module.load (internal/modules/cjs/loader.js:950:32)
|
|
205
|
-
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
|
|
206
|
-
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12)
|
|
207
|
-
at internal/main/run_main_module.js:17:47
|
|
208
|
-
}
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
</details>
|
|
212
|
-
|
|
213
|
-
### Objects
|
|
214
|
-
|
|
215
|
-
Rather than including information in the log message itself, it is more helpful
|
|
216
|
-
to include data in the first argument.
|
|
217
|
-
|
|
218
|
-
For example, if we want to log the contents of an object:
|
|
219
|
-
|
|
220
|
-
```ts
|
|
221
|
-
const manifest = require('./package.json');
|
|
222
|
-
logger.info({ manifest }, 'package.json contents');
|
|
223
|
-
// instead of
|
|
224
|
-
logger.info('package.json contents: %o', manifest);
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
<details>
|
|
228
|
-
<summary>Output (Click to expand)</summary>
|
|
229
|
-
|
|
230
|
-
```
|
|
231
|
-
[1649265443612] INFO (12345 on foo): package.json contents
|
|
232
|
-
manifest: {
|
|
233
|
-
"name": "@contrast/logger",
|
|
234
|
-
"version": "1.0.0",
|
|
235
|
-
"description": "Centralized logging for Contrast agent services",
|
|
236
|
-
"license": "UNLICENSED",
|
|
237
|
-
"author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
|
|
238
|
-
"main": "lib/index.js",
|
|
239
|
-
"types": "lib/index.d.ts",
|
|
240
|
-
"engines": {
|
|
241
|
-
"npm": ">=6.13.7 <7 || >= 8.3.1",
|
|
242
|
-
"node": ">= 14.15.0"
|
|
243
|
-
},
|
|
244
|
-
"scripts": {
|
|
245
|
-
"build": "tsc --build src/",
|
|
246
|
-
"test": "nyc mocha src/",
|
|
247
|
-
"test:only": "mocha --no-parallel lib/",
|
|
248
|
-
"posttest": "echo \"file://$PWD/coverage/lcov-report/index.html\""
|
|
249
|
-
},
|
|
250
|
-
"dependencies": {
|
|
251
|
-
"pino": "^7.9.1"
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
[1649265443613] INFO (12345 on foo): package.json contents: {"name":"@contrast/logger","version":"1.0.0","description":"Centralized logging for Contrast agent services","license":"UNLICENSED","author":"Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)","main":"lib/index.js","types":"lib/index.d.ts","engines":{"npm":">= 8.4.0","node":">= 14.15.0"},"scripts":{"build":"tsc --build src/","test":"nyc mocha src/","test:only":"npm test -- --no-parallel","posttest":"echo \"file://$PWD/coverage/lcov-report/index.html\""},"dependencies":{"pino":"^7.9.1"}}
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
</details>
|
|
259
|
-
|
|
260
|
-
## Namespacing
|
|
261
|
-
|
|
262
|
-
When using the logger in another module, you could instantiate a namespace using
|
|
263
|
-
the [`child`](https://github.com/pinojs/pino/blob/master/docs/api.md#loggerchildbindings-options--logger) method.
|
|
264
|
-
|
|
265
|
-
For example, in the `@contrast/rewriter` module, we could namespace the logger
|
|
266
|
-
as follows:
|
|
267
|
-
|
|
268
|
-
```ts
|
|
269
|
-
const logger = core.logger.child({ name: 'contrast:rewriter' });
|
|
270
|
-
```
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { LoggerOptions, Logger } from 'pino';
|
|
2
|
-
import { Config } from '@contrast/config';
|
|
3
|
-
import { Messages, ThreadTransferData } from '@contrast/common';
|
|
4
|
-
import Perf from '@contrast/perf';
|
|
5
|
-
export interface Core {
|
|
6
|
-
readonly config: Config;
|
|
7
|
-
readonly messages: Messages;
|
|
8
|
-
readonly Perf: typeof Perf;
|
|
9
|
-
readonly threadTransferData?: ThreadTransferData;
|
|
10
|
-
}
|
|
11
|
-
export { Logger };
|
|
12
|
-
export declare const kChildren: unique symbol;
|
|
13
|
-
export default function init(core: Core & {
|
|
14
|
-
logger?: Logger;
|
|
15
|
-
}, opts?: LoggerOptions): Logger;
|
|
16
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright: 2025 Contrast Security, Inc
|
|
4
|
-
* Contact: support@contrastsecurity.com
|
|
5
|
-
* License: Commercial
|
|
6
|
-
|
|
7
|
-
* NOTICE: This Software and the patented inventions embodied within may only be
|
|
8
|
-
* used as part of Contrast Security’s commercial offerings. Even though it is
|
|
9
|
-
* made available through public repositories, use of this Software is subject to
|
|
10
|
-
* the applicable End User Licensing Agreement found at
|
|
11
|
-
* https://www.contrastsecurity.com/enduser-terms-0317a or as otherwise agreed
|
|
12
|
-
* between Contrast Security and the End User. The Software may not be reverse
|
|
13
|
-
* engineered, modified, repackaged, sold, redistributed or otherwise used in a
|
|
14
|
-
* way not consistent with the End User License Agreement.
|
|
15
|
-
*/
|
|
16
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
17
|
-
if (k2 === undefined) k2 = k;
|
|
18
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
19
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
20
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
21
|
-
}
|
|
22
|
-
Object.defineProperty(o, k2, desc);
|
|
23
|
-
}) : (function(o, m, k, k2) {
|
|
24
|
-
if (k2 === undefined) k2 = k;
|
|
25
|
-
o[k2] = m[k];
|
|
26
|
-
}));
|
|
27
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
28
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
29
|
-
}) : function(o, v) {
|
|
30
|
-
o["default"] = v;
|
|
31
|
-
});
|
|
32
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
33
|
-
if (mod && mod.__esModule) return mod;
|
|
34
|
-
var result = {};
|
|
35
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
36
|
-
__setModuleDefault(result, mod);
|
|
37
|
-
return result;
|
|
38
|
-
};
|
|
39
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
40
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
41
|
-
};
|
|
42
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
-
exports.kChildren = void 0;
|
|
44
|
-
const node_fs_1 = __importDefault(require("node:fs"));
|
|
45
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
46
|
-
const node_os_1 = require("node:os");
|
|
47
|
-
const node_worker_threads_1 = require("node:worker_threads");
|
|
48
|
-
const pino_1 = __importDefault(require("pino"));
|
|
49
|
-
const config_1 = require("@contrast/config");
|
|
50
|
-
const common_1 = require("@contrast/common");
|
|
51
|
-
const serializers = __importStar(require("./serializers"));
|
|
52
|
-
const REDACT_PATHS = [
|
|
53
|
-
'err.config.headers.Authorization',
|
|
54
|
-
'err.config.headers["API-Key"]',
|
|
55
|
-
];
|
|
56
|
-
exports.kChildren = Symbol('contrast.logger.children');
|
|
57
|
-
function extend(logger) {
|
|
58
|
-
Reflect.set(logger, exports.kChildren, []);
|
|
59
|
-
return logger;
|
|
60
|
-
}
|
|
61
|
-
function init(core, opts = {}) {
|
|
62
|
-
const config = core.config.agent.logger;
|
|
63
|
-
const perf = new core.Perf('logger');
|
|
64
|
-
const streams = [];
|
|
65
|
-
let err;
|
|
66
|
-
if (config.path !== '/dev/null') {
|
|
67
|
-
try {
|
|
68
|
-
// fs methods throw if we don't have write permissions.
|
|
69
|
-
node_fs_1.default.mkdirSync(node_path_1.default.dirname(config.path), { recursive: true });
|
|
70
|
-
// check for an existing log file descriptor, or open a new one and remember it.
|
|
71
|
-
const fd = core.threadTransferData?.loggerFd ?? node_fs_1.default.openSync(config.path, config.append ? 'a' : 'w');
|
|
72
|
-
if (core.threadTransferData)
|
|
73
|
-
core.threadTransferData.loggerFd = fd;
|
|
74
|
-
streams.push({
|
|
75
|
-
stream: pino_1.default.destination(fd),
|
|
76
|
-
level: 'trace',
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
catch (cause) {
|
|
80
|
-
err = new Error('Unable to write to the configured log file. To disable writing to a log file, set `agent.logger.path` to \'/dev/null\', or set CONTRAST__AGENT__LOGGER__PATH="/dev/null" in your environment',
|
|
81
|
-
// @ts-expect-error `cause` requires ts to target es2022 or above, which corresponds to Node 17+, despite being added to Node in 16.9
|
|
82
|
-
{ cause });
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
if (config.stdout) {
|
|
86
|
-
streams.push({
|
|
87
|
-
stream: pino_1.default.destination(process.stdout.fd),
|
|
88
|
-
level: 'trace',
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
if (err && streams.length === 0)
|
|
92
|
-
throw err;
|
|
93
|
-
const logger = (core.logger = perf.wrapPinoInstance(extend((0, pino_1.default)({
|
|
94
|
-
name: 'contrast',
|
|
95
|
-
level: config.level,
|
|
96
|
-
base: { tid: node_worker_threads_1.threadId, pid: process.pid, hostname: (0, node_os_1.hostname)() },
|
|
97
|
-
serializers,
|
|
98
|
-
onChild(instance) {
|
|
99
|
-
Reflect.get(this, exports.kChildren).push(perf.wrapPinoInstance(extend(instance)));
|
|
100
|
-
},
|
|
101
|
-
redact: {
|
|
102
|
-
paths: REDACT_PATHS,
|
|
103
|
-
censor: 'contrast-redacted',
|
|
104
|
-
},
|
|
105
|
-
...opts,
|
|
106
|
-
}, pino_1.default.multistream(streams)))));
|
|
107
|
-
logger.on('level-change', (level, val, prevLevel, prevVal, instance) => {
|
|
108
|
-
Reflect.get(instance, exports.kChildren).forEach((child) => {
|
|
109
|
-
child.level = level;
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
if (core.config.getEffectiveSource('agent.logger.level') === config_1.ConfigSource.DEFAULT_VALUE) {
|
|
113
|
-
core.messages?.on?.(common_1.Event.SERVER_SETTINGS_UPDATE, () => {
|
|
114
|
-
const effectiveLevel = core.config.getEffectiveValue('agent.logger.level');
|
|
115
|
-
if (effectiveLevel && effectiveLevel !== logger.level) {
|
|
116
|
-
logger.level = effectiveLevel;
|
|
117
|
-
logger.info('Received new log level: %s from server-features', effectiveLevel);
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
if (err)
|
|
122
|
-
logger.error({ err });
|
|
123
|
-
// (NODE-3735) if the app has a dependency on same pino version, then our depHooks for it
|
|
124
|
-
// will not execute since it's already in the module cache, e.g. we patch it for deadzones
|
|
125
|
-
for (const cacheKey of Object.keys(require.cache)) {
|
|
126
|
-
if (cacheKey.includes(`${node_path_1.default.sep}pino${node_path_1.default.sep}`))
|
|
127
|
-
delete require.cache[cacheKey];
|
|
128
|
-
}
|
|
129
|
-
return logger;
|
|
130
|
-
}
|
|
131
|
-
exports.default = init;
|
|
132
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Config } from '@contrast/config';
|
|
2
|
-
import { AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
3
|
-
/**
|
|
4
|
-
* Logs the config object in the format used by the agent (the report format is used in
|
|
5
|
-
* diagnostics capabilities). Leverages the .getReport() redaction functionality to make
|
|
6
|
-
* a copy of the config with sensitive values masked.
|
|
7
|
-
*/
|
|
8
|
-
export declare function config(config: Config): any;
|
|
9
|
-
/**
|
|
10
|
-
* Hides the `stdout` and `stderr` fields from child_process errors since they
|
|
11
|
-
* are extremely verbose.
|
|
12
|
-
*/
|
|
13
|
-
export declare const err: (err: Error) => Record<string, any>;
|
|
14
|
-
/** Excludes irrelevant information from the metrics object. */
|
|
15
|
-
export declare function metrics({ start, timeout, ...metrics }: any): any;
|
|
16
|
-
/**
|
|
17
|
-
* Serializes requests for the contrast-ui http logger.
|
|
18
|
-
*/
|
|
19
|
-
export declare function req(config: AxiosRequestConfig): {
|
|
20
|
-
id: any;
|
|
21
|
-
method: string | undefined;
|
|
22
|
-
url: string | undefined;
|
|
23
|
-
data: any;
|
|
24
|
-
contentLength: any;
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* Serializes response for the contrast-ui http logger.
|
|
28
|
-
*/
|
|
29
|
-
export declare function res(response: AxiosResponse): {
|
|
30
|
-
status: number;
|
|
31
|
-
data: any;
|
|
32
|
-
};
|
|
33
|
-
//# sourceMappingURL=serializers.d.ts.map
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright: 2025 Contrast Security, Inc
|
|
4
|
-
* Contact: support@contrastsecurity.com
|
|
5
|
-
* License: Commercial
|
|
6
|
-
|
|
7
|
-
* NOTICE: This Software and the patented inventions embodied within may only be
|
|
8
|
-
* used as part of Contrast Security’s commercial offerings. Even though it is
|
|
9
|
-
* made available through public repositories, use of this Software is subject to
|
|
10
|
-
* the applicable End User Licensing Agreement found at
|
|
11
|
-
* https://www.contrastsecurity.com/enduser-terms-0317a or as otherwise agreed
|
|
12
|
-
* between Contrast Security and the End User. The Software may not be reverse
|
|
13
|
-
* engineered, modified, repackaged, sold, redistributed or otherwise used in a
|
|
14
|
-
* way not consistent with the End User License Agreement.
|
|
15
|
-
*/
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.res = exports.req = exports.metrics = exports.err = exports.config = void 0;
|
|
18
|
-
const common_1 = require("@contrast/common");
|
|
19
|
-
const pino_1 = require("pino");
|
|
20
|
-
/**
|
|
21
|
-
* Logs the config object in the format used by the agent (the report format is used in
|
|
22
|
-
* diagnostics capabilities). Leverages the .getReport() redaction functionality to make
|
|
23
|
-
* a copy of the config with sensitive values masked.
|
|
24
|
-
*/
|
|
25
|
-
function config(config) {
|
|
26
|
-
// log as-is if not a Config instance
|
|
27
|
-
if (typeof config?.getReport !== 'function')
|
|
28
|
-
return config;
|
|
29
|
-
const safeCopy = { _errors: [...config._errors] };
|
|
30
|
-
const { config: { effective_config } } = config.getReport({ redact: true });
|
|
31
|
-
for (const info of effective_config) {
|
|
32
|
-
const { canonical_name, value } = info;
|
|
33
|
-
(0, common_1.set)(safeCopy, canonical_name, value);
|
|
34
|
-
}
|
|
35
|
-
return safeCopy;
|
|
36
|
-
}
|
|
37
|
-
exports.config = config;
|
|
38
|
-
/**
|
|
39
|
-
* Hides the `stdout` and `stderr` fields from child_process errors since they
|
|
40
|
-
* are extremely verbose.
|
|
41
|
-
*/
|
|
42
|
-
exports.err = pino_1.stdSerializers.wrapErrorSerializer(({ stdout, stderr, ...err }) => err);
|
|
43
|
-
/** Excludes irrelevant information from the metrics object. */
|
|
44
|
-
function metrics({ start, timeout, ...metrics }) {
|
|
45
|
-
return metrics;
|
|
46
|
-
}
|
|
47
|
-
exports.metrics = metrics;
|
|
48
|
-
/**
|
|
49
|
-
* Serializes requests for the contrast-ui http logger.
|
|
50
|
-
*/
|
|
51
|
-
function req(config) {
|
|
52
|
-
return {
|
|
53
|
-
id: Reflect.get(config, 'id'),
|
|
54
|
-
method: config.method,
|
|
55
|
-
url: config.url,
|
|
56
|
-
// Since we log `req` data on both request and response events we don't want
|
|
57
|
-
// to duplicate logging `data`, which is a JSON object when provided to the
|
|
58
|
-
// request interceptor but a string within the `response.config` object.
|
|
59
|
-
data: typeof config.data === 'object' ? config.data : undefined,
|
|
60
|
-
contentLength: config.headers?.['Content-Length'] // only present on response.config
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
exports.req = req;
|
|
64
|
-
/**
|
|
65
|
-
* Serializes response for the contrast-ui http logger.
|
|
66
|
-
*/
|
|
67
|
-
function res(response) {
|
|
68
|
-
return {
|
|
69
|
-
status: response.status,
|
|
70
|
-
// If the response is empty, like from a 204 or 304, don't log ""
|
|
71
|
-
data: response.data !== '' ? response.data : undefined,
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
exports.res = res;
|
|
75
|
-
//# sourceMappingURL=serializers.js.map
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="mocha" />
|
|
3
|
-
/// <reference types="node" />
|
|
4
|
-
/// <reference types="node" />
|
|
5
|
-
/// <reference types="node" />
|
|
6
|
-
/// <reference types="node" />
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated this is a relic from when we used transports.
|
|
9
|
-
*
|
|
10
|
-
* Removes any `'-r @contrast/protect'` or similar strings from `process.env.NODE_OPTIONS.`.
|
|
11
|
-
* If we don't do this, the logger worker threads will be instrumented and those agents
|
|
12
|
-
* will attempt to spawn more loggers and result in infinite recursion scenario.
|
|
13
|
-
*/
|
|
14
|
-
export declare const cleanEnv: (env: NodeJS.ProcessEnv) => NodeJS.ProcessEnv;
|
|
15
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright: 2025 Contrast Security, Inc
|
|
4
|
-
* Contact: support@contrastsecurity.com
|
|
5
|
-
* License: Commercial
|
|
6
|
-
|
|
7
|
-
* NOTICE: This Software and the patented inventions embodied within may only be
|
|
8
|
-
* used as part of Contrast Security’s commercial offerings. Even though it is
|
|
9
|
-
* made available through public repositories, use of this Software is subject to
|
|
10
|
-
* the applicable End User Licensing Agreement found at
|
|
11
|
-
* https://www.contrastsecurity.com/enduser-terms-0317a or as otherwise agreed
|
|
12
|
-
* between Contrast Security and the End User. The Software may not be reverse
|
|
13
|
-
* engineered, modified, repackaged, sold, redistributed or otherwise used in a
|
|
14
|
-
* way not consistent with the End User License Agreement.
|
|
15
|
-
*/
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.cleanEnv = void 0;
|
|
18
|
-
const common_1 = require("@contrast/common");
|
|
19
|
-
const { StringPrototypeReplace } = common_1.primordials;
|
|
20
|
-
const ENV_REGEX = /(?:-r|--require|--import|--(?:experimental-)?loader)\s+(@contrast\S+|\S*agent(?:\.c?js)?|\S*loader(?:\.m?js)?)\s*/;
|
|
21
|
-
/**
|
|
22
|
-
* @deprecated this is a relic from when we used transports.
|
|
23
|
-
*
|
|
24
|
-
* Removes any `'-r @contrast/protect'` or similar strings from `process.env.NODE_OPTIONS.`.
|
|
25
|
-
* If we don't do this, the logger worker threads will be instrumented and those agents
|
|
26
|
-
* will attempt to spawn more loggers and result in infinite recursion scenario.
|
|
27
|
-
*/
|
|
28
|
-
const cleanEnv = (env) => {
|
|
29
|
-
// @ts-expect-error exported primordials don't handle overloads very well
|
|
30
|
-
const NODE_OPTIONS = env.NODE_OPTIONS ? StringPrototypeReplace.call(env.NODE_OPTIONS, ENV_REGEX, '') : undefined;
|
|
31
|
-
return { ...env, NODE_OPTIONS };
|
|
32
|
-
};
|
|
33
|
-
exports.cleanEnv = cleanEnv;
|
|
34
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@contrast/logger",
|
|
3
|
-
"version": "1.26.0",
|
|
4
|
-
"description": "Centralized logging for Contrast agent services",
|
|
5
|
-
"license": "SEE LICENSE IN LICENSE",
|
|
6
|
-
"author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
|
|
7
|
-
"files": [
|
|
8
|
-
"lib/",
|
|
9
|
-
"!*.test.*",
|
|
10
|
-
"!tsconfig.*",
|
|
11
|
-
"!*.map"
|
|
12
|
-
],
|
|
13
|
-
"main": "lib/index.js",
|
|
14
|
-
"types": "lib/index.d.ts",
|
|
15
|
-
"engines": {
|
|
16
|
-
"npm": ">=6.13.7 <7 || >= 8.3.1",
|
|
17
|
-
"node": ">= 16.9.1"
|
|
18
|
-
},
|
|
19
|
-
"scripts": {
|
|
20
|
-
"build": "tsc --build src/",
|
|
21
|
-
"test": "bash ../scripts/test.sh"
|
|
22
|
-
},
|
|
23
|
-
"dependencies": {
|
|
24
|
-
"@contrast/common": "1.33.0",
|
|
25
|
-
"@contrast/config": "1.48.0",
|
|
26
|
-
"pino": "^8.15.0"
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -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.
|