From 84eb0a768a57db94c346906dc3fe4e8eca569384 Mon Sep 17 00:00:00 2001 From: patrick Date: Mon, 26 Sep 2022 08:28:07 +0200 Subject: [PATCH 01/10] update to jackson 2.13 --- graylog2-server/pom.xml | 4 ++-- .../main/java/org/graylog/plugins/beats/Beats2Codec.java | 2 +- .../shared/bindings/providers/ObjectMapperProvider.java | 4 +++- .../contentpack/facade/EventDefinitionFacadeTest.java | 7 +++++-- .../events/contentpack/facade/NotificationFacadeTest.java | 7 +++++-- ...20200204122000_MigrateUntypedViewsToDashboardsTest.java | 4 +++- .../graylog2/jackson/MongoJodaDateTimeSerializerTest.java | 6 ++++-- .../graylog2/jackson/MongoZonedDateTimeSerializerTest.java | 6 ++++-- .../test/java/org/graylog2/plugin/MessageSummaryTest.java | 4 ++-- pom.xml | 2 ++ 10 files changed, 31 insertions(+), 15 deletions(-) diff --git a/graylog2-server/pom.xml b/graylog2-server/pom.xml index bf89ec5ee094..d489b1e56843 100644 --- a/graylog2-server/pom.xml +++ b/graylog2-server/pom.xml @@ -181,8 +181,8 @@ com.fasterxml.jackson.module - jackson-module-scala_2.13 - 2.9.10 + jackson-module-scala_3 + 2.13.4 com.fasterxml.jackson.jaxrs diff --git a/graylog2-server/src/main/java/org/graylog/plugins/beats/Beats2Codec.java b/graylog2-server/src/main/java/org/graylog/plugins/beats/Beats2Codec.java index 9b3c88e92f3b..a97d83b11d8c 100644 --- a/graylog2-server/src/main/java/org/graylog/plugins/beats/Beats2Codec.java +++ b/graylog2-server/src/main/java/org/graylog/plugins/beats/Beats2Codec.java @@ -70,7 +70,7 @@ public Message decode(@Nonnull RawMessage rawMessage) { final JsonNode event; try { event = objectMapper.readTree(payload); - if (event == null) { + if (event == null || event.isMissingNode()) { throw new IOException("null result"); } } catch (IOException e) { diff --git a/graylog2-server/src/main/java/org/graylog2/shared/bindings/providers/ObjectMapperProvider.java b/graylog2-server/src/main/java/org/graylog2/shared/bindings/providers/ObjectMapperProvider.java index d244e582fb59..3991ff28dfe4 100644 --- a/graylog2-server/src/main/java/org/graylog2/shared/bindings/providers/ObjectMapperProvider.java +++ b/graylog2-server/src/main/java/org/graylog2/shared/bindings/providers/ObjectMapperProvider.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.module.SimpleModule; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.fasterxml.jackson.databind.type.TypeFactory; +import com.fasterxml.jackson.databind.util.StdDateFormat; import com.fasterxml.jackson.datatype.guava.GuavaModule; import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; import com.fasterxml.jackson.datatype.joda.JodaModule; @@ -80,7 +81,7 @@ public class ObjectMapperProvider implements Provider { private final LoadingCache mapperByTimeZone = CacheBuilder.newBuilder() .maximumSize(DateTimeZone.getAvailableIDs().size()) .build( - new CacheLoader() { + new CacheLoader<>() { @Override public ObjectMapper load(@Nonnull DateTimeZone key) { return objectMapper.copy().setTimeZone(key.toTimeZone()); @@ -114,6 +115,7 @@ public ObjectMapperProvider(@GraylogClassLoader final ClassLoader classLoader, .setPropertyNamingStrategy(new PropertyNamingStrategy.SnakeCaseStrategy()) .setSubtypeResolver(subtypeResolver) .setTypeFactory(typeFactory) + .setDateFormat(new StdDateFormat().withColonInTimeZone(false)) .registerModule(new GuavaModule()) .registerModule(new JodaModule()) .registerModule(new Jdk8Module()) diff --git a/graylog2-server/src/test/java/org/graylog/events/contentpack/facade/EventDefinitionFacadeTest.java b/graylog2-server/src/test/java/org/graylog/events/contentpack/facade/EventDefinitionFacadeTest.java index aa99f2c324b2..3c3ff47cf65e 100644 --- a/graylog2-server/src/test/java/org/graylog/events/contentpack/facade/EventDefinitionFacadeTest.java +++ b/graylog2-server/src/test/java/org/graylog/events/contentpack/facade/EventDefinitionFacadeTest.java @@ -100,14 +100,14 @@ public class EventDefinitionFacadeTest { @Rule public final MongoDBInstance mongodb = MongoDBInstance.createForClass(); - private ObjectMapper objectMapper = new ObjectMapperProvider().get(); + private ObjectMapper objectMapper; private EventDefinitionFacade facade; @Rule public final MockitoRule mockitoRule = MockitoJUnit.rule(); - private MongoJackObjectMapperProvider mapperProvider = new MongoJackObjectMapperProvider(objectMapper); + private MongoJackObjectMapperProvider mapperProvider; @Mock private DBEventProcessorStateService stateService; @@ -129,11 +129,14 @@ public class EventDefinitionFacadeTest { @Before @SuppressForbidden("Using Executors.newSingleThreadExecutor() is okay in tests") public void setUp() throws Exception { + objectMapper = new ObjectMapperProvider().get(); objectMapper.registerSubtypes( AggregationEventProcessorConfig.class, PersistToStreamsStorageHandler.Config.class, TemplateFieldValueProvider.Config.class, AggregationEventProcessorConfigEntity.class); + mapperProvider = new MongoJackObjectMapperProvider(objectMapper); + stateService = mock(DBEventProcessorStateService.class); jobDefinitionService = mock(DBJobDefinitionService.class); jobTriggerService = mock(DBJobTriggerService.class); diff --git a/graylog2-server/src/test/java/org/graylog/events/contentpack/facade/NotificationFacadeTest.java b/graylog2-server/src/test/java/org/graylog/events/contentpack/facade/NotificationFacadeTest.java index 197762c4eeae..f0c0ca7c2392 100644 --- a/graylog2-server/src/test/java/org/graylog/events/contentpack/facade/NotificationFacadeTest.java +++ b/graylog2-server/src/test/java/org/graylog/events/contentpack/facade/NotificationFacadeTest.java @@ -73,7 +73,7 @@ public class NotificationFacadeTest { @Rule public final MongoDBInstance mongodb = MongoDBInstance.createForClass(); - private ObjectMapper objectMapper = new ObjectMapperProvider().get(); + private ObjectMapper objectMapper; private NotificationFacade facade; @@ -98,17 +98,20 @@ public class NotificationFacadeTest { @Rule public final MockitoRule mockitoRule = MockitoJUnit.rule(); - private MongoJackObjectMapperProvider mapperProvider = new MongoJackObjectMapperProvider(objectMapper); + private MongoJackObjectMapperProvider mapperProvider; @Before @SuppressForbidden("Using Executors.newSingleThreadExecutor() is okay in tests") public void setUp() throws Exception { + objectMapper = new ObjectMapperProvider().get(); objectMapper.registerSubtypes( EmailEventNotificationConfig.class, EmailEventNotificationConfigEntity.class, HttpEventNotificationConfigEntity.class, HTTPEventNotificationConfig.class ); + mapperProvider = new MongoJackObjectMapperProvider(objectMapper); + jobDefinitionService = mock(DBJobDefinitionService.class); stateService = mock(DBEventProcessorStateService.class); eventDefinitionService = new DBEventDefinitionService(mongodb.mongoConnection(), mapperProvider, stateService, mock(EntityOwnershipService.class), null); diff --git a/graylog2-server/src/test/java/org/graylog/plugins/views/migrations/V20200204122000_MigrateUntypedViewsToDashboardsTest.java b/graylog2-server/src/test/java/org/graylog/plugins/views/migrations/V20200204122000_MigrateUntypedViewsToDashboardsTest.java index b14aff42d7ad..a832627783da 100644 --- a/graylog2-server/src/test/java/org/graylog/plugins/views/migrations/V20200204122000_MigrateUntypedViewsToDashboardsTest.java +++ b/graylog2-server/src/test/java/org/graylog/plugins/views/migrations/V20200204122000_MigrateUntypedViewsToDashboardsTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.util.StdDateFormat; import com.mongodb.BasicDBObject; import com.mongodb.client.MongoCollection; import com.mongodb.client.MongoDatabase; @@ -73,7 +74,8 @@ public class V20200204122000_MigrateUntypedViewsToDashboardsTest { @Mock private ClusterConfigService clusterConfigService; - private final ObjectMapper objectMapper = new ObjectMapperProvider().get(); + private final ObjectMapper objectMapper = new ObjectMapperProvider().get() + .setDateFormat(new StdDateFormat().withColonInTimeZone(false)); private Migration migration; private MongoCollection viewsCollection; diff --git a/graylog2-server/src/test/java/org/graylog2/jackson/MongoJodaDateTimeSerializerTest.java b/graylog2-server/src/test/java/org/graylog2/jackson/MongoJodaDateTimeSerializerTest.java index 107b871fbc6f..a1f3b17e3b97 100644 --- a/graylog2-server/src/test/java/org/graylog2/jackson/MongoJodaDateTimeSerializerTest.java +++ b/graylog2-server/src/test/java/org/graylog2/jackson/MongoJodaDateTimeSerializerTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.util.StdDateFormat; import org.graylog2.shared.bindings.providers.ObjectMapperProvider; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; @@ -26,7 +27,8 @@ import static org.assertj.core.api.Assertions.assertThat; public class MongoJodaDateTimeSerializerTest { - private final ObjectMapper objectMapper = new ObjectMapperProvider().get(); + private final ObjectMapper objectMapper = new ObjectMapperProvider().get() + .setDateFormat(new StdDateFormat().withColonInTimeZone(false)); @Test public void serializeZonedDateTime() throws Exception { @@ -54,4 +56,4 @@ public TestBean(DateTime dateTime) { this.dateTime = dateTime; } } -} \ No newline at end of file +} diff --git a/graylog2-server/src/test/java/org/graylog2/jackson/MongoZonedDateTimeSerializerTest.java b/graylog2-server/src/test/java/org/graylog2/jackson/MongoZonedDateTimeSerializerTest.java index 69d0c55c8f88..607f61549f6d 100644 --- a/graylog2-server/src/test/java/org/graylog2/jackson/MongoZonedDateTimeSerializerTest.java +++ b/graylog2-server/src/test/java/org/graylog2/jackson/MongoZonedDateTimeSerializerTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.util.StdDateFormat; import org.graylog2.shared.bindings.providers.ObjectMapperProvider; import org.junit.Test; @@ -27,7 +28,8 @@ import static org.assertj.core.api.Assertions.assertThat; public class MongoZonedDateTimeSerializerTest { - private final ObjectMapper objectMapper = new ObjectMapperProvider().get(); + private final ObjectMapper objectMapper = new ObjectMapperProvider().get() + .setDateFormat(new StdDateFormat().withColonInTimeZone(false)); @Test public void serializeZonedDateTime() throws Exception { @@ -55,4 +57,4 @@ public TestBean(ZonedDateTime dateTime) { this.dateTime = dateTime; } } -} \ No newline at end of file +} diff --git a/graylog2-server/src/test/java/org/graylog2/plugin/MessageSummaryTest.java b/graylog2-server/src/test/java/org/graylog2/plugin/MessageSummaryTest.java index f0a2e8ebd464..6ed59e3ffed1 100644 --- a/graylog2-server/src/test/java/org/graylog2/plugin/MessageSummaryTest.java +++ b/graylog2-server/src/test/java/org/graylog2/plugin/MessageSummaryTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.type.MapType; +import com.fasterxml.jackson.datatype.joda.JodaModule; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; @@ -27,7 +28,6 @@ import org.junit.Test; import java.util.HashMap; -import java.util.List; import java.util.Map; import static org.assertj.core.api.Assertions.assertThat; @@ -91,7 +91,7 @@ public void testGetFields() throws Exception { @Test public void testJSONSerialization() throws Exception { - final ObjectMapper mapper = new ObjectMapper(); + final ObjectMapper mapper = new ObjectMapper().registerModule(new JodaModule()); final MapType valueType = mapper.getTypeFactory().constructMapType(HashMap.class, String.class, Object.class); final Map map = mapper.readValue(mapper.writeValueAsBytes(messageSummary), valueType); diff --git a/pom.xml b/pom.xml index 9e48e12c67fb..2c80ec72c55f 100644 --- a/pom.xml +++ b/pom.xml @@ -117,6 +117,8 @@ 2.1.12 6.1.2.Final 2.6.1 + 2.13.4 + 0.14.0 2.9.10.20200411 0.14.0 0.9.0 From 8575e099a0c5b5ec2c95e62ce2548722d8c75e12 Mon Sep 17 00:00:00 2001 From: patrick Date: Fri, 7 Oct 2022 10:36:00 +0200 Subject: [PATCH 02/10] remove obsolete dependency --- graylog2-server/pom.xml | 6 ------ ...V20200204122000_MigrateUntypedViewsToDashboardsTest.java | 4 +--- .../graylog2/jackson/MongoJodaDateTimeSerializerTest.java | 4 +--- .../graylog2/jackson/MongoZonedDateTimeSerializerTest.java | 4 +--- 4 files changed, 3 insertions(+), 15 deletions(-) diff --git a/graylog2-server/pom.xml b/graylog2-server/pom.xml index d489b1e56843..ade65a02b50d 100644 --- a/graylog2-server/pom.xml +++ b/graylog2-server/pom.xml @@ -178,12 +178,6 @@ com.fasterxml.jackson.module jackson-module-jsonSchema - - - com.fasterxml.jackson.module - jackson-module-scala_3 - 2.13.4 - com.fasterxml.jackson.jaxrs jackson-jaxrs-json-provider diff --git a/graylog2-server/src/test/java/org/graylog/plugins/views/migrations/V20200204122000_MigrateUntypedViewsToDashboardsTest.java b/graylog2-server/src/test/java/org/graylog/plugins/views/migrations/V20200204122000_MigrateUntypedViewsToDashboardsTest.java index a832627783da..b14aff42d7ad 100644 --- a/graylog2-server/src/test/java/org/graylog/plugins/views/migrations/V20200204122000_MigrateUntypedViewsToDashboardsTest.java +++ b/graylog2-server/src/test/java/org/graylog/plugins/views/migrations/V20200204122000_MigrateUntypedViewsToDashboardsTest.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.util.StdDateFormat; import com.mongodb.BasicDBObject; import com.mongodb.client.MongoCollection; import com.mongodb.client.MongoDatabase; @@ -74,8 +73,7 @@ public class V20200204122000_MigrateUntypedViewsToDashboardsTest { @Mock private ClusterConfigService clusterConfigService; - private final ObjectMapper objectMapper = new ObjectMapperProvider().get() - .setDateFormat(new StdDateFormat().withColonInTimeZone(false)); + private final ObjectMapper objectMapper = new ObjectMapperProvider().get(); private Migration migration; private MongoCollection viewsCollection; diff --git a/graylog2-server/src/test/java/org/graylog2/jackson/MongoJodaDateTimeSerializerTest.java b/graylog2-server/src/test/java/org/graylog2/jackson/MongoJodaDateTimeSerializerTest.java index a1f3b17e3b97..e33ab9ae262f 100644 --- a/graylog2-server/src/test/java/org/graylog2/jackson/MongoJodaDateTimeSerializerTest.java +++ b/graylog2-server/src/test/java/org/graylog2/jackson/MongoJodaDateTimeSerializerTest.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.databind.util.StdDateFormat; import org.graylog2.shared.bindings.providers.ObjectMapperProvider; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; @@ -27,8 +26,7 @@ import static org.assertj.core.api.Assertions.assertThat; public class MongoJodaDateTimeSerializerTest { - private final ObjectMapper objectMapper = new ObjectMapperProvider().get() - .setDateFormat(new StdDateFormat().withColonInTimeZone(false)); + private final ObjectMapper objectMapper = new ObjectMapperProvider().get(); @Test public void serializeZonedDateTime() throws Exception { diff --git a/graylog2-server/src/test/java/org/graylog2/jackson/MongoZonedDateTimeSerializerTest.java b/graylog2-server/src/test/java/org/graylog2/jackson/MongoZonedDateTimeSerializerTest.java index 607f61549f6d..c7c4abbb352b 100644 --- a/graylog2-server/src/test/java/org/graylog2/jackson/MongoZonedDateTimeSerializerTest.java +++ b/graylog2-server/src/test/java/org/graylog2/jackson/MongoZonedDateTimeSerializerTest.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.databind.util.StdDateFormat; import org.graylog2.shared.bindings.providers.ObjectMapperProvider; import org.junit.Test; @@ -28,8 +27,7 @@ import static org.assertj.core.api.Assertions.assertThat; public class MongoZonedDateTimeSerializerTest { - private final ObjectMapper objectMapper = new ObjectMapperProvider().get() - .setDateFormat(new StdDateFormat().withColonInTimeZone(false)); + private final ObjectMapper objectMapper = new ObjectMapperProvider().get(); @Test public void serializeZonedDateTime() throws Exception { From e88025d12592ae618bda008aec222bf183e7a378 Mon Sep 17 00:00:00 2001 From: patrick Date: Fri, 7 Oct 2022 12:00:16 +0200 Subject: [PATCH 03/10] add missing @Id annotation --- .../java/org/graylog2/database/PaginatedDbServiceTest.java | 3 +-- .../org/graylog2/security/encryption/EncryptedValueTest.java | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/graylog2-server/src/test/java/org/graylog2/database/PaginatedDbServiceTest.java b/graylog2-server/src/test/java/org/graylog2/database/PaginatedDbServiceTest.java index 039c6fd11b4a..a77442b36508 100644 --- a/graylog2-server/src/test/java/org/graylog2/database/PaginatedDbServiceTest.java +++ b/graylog2-server/src/test/java/org/graylog2/database/PaginatedDbServiceTest.java @@ -26,7 +26,6 @@ import org.graylog2.bindings.providers.MongoJackObjectMapperProvider; import org.junit.After; import org.junit.Before; -import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; import org.mongojack.DBQuery; @@ -56,7 +55,7 @@ public static class TestDTO { public String title; @JsonCreator - public TestDTO(@JsonProperty("id") String id, @JsonProperty("title") String title) { + public TestDTO(@JsonProperty("id") @Id String id, @JsonProperty("title") String title) { this.id = id; this.title = title; } diff --git a/graylog2-server/src/test/java/org/graylog2/security/encryption/EncryptedValueTest.java b/graylog2-server/src/test/java/org/graylog2/security/encryption/EncryptedValueTest.java index 543956131536..6227846fe69c 100644 --- a/graylog2-server/src/test/java/org/graylog2/security/encryption/EncryptedValueTest.java +++ b/graylog2-server/src/test/java/org/graylog2/security/encryption/EncryptedValueTest.java @@ -203,7 +203,7 @@ public static TestDTO create(@JsonProperty EncryptedValue passwordValue) { } @JsonCreator - public static TestDTO create(@JsonProperty("id") String id, @JsonProperty("password_value") EncryptedValue passwordValue) { + public static TestDTO create(@JsonProperty("id") @Id String id, @JsonProperty("password_value") EncryptedValue passwordValue) { return new AutoValue_EncryptedValueTest_TestDTO(id, passwordValue); } } From 7c90b395757dc52dbc299a21783cb86664546103 Mon Sep 17 00:00:00 2001 From: patrick Date: Tue, 11 Oct 2022 12:20:01 +0200 Subject: [PATCH 04/10] use OjectMapperProvider in unit test --- .../test/java/org/graylog2/plugin/MessageSummaryTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/graylog2-server/src/test/java/org/graylog2/plugin/MessageSummaryTest.java b/graylog2-server/src/test/java/org/graylog2/plugin/MessageSummaryTest.java index 6ed59e3ffed1..8cd727a80c91 100644 --- a/graylog2-server/src/test/java/org/graylog2/plugin/MessageSummaryTest.java +++ b/graylog2-server/src/test/java/org/graylog2/plugin/MessageSummaryTest.java @@ -18,10 +18,10 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.type.MapType; -import com.fasterxml.jackson.datatype.joda.JodaModule; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; +import org.graylog2.shared.bindings.providers.ObjectMapperProvider; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; import org.junit.Before; @@ -91,12 +91,12 @@ public void testGetFields() throws Exception { @Test public void testJSONSerialization() throws Exception { - final ObjectMapper mapper = new ObjectMapper().registerModule(new JodaModule()); + final ObjectMapper mapper = new ObjectMapperProvider().get(); final MapType valueType = mapper.getTypeFactory().constructMapType(HashMap.class, String.class, Object.class); final Map map = mapper.readValue(mapper.writeValueAsBytes(messageSummary), valueType); - assertEquals(Sets.newHashSet("id", "timestamp", "message", "index", "source", "streamIds", "fields"), map.keySet()); + assertEquals(Sets.newHashSet("id", "timestamp", "message", "index", "source", "stream_ids", "fields"), map.keySet()); } @Test From 1b2e320069a08ff51f6348e7ea4a561a26ee1d59 Mon Sep 17 00:00:00 2001 From: patrick Date: Tue, 11 Oct 2022 16:46:14 +0200 Subject: [PATCH 05/10] scala_3 dependency --- graylog2-server/pom.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/graylog2-server/pom.xml b/graylog2-server/pom.xml index ade65a02b50d..31fc09ebb555 100644 --- a/graylog2-server/pom.xml +++ b/graylog2-server/pom.xml @@ -178,6 +178,11 @@ com.fasterxml.jackson.module jackson-module-jsonSchema + + com.fasterxml.jackson.module + jackson-module-scala_3 + 2.13.4 + com.fasterxml.jackson.jaxrs jackson-jaxrs-json-provider From 406c730075a419f82cf9a3db747f688ac3bcba31 Mon Sep 17 00:00:00 2001 From: patrick Date: Tue, 11 Oct 2022 17:08:49 +0200 Subject: [PATCH 06/10] disable timestamps for durations in ObjectMapperProvider --- .../graylog2/shared/bindings/providers/ObjectMapperProvider.java | 1 + 1 file changed, 1 insertion(+) diff --git a/graylog2-server/src/main/java/org/graylog2/shared/bindings/providers/ObjectMapperProvider.java b/graylog2-server/src/main/java/org/graylog2/shared/bindings/providers/ObjectMapperProvider.java index 3991ff28dfe4..6d827f568ce7 100644 --- a/graylog2-server/src/main/java/org/graylog2/shared/bindings/providers/ObjectMapperProvider.java +++ b/graylog2-server/src/main/java/org/graylog2/shared/bindings/providers/ObjectMapperProvider.java @@ -110,6 +110,7 @@ public ObjectMapperProvider(@GraylogClassLoader final ClassLoader classLoader, this.objectMapper = mapper .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) + .disable(SerializationFeature.WRITE_DURATIONS_AS_TIMESTAMPS) .disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE) .disable(DeserializationFeature.FAIL_ON_MISSING_EXTERNAL_TYPE_ID_PROPERTY) .setPropertyNamingStrategy(new PropertyNamingStrategy.SnakeCaseStrategy()) From 92438b9ddea5f181d6aeb0e6e6d119a3961da7d6 Mon Sep 17 00:00:00 2001 From: patrick Date: Tue, 11 Oct 2022 21:56:56 +0200 Subject: [PATCH 07/10] fix copy-paste error in pom --- pom.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/pom.xml b/pom.xml index 2c80ec72c55f..7f304dfedfe4 100644 --- a/pom.xml +++ b/pom.xml @@ -119,8 +119,6 @@ 2.6.1 2.13.4 0.14.0 - 2.9.10.20200411 - 0.14.0 0.9.0 1.3.2 3.0.0 From d98db6ed91265917658e923b9a146fe1bcdeb59c Mon Sep 17 00:00:00 2001 From: patrick Date: Thu, 13 Oct 2022 10:06:29 +0200 Subject: [PATCH 08/10] move scala_3 dependency to backend tests --- full-backend-tests/pom.xml | 5 +++++ graylog2-server/pom.xml | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/full-backend-tests/pom.xml b/full-backend-tests/pom.xml index ecd82822148d..c6901a79c50c 100644 --- a/full-backend-tests/pom.xml +++ b/full-backend-tests/pom.xml @@ -139,6 +139,11 @@ jackson-databind test + + com.fasterxml.jackson.module + jackson-module-scala_3 + test + commons-io commons-io diff --git a/graylog2-server/pom.xml b/graylog2-server/pom.xml index 31fc09ebb555..ade65a02b50d 100644 --- a/graylog2-server/pom.xml +++ b/graylog2-server/pom.xml @@ -178,11 +178,6 @@ com.fasterxml.jackson.module jackson-module-jsonSchema - - com.fasterxml.jackson.module - jackson-module-scala_3 - 2.13.4 - com.fasterxml.jackson.jaxrs jackson-jaxrs-json-provider From 09c2ac342ed4de01bd008732a4b9469193901060 Mon Sep 17 00:00:00 2001 From: patrick Date: Tue, 18 Oct 2022 11:59:32 +0200 Subject: [PATCH 09/10] Jackson micropatch for security issue --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7f304dfedfe4..8ee9afee05f6 100644 --- a/pom.xml +++ b/pom.xml @@ -117,7 +117,7 @@ 2.1.12 6.1.2.Final 2.6.1 - 2.13.4 + 2.13.4.20221013 0.14.0 0.9.0 1.3.2 From 0a42702afa5bac87fbeede3e351a1409a8a4dd88 Mon Sep 17 00:00:00 2001 From: Bernd Ahlers Date: Tue, 18 Oct 2022 15:10:57 +0200 Subject: [PATCH 10/10] Fix newline-only change