Skip to content

Commit 80eec03

Browse files
committed
deps: @npmcli/redact@2.0.0
1 parent a7145d4 commit 80eec03

File tree

13 files changed

+20
-159
lines changed

13 files changed

+20
-159
lines changed

node_modules/.gitignore

-5
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,6 @@
158158
!/npm-pick-manifest
159159
!/npm-profile
160160
!/npm-registry-fetch
161-
!/npm-registry-fetch/node_modules/
162-
/npm-registry-fetch/node_modules/*
163-
!/npm-registry-fetch/node_modules/@npmcli/
164-
/npm-registry-fetch/node_modules/@npmcli/*
165-
!/npm-registry-fetch/node_modules/@npmcli/redact
166161
!/npm-user-validate
167162
!/p-map
168163
!/pacote

node_modules/@npmcli/redact/lib/index.js

+5-20
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,15 @@
1-
const { URL } = require('url')
1+
const matchers = require('./matchers')
2+
const { redactUrlPassword } = require('./utils')
23

34
const REPLACE = '***'
4-
const TOKEN_REGEX = /\bnpm_[a-zA-Z0-9]{36}\b/g
5-
const GUID_REGEX = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/g
65

76
const redact = (value) => {
87
if (typeof value !== 'string' || !value) {
98
return value
109
}
11-
12-
let urlValue
13-
try {
14-
urlValue = new URL(value)
15-
} catch {
16-
// If it's not a URL then we can ignore all errors
17-
}
18-
19-
if (urlValue?.password) {
20-
urlValue.password = REPLACE
21-
value = urlValue.toString()
22-
}
23-
24-
return value
25-
.replace(TOKEN_REGEX, `npm_${REPLACE}`)
26-
.replace(GUID_REGEX, REPLACE)
10+
return redactUrlPassword(value, REPLACE)
11+
.replace(matchers.NPM_SECRET.pattern, `npm_${REPLACE}`)
12+
.replace(matchers.UUID.pattern, REPLACE)
2713
}
2814

2915
// split on \s|= similar to how nopt parses options
@@ -49,7 +35,6 @@ const redactLog = (arg) => {
4935
} else if (Array.isArray(arg)) {
5036
return arg.map((a) => typeof a === 'string' ? splitAndRedact(a) : a)
5137
}
52-
5338
return arg
5439
}
5540

node_modules/@npmcli/redact/package.json

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
{
22
"name": "@npmcli/redact",
3-
"version": "1.1.0",
3+
"version": "2.0.0",
44
"description": "Redact sensitive npm information from output",
55
"main": "lib/index.js",
6+
"exports": {
7+
".": "./lib/index.js",
8+
"./server": "./lib/server.js",
9+
"./package.json": "./package.json"
10+
},
611
"scripts": {
712
"test": "tap",
813
"lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"",
@@ -32,7 +37,8 @@
3237
"nyc-arg": [
3338
"--exclude",
3439
"tap-snapshots/**"
35-
]
40+
],
41+
"timeout": 120
3642
},
3743
"devDependencies": {
3844
"@npmcli/eslint-config": "^4.0.2",

node_modules/npm-registry-fetch/node_modules/@npmcli/redact/LICENSE

-21
This file was deleted.

node_modules/npm-registry-fetch/node_modules/@npmcli/redact/lib/index.js

-44
This file was deleted.

node_modules/npm-registry-fetch/node_modules/@npmcli/redact/package.json

-51
This file was deleted.

package-lock.json

+5-14
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
"@npmcli/map-workspaces": "^3.0.6",
9494
"@npmcli/package-json": "^5.1.0",
9595
"@npmcli/promise-spawn": "^7.0.1",
96-
"@npmcli/redact": "^1.1.0",
96+
"@npmcli/redact": "^2.0.0",
9797
"@npmcli/run-script": "^8.1.0",
9898
"@sigstore/tuf": "^2.3.2",
9999
"abbrev": "^2.0.0",
@@ -1787,9 +1787,9 @@
17871787
}
17881788
},
17891789
"node_modules/@npmcli/redact": {
1790-
"version": "1.1.0",
1791-
"resolved": "https://registry.npmjs.org/@npmcli/redact/-/redact-1.1.0.tgz",
1792-
"integrity": "sha512-PfnWuOkQgu7gCbnSsAisaX7hKOdZ4wSAhAzH3/ph5dSGau52kCRrMMGbiSQLwyTZpgldkZ49b0brkOr1AzGBHQ==",
1790+
"version": "2.0.0",
1791+
"resolved": "https://registry.npmjs.org/@npmcli/redact/-/redact-2.0.0.tgz",
1792+
"integrity": "sha512-SEjCPAVHWYUIQR+Yn03kJmrJjZDtJLYpj300m3HV9OTRZNpC5YpbMsM3eTkECyT4aWj8lDr9WeY6TWefpubtYQ==",
17931793
"inBundle": true,
17941794
"engines": {
17951795
"node": "^16.14.0 || >=18.0.0"
@@ -9043,15 +9043,6 @@
90439043
"node": "^16.14.0 || >=18.0.0"
90449044
}
90459045
},
9046-
"node_modules/npm-registry-fetch/node_modules/@npmcli/redact": {
9047-
"version": "2.0.0",
9048-
"resolved": "https://registry.npmjs.org/@npmcli/redact/-/redact-2.0.0.tgz",
9049-
"integrity": "sha512-SEjCPAVHWYUIQR+Yn03kJmrJjZDtJLYpj300m3HV9OTRZNpC5YpbMsM3eTkECyT4aWj8lDr9WeY6TWefpubtYQ==",
9050-
"inBundle": true,
9051-
"engines": {
9052-
"node": "^16.14.0 || >=18.0.0"
9053-
}
9054-
},
90559046
"node_modules/npm-run-path": {
90569047
"version": "4.0.1",
90579048
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz",
@@ -14979,7 +14970,7 @@
1497914970
"@npmcli/node-gyp": "^3.0.0",
1498014971
"@npmcli/package-json": "^5.1.0",
1498114972
"@npmcli/query": "^3.1.0",
14982-
"@npmcli/redact": "^1.1.0",
14973+
"@npmcli/redact": "^2.0.0",
1498314974
"@npmcli/run-script": "^8.1.0",
1498414975
"bin-links": "^4.0.1",
1498514976
"cacache": "^18.0.0",

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"@npmcli/map-workspaces": "^3.0.6",
5959
"@npmcli/package-json": "^5.1.0",
6060
"@npmcli/promise-spawn": "^7.0.1",
61-
"@npmcli/redact": "^1.1.0",
61+
"@npmcli/redact": "^2.0.0",
6262
"@npmcli/run-script": "^8.1.0",
6363
"@sigstore/tuf": "^2.3.2",
6464
"abbrev": "^2.0.0",

workspaces/arborist/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"@npmcli/node-gyp": "^3.0.0",
1313
"@npmcli/package-json": "^5.1.0",
1414
"@npmcli/query": "^3.1.0",
15-
"@npmcli/redact": "^1.1.0",
15+
"@npmcli/redact": "^2.0.0",
1616
"@npmcli/run-script": "^8.1.0",
1717
"bin-links": "^4.0.1",
1818
"cacache": "^18.0.0",

0 commit comments

Comments
 (0)