jerryshao commented on code in PR #14979:
URL: https://github.com/apache/gravitino/pull/14979#discussion_r4583537043
##########
core/src/main/java/org/apache/gravitino/connector/HiddenPropertyMaskUtils.java:
##########
@@ -75,10 +75,16 @@ public final class HiddenPropertyMaskUtils {
/**
* Mapper for nest-JSON masking. Uses {@link JsonNode} with big-decimal
floats so rewritten JSON
- * keeps numeric fidelity better than {@code Map}/{@code List} round-trips.
+ * keeps numeric fidelity better than {@code Map}/{@code List} round-trips.
{@link
+ * DeserializationFeature#FAIL_ON_TRAILING_TOKENS} rejects concatenated
values (for example {@code
+ * {} {"password":"secret"}}), so a no-op first object cannot leave a
trailing secret in the
+ * original string.
*/
private static final ObjectMapper NEST_JSON_MAPPER =
-
JsonUtils.anyFieldMapper().copy().enable(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS);
+ JsonUtils.anyFieldMapper()
+ .copy()
+ .enable(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS)
+ .enable(DeserializationFeature.FAIL_ON_TRAILING_TOKENS);
Review Comment:
[P2] If `--updater-options` receives
`{"config":{"password":"example"},"config":{}}`, the INFO log still includes
`example`. Jackson keeps only the second `config`, so the masking walk finds
nothing and returns the full original argument. Please enable
`FAIL_ON_READING_DUP_TREE_KEY` on `NEST_JSON_MAPPER` and add a regression
assertion that this input becomes `MASKED_VALUE`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]