-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(redact): redact emails inside strings MONGOSH-1392 (#404)
* fix(redact): redact emails inside strings MONGOSH-1392 * refactor: combine rules
- Loading branch information
1 parent
6f9e6b5
commit be8a9b7
Showing
2 changed files
with
10 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,6 +77,14 @@ describe('mongodb-redact', function () { | |
expect(redact('[email protected]')).to.equal('<email>'); | ||
}); | ||
|
||
it('should redact emails inside strings', function () { | ||
expect( | ||
redact( | ||
'"db.test.insert({ email: "[email protected]" })"' | ||
) | ||
).to.equal('"db.test.insert({ email: "<email>" })"'); | ||
}); | ||
|
||
it('should redact ip addresses', function () { | ||
expect(redact('10.0.0.1')).to.equal('<ip address>'); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters