Skip to content

Commit e8102c1

Browse files
authored
feat: Add web auth type (#5076)
1 parent d3791e6 commit e8102c1

File tree

8 files changed

+21
-29
lines changed

8 files changed

+21
-29
lines changed

docs/content/commands/npm-adduser.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,13 @@ npm init --scope=@foo --yes
9393
#### `auth-type`
9494

9595
* Default: "legacy"
96-
* Type: "legacy", "webauthn", "sso", "saml", or "oauth"
96+
* Type: "legacy", "web", "sso", "saml", "oauth", or "webauthn"
9797

98-
NOTE: auth-type values "sso", "saml", and "oauth" will be removed in a
99-
future version.
98+
NOTE: auth-type values "sso", "saml", "oauth", and "webauthn" will be
99+
removed in a future version.
100100

101101
What authentication strategy to use with `login`.
102102

103-
Pass `webauthn` to use a web-based login.
104-
105103
<!-- automatically generated, do not edit manually -->
106104
<!-- see lib/utils/config/definitions.js -->
107105

docs/content/using-npm/config.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -218,15 +218,13 @@ exit code.
218218
#### `auth-type`
219219

220220
* Default: "legacy"
221-
* Type: "legacy", "webauthn", "sso", "saml", or "oauth"
221+
* Type: "legacy", "web", "sso", "saml", "oauth", or "webauthn"
222222

223-
NOTE: auth-type values "sso", "saml", and "oauth" will be removed in a
224-
future version.
223+
NOTE: auth-type values "sso", "saml", "oauth", and "webauthn" will be
224+
removed in a future version.
225225

226226
What authentication strategy to use with `login`.
227227

228-
Pass `webauthn` to use a web-based login.
229-
230228
<!-- automatically generated, do not edit manually -->
231229
<!-- see lib/utils/config/definitions.js -->
232230

lib/commands/adduser.js

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const replaceInfo = require('../utils/replace-info.js')
33
const BaseCommand = require('../base-command.js')
44
const authTypes = {
55
legacy: require('../auth/legacy.js'),
6+
web: require('../auth/legacy.js'),
67
webauthn: require('../auth/legacy.js'),
78
oauth: require('../auth/oauth.js'),
89
saml: require('../auth/saml.js'),

lib/utils/config/definitions.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -239,15 +239,14 @@ define('audit-level', {
239239

240240
define('auth-type', {
241241
default: 'legacy',
242-
type: ['legacy', 'webauthn', 'sso', 'saml', 'oauth'],
242+
type: ['legacy', 'web', 'sso', 'saml', 'oauth', 'webauthn'],
243243
// deprecation in description rather than field, because not every value
244244
// is deprecated
245245
description: `
246-
NOTE: auth-type values "sso", "saml", and "oauth" will be removed in a future version.
247-
248-
What authentication strategy to use with \`login\`.
246+
NOTE: auth-type values "sso", "saml", "oauth", and "webauthn" will be
247+
removed in a future version.
249248
250-
Pass \`webauthn\` to use a web-based login.
249+
What authentication strategy to use with \`login\`.
251250
`,
252251
flatten (key, obj, flatOptions) {
253252
flatOptions.authType = obj[key]

tap-snapshots/test/lib/load-all-commands.js.test.cjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ npm adduser
3333
3434
Options:
3535
[--registry <registry>] [--scope <@scope>]
36-
[--auth-type <legacy|webauthn|sso|saml|oauth>]
36+
[--auth-type <legacy|web|sso|saml|oauth|webauthn>]
3737
3838
aliases: login, add-user
3939
@@ -499,7 +499,7 @@ npm adduser
499499
500500
Options:
501501
[--registry <registry>] [--scope <@scope>]
502-
[--auth-type <legacy|webauthn|sso|saml|oauth>]
502+
[--auth-type <legacy|web|sso|saml|oauth|webauthn>]
503503
504504
aliases: login, add-user
505505

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ All commands:
190190
191191
Options:
192192
[--registry <registry>] [--scope <@scope>]
193-
[--auth-type <legacy|webauthn|sso|saml|oauth>]
193+
[--auth-type <legacy|web|sso|saml|oauth|webauthn>]
194194
195195
aliases: login, add-user
196196
@@ -577,7 +577,7 @@ All commands:
577577
578578
Options:
579579
[--registry <registry>] [--scope <@scope>]
580-
[--auth-type <legacy|webauthn|sso|saml|oauth>]
580+
[--auth-type <legacy|web|sso|saml|oauth|webauthn>]
581581
582582
aliases: login, add-user
583583

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

+3-5
Original file line numberDiff line numberDiff line change
@@ -253,14 +253,12 @@ exports[`test/lib/utils/config/definitions.js TAP > config description for auth-
253253
#### \`auth-type\`
254254
255255
* Default: "legacy"
256-
* Type: "legacy", "webauthn", "sso", "saml", or "oauth"
256+
* Type: "legacy", "web", "sso", "saml", "oauth", or "webauthn"
257257
258-
NOTE: auth-type values "sso", "saml", and "oauth" will be removed in a
259-
future version.
258+
NOTE: auth-type values "sso", "saml", "oauth", and "webauthn" will be
259+
removed in a future version.
260260
261261
What authentication strategy to use with \`login\`.
262-
263-
Pass \`webauthn\` to use a web-based login.
264262
`
265263

266264
exports[`test/lib/utils/config/definitions.js TAP > config description for before 1`] = `

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

+3-5
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,13 @@ exit code.
9191
#### \`auth-type\`
9292
9393
* Default: "legacy"
94-
* Type: "legacy", "webauthn", "sso", "saml", or "oauth"
94+
* Type: "legacy", "web", "sso", "saml", "oauth", or "webauthn"
9595
96-
NOTE: auth-type values "sso", "saml", and "oauth" will be removed in a
97-
future version.
96+
NOTE: auth-type values "sso", "saml", "oauth", and "webauthn" will be
97+
removed in a future version.
9898
9999
What authentication strategy to use with \`login\`.
100100
101-
Pass \`webauthn\` to use a web-based login.
102-
103101
<!-- automatically generated, do not edit manually -->
104102
<!-- see lib/utils/config/definitions.js -->
105103

0 commit comments

Comments
 (0)