@npmcli/config 4.2.0 → 4.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +7 -9
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -296,6 +296,7 @@ class Config {
|
|
|
296
296
|
// might be a security hazard, which was the intention.
|
|
297
297
|
try {
|
|
298
298
|
this.setCredentialsByURI(reg, creds)
|
|
299
|
+
// eslint-disable-next-line no-empty
|
|
299
300
|
} catch (_) {}
|
|
300
301
|
process.emit('timeEnd', 'config:load:credentials')
|
|
301
302
|
|
|
@@ -366,9 +367,11 @@ class Config {
|
|
|
366
367
|
if (!/^npm_config_/i.test(envKey) || envVal === '') {
|
|
367
368
|
continue
|
|
368
369
|
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
.
|
|
370
|
+
let key = envKey.slice('npm_config_'.length)
|
|
371
|
+
if (!key.startsWith('//')) { // don't normalize nerf-darted keys
|
|
372
|
+
key = key.replace(/(?!^)_/g, '-') // don't replace _ at the start of the key
|
|
373
|
+
.toLowerCase()
|
|
374
|
+
}
|
|
372
375
|
conf[key] = envVal
|
|
373
376
|
}
|
|
374
377
|
this[_loadObject](conf, 'env', 'environment')
|
|
@@ -654,6 +657,7 @@ class Config {
|
|
|
654
657
|
// saved back to the .npmrc file, so we're good.
|
|
655
658
|
try {
|
|
656
659
|
this.setCredentialsByURI(reg, creds)
|
|
660
|
+
// eslint-disable-next-line no-empty
|
|
657
661
|
} catch (_) {}
|
|
658
662
|
}
|
|
659
663
|
|
|
@@ -691,8 +695,6 @@ class Config {
|
|
|
691
695
|
this.delete(`_password`, 'user')
|
|
692
696
|
this.delete(`username`, 'user')
|
|
693
697
|
}
|
|
694
|
-
this.delete(`${nerfed}:-authtoken`, 'user')
|
|
695
|
-
this.delete(`${nerfed}:_authtoken`, 'user')
|
|
696
698
|
this.delete(`${nerfed}:_authToken`, 'user')
|
|
697
699
|
this.delete(`${nerfed}:_auth`, 'user')
|
|
698
700
|
this.delete(`${nerfed}:_password`, 'user')
|
|
@@ -732,8 +734,6 @@ class Config {
|
|
|
732
734
|
// send auth if we have it, only to the URIs under the nerf dart.
|
|
733
735
|
this.delete(`${nerfed}:always-auth`, 'user')
|
|
734
736
|
|
|
735
|
-
this.delete(`${nerfed}:-authtoken`, 'user')
|
|
736
|
-
this.delete(`${nerfed}:_authtoken`, 'user')
|
|
737
737
|
this.delete(`${nerfed}:email`, 'user')
|
|
738
738
|
if (certfile && keyfile) {
|
|
739
739
|
this.set(`${nerfed}:certfile`, certfile, 'user')
|
|
@@ -781,8 +781,6 @@ class Config {
|
|
|
781
781
|
}
|
|
782
782
|
|
|
783
783
|
const tokenReg = this.get(`${nerfed}:_authToken`) ||
|
|
784
|
-
this.get(`${nerfed}:_authtoken`) ||
|
|
785
|
-
this.get(`${nerfed}:-authtoken`) ||
|
|
786
784
|
nerfed === nerfDart(this.get('registry')) && this.get('_authToken')
|
|
787
785
|
|
|
788
786
|
if (tokenReg) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@npmcli/config",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.1",
|
|
4
4
|
"files": [
|
|
5
5
|
"bin/",
|
|
6
6
|
"lib/"
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@npmcli/map-workspaces": "^2.0.2",
|
|
39
39
|
"ini": "^3.0.0",
|
|
40
40
|
"mkdirp-infer-owner": "^2.0.0",
|
|
41
|
-
"nopt": "^
|
|
41
|
+
"nopt": "^6.0.0",
|
|
42
42
|
"proc-log": "^2.0.0",
|
|
43
43
|
"read-package-json-fast": "^2.0.3",
|
|
44
44
|
"semver": "^7.3.5",
|