@@ -34,6 +34,7 @@ import reactor.core.publisher.Flux;
|
||||
|
||||
import org.springframework.cloud.function.context.catalog.FunctionTypeUtils;
|
||||
import org.springframework.cloud.function.json.JsonMapper;
|
||||
import org.springframework.cloud.function.utils.JsonMasker;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.MessageHeaders;
|
||||
@@ -67,6 +68,8 @@ public final class AWSLambdaUtils {
|
||||
*/
|
||||
public static final String AWS_CONTEXT = "aws-context";
|
||||
|
||||
private final static JsonMasker masker = JsonMasker.INSTANCE();
|
||||
|
||||
private AWSLambdaUtils() {
|
||||
|
||||
}
|
||||
@@ -102,11 +105,15 @@ public final class AWSLambdaUtils {
|
||||
return generateMessage(payload, inputType, isSupplier, jsonMapper, null);
|
||||
}
|
||||
|
||||
private static String mask(String value) {
|
||||
return masker.mask(value);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public static Message<byte[]> generateMessage(byte[] payload, Type inputType, boolean isSupplier,
|
||||
JsonMapper jsonMapper, Context context) {
|
||||
if (logger.isInfoEnabled()) {
|
||||
logger.info("Received: " + new String(payload, StandardCharsets.UTF_8));
|
||||
logger.info("Received: " + mask(new String(payload, StandardCharsets.UTF_8)));
|
||||
}
|
||||
|
||||
Object structMessage = jsonMapper.fromJson(payload, Object.class);
|
||||
|
||||
Reference in New Issue
Block a user