Replies: 4 comments 6 replies
-
I would assume the library to mask values for every key that I pass irrespective of the field type. So enabling numeric fields masking by default seems logical. That also concerns masking boolean fields. |
Beta Was this translation helpful? Give feedback.
-
Since the main function of this library is to mask values, I expect it to mask any fields out of the box without any side-effects. Thus disabling number masking or obfuscating the length by default is kind of weird in my opinion. Making the That will leave 3 options:
In conclusion, I think it's important to keep the main functionality in mind and don't worry too much about the looks of it. For this reason picking some digit, where |
Beta Was this translation helpful? Give feedback.
-
To me the option 2:
seems like a good default to have together with masking everything by default. However about length obfuscation, I think we should obfuscate by default and instead introduce an option We could also make it possible to choose from variable options and checking invariants on the config builder, for example we might have these configuration options:
and the default config being something like this
As part of larger discussion I'd love to be able to set these on the level of a target key(s), but that's probably for the different discussion. |
Beta Was this translation helpful? Give feedback.
-
To conclude this Github discussion: this had led to this ADR |
Beta Was this translation helpful? Give feedback.
-
One of the things I think is currently sub-optimal in the API is that number masking is configured to be disabled by default.
This seems counter-intuitive for a library which is meant to mask JSON messages, for example to mask sensitive data.
I (and I heard this from other users) think it is somewhat unexpected that by default, when a key is masked but has a numeric value, it is not masked unless number masking is enabled.
This was decided in the past because of a combination of considerations:
For strings in JSON, it is quite easy to come up with a logical mask for a value: E.g.: replacing each human-readable character with a single asterisk (*).
However, combining considerations 1. and 2. above, this is not so obvious for numbers:
Either users would like to preserve the length of the numeric values or they feel like '0' is the most logical mask. Preserving the length of the numeric value would mean that only the digits 1-9 can be used, and not 0 (again, because of consideration 2).
Considering the above, historically we decided to have number masking disabled by default and the user could determine what seemed most logic for them. Again, because of consideration 3., using a single '0' (see consideration 2) as mask for numbers used to come with a severe performance penalty for certain cases.
Now that this performance penalty has been mitigated and based on user feedback, I think we can consider enabling number masking by default and there are multiple options for this.
Therefore, we can do the following things:
maskNumberValueWith(int numberMask)
a required part of the builder (of course, something likedisableNumberMasking
would be an alternative option there as well). This forces users to make the decision about number masking,Curious to hear about any input!
Beta Was this translation helpful? Give feedback.
All reactions