trim sensitive info from logs

This commit is contained in:
Dave Horton
2021-11-03 14:37:57 -04:00
parent f11feb7975
commit dcf27ba5d3
5 changed files with 15 additions and 13 deletions

View File

@@ -137,7 +137,9 @@ module.exports = function(srf, logger) {
const obj = Object.assign({}, app);
delete obj.requestor;
delete obj.notifier;
logger.info({app: obj}, `retrieved application for incoming call to ${req.locals.calledNumber}`);
// eslint-disable-next-line no-unused-vars
const {call_hook, call_status_hook, ...appInfo} = obj; // mask sensitive data like user/pass on webhook
logger.info({app: appInfo}, `retrieved application for incoming call to ${req.locals.calledNumber}`);
req.locals.callInfo = new CallInfo({req, app, direction: CallDirection.Inbound});
next();
} catch (err) {