@socketsecurity/cli-with-sentry 0.14.148 → 0.14.150
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/dist/cli.js +698 -220
- package/dist/cli.js.map +1 -1
- package/dist/instrument-with-sentry.js +2 -2
- package/dist/instrument-with-sentry.js.map +1 -1
- package/dist/shadow-npm-inject.js +18 -8
- package/dist/shadow-npm-inject.js.map +1 -1
- package/dist/vendor.js +18154 -18160
- package/dist/vendor.js.map +1 -1
- package/package.json +22 -22
|
@@ -30,7 +30,7 @@ const relConstantsPath = './constants'
|
|
|
30
30
|
Sentry.setTag(
|
|
31
31
|
'version',
|
|
32
32
|
// The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
|
|
33
|
-
'0.14.
|
|
33
|
+
'0.14.150:cc2913a:84ef72e1:pub'
|
|
34
34
|
)
|
|
35
35
|
const constants = require(relConstantsPath)
|
|
36
36
|
if (constants.ENV.SOCKET_CLI_DEBUG) {
|
|
@@ -45,5 +45,5 @@ const relConstantsPath = './constants'
|
|
|
45
45
|
} = constants
|
|
46
46
|
setSentry(Sentry)
|
|
47
47
|
}
|
|
48
|
-
//# debugId=
|
|
48
|
+
//# debugId=57081891-4aac-4730-be9e-f34d633bc099
|
|
49
49
|
//# sourceMappingURL=instrument-with-sentry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrument-with-sentry.js","sources":["../src/instrument-with-sentry.ts"],"sourcesContent":["// This should ONLY be included in the special Sentry build!\n// Otherwise the Sentry dependency won't even be present in the manifest.\n\nimport { logger } from '@socketsecurity/registry/lib/logger'\n\n// Require constants with require(relConstantsPath) instead of require('./constants')\n// so Rollup doesn't generate a constants2.js chunk.\nconst relConstantsPath = './constants'\n// The '@rollup/plugin-replace' will replace \"process.env['INLINED_SOCKET_CLI_SENTRY_BUILD']\".\nif (process.env['INLINED_SOCKET_CLI_SENTRY_BUILD']) {\n const Sentry = require('@sentry/node')\n Sentry.init({\n onFatalError(error: Error) {\n // Defer module loads until after Sentry.init is called.\n if (require(relConstantsPath).ENV.SOCKET_CLI_DEBUG) {\n logger.fail('[DEBUG] [Sentry onFatalError]:', error)\n }\n },\n dsn: 'https://66736701db8e4ffac046bd09fa6aaced@o555220.ingest.us.sentry.io/4508846967619585',\n enabled: true,\n integrations: []\n })\n Sentry.setTag(\n 'environment',\n // The '@rollup/plugin-replace' will replace \"process.env['INLINED_SOCKET_CLI_PUBLISHED_BUILD']\".\n process.env['INLINED_SOCKET_CLI_PUBLISHED_BUILD']\n ? 'pub'\n : // The NODE_ENV convention is used by apps to define the runtime environment.\n // https://nodejs.org/en/learn/getting-started/nodejs-the-difference-between-development-and-production\n process.env['NODE_ENV']\n )\n Sentry.setTag(\n 'version',\n // The '@rollup/plugin-replace' will replace \"process.env['INLINED_SOCKET_CLI_VERSION_HASH']\".\n process.env['INLINED_SOCKET_CLI_VERSION_HASH']\n )\n const constants = require(relConstantsPath)\n if (constants.ENV.SOCKET_CLI_DEBUG) {\n Sentry.setTag('debugging', true)\n logger.log('[DEBUG] Set up Sentry.')\n } else {\n Sentry.setTag('debugging', false)\n }\n const {\n kInternalsSymbol,\n [kInternalsSymbol as unknown as 'Symbol(kInternalsSymbol)']: { setSentry }\n } = constants\n setSentry(Sentry)\n} else if (require(relConstantsPath).ENV.SOCKET_CLI_DEBUG) {\n logger.log('[DEBUG] Sentry disabled explicitly.')\n}\n"],"names":["logger","dsn","enabled","integrations","process","Sentry","setSentry"],"mappings":";;;;AAAA;AACA;;;AAIA;AACA;AACA;AACA;AACoD;AAClD;;;AAGI;;AAEEA;AACF;;AAEFC;AACAC;AACAC;AACF;;AAGE;AACAC;;AAQA;AACAA;AAEF;AACA;AACEC;AACAL;AACF;AACEK;AACF;;;AAGE;AAA+DC;AAAU;AAC3E;;AAEF","debugId":"
|
|
1
|
+
{"version":3,"file":"instrument-with-sentry.js","sources":["../src/instrument-with-sentry.ts"],"sourcesContent":["// This should ONLY be included in the special Sentry build!\n// Otherwise the Sentry dependency won't even be present in the manifest.\n\nimport { logger } from '@socketsecurity/registry/lib/logger'\n\n// Require constants with require(relConstantsPath) instead of require('./constants')\n// so Rollup doesn't generate a constants2.js chunk.\nconst relConstantsPath = './constants'\n// The '@rollup/plugin-replace' will replace \"process.env['INLINED_SOCKET_CLI_SENTRY_BUILD']\".\nif (process.env['INLINED_SOCKET_CLI_SENTRY_BUILD']) {\n const Sentry = require('@sentry/node')\n Sentry.init({\n onFatalError(error: Error) {\n // Defer module loads until after Sentry.init is called.\n if (require(relConstantsPath).ENV.SOCKET_CLI_DEBUG) {\n logger.fail('[DEBUG] [Sentry onFatalError]:', error)\n }\n },\n dsn: 'https://66736701db8e4ffac046bd09fa6aaced@o555220.ingest.us.sentry.io/4508846967619585',\n enabled: true,\n integrations: []\n })\n Sentry.setTag(\n 'environment',\n // The '@rollup/plugin-replace' will replace \"process.env['INLINED_SOCKET_CLI_PUBLISHED_BUILD']\".\n process.env['INLINED_SOCKET_CLI_PUBLISHED_BUILD']\n ? 'pub'\n : // The NODE_ENV convention is used by apps to define the runtime environment.\n // https://nodejs.org/en/learn/getting-started/nodejs-the-difference-between-development-and-production\n process.env['NODE_ENV']\n )\n Sentry.setTag(\n 'version',\n // The '@rollup/plugin-replace' will replace \"process.env['INLINED_SOCKET_CLI_VERSION_HASH']\".\n process.env['INLINED_SOCKET_CLI_VERSION_HASH']\n )\n const constants = require(relConstantsPath)\n if (constants.ENV.SOCKET_CLI_DEBUG) {\n Sentry.setTag('debugging', true)\n logger.log('[DEBUG] Set up Sentry.')\n } else {\n Sentry.setTag('debugging', false)\n }\n const {\n kInternalsSymbol,\n [kInternalsSymbol as unknown as 'Symbol(kInternalsSymbol)']: { setSentry }\n } = constants\n setSentry(Sentry)\n} else if (require(relConstantsPath).ENV.SOCKET_CLI_DEBUG) {\n logger.log('[DEBUG] Sentry disabled explicitly.')\n}\n"],"names":["logger","dsn","enabled","integrations","process","Sentry","setSentry"],"mappings":";;;;AAAA;AACA;;;AAIA;AACA;AACA;AACA;AACoD;AAClD;;;AAGI;;AAEEA;AACF;;AAEFC;AACAC;AACAC;AACF;;AAGE;AACAC;;AAQA;AACAA;AAEF;AACA;AACEC;AACAL;AACF;AACEK;AACF;;;AAGE;AAA+DC;AAAU;AAC3E;;AAEF","debugId":"57081891-4aac-4730-be9e-f34d633bc099"}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
const shadowNpmPaths = require('./shadow-npm-paths.js')
|
|
4
4
|
const process$1 = require('node:process')
|
|
5
|
-
const vendor = require('./vendor.js')
|
|
6
5
|
const logger = require('../external/@socketsecurity/registry/lib/logger')
|
|
7
6
|
const constants = require('./constants.js')
|
|
7
|
+
const vendor = require('./vendor.js')
|
|
8
8
|
const arrays = require('../external/@socketsecurity/registry/lib/arrays')
|
|
9
9
|
const packages = require('../external/@socketsecurity/registry/lib/packages')
|
|
10
10
|
const registry = require('../external/@socketsecurity/registry')
|
|
@@ -332,7 +332,8 @@ const supportedConfigKeys = new Map([
|
|
|
332
332
|
[
|
|
333
333
|
'enforcedOrgs',
|
|
334
334
|
'Orgs in this list have their security policies enforced on this machine'
|
|
335
|
-
]
|
|
335
|
+
],
|
|
336
|
+
['isTestingV1', 'For development of testing the next major bump']
|
|
336
337
|
])
|
|
337
338
|
const sensitiveConfigKeys = new Set(['apiToken'])
|
|
338
339
|
let _cachedConfig
|
|
@@ -349,6 +350,9 @@ function overrideCachedConfig(jsonConfig) {
|
|
|
349
350
|
throw new Error()
|
|
350
351
|
}
|
|
351
352
|
} catch {
|
|
353
|
+
// Force set an empty config to prevent accidentally using system settings
|
|
354
|
+
_cachedConfig = {}
|
|
355
|
+
_readOnlyConfig = true
|
|
352
356
|
return {
|
|
353
357
|
ok: false,
|
|
354
358
|
message:
|
|
@@ -524,6 +528,9 @@ function updateConfigValue(key, value) {
|
|
|
524
528
|
})
|
|
525
529
|
}
|
|
526
530
|
}
|
|
531
|
+
function isTestingV1() {
|
|
532
|
+
return !!getConfigValue('isTestingV1')
|
|
533
|
+
}
|
|
527
534
|
|
|
528
535
|
const {
|
|
529
536
|
kInternalsSymbol: kInternalsSymbol$1,
|
|
@@ -623,7 +630,7 @@ async function setupSdk(
|
|
|
623
630
|
// The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_NAME']".
|
|
624
631
|
name: '@socketsecurity/cli',
|
|
625
632
|
// The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION']".
|
|
626
|
-
version: '0.14.
|
|
633
|
+
version: '0.14.150',
|
|
627
634
|
// The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_HOMEPAGE']".
|
|
628
635
|
homepage: 'https://github.com/SocketDev/socket-cli'
|
|
629
636
|
})
|
|
@@ -2506,8 +2513,6 @@ class SafeArborist extends Arborist {
|
|
|
2506
2513
|
)
|
|
2507
2514
|
// Lazily access constants.ENV[SOCKET_CLI_ACCEPT_RISKS].
|
|
2508
2515
|
const acceptRisks = constants.ENV[SOCKET_CLI_ACCEPT_RISKS]
|
|
2509
|
-
// Lazily access constants.ENV[SOCKET_CLI_VIEW_ALL_RISKS].
|
|
2510
|
-
const viewAllRisks = constants.ENV[SOCKET_CLI_VIEW_ALL_RISKS]
|
|
2511
2516
|
const progress = ipc[SOCKET_CLI_SAFE_PROGRESS]
|
|
2512
2517
|
const spinner =
|
|
2513
2518
|
options['silent'] || !progress
|
|
@@ -2535,13 +2540,17 @@ class SafeArborist extends Arborist {
|
|
|
2535
2540
|
})
|
|
2536
2541
|
if (alertsMap.size) {
|
|
2537
2542
|
process$1.exitCode = 1
|
|
2543
|
+
// Lazily access constants.ENV[SOCKET_CLI_VIEW_ALL_RISKS].
|
|
2544
|
+
const viewAllRisks = constants.ENV[SOCKET_CLI_VIEW_ALL_RISKS]
|
|
2538
2545
|
logAlertsMap(alertsMap, {
|
|
2539
2546
|
hideAt: viewAllRisks ? 'none' : 'middle',
|
|
2540
2547
|
output: process$1.stderr
|
|
2541
2548
|
})
|
|
2542
|
-
throw new Error(
|
|
2549
|
+
throw new Error(
|
|
2550
|
+
`
|
|
2543
2551
|
Socket ${binName} exiting due to risks.${viewAllRisks ? '' : `\nView all risks - Rerun with environment variable ${SOCKET_CLI_VIEW_ALL_RISKS}=1.`}${acceptRisks ? '' : `\nAccept risks - Rerun with environment variable ${SOCKET_CLI_ACCEPT_RISKS}=1.`}
|
|
2544
|
-
|
|
2552
|
+
`.trim()
|
|
2553
|
+
)
|
|
2545
2554
|
} else if (!options['silent']) {
|
|
2546
2555
|
logger.logger.success(
|
|
2547
2556
|
`Socket ${binName} ${acceptRisks ? 'accepted' : 'found no'} risks`
|
|
@@ -2604,6 +2613,7 @@ exports.getSocketDevPackageOverviewUrl = getSocketDevPackageOverviewUrl
|
|
|
2604
2613
|
exports.globWithGitIgnore = globWithGitIgnore
|
|
2605
2614
|
exports.globWorkspace = globWorkspace
|
|
2606
2615
|
exports.isReadOnlyConfig = isReadOnlyConfig
|
|
2616
|
+
exports.isTestingV1 = isTestingV1
|
|
2607
2617
|
exports.overrideCachedConfig = overrideCachedConfig
|
|
2608
2618
|
exports.overrideConfigApiToken = overrideConfigApiToken
|
|
2609
2619
|
exports.pathsToGlobPatterns = pathsToGlobPatterns
|
|
@@ -2617,5 +2627,5 @@ exports.supportedConfigKeys = supportedConfigKeys
|
|
|
2617
2627
|
exports.updateConfigValue = updateConfigValue
|
|
2618
2628
|
exports.updateNode = updateNode
|
|
2619
2629
|
exports.updatePackageJsonFromNode = updatePackageJsonFromNode
|
|
2620
|
-
//# debugId=
|
|
2630
|
+
//# debugId=32c0e7c8-3d51-46ad-b003-37963c3c7d8e
|
|
2621
2631
|
//# sourceMappingURL=shadow-npm-inject.js.map
|