fix(masking): Various performance, functional, and readability fixes for JSON-based masking #2051
+355
−322
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Several fixes here:
this will now apply to both:
and now also to all the
firstLine
values in an array type, too (this was not working correctly previously):Primitives will be handled as expected as well, where a filter like:
would now result that the following object:
will correctly look like:
instead of the current:
which is currently losing the format, as well as non-sensitive information such as array length.
Some readability improvements & fixes, also updating tests to be uniform, so the exact same test code is not repeated. Now the
JsonMaskerTest
interface defines the core tests the input and output, with theShowByDefault
andMaskByDefault
tests implementing the interface (with their own backingapplication.yml
which makes them fit the test criteria) and have their own specific tests written in the class onlySmall performance improvements, including defining the topic -> filtering keys in the constructor rather than constantly re-evaluating
Remove the phrase "Please contact akhq administrator" which is likely to cause confusion and bring people here, when the issue isn't AKHQ but that a record has not fulfilled the criteria for masking