Skip to content

Commit

Permalink
fix: also handle 'secret' as sensible data
Browse files Browse the repository at this point in the history
  • Loading branch information
arlac77 committed May 6, 2019
1 parent c05a9df commit ef1d452
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/util.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function merge(a, b) {
*/
export function removeSensibleValues(
object,
toBeRemoved = key => key.match(/pass|auth|key|user/)
toBeRemoved = key => key.match(/pass|auth|key|user|secret/)
) {
if (
object === undefined ||
Expand Down
5 changes: 3 additions & 2 deletions tests/remove-sensible-test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ test("removeSensibleValues", t => {
removeSensibleValues({
a: { value: 7 },
key: "secure",
password: "secure"
password: "secure",
secret: "secure"
}),
{ a: { value: 7 }, key: "...", password: "..." }
{ a: { value: 7 }, key: "...", password: "...", secret: "..." }
);
});

0 comments on commit ef1d452

Please sign in to comment.