File tree Expand file tree Collapse file tree 5 files changed +17
-12
lines changed
tap-snapshots/test/lib/utils/config Expand file tree Collapse file tree 5 files changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ class Publish extends BaseCommand {
101101 const resolved = npa . resolve ( manifest . name , manifest . version )
102102 const registry = npmFetch . pickRegistry ( resolved , opts )
103103 const creds = this . npm . config . getCredentialsByURI ( registry )
104- const noCreds = ! creds . token && ! creds . username
104+ const noCreds = ! ( creds . token || creds . username || creds . certfile && creds . keyfile )
105105 const outputRegistry = replaceInfo ( registry )
106106
107107 if ( noCreds ) {
Original file line number Diff line number Diff line change @@ -436,8 +436,8 @@ define('cert', {
436436 cert="-----BEGIN CERTIFICATE-----\\nXXXX\\nXXXX\\n-----END CERTIFICATE-----"
437437 \`\`\`
438438
439- It is _not_ the path to a certificate file (and there is no "certfile"
440- option) .
439+ It is _not_ the path to a certificate file, though you can set a registry-scoped
440+ "certfile" path like "//other-registry.tld/:certfile=/path/to/cert.pem" .
441441 ` ,
442442 flatten,
443443} )
@@ -1118,7 +1118,8 @@ define('key', {
11181118 key="-----BEGIN PRIVATE KEY-----\\nXXXX\\nXXXX\\n-----END PRIVATE KEY-----"
11191119 \`\`\`
11201120
1121- It is _not_ the path to a key file (and there is no "keyfile" option).
1121+ It is _not_ the path to a key file, though you can set a registry-scoped
1122+ "keyfile" path like "//other-registry.tld/:keyfile=/path/to/key.pem".
11221123 ` ,
11231124 flatten,
11241125} )
Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ module.exports = async (npm, opts) => {
99 return creds . username
1010 }
1111
12- // No username, but we have a token ; fetch the username from registry
13- if ( creds . token ) {
12+ // No username, but we have other credentials ; fetch the username from registry
13+ if ( creds . token || creds . certfile && creds . keyfile ) {
1414 const registryData = await npmFetch . json ( '/-/whoami' , { ...opts } )
1515 return registryData . username
1616 }
Original file line number Diff line number Diff line change @@ -404,8 +404,9 @@ newlines replaced by the string "\\n". For example:
404404cert="-----BEGIN CERTIFICATE-----\\nXXXX\\nXXXX\\n-----END CERTIFICATE-----"
405405\`\`\`
406406
407- It is _not_ the path to a certificate file (and there is no "certfile"
408- option).
407+ It is _not_ the path to a certificate file, though you can set a
408+ registry-scoped "certfile" path like
409+ "//other-registry.tld/:certfile=/path/to/cert.pem".
409410`
410411
411412exports [ `test/lib/utils/config/definitions.js TAP > config description for ci-name 1` ] = `
@@ -1016,7 +1017,8 @@ format with newlines replaced by the string "\\n". For example:
10161017key="-----BEGIN PRIVATE KEY-----\\nXXXX\\nXXXX\\n-----END PRIVATE KEY-----"
10171018\`\`\`
10181019
1019- It is _not_ the path to a key file (and there is no "keyfile" option).
1020+ It is _not_ the path to a key file, though you can set a registry-scoped
1021+ "keyfile" path like "//other-registry.tld/:keyfile=/path/to/key.pem".
10201022`
10211023
10221024exports [ `test/lib/utils/config/definitions.js TAP > config description for legacy-bundling 1` ] = `
Original file line number Diff line number Diff line change @@ -230,8 +230,9 @@ newlines replaced by the string "\\n". For example:
230230cert="-----BEGIN CERTIFICATE-----\\nXXXX\\nXXXX\\n-----END CERTIFICATE-----"
231231\`\`\`
232232
233- It is _not_ the path to a certificate file (and there is no "certfile"
234- option).
233+ It is _not_ the path to a certificate file, though you can set a
234+ registry-scoped "certfile" path like
235+ "//other-registry.tld/:certfile=/path/to/cert.pem".
235236
236237<!-- automatically generated, do not edit manually -->
237238<!-- see lib/utils/config/definitions.js -->
@@ -819,7 +820,8 @@ format with newlines replaced by the string "\\n". For example:
819820key="-----BEGIN PRIVATE KEY-----\\nXXXX\\nXXXX\\n-----END PRIVATE KEY-----"
820821\`\`\`
821822
822- It is _not_ the path to a key file (and there is no "keyfile" option).
823+ It is _not_ the path to a key file, though you can set a registry-scoped
824+ "keyfile" path like "//other-registry.tld/:keyfile=/path/to/key.pem".
823825
824826<!-- automatically generated, do not edit manually -->
825827<!-- see lib/utils/config/definitions.js -->
You can’t perform that action at this time.
0 commit comments