fix(lambda): raise Jackson maxStringLength for large inline zip uploads (#412) (#418)

Jackson 2.15+ defaults StreamReadConstraints.maxStringLength to 20 MB,
blocking Lambda CreateFunction when the base64-encoded ZipFile exceeds
that limit. AWS allows up to 50 MB direct upload (~67 MB base64).

Add an ObjectMapperCustomizer that raises the limit to 100 MB, and an
integration test that sends a >20 MB base64 payload to verify it works.
This commit is contained in:
TiM authored and GitHub committed 2026-04-13 17:42:06 -05:00
1 parent cf9eb32516
commit d16945f30d
2 files changed
+77

No files matched your search

@@ -0,0 +1,25 @@
package io.github.hectorvent.floci.core.common;
import com.fasterxml.jackson.core.StreamReadConstraints;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.quarkus.jackson.ObjectMapperCustomizer;
import jakarta.inject.Singleton;
/**
* Raises this application's Jackson string-length limit so that large inline payloads
* (e.g. base64-encoded Lambda ZipFile up to ~67 MB) are accepted.
* AWS allows 50 MB direct upload; base64 expands that by ~33%.
*/
@Singleton
public class JacksonConfig implements ObjectMapperCustomizer {
private static final int MAX_STRING_LENGTH = 100_000_000; // 100 MB
@Override
public void customize(ObjectMapper mapper) {
mapper.getFactory().setStreamReadConstraints(
StreamReadConstraints.builder()
.maxStringLength(MAX_STRING_LENGTH)
.build());
}
}