-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add actual withTextFunction that decodes / encodes JSON values (#104)
* Add actual withTextFunction that decodes / encodes JSON values * Add benchmark for encoding function * Refactor handling of all unicode characters, added tests, removed escaping of forward slash * Throw exception instead of replacing with ? * Added comment * Added javadoc for invalidJson * Added docs to withTextFunction, improved docs on `withRawValueFunction` * Added a test case with empty input string * Added a test case with two consecutive high surrogates * Added a test case with high surrogate followed by an escape character * Fix docs for replaceAll case * Apply suggestions from code review * Apply suggestions from code review * Extract ValueMasker in test * Not enough test coverage * Extract ValueMasker in test * Remove unnecessary space * Fixed test case with escape character, 100% coverage, baby * Small refactor for decoded index * Update src/main/java/dev/blaauwendraad/masker/json/InvalidJsonException.java * Added validation for hex byte conversion and docs * Added tests for specific hex conversion to cover all branches * More coverage * Added a comment regarding decodedBytes * Added some clarifying comments and inverted some conditions --------- Co-authored-by: breus <[email protected]>
- Loading branch information
1 parent
12324ff
commit c0e63df
Showing
12 changed files
with
538 additions
and
13 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
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
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
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
219 changes: 210 additions & 9 deletions
219
src/main/java/dev/blaauwendraad/masker/json/ValueMaskers.java
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
Oops, something went wrong.