@npmcli/config
Advanced tools
Comparing version 4.1.0 to 4.2.0
@@ -701,5 +701,7 @@ // TODO: set the scope config from package.json or explicit cli config | ||
this.delete(`${nerfed}:email`, 'user') | ||
this.delete(`${nerfed}:certfile`, 'user') | ||
this.delete(`${nerfed}:keyfile`, 'user') | ||
} | ||
setCredentialsByURI (uri, { token, username, password, email }) { | ||
setCredentialsByURI (uri, { token, username, password, email, certfile, keyfile }) { | ||
const nerfed = nerfDart(uri) | ||
@@ -737,2 +739,7 @@ const def = nerfDart(this.get('registry')) | ||
this.delete(`${nerfed}:email`, 'user') | ||
if (certfile && keyfile) { | ||
this.set(`${nerfed}:certfile`, certfile, 'user') | ||
this.set(`${nerfed}:keyfile`, keyfile, 'user') | ||
// cert/key may be used in conjunction with other credentials, thus no `else` | ||
} | ||
if (token) { | ||
@@ -755,3 +762,3 @@ this.set(`${nerfed}:_authToken`, token, 'user') | ||
this.set(`${nerfed}:_password`, encoded, 'user') | ||
} else { | ||
} else if (!certfile || !keyfile) { | ||
throw new Error('No credentials to set.') | ||
@@ -771,2 +778,10 @@ } | ||
const certfileReg = this.get(`${nerfed}:certfile`) | ||
const keyfileReg = this.get(`${nerfed}:keyfile`) | ||
if (certfileReg && keyfileReg) { | ||
creds.certfile = certfileReg | ||
creds.keyfile = keyfileReg | ||
// cert/key may be used in conjunction with other credentials, thus no `return` | ||
} | ||
const tokenReg = this.get(`${nerfed}:_authToken`) || | ||
@@ -773,0 +788,0 @@ this.get(`${nerfed}:_authtoken`) || |
{ | ||
"name": "@npmcli/config", | ||
"version": "4.1.0", | ||
"version": "4.2.0", | ||
"files": [ | ||
@@ -34,3 +34,3 @@ "bin/", | ||
"@npmcli/eslint-config": "^3.0.1", | ||
"@npmcli/template-oss": "3.3.2", | ||
"@npmcli/template-oss": "3.5.0", | ||
"tap": "^16.0.1" | ||
@@ -53,4 +53,4 @@ }, | ||
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", | ||
"version": "3.3.2" | ||
"version": "3.5.0" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48642
1080