fix: hide sensitive data in relesae notes and fail/success plugin params

This commit is contained in:
Pierre Vanduynslager
2018-08-27 16:20:36 -04:00
parent 1aed97e577
commit dffe148e33
6 changed files with 128 additions and 13 deletions
+14 -1
View File
@@ -1,7 +1,20 @@
const {isFunction} = require('lodash');
const hideSensitive = require('./hide-sensitive');
function extractErrors(err) {
return err && isFunction(err[Symbol.iterator]) ? [...err] : [err];
}
module.exports = {extractErrors};
function hideSensitiveValues(env, objs) {
const hideFunction = hideSensitive(env);
return objs.map(obj => {
Object.getOwnPropertyNames(obj).forEach(prop => {
if (obj[prop]) {
obj[prop] = hideFunction(obj[prop]);
}
});
return obj;
});
}
module.exports = {extractErrors, hideSensitiveValues};