diff options
author | Luke Karrys <luke@lukekarrys.com> | 2021-12-09 01:39:19 +0300 |
---|---|---|
committer | nlf <quitlahok@gmail.com> | 2021-12-09 02:28:35 +0300 |
commit | e605b128c87620aae843cdbd8f35cc614da3f8a2 (patch) | |
tree | d2b4e8811696a6548a788debd5b31a947a4df6d4 /test | |
parent | 9e9a76a21d3b8649b7debfaf0782433cbd8179b3 (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.js | 8 |
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' ) }) |