Skip to content

Commit

Permalink
Remove --always-auth config definition
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
isaacs committed Apr 23, 2021
1 parent c74e67f commit 72a7eeb
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 53 deletions.
19 changes: 1 addition & 18 deletions docs/content/commands/npm-adduser.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: Add a registry user account
### Synopsis

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

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

#### always-auth

Default: false

If specified, save configuration indicating that all requests to the given
registry should include authorization information. Useful for private
registries. Can be used with `--registry` and / or `--scope`, e.g.

```bash
npm adduser --registry=http://private-registry.example.com --always-auth
```

This will ensure that all requests to that registry (including for tarballs)
include an authorization header. This setting may be necessary for use with
private registries where metadata and package tarballs are stored on hosts with
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.

#### auth-type

* Default: `'legacy'`
Expand Down
12 changes: 2 additions & 10 deletions docs/content/using-npm/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,6 @@ upon by the current project.
Prevents throwing an error when `npm version` is used to set the new version
to the same value as the current version.

#### `always-auth`

* Default: false
* Type: Boolean

Force npm to always require authentication when accessing the registry, even
for `GET` requests.

#### `audit`

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

The shell to use for scripts run with the `npm exec`, `npm run` and
`npm init <pkg>` commands.
The shell to use for scripts run with the `npm exec`, `npm run` and `npm
init <pkg>` commands.

#### `searchexclude`

Expand Down
1 change: 0 additions & 1 deletion lib/adduser.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class AddUser extends BaseCommand {
return [
'registry',
'scope',
'always-auth',
]
}

Expand Down
10 changes: 0 additions & 10 deletions lib/utils/config/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,16 +199,6 @@ define('also', {
},
})

define('always-auth', {
default: false,
type: Boolean,
description: `
Force npm to always require authentication when accessing the registry,
even for \`GET\` requests.
`,
flatten,
})

define('audit', {
default: true,
type: Boolean,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Array [
"all",
"allow-same-version",
"also",
"always-auth",
"audit",
"audit-level",
"auth-type",
Expand Down
8 changes: 0 additions & 8 deletions tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,6 @@ upon by the current project.
Prevents throwing an error when \`npm version\` is used to set the new version
to the same value as the current version.
#### \`always-auth\`
* Default: false
* Type: Boolean
Force npm to always require authentication when accessing the registry, even
for \`GET\` requests.
#### \`audit\`
* Default: true
Expand Down
4 changes: 2 additions & 2 deletions tap-snapshots/test/lib/utils/npm-usage.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ All commands:
npm adduser
Options:
[--registry <registry>] [--scope <@scope>] [--always-auth]
[--registry <registry>] [--scope <@scope>]
aliases: login, add-user
Expand Down Expand Up @@ -565,7 +565,7 @@ All commands:
npm adduser
Options:
[--registry <registry>] [--scope <@scope>] [--always-auth]
[--registry <registry>] [--scope <@scope>]
aliases: login, add-user
Expand Down
6 changes: 3 additions & 3 deletions test/lib/utils/config/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ t.equal(definitions['node-version'].default, process.version, 'node-version defa

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

Expand Down

0 comments on commit 72a7eeb

Please sign in to comment.