Skip to content

Commit 72a7eeb

Browse files
committed
Remove --always-auth config definition
As of the recent updates to npm-registry-fetch and @npmcli/config, this config field is no longer used anywhere. Prior to those changes, it was used, but not in the manner documented.
1 parent c74e67f commit 72a7eeb

File tree

8 files changed

+8
-53
lines changed

8 files changed

+8
-53
lines changed

docs/content/commands/npm-adduser.md

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: Add a registry user account
77
### Synopsis
88

99
```bash
10-
npm adduser [--registry=url] [--scope=@orgname] [--always-auth] [--auth-type=legacy]
10+
npm adduser [--registry=url] [--scope=@orgname] [--auth-type=legacy]
1111

1212
aliases: login, add-user
1313
```
@@ -58,23 +58,6 @@ npm adduser --registry=http://myregistry.example.com --scope=@myco
5858
This will set a registry for the given scope and login or create a user for
5959
that registry at the same time.
6060

61-
#### always-auth
62-
63-
Default: false
64-
65-
If specified, save configuration indicating that all requests to the given
66-
registry should include authorization information. Useful for private
67-
registries. Can be used with `--registry` and / or `--scope`, e.g.
68-
69-
```bash
70-
npm adduser --registry=http://private-registry.example.com --always-auth
71-
```
72-
73-
This will ensure that all requests to that registry (including for tarballs)
74-
include an authorization header. This setting may be necessary for use with
75-
private registries where metadata and package tarballs are stored on hosts with
76-
different hostnames. See `always-auth` in [`config`](/using-npm/config) for more details on always-auth. Registry-specific configuration of `always-auth` takes precedence over any global configuration.
77-
7861
#### auth-type
7962

8063
* Default: `'legacy'`

docs/content/using-npm/config.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -165,14 +165,6 @@ upon by the current project.
165165
Prevents throwing an error when `npm version` is used to set the new version
166166
to the same value as the current version.
167167

168-
#### `always-auth`
169-
170-
* Default: false
171-
* Type: Boolean
172-
173-
Force npm to always require authentication when accessing the registry, even
174-
for `GET` requests.
175-
176168
#### `audit`
177169

178170
* Default: true
@@ -1087,8 +1079,8 @@ installation of packages specified according to the pattern
10871079
* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
10881080
* Type: null or String
10891081

1090-
The shell to use for scripts run with the `npm exec`, `npm run` and
1091-
`npm init <pkg>` commands.
1082+
The shell to use for scripts run with the `npm exec`, `npm run` and `npm
1083+
init <pkg>` commands.
10921084

10931085
#### `searchexclude`
10941086

lib/adduser.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ class AddUser extends BaseCommand {
2121
return [
2222
'registry',
2323
'scope',
24-
'always-auth',
2524
]
2625
}
2726

lib/utils/config/definitions.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -199,16 +199,6 @@ define('also', {
199199
},
200200
})
201201

202-
define('always-auth', {
203-
default: false,
204-
type: Boolean,
205-
description: `
206-
Force npm to always require authentication when accessing the registry,
207-
even for \`GET\` requests.
208-
`,
209-
flatten,
210-
})
211-
212202
define('audit', {
213203
default: true,
214204
type: Boolean,

tap-snapshots/test/lib/utils/config/definitions.js.test.cjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ Array [
1212
"all",
1313
"allow-same-version",
1414
"also",
15-
"always-auth",
1615
"audit",
1716
"audit-level",
1817
"auth-type",

tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,6 @@ upon by the current project.
4444
Prevents throwing an error when \`npm version\` is used to set the new version
4545
to the same value as the current version.
4646
47-
#### \`always-auth\`
48-
49-
* Default: false
50-
* Type: Boolean
51-
52-
Force npm to always require authentication when accessing the registry, even
53-
for \`GET\` requests.
54-
5547
#### \`audit\`
5648
5749
* Default: true

tap-snapshots/test/lib/utils/npm-usage.js.test.cjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ All commands:
190190
npm adduser
191191
192192
Options:
193-
[--registry <registry>] [--scope <@scope>] [--always-auth]
193+
[--registry <registry>] [--scope <@scope>]
194194
195195
aliases: login, add-user
196196
@@ -565,7 +565,7 @@ All commands:
565565
npm adduser
566566
567567
Options:
568-
[--registry <registry>] [--scope <@scope>] [--always-auth]
568+
[--registry <registry>] [--scope <@scope>]
569569
570570
aliases: login, add-user
571571

test/lib/utils/config/definitions.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ t.equal(definitions['node-version'].default, process.version, 'node-version defa
2929

3030
t.test('basic flattening function camelCases from css-case', t => {
3131
const flat = {}
32-
const obj = { 'always-auth': true }
33-
definitions['always-auth'].flatten('always-auth', obj, flat)
34-
t.strictSame(flat, { alwaysAuth: true })
32+
const obj = { 'prefer-online': true }
33+
definitions['prefer-online'].flatten('prefer-online', obj, flat)
34+
t.strictSame(flat, { preferOnline: true })
3535
t.end()
3636
})
3737

0 commit comments

Comments
 (0)