Skip to content

Commit 2561822

Browse files
nlflukekarrys
authored andcommitted
deps: @npmcli/config@4.2.2
1 parent 53037b3 commit 2561822

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

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

+12-2
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,11 @@ class Config {
767767
const nerfed = nerfDart(uri)
768768
const creds = {}
769769

770+
const deprecatedAuthWarning = [
771+
'`_auth`, `_authToken`, `username` and `_password` must be scoped to a registry.',
772+
'see `npm help npmrc` for more information.',
773+
].join(' ')
774+
770775
const email = this.get(`${nerfed}:email`) || this.get('email')
771776
if (email) {
772777
creds.email = email
@@ -780,10 +785,13 @@ class Config {
780785
// cert/key may be used in conjunction with other credentials, thus no `return`
781786
}
782787

783-
const tokenReg = this.get(`${nerfed}:_authToken`) ||
784-
nerfed === nerfDart(this.get('registry')) && this.get('_authToken')
788+
const defaultToken = nerfDart(this.get('registry')) && this.get('_authToken')
789+
const tokenReg = this.get(`${nerfed}:_authToken`) || defaultToken
785790

786791
if (tokenReg) {
792+
if (tokenReg === defaultToken) {
793+
log.warn('config', deprecatedAuthWarning)
794+
}
787795
creds.token = tokenReg
788796
return creds
789797
}
@@ -818,6 +826,7 @@ class Config {
818826
const userDef = this.get('username')
819827
const passDef = this.get('_password')
820828
if (userDef && passDef) {
829+
log.warn('config', deprecatedAuthWarning)
821830
creds.username = userDef
822831
creds.password = Buffer.from(passDef, 'base64').toString('utf8')
823832
const auth = `${creds.username}:${creds.password}`
@@ -832,6 +841,7 @@ class Config {
832841
return creds
833842
}
834843

844+
log.warn('config', deprecatedAuthWarning)
835845
const authDecode = Buffer.from(auth, 'base64').toString('utf8')
836846
const authSplit = authDecode.split(':')
837847
creds.username = authSplit.shift()

node_modules/@npmcli/config/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@npmcli/config",
3-
"version": "4.2.1",
3+
"version": "4.2.2",
44
"files": [
55
"bin/",
66
"lib/"
@@ -31,7 +31,7 @@
3131
},
3232
"devDependencies": {
3333
"@npmcli/eslint-config": "^3.0.1",
34-
"@npmcli/template-oss": "3.5.0",
34+
"@npmcli/template-oss": "3.6.0",
3535
"tap": "^16.0.1"
3636
},
3737
"dependencies": {
@@ -49,6 +49,6 @@
4949
},
5050
"templateOSS": {
5151
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
52-
"version": "3.5.0"
52+
"version": "3.6.0"
5353
}
5454
}

package-lock.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -878,9 +878,9 @@
878878
}
879879
},
880880
"node_modules/@npmcli/config": {
881-
"version": "4.2.1",
882-
"resolved": "https://registry.npmjs.org/@npmcli/config/-/config-4.2.1.tgz",
883-
"integrity": "sha512-iJEnXNAGGr7sGUcoKmeJNrc943vFiWrDWq6DNK/t+SuqoObmozMb3tN3G5T9yo3uBf5Cw4h+SWgoqSaiwczl0Q==",
881+
"version": "4.2.2",
882+
"resolved": "https://registry.npmjs.org/@npmcli/config/-/config-4.2.2.tgz",
883+
"integrity": "sha512-5GNcLd+0c4bYBnFop53+26CO5GQP0R9YcxlernohpHDWdIgzUg9I0+GEMk3sNHnLntATVU39d283A4OO+W402w==",
884884
"inBundle": true,
885885
"dependencies": {
886886
"@npmcli/map-workspaces": "^2.0.2",

0 commit comments

Comments
 (0)