Skip to content

Commit 7a09902

Browse files
authored
docs: bring back certfile (#8582)
Partial revert of #7947 `certfile` and `cafile` are both valid, and are used for different things: - `certfile` is the path to the certificate file. It's used for mutual TLS and represents the client's certificate (supersedes the deprecated `cert`, and complements `keyfile`). - `cafile` is the path to the certificate authority file. It's used to verify the authenticity of the registry's certificate. Also clarify that `keyfile` and `certfile` must be scoped to a registry.
1 parent 5db81c3 commit 7a09902

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

docs/lib/content/configuring-npm/npmrc.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ to override default configs in a standard and consistent manner.
9696

9797
### Auth related configuration
9898

99-
The settings `_auth`, `_authToken`, `username` and `_password` must all be
100-
scoped to a specific registry. This ensures that `npm` will never send
101-
credentials to the wrong host.
99+
The settings `_auth`, `_authToken`, `username`, `_password`, `certfile`,
100+
and `keyfile` must all be scoped to a specific registry. This ensures that
101+
`npm` will never send credentials to the wrong host.
102102

103103
The full list is:
104104
- `_auth` (base64 authentication string)
@@ -107,6 +107,7 @@ The full list is:
107107
- `_password`
108108
- `email`
109109
- `cafile` (path to certificate authority file)
110+
- `certfile` (path to certificate file)
110111
- `keyfile` (path to key file)
111112

112113
In order to scope these values, they must be prefixed by a URI fragment.

tap-snapshots/test/lib/docs.js.test.cjs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1911,9 +1911,9 @@ When set to \`dev\` or \`development\`, this is an alias for \`--include=dev\`.
19111911
* Default: null
19121912
* Type: null or String
19131913
* DEPRECATED: \`key\` and \`cert\` are no longer used for most registry
1914-
operations. Use registry scoped \`keyfile\` and \`cafile\` instead. Example:
1914+
operations. Use registry scoped \`keyfile\` and \`certfile\` instead. Example:
19151915
//other-registry.tld/:keyfile=/path/to/key.pem
1916-
//other-registry.tld/:cafile=/path/to/cert.crt
1916+
//other-registry.tld/:certfile=/path/to/cert.crt
19171917
19181918
A client certificate to pass when accessing the registry. Values should be
19191919
in PEM format (Windows calls it "Base-64 encoded X.509 (.CER)") with
@@ -1924,8 +1924,8 @@ cert="-----BEGIN CERTIFICATE-----\\nXXXX\\nXXXX\\n-----END CERTIFICATE-----"
19241924
\`\`\`
19251925
19261926
It is _not_ the path to a certificate file, though you can set a
1927-
registry-scoped "cafile" path like
1928-
"//other-registry.tld/:cafile=/path/to/cert.pem".
1927+
registry-scoped "certfile" path like
1928+
"//other-registry.tld/:certfile=/path/to/cert.pem".
19291929
19301930
19311931
@@ -2016,9 +2016,9 @@ Alias for \`--init-version\`
20162016
* Default: null
20172017
* Type: null or String
20182018
* DEPRECATED: \`key\` and \`cert\` are no longer used for most registry
2019-
operations. Use registry scoped \`keyfile\` and \`cafile\` instead. Example:
2019+
operations. Use registry scoped \`keyfile\` and \`certfile\` instead. Example:
20202020
//other-registry.tld/:keyfile=/path/to/key.pem
2021-
//other-registry.tld/:cafile=/path/to/cert.crt
2021+
//other-registry.tld/:certfile=/path/to/cert.crt
20222022
20232023
A client key to pass when accessing the registry. Values should be in PEM
20242024
format with newlines replaced by the string "\\n". For example:

workspaces/config/lib/definitions/definitions.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -398,14 +398,14 @@ const definitions = {
398398
\`\`\`
399399
400400
It is _not_ the path to a certificate file, though you can set a registry-scoped
401-
"cafile" path like "//other-registry.tld/:cafile=/path/to/cert.pem".
401+
"certfile" path like "//other-registry.tld/:certfile=/path/to/cert.pem".
402402
`,
403403
deprecated: `
404404
\`key\` and \`cert\` are no longer used for most registry operations.
405-
Use registry scoped \`keyfile\` and \`cafile\` instead.
405+
Use registry scoped \`keyfile\` and \`certfile\` instead.
406406
Example:
407407
//other-registry.tld/:keyfile=/path/to/key.pem
408-
//other-registry.tld/:cafile=/path/to/cert.crt
408+
//other-registry.tld/:certfile=/path/to/cert.crt
409409
`,
410410
flatten,
411411
}),
@@ -1094,10 +1094,10 @@ const definitions = {
10941094
`,
10951095
deprecated: `
10961096
\`key\` and \`cert\` are no longer used for most registry operations.
1097-
Use registry scoped \`keyfile\` and \`cafile\` instead.
1097+
Use registry scoped \`keyfile\` and \`certfile\` instead.
10981098
Example:
10991099
//other-registry.tld/:keyfile=/path/to/key.pem
1100-
//other-registry.tld/:cafile=/path/to/cert.crt
1100+
//other-registry.tld/:certfile=/path/to/cert.crt
11011101
`,
11021102
flatten,
11031103
}),

0 commit comments

Comments
 (0)