feat: hide sensitive info in stdout/sdtin

This commit is contained in:
Pierre Vanduynslager
2018-01-27 14:00:06 -05:00
parent cdb98f919f
commit fb0caa005b
6 changed files with 87 additions and 5 deletions
+11
View File
@@ -0,0 +1,11 @@
const {escapeRegExp} = require('lodash');
const regexp = new RegExp(
Object.keys(process.env)
.filter(envVar => /token|password|credential|secret|private/i.test(envVar))
.map(envVar => escapeRegExp(process.env[envVar]))
.join('|'),
'g'
);
module.exports = output => output.replace(regexp, '[secure]');