diff options
author | Nathan Fritz <fritzy@github.com> | 2022-07-12 02:47:40 +0300 |
---|---|---|
committer | Gar <wraithgar@github.com> | 2022-07-12 21:34:35 +0300 |
commit | e58f02f5e8263bf86ae1f07a863098d445e6d0cd (patch) | |
tree | 333aba1e632c599b16ad37b1eff3d845d96bae5f /lib | |
parent | c6c4ba3b62e2a0896a48329f4c7e13d9e44a2f80 (diff) |
feat: warn on config --auth-type=sso/saml/oauth, undeprecate --auth-type
Diffstat (limited to 'lib')
-rw-r--r-- | lib/utils/config/definitions.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/utils/config/definitions.js b/lib/utils/config/definitions.js index f58a26768..e654c6b99 100644 --- a/lib/utils/config/definitions.js +++ b/lib/utils/config/definitions.js @@ -3,6 +3,7 @@ module.exports = definitions const Definition = require('./definition.js') +const log = require('../log-shim') const { version: npmVersion } = require('../../../package.json') const ciDetect = require('@npmcli/ci-detect') const ciName = ciDetect() @@ -239,12 +240,24 @@ define('audit-level', { define('auth-type', { default: 'legacy', type: ['legacy', 'webauthn', 'sso', 'saml', 'oauth'], + // 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\`. Pass \`webauthn\` to use a web-based login. `, - flatten, + flatten (key, obj, flatOptions) { + flatOptions.authType = obj[key] + if (obj[key] === 'sso') { + // no need to deprecate saml/oauth here, as sso-type will be set by these in + // lib/auth/ and is deprecated already + log.warn('config', + '--auth-type=sso is will be removed in a future version.') + } + }, }) define('before', { |