diff options
author | Julian Møller Ellehauge <jumoel@github.com> | 2022-07-12 22:55:00 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-12 22:55:00 +0300 |
commit | e8102c1aae65a18e41253fbcdffe2eff0bedae53 (patch) | |
tree | 6aa044c12a43848efc40615e41ee35274bc0dd8f | |
parent | d3791e6eafab51aab16bb2f3e2d2c566b77df5cf (diff) |
feat: Add `web` auth type (#5076)
-rw-r--r-- | docs/content/commands/npm-adduser.md | 8 | ||||
-rw-r--r-- | docs/content/using-npm/config.md | 8 | ||||
-rw-r--r-- | lib/commands/adduser.js | 1 | ||||
-rw-r--r-- | lib/utils/config/definitions.js | 9 | ||||
-rw-r--r-- | tap-snapshots/test/lib/load-all-commands.js.test.cjs | 4 | ||||
-rw-r--r-- | tap-snapshots/test/lib/npm.js.test.cjs | 4 | ||||
-rw-r--r-- | tap-snapshots/test/lib/utils/config/definitions.js.test.cjs | 8 | ||||
-rw-r--r-- | tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs | 8 |
8 files changed, 21 insertions, 29 deletions
diff --git a/docs/content/commands/npm-adduser.md b/docs/content/commands/npm-adduser.md index aaa62e1b9..700aecb22 100644 --- a/docs/content/commands/npm-adduser.md +++ b/docs/content/commands/npm-adduser.md @@ -93,15 +93,13 @@ npm init --scope=@foo --yes #### `auth-type` * Default: "legacy" -* Type: "legacy", "webauthn", "sso", "saml", or "oauth" +* Type: "legacy", "web", "sso", "saml", "oauth", or "webauthn" -NOTE: auth-type values "sso", "saml", and "oauth" will be removed in a -future version. +NOTE: auth-type values "sso", "saml", "oauth", and "webauthn" will be +removed in a future version. What authentication strategy to use with `login`. -Pass `webauthn` to use a web-based login. - <!-- automatically generated, do not edit manually --> <!-- see lib/utils/config/definitions.js --> diff --git a/docs/content/using-npm/config.md b/docs/content/using-npm/config.md index debb25636..ffbf9be05 100644 --- a/docs/content/using-npm/config.md +++ b/docs/content/using-npm/config.md @@ -218,15 +218,13 @@ exit code. #### `auth-type` * Default: "legacy" -* Type: "legacy", "webauthn", "sso", "saml", or "oauth" +* Type: "legacy", "web", "sso", "saml", "oauth", or "webauthn" -NOTE: auth-type values "sso", "saml", and "oauth" will be removed in a -future version. +NOTE: auth-type values "sso", "saml", "oauth", and "webauthn" will be +removed in a future version. What authentication strategy to use with `login`. -Pass `webauthn` to use a web-based login. - <!-- automatically generated, do not edit manually --> <!-- see lib/utils/config/definitions.js --> diff --git a/lib/commands/adduser.js b/lib/commands/adduser.js index 29eb5acf8..5e23f40dc 100644 --- a/lib/commands/adduser.js +++ b/lib/commands/adduser.js @@ -3,6 +3,7 @@ const replaceInfo = require('../utils/replace-info.js') const BaseCommand = require('../base-command.js') const authTypes = { legacy: require('../auth/legacy.js'), + web: require('../auth/legacy.js'), webauthn: require('../auth/legacy.js'), oauth: require('../auth/oauth.js'), saml: require('../auth/saml.js'), diff --git a/lib/utils/config/definitions.js b/lib/utils/config/definitions.js index e654c6b99..665ed1efe 100644 --- a/lib/utils/config/definitions.js +++ b/lib/utils/config/definitions.js @@ -239,15 +239,14 @@ define('audit-level', { define('auth-type', { default: 'legacy', - type: ['legacy', 'webauthn', 'sso', 'saml', 'oauth'], + type: ['legacy', 'web', 'sso', 'saml', 'oauth', 'webauthn'], // deprecation in description rather than field, because not every value // is deprecated description: ` - NOTE: auth-type values "sso", "saml", and "oauth" will be removed in a future version. - - What authentication strategy to use with \`login\`. + NOTE: auth-type values "sso", "saml", "oauth", and "webauthn" will be + removed in a future version. - Pass \`webauthn\` to use a web-based login. + What authentication strategy to use with \`login\`. `, flatten (key, obj, flatOptions) { flatOptions.authType = obj[key] diff --git a/tap-snapshots/test/lib/load-all-commands.js.test.cjs b/tap-snapshots/test/lib/load-all-commands.js.test.cjs index ef832be1b..b697dfbb7 100644 --- a/tap-snapshots/test/lib/load-all-commands.js.test.cjs +++ b/tap-snapshots/test/lib/load-all-commands.js.test.cjs @@ -33,7 +33,7 @@ npm adduser Options: [--registry <registry>] [--scope <@scope>] -[--auth-type <legacy|webauthn|sso|saml|oauth>] +[--auth-type <legacy|web|sso|saml|oauth|webauthn>] aliases: login, add-user @@ -499,7 +499,7 @@ npm adduser Options: [--registry <registry>] [--scope <@scope>] -[--auth-type <legacy|webauthn|sso|saml|oauth>] +[--auth-type <legacy|web|sso|saml|oauth|webauthn>] aliases: login, add-user diff --git a/tap-snapshots/test/lib/npm.js.test.cjs b/tap-snapshots/test/lib/npm.js.test.cjs index c87e947fc..3cdf37684 100644 --- a/tap-snapshots/test/lib/npm.js.test.cjs +++ b/tap-snapshots/test/lib/npm.js.test.cjs @@ -190,7 +190,7 @@ All commands: Options: [--registry <registry>] [--scope <@scope>] - [--auth-type <legacy|webauthn|sso|saml|oauth>] + [--auth-type <legacy|web|sso|saml|oauth|webauthn>] aliases: login, add-user @@ -577,7 +577,7 @@ All commands: Options: [--registry <registry>] [--scope <@scope>] - [--auth-type <legacy|webauthn|sso|saml|oauth>] + [--auth-type <legacy|web|sso|saml|oauth|webauthn>] aliases: login, add-user diff --git a/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs b/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs index 5a06f2c4b..04d304a22 100644 --- a/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs +++ b/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs @@ -253,14 +253,12 @@ exports[`test/lib/utils/config/definitions.js TAP > config description for auth- #### \`auth-type\` * Default: "legacy" -* Type: "legacy", "webauthn", "sso", "saml", or "oauth" +* Type: "legacy", "web", "sso", "saml", "oauth", or "webauthn" -NOTE: auth-type values "sso", "saml", and "oauth" will be removed in a -future version. +NOTE: auth-type values "sso", "saml", "oauth", and "webauthn" will be +removed in a future version. What authentication strategy to use with \`login\`. - -Pass \`webauthn\` to use a web-based login. ` exports[`test/lib/utils/config/definitions.js TAP > config description for before 1`] = ` diff --git a/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs b/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs index a06f53012..a291af6de 100644 --- a/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs +++ b/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs @@ -91,15 +91,13 @@ exit code. #### \`auth-type\` * Default: "legacy" -* Type: "legacy", "webauthn", "sso", "saml", or "oauth" +* Type: "legacy", "web", "sso", "saml", "oauth", or "webauthn" -NOTE: auth-type values "sso", "saml", and "oauth" will be removed in a -future version. +NOTE: auth-type values "sso", "saml", "oauth", and "webauthn" will be +removed in a future version. What authentication strategy to use with \`login\`. -Pass \`webauthn\` to use a web-based login. - <!-- automatically generated, do not edit manually --> <!-- see lib/utils/config/definitions.js --> |