Filter out certain keys from the response body. Keep those secrets secret!
Install with npm
$ npm install koa-response-censor
var app = require('koa')(),
koaCensor = require('koa-response-censor');
app.use(koaCensor({
keys: [
'pwdHash',
'_secretKey',
'myPhoneNumber'
]
}));
...
// any keys at any depth of the response body matching
// a term found in the array above will be omitted from
// the response.
keys
{array} An array of keys to be omitted (deeply) from the response body
$ npm test
The MIT License, 2014 Murphy Randle