CLI documentation update from CI

npm CLI robot committed Aug 26, 2022 at 03:14 UTC 353520a1006449b97839e0594de2a4241bba32c5
3 files changed +35 -8
cli/v8
+1 -1
@@ -1 +1 @@
1 -Subproject commit 1e841029917817556207c39d25be1ea91e2959e7
1 +Subproject commit f628431c8a79d7cf00987ca6372dc34d4fbadfcf
content/cli/v8/commands/npm-access.md
+6 -7
@@ -46,29 +46,28 @@ For all of the subcommands, `npm access` will perform actions on the packages
46 in the current working directory if no package name is passed to the
47 subcommand.
48
49 -* public / restricted:
49 +* public / restricted (deprecated):
50 Set a package to be either publicly accessible or restricted.
51
52 -* grant / revoke:
52 +* grant / revoke (deprecated):
53 Add or remove the ability of users and teams to have read-only or read-write
54 access to a package.
55
56 -* 2fa-required / 2fa-not-required:
56 +* 2fa-required / 2fa-not-required (deprecated):
57 Configure whether a package requires that anyone publishing it have two-factor
58 authentication enabled on their account.
59
60 -* ls-packages:
60 +* ls-packages (deprecated):
61 Show all of the packages a user or a team is able to access, along with the
62 access level, except for read-only public packages (it won't print the whole
63 registry listing)
64
65 -* ls-collaborators:
65 +* ls-collaborators (deprecated):
66 Show all of the access privileges for a package. Will only show permissions
67 for packages to which you have at least read access. If `<user>` is passed in,
68 the list is filtered only to teams _that_ user happens to belong to.
69
70 -* edit:
71 - Set the access privileges for a package at once using `$EDITOR`.
70 +* edit (not implemented)
71
72 ### Details
73
content/cli/v8/configuring-npm/npmrc.md
+28
@@ -100,6 +100,34 @@ consistent across updates. Set fields in here using the `./configure`
100 script that comes with npm. This is primarily for distribution maintainers
101 to override default configs in a standard and consistent manner.
102
103 +### Auth related configuration
104 +
105 +The settings `_auth`, `_authToken`, `username` and `_password` must all be
106 +scoped to a specific registry. This ensures that `npm` will never send
107 +credentials to the wrong host.
108 +
109 +In order to scope these values, they must be prefixed by a URI fragment.
110 +If the credential is meant for any request to a registry on a single host,
111 +the scope may look like `//registry.npmjs.org/:`. If it must be scoped to a
112 +specific path on the host that path may also be provided, such as
113 +`//my-custom-registry.org/unique/path:`.
114 +
115 +```
116 +; bad config
117 +_authToken=MYTOKEN
118 +
119 +; good config
120 +@myorg:registry=https://somewhere-else.com/myorg
121 +@another:registry=https://somewhere-else.com/another
122 +//registry.npmjs.org/:_authToken=MYTOKEN
123 +; would apply to both @myorg and @another
124 +; //somewhere-else.com/:_authToken=MYTOKEN
125 +; would apply only to @myorg
126 +//somewhere-else.com/myorg/:_authToken=MYTOKEN1
127 +; would apply only to @another
128 +//somewhere-else.com/another/:_authToken=MYTOKEN2
129 +```
130 +
131 ### See also
132
133 * [npm folders](/cli/v8/configuring-npm/folders)