Skip to content

Filter out certain keys from the response body. Keep those secrets secret!

Notifications You must be signed in to change notification settings

mrmurphy/koa-response-censor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

koa-response-censor

Filter out certain keys from the response body. Keep those secrets secret! Build Status

A little joke header image of censored text

Install

Install with npm

$ npm install koa-response-censor

Usage

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.

Options

  • keys {array} An array of keys to be omitted (deeply) from the response body

Tests

$ npm test

License

The MIT License, 2014 Murphy Randle

About

Filter out certain keys from the response body. Keep those secrets secret!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published