diff options
author | Ruy Adorno <ruyadorno@hotmail.com> | 2020-11-10 23:27:59 +0300 |
---|---|---|
committer | isaacs <i@izs.me> | 2020-11-13 22:22:56 +0300 |
commit | 2a80c67ef8c12c3d9d254f5be6293a6461067d99 (patch) | |
tree | 8fa29e311d962e48b3701eb810bd9fc5c7b37766 /lib/utils | |
parent | 786e36404068fd51657ddac766e066a98754edbf (diff) |
fix: legacy auth tokens
Add legacy `_auth` token to flatOptions in order to support it when
reaching out to registries.
Fixes: #2008
Credit: @ruyadorno
Close: #2153
Reviewed-by: @isaacs
Diffstat (limited to 'lib/utils')
-rw-r--r-- | lib/utils/config.js | 2 | ||||
-rw-r--r-- | lib/utils/flat-options.js | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/lib/utils/config.js b/lib/utils/config.js index f9de6e9a7..6abb502e2 100644 --- a/lib/utils/config.js +++ b/lib/utils/config.js @@ -52,6 +52,7 @@ const defaults = { 'always-auth': false, audit: true, 'audit-level': null, + _auth: null, 'auth-type': 'legacy', before: null, 'bin-links': true, @@ -191,6 +192,7 @@ const types = { all: Boolean, 'allow-same-version': Boolean, also: [null, 'dev', 'development'], + _auth: [null, String], 'always-auth': Boolean, audit: Boolean, 'audit-level': ['low', 'moderate', 'high', 'critical', 'none', null], diff --git a/lib/utils/flat-options.js b/lib/utils/flat-options.js index be62c5a4c..8b6864aa8 100644 --- a/lib/utils/flat-options.js +++ b/lib/utils/flat-options.js @@ -50,6 +50,7 @@ const flatten = obj => ({ alwaysAuth: obj['always-auth'], audit: obj.audit, auditLevel: obj['audit-level'], + _auth: obj._auth, authType: obj['auth-type'], ssoType: obj['sso-type'], ssoPollFrequency: obj['sso-poll-frequency'], |