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
path: root/test
diff options
context:
space:
mode:
authorLuke Karrys <luke@lukekarrys.com>2021-12-09 01:39:19 +0300
committernlf <quitlahok@gmail.com>2021-12-09 02:28:35 +0300
commite605b128c87620aae843cdbd8f35cc614da3f8a2 (patch)
treed2b4e8811696a6548a788debd5b31a947a4df6d4 /test
parent9e9a76a21d3b8649b7debfaf0782433cbd8179b3 (diff)
fix: redact all private keys from config output
PR-URL: https://github.com/npm/cli/pull/4142 Credit: @lukekarrys Close: #4142 Reviewed-by: @wraithgar
Diffstat (limited to 'test')
-rw-r--r--test/lib/commands/config.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/lib/commands/config.js b/test/lib/commands/config.js
index b37088c06..d78e0290a 100644
--- a/test/lib/commands/config.js
+++ b/test/lib/commands/config.js
@@ -333,7 +333,13 @@ t.test('config get private key', async t => {
await t.rejects(
sandbox.run('config', ['get', '_authToken']),
- '_authToken is protected',
+ /_authToken option is protected/,
+ 'rejects with protected string'
+ )
+
+ await t.rejects(
+ sandbox.run('config', ['get', '//localhost:8080/:_password']),
+ /_password option is protected/,
'rejects with protected string'
)
})