Package dev.blaauwendraad.masker.json
Class KeyContainsMasker
java.lang.Object
dev.blaauwendraad.masker.json.KeyContainsMasker
- All Implemented Interfaces:
JsonMasker
Default implementation of the
JsonMasker
.-
Constructor Summary
ConstructorsConstructorDescriptionKeyContainsMasker
(JsonMaskingConfig maskingConfig) Creates an instance of anKeyContainsMasker
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
mask
(byte[] input) Masks the values in the given input for all values having keys corresponding to any of the provided target keys.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.blaauwendraad.masker.json.JsonMasker
mask
-
Constructor Details
-
KeyContainsMasker
Creates an instance of anKeyContainsMasker
- Parameters:
maskingConfig
- theJsonMaskingConfig
for the created masker
-
-
Method Details
-
mask
public byte[] mask(byte[] input) Masks the values in the given input for all values having keys corresponding to any of the provided target keys. This implementation is optimized for multiple target keys. Since RFC-8529 dictates that JSON exchanges between systems that are not part of an enclosed system MUST be encoded using UTF-8, this method assumes UTF-8 encoding.- Specified by:
mask
in interfaceJsonMasker
- Parameters:
input
- the input message for which values might be masked- Returns:
- the masked message
-