public static String desensitizeBody(final boolean desensitized, final String source,
                                     final KeyWordMatch keyWordMatch, final String dataDesensitizeAlg) {
        if (StringUtils.hasLength(source) && desensitized) {
            Map<String, String> bodyMap = JsonUtils.jsonToMap(source, String.class);
            bodyMap.forEach((key, value) -> {
                if (keyWordMatch.matches(key)) {
                    bodyMap.put(key, DataDesensitizeFactory.selectDesensitize(value, dataDesensitizeAlg));
                }
            });
            return JsonUtils.toJson(bodyMap);
        } else {
            return source;
        }
    }
mask for body.

@param desensitized desensitized flag
@param source source data
@param keyWordMatch keyword match strategy
@param dataDesensitizeAlg desensitize algorithm
@return desensitized data
shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-desensitize-api/src/main/java/org/apache/shenyu/plugin/logging/desensitize/api/utils/DataDesensitizeUtils.java