Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGar <gar+gh@danger.computer>2022-09-21 23:07:30 +0300
committerGitHub <noreply@github.com>2022-09-21 23:07:30 +0300
commit314311c61b8f341715c168199d52976ee3237077 (patch)
tree18ce4d66ecf0a73ba974f1ed1ccf3c032fb7cd72 /tap-snapshots/test
parentd3ff2aa9b57d7448c5770ba307118ce4c3b6a888 (diff)
feat: separate login/adduser, remove auth types (#5550)
The difference between `adduser` and `login` depends on the `auth-type`. - `web`: the POST to `/-/v1/login` contains a `{ create: true }` value in its payload for `adduser` - `legacy` the `PUT` request to `/-/user/org.couchdb.user:${username}` contains an `email` value in its payload for `adduser`. BREAKING CHANGE: `login`, `adduser`, and `auth-type` changes - This removes all `auth-type` configs except `web` and `legacy`. - `login` and `adduser` are now separate commands that send different data to the registry. - `auth-type` config values `web` and `legacy` only try their respective methods, npm no longer tries them all and waits to see which one doesn't fail.
Diffstat (limited to 'tap-snapshots/test')
-rw-r--r--tap-snapshots/test/lib/commands/adduser.js.test.cjs17
-rw-r--r--tap-snapshots/test/lib/commands/completion.js.test.cjs1
-rw-r--r--tap-snapshots/test/lib/commands/config.js.test.cjs4
-rw-r--r--tap-snapshots/test/lib/load-all-commands.js.test.cjs16
-rw-r--r--tap-snapshots/test/lib/npm.js.test.cjs16
-rw-r--r--tap-snapshots/test/lib/utils/cmd-list.js.test.cjs1
-rw-r--r--tap-snapshots/test/lib/utils/config/definitions.js.test.cjs30
-rw-r--r--tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs30
8 files changed, 14 insertions, 101 deletions
diff --git a/tap-snapshots/test/lib/commands/adduser.js.test.cjs b/tap-snapshots/test/lib/commands/adduser.js.test.cjs
deleted file mode 100644
index ba27a6a78..000000000
--- a/tap-snapshots/test/lib/commands/adduser.js.test.cjs
+++ /dev/null
@@ -1,17 +0,0 @@
-/* IMPORTANT
- * This snapshot file is auto-generated, but designed for humans.
- * It should be checked into source control and tracked carefully.
- * Re-generate by setting TAP_SNAPSHOT=1 and running tests.
- * Make sure to inspect the output below. Do not ignore changes!
- */
-'use strict'
-exports[`test/lib/commands/adduser.js TAP auth-type sso warning > warning 1`] = `
-Object {
- "warn": Array [
- Array [
- "config",
- "--auth-type=sso is will be removed in a future version.",
- ],
- ],
-}
-`
diff --git a/tap-snapshots/test/lib/commands/completion.js.test.cjs b/tap-snapshots/test/lib/commands/completion.js.test.cjs
index 85a883bd5..3e7125bc3 100644
--- a/tap-snapshots/test/lib/commands/completion.js.test.cjs
+++ b/tap-snapshots/test/lib/commands/completion.js.test.cjs
@@ -109,7 +109,6 @@ Array [
version
view
whoami
- login
author
home
issues
diff --git a/tap-snapshots/test/lib/commands/config.js.test.cjs b/tap-snapshots/test/lib/commands/config.js.test.cjs
index 6ed14ae5b..043dccd9c 100644
--- a/tap-snapshots/test/lib/commands/config.js.test.cjs
+++ b/tap-snapshots/test/lib/commands/config.js.test.cjs
@@ -140,8 +140,6 @@ exports[`test/lib/commands/config.js TAP config list --json > output matches sna
"shrinkwrap": true,
"sign-git-commit": false,
"sign-git-tag": false,
- "sso-poll-frequency": 500,
- "sso-type": "oauth",
"strict-peer-deps": false,
"strict-ssl": true,
"tag": "latest",
@@ -297,8 +295,6 @@ shell = "{SHELL}"
shrinkwrap = true
sign-git-commit = false
sign-git-tag = false
-sso-poll-frequency = 500
-sso-type = "oauth"
strict-peer-deps = false
strict-ssl = true
tag = "latest"
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 038121be9..e3d3d02fc 100644
--- a/tap-snapshots/test/lib/load-all-commands.js.test.cjs
+++ b/tap-snapshots/test/lib/load-all-commands.js.test.cjs
@@ -30,10 +30,9 @@ Usage:
npm adduser
Options:
-[--registry <registry>] [--scope <@scope>]
-[--auth-type <legacy|web|sso|saml|oauth|webauthn>]
+[--registry <registry>] [--scope <@scope>] [--auth-type <legacy|web>]
-aliases: login, add-user
+alias: add-user
Run "npm help adduser" for more info
`
@@ -479,18 +478,15 @@ Run "npm help ll" for more info
`
exports[`test/lib/load-all-commands.js TAP load each command login > must match snapshot 1`] = `
-Add a registry user account
+Login to a registry user account
Usage:
-npm adduser
+npm login
Options:
-[--registry <registry>] [--scope <@scope>]
-[--auth-type <legacy|web|sso|saml|oauth|webauthn>]
-
-aliases: login, add-user
+[--registry <registry>] [--scope <@scope>] [--auth-type <legacy|web>]
-Run "npm help adduser" for more info
+Run "npm help login" for more info
`
exports[`test/lib/load-all-commands.js TAP load each command logout > must match snapshot 1`] = `
diff --git a/tap-snapshots/test/lib/npm.js.test.cjs b/tap-snapshots/test/lib/npm.js.test.cjs
index 1c3dbe39b..35a5ee4da 100644
--- a/tap-snapshots/test/lib/npm.js.test.cjs
+++ b/tap-snapshots/test/lib/npm.js.test.cjs
@@ -187,10 +187,9 @@ All commands:
npm adduser
Options:
- [--registry <registry>] [--scope <@scope>]
- [--auth-type <legacy|web|sso|saml|oauth|webauthn>]
+ [--registry <registry>] [--scope <@scope>] [--auth-type <legacy|web>]
- aliases: login, add-user
+ alias: add-user
Run "npm help adduser" for more info
@@ -568,18 +567,15 @@ All commands:
Run "npm help ll" for more info
- login Add a registry user account
+ login Login to a registry user account
Usage:
- npm adduser
+ npm login
Options:
- [--registry <registry>] [--scope <@scope>]
- [--auth-type <legacy|web|sso|saml|oauth|webauthn>]
+ [--registry <registry>] [--scope <@scope>] [--auth-type <legacy|web>]
- aliases: login, add-user
-
- Run "npm help adduser" for more info
+ Run "npm help login" for more info
logout Log out of the registry
diff --git a/tap-snapshots/test/lib/utils/cmd-list.js.test.cjs b/tap-snapshots/test/lib/utils/cmd-list.js.test.cjs
index e76f89014..574b0855b 100644
--- a/tap-snapshots/test/lib/utils/cmd-list.js.test.cjs
+++ b/tap-snapshots/test/lib/utils/cmd-list.js.test.cjs
@@ -381,7 +381,6 @@ Object {
"la": "ll",
"list": "ls",
"ln": "link",
- "login": "adduser",
"ogr": "org",
"r": "uninstall",
"rb": "rebuild",
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 6eac545b2..8eff450e7 100644
--- a/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs
+++ b/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs
@@ -135,8 +135,6 @@ Array [
"shrinkwrap",
"sign-git-commit",
"sign-git-tag",
- "sso-poll-frequency",
- "sso-type",
"strict-peer-deps",
"strict-ssl",
"tag",
@@ -254,10 +252,7 @@ exports[`test/lib/utils/config/definitions.js TAP > config description for auth-
#### \`auth-type\`
* Default: "legacy"
-* Type: "legacy", "web", "sso", "saml", "oauth", or "webauthn"
-
-NOTE: auth-type values "sso", "saml", "oauth", and "webauthn" will be
-removed in a future version.
+* Type: "legacy" or "web"
What authentication strategy to use with \`login\`.
`
@@ -1697,29 +1692,6 @@ Note that git requires you to have set up GPG keys in your git configs for
this to work properly.
`
-exports[`test/lib/utils/config/definitions.js TAP > config description for sso-poll-frequency 1`] = `
-#### \`sso-poll-frequency\`
-
-* Default: 500
-* Type: Number
-* DEPRECATED: The --auth-type method of SSO/SAML/OAuth will be removed in a
- future version of npm in favor of web-based login.
-
-When used with SSO-enabled \`auth-type\`s, configures how regularly the
-registry should be polled while the user is completing authentication.
-`
-
-exports[`test/lib/utils/config/definitions.js TAP > config description for sso-type 1`] = `
-#### \`sso-type\`
-
-* Default: "oauth"
-* Type: null, "oauth", or "saml"
-* DEPRECATED: The --auth-type method of SSO/SAML/OAuth will be removed in a
- future version of npm in favor of web-based login.
-
-If \`--auth-type=sso\`, the type of SSO type to use.
-`
-
exports[`test/lib/utils/config/definitions.js TAP > config description for strict-peer-deps 1`] = `
#### \`strict-peer-deps\`
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 46910d128..633b2da8e 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,10 +91,7 @@ exit code.
#### \`auth-type\`
* Default: "legacy"
-* Type: "legacy", "web", "sso", "saml", "oauth", or "webauthn"
-
-NOTE: auth-type values "sso", "saml", "oauth", and "webauthn" will be
-removed in a future version.
+* Type: "legacy" or "web"
What authentication strategy to use with \`login\`.
@@ -1957,31 +1954,6 @@ Alias for --package-lock
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
-#### \`sso-poll-frequency\`
-
-* Default: 500
-* Type: Number
-* DEPRECATED: The --auth-type method of SSO/SAML/OAuth will be removed in a
- future version of npm in favor of web-based login.
-
-When used with SSO-enabled \`auth-type\`s, configures how regularly the
-registry should be polled while the user is completing authentication.
-
-<!-- automatically generated, do not edit manually -->
-<!-- see lib/utils/config/definitions.js -->
-
-#### \`sso-type\`
-
-* Default: "oauth"
-* Type: null, "oauth", or "saml"
-* DEPRECATED: The --auth-type method of SSO/SAML/OAuth will be removed in a
- future version of npm in favor of web-based login.
-
-If \`--auth-type=sso\`, the type of SSO type to use.
-
-<!-- automatically generated, do not edit manually -->
-<!-- see lib/utils/config/definitions.js -->
-
#### \`tmp\`
* Default: The value returned by the Node.js \`os.tmpdir()\` method