Skip to content

Commit

Permalink
feat: deprecated key, cert config options and updated registry sc…
Browse files Browse the repository at this point in the history
…oped auth docs
  • Loading branch information
fritzy committed Oct 18, 2022
1 parent 353b5bb commit 29d5f6a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/lib/content/configuring-npm/npmrc.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,15 @@ The settings `_auth`, `_authToken`, `username` and `_password` must all be
scoped to a specific registry. This ensures that `npm` will never send
credentials to the wrong host.

The full list is:
- `_auth` (base64 authentication string)
- `_authToken` (authentication token)
- `username`
- `_password`
- `email`
- `certfile` (path to certificate file)
- `keyfile` (path to key file)

In order to scope these values, they must be prefixed by a URI fragment.
If the credential is meant for any request to a registry on a single host,
the scope may look like `//registry.npmjs.org/:`. If it must be scoped to a
Expand Down
3 changes: 3 additions & 0 deletions docs/lib/content/using-npm/registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ used, which is supplied by the [`registry` config](/using-npm/config#registry)
parameter. See [`npm config`](/commands/npm-config),
[`npmrc`](/configuring-npm/npmrc), and [`config`](/using-npm/config) for more on
managing npm's configuration.
Authentication configuration such as auth tokens and certificates are configured
specifically scoped to an individual registry. See
[Auth Related Configuration](/configuring-npm/npmrc#auth-related-configuration)

When the default registry is used in a package-lock or shrinkwrap is has the
special meaning of "the currently configured registry". If you create a lock
Expand Down
14 changes: 14 additions & 0 deletions lib/utils/config/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,13 @@ define('cert', {
It is _not_ the path to a certificate file, though you can set a registry-scoped
"certfile" path like "//other-registry.tld/:certfile=/path/to/cert.pem".
`,
deprecated: `
\`key\` and \`cert\` are no longer used for most registry operations.
Use registry scoped \`keyfile\` and \`certfile\` instead.
Example:
//other-registry.tld/:keyfile=/path/to/key.pem
//other-registry.tld/:certfile=/path/to/cert.crt
`,
flatten,
})

Expand Down Expand Up @@ -1104,6 +1111,13 @@ define('key', {
It is _not_ the path to a key file, though you can set a registry-scoped
"keyfile" path like "//other-registry.tld/:keyfile=/path/to/key.pem".
`,
deprecated: `
\`key\` and \`cert\` are no longer used for most registry operations.
Use registry scoped \`keyfile\` and \`certfile\` instead.
Example:
//other-registry.tld/:keyfile=/path/to/key.pem
//other-registry.tld/:certfile=/path/to/cert.crt
`,
flatten,
})

Expand Down

0 comments on commit 29d5f6a

Please sign in to comment.