Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changes

## Version 2.0.0

* Upgrade ecChronos to Spring Boot 4 - Issue #1711

## Version 1.0.5

* Bump Spring Boot to 3.5.16 and override Tomcat embed to 10.1.56 to fix CVE-2026-53434 - Issue #1706
Expand Down
4 changes: 2 additions & 2 deletions application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,12 @@

<!-- Jackson -->
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<groupId>tools.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<groupId>tools.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@
import com.ericsson.bss.cassandra.ecchronos.application.config.runpolicy.RunPolicyConfig;
import com.ericsson.bss.cassandra.ecchronos.application.config.scheduler.SchedulerConfig;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
import tools.jackson.databind.ObjectMapper;
import tools.jackson.databind.json.JsonMapper;
import tools.jackson.core.JacksonException;

public class Config
{
Expand Down Expand Up @@ -169,12 +168,10 @@ public String toString()
{
try
{
ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(new Jdk8Module());
mapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
ObjectMapper mapper = JsonMapper.builder().build();
return mapper.writeValueAsString(this);
}
catch (JsonProcessingException e)
catch (JacksonException e)
{
return "Config{error=" + e.getMessage() + "}";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
import java.nio.file.FileSystems;
import java.nio.file.Path;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import tools.jackson.databind.ObjectMapper;
import tools.jackson.dataformat.yaml.YAMLMapper;
import tools.jackson.core.JacksonException;

public class ConfigurationHelper
{
Expand Down Expand Up @@ -76,7 +77,7 @@ private <T> T getConfiguration(final File configurationFile, final Class<T> claz
{
try
{
ObjectMapper objectMapper = new ObjectMapper(new YAMLFactory());
ObjectMapper objectMapper = new YAMLMapper();

T config = objectMapper.readValue(configurationFile, clazz);
if (config == null)
Expand All @@ -85,7 +86,7 @@ private <T> T getConfiguration(final File configurationFile, final Class<T> claz
}
return config;
}
catch (IOException e)
catch (JacksonException | IOException e)
{
throw new ConfigurationException("Unable to load configuration file " + configurationFile, e);
}
Expand All @@ -96,7 +97,7 @@ private <T> T getConfiguration(final InputStream configurationFile,
{
try
{
ObjectMapper objectMapper = new ObjectMapper(new YAMLFactory());
ObjectMapper objectMapper = new YAMLMapper();

T config = objectMapper.readValue(configurationFile, clazz);
if (config == null)
Expand All @@ -105,7 +106,7 @@ private <T> T getConfiguration(final InputStream configurationFile,
}
return config;
}
catch (IOException e)
catch (JacksonException | IOException e)
{
throw new ConfigurationException("Unable to load configuration file from classpath", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
package com.ericsson.bss.cassandra.ecchronos.application.config.security;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
import tools.jackson.databind.ObjectMapper;
import tools.jackson.databind.json.JsonMapper;
import tools.jackson.core.JacksonException;

public final class Security
{
Expand Down Expand Up @@ -59,12 +58,10 @@ public String toString()
{
try
{
ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(new Jdk8Module());
mapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
ObjectMapper mapper = JsonMapper.builder().build();
return mapper.writeValueAsString(this);
}
catch (JsonProcessingException e)
catch (JacksonException e)
{
return "Security{error=" + e.getMessage() + "}";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory;
import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory;
import org.springframework.boot.web.server.servlet.ConfigurableServletWebServerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;
Expand All @@ -73,7 +73,6 @@ public class BeanConfigurator

private static final String CONFIGURATION_FILE = "ecc.yml";
private static final String SECURITY_FILE = "security.yml";
private static final String ECCHORONS_ID_PRE_STRING = "ecchronos-";

private final AtomicReference<Security.CqlSecurity> cqlSecurity = new AtomicReference<>();
private final AtomicReference<Security.JmxSecurity> jmxSecurity = new AtomicReference<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.http.HttpStatus;
import org.springframework.web.filter.OncePerRequestFilter;

Expand Down Expand Up @@ -129,6 +130,7 @@ public PrometheusMeterRegistry prometheusMeterRegistry()
}

@Bean
@Primary
public CompositeMeterRegistry eccCompositeMeterRegistry()
{
return myCompositeMeterRegistry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory;
import org.springframework.boot.web.server.Ssl;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.scheduling.annotation.EnableScheduling;
Expand Down Expand Up @@ -59,7 +59,7 @@ public final void customize(final TomcatServletWebServerFactory factory)
{
if (metricsServerProperties.isEnabled())
{
factory.addAdditionalTomcatConnectors(metricsConnector());
factory.addAdditionalConnectors(metricsConnector());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
import com.ericsson.bss.cassandra.ecchronos.utils.enums.repair.RepairHistoryProvider;
import com.ericsson.bss.cassandra.ecchronos.utils.enums.repair.RepairType;
import com.ericsson.bss.cassandra.ecchronos.utils.exceptions.ConfigurationException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import tools.jackson.databind.ObjectMapper;
import tools.jackson.dataformat.yaml.YAMLMapper;

import java.util.concurrent.TimeUnit;
import org.junit.Before;
Expand Down Expand Up @@ -56,7 +56,7 @@ public void setup() throws IOException

File file = new File(classLoader.getResource(DEFAULT_AGENT_FILE_NAME).getFile());

ObjectMapper objectMapper = new ObjectMapper(new YAMLFactory());
ObjectMapper objectMapper = new YAMLMapper();

config = objectMapper.readValue(file, Config.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
import com.ericsson.bss.cassandra.ecchronos.application.providers.AgentJmxConnectionProvider;
import com.ericsson.bss.cassandra.ecchronos.utils.enums.repair.RepairHistoryProvider;
import com.ericsson.bss.cassandra.ecchronos.utils.enums.repair.RepairType;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import tools.jackson.databind.ObjectMapper;
import tools.jackson.dataformat.yaml.YAMLMapper;

import org.junit.Before;
import org.junit.Test;

Expand All @@ -48,7 +49,7 @@ public void setup() throws IOException

File file = new File(classLoader.getResource(DEFAULT_AGENT_FILE_NAME).getFile());

ObjectMapper objectMapper = new ObjectMapper(new YAMLFactory());
ObjectMapper objectMapper = new YAMLMapper();

config = objectMapper.readValue(file, Config.class);
repairConfig = config.getRepairConfig();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
package com.ericsson.bss.cassandra.ecchronos.application.config.lockfactory;

import com.ericsson.bss.cassandra.ecchronos.application.config.Config;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import tools.jackson.databind.ObjectMapper;
import tools.jackson.dataformat.yaml.YAMLMapper;

import org.junit.Test;

import java.io.File;
Expand Down Expand Up @@ -48,7 +49,7 @@ private CasLockFactoryConfig getCasLockFactoryConfig(final String fileName) thro
{
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
File file = new File(classLoader.getResource(fileName).getFile());
ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
ObjectMapper mapper = new YAMLMapper();
Config config = mapper.readValue(file, Config.class);
return config.getLockFactory().getCasLockFactoryConfig();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
import java.io.File;
import java.util.concurrent.TimeUnit;

import com.fasterxml.jackson.databind.JsonMappingException;
import org.junit.Test;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import tools.jackson.databind.ObjectMapper;
import tools.jackson.dataformat.yaml.YAMLMapper;
import tools.jackson.databind.DatabindException;

public class TestRepairSchedule
{
Expand All @@ -38,7 +38,7 @@ public void testDefault() throws Exception
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
File file = new File(classLoader.getResource("schedule.yml").getFile());

ObjectMapper objectMapper = new ObjectMapper(new YAMLFactory());
ObjectMapper objectMapper = new YAMLMapper();

RepairSchedule schedule = objectMapper.readValue(file, RepairSchedule.class);

Expand All @@ -51,7 +51,7 @@ public void testSettings() throws Exception
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
File file = new File(classLoader.getResource("repair/test_schedule.yml").getFile());

ObjectMapper objectMapper = new ObjectMapper(new YAMLFactory());
ObjectMapper objectMapper = new YAMLMapper();

RepairSchedule schedule = objectMapper.readValue(file, RepairSchedule.class);

Expand Down Expand Up @@ -90,7 +90,7 @@ public void testRegex() throws Exception
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
File file = new File(classLoader.getResource("repair/regex_schedule.yml").getFile());

ObjectMapper objectMapper = new ObjectMapper(new YAMLFactory());
ObjectMapper objectMapper = new YAMLMapper();

RepairSchedule schedule = objectMapper.readValue(file, RepairSchedule.class);

Expand Down Expand Up @@ -131,7 +131,7 @@ public void testMultipleSchedulesForSameTable() throws Exception
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
File file = new File(classLoader.getResource("repair/multiple_schedules.yml").getFile());

ObjectMapper objectMapper = new ObjectMapper(new YAMLFactory());
ObjectMapper objectMapper = new YAMLMapper();

RepairSchedule schedule = objectMapper.readValue(file, RepairSchedule.class);

Expand All @@ -155,7 +155,7 @@ public void testMultipleSchedulesForSameTableRegex() throws Exception
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
File file = new File(classLoader.getResource("repair/multiple_schedules_regex.yml").getFile());

ObjectMapper objectMapper = new ObjectMapper(new YAMLFactory());
ObjectMapper objectMapper = new YAMLMapper();

RepairSchedule schedule = objectMapper.readValue(file, RepairSchedule.class);

Expand All @@ -180,9 +180,9 @@ public void testRepairIntervalLongerThanWarn()
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
File file = new File(classLoader.getResource("repair/schedule_repair_interval_longer_than_warn.yml").getFile());

ObjectMapper objectMapper = new ObjectMapper(new YAMLFactory());
ObjectMapper objectMapper = new YAMLMapper();

assertThatExceptionOfType(JsonMappingException.class).isThrownBy(() -> objectMapper.readValue(file, RepairSchedule.class));
assertThatExceptionOfType(DatabindException.class).isThrownBy(() -> objectMapper.readValue(file, RepairSchedule.class));
}

@Test
Expand All @@ -191,8 +191,8 @@ public void testWarnIntervalLongerThanError()
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
File file = new File(classLoader.getResource("repair/schedule_warn_interval_longer_than_error.yml").getFile());

ObjectMapper objectMapper = new ObjectMapper(new YAMLFactory());
ObjectMapper objectMapper = new YAMLMapper();

assertThatExceptionOfType(JsonMappingException.class).isThrownBy(() -> objectMapper.readValue(file, RepairSchedule.class));
assertThatExceptionOfType(DatabindException.class).isThrownBy(() -> objectMapper.readValue(file, RepairSchedule.class));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
*/
package com.ericsson.bss.cassandra.ecchronos.application.config.security;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.exc.ValueInstantiationException;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import tools.jackson.databind.ObjectMapper;
import tools.jackson.databind.exc.ValueInstantiationException;
import tools.jackson.dataformat.yaml.YAMLMapper;

import org.junit.Test;

import java.io.File;
Expand All @@ -32,7 +33,7 @@ public void testDefault() throws Exception
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
File file = new File(classLoader.getResource("security.yml").getFile());

ObjectMapper objectMapper = new ObjectMapper(new YAMLFactory());
ObjectMapper objectMapper = new YAMLMapper();

Security config = objectMapper.readValue(file, Security.class);

Expand Down Expand Up @@ -61,7 +62,7 @@ public void testCqlAndJmxEnabledKeyStore() throws Exception
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
File file = new File(classLoader.getResource("security/enabled_keystore_jmxandcql.yml").getFile());

ObjectMapper objectMapper = new ObjectMapper(new YAMLFactory());
ObjectMapper objectMapper = new YAMLMapper();

Security config = objectMapper.readValue(file, Security.class);

Expand Down Expand Up @@ -93,7 +94,7 @@ public void testCqlEnabledWithCertificate() throws Exception
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
File file = new File(classLoader.getResource("security/enabled_pem_cql.yml").getFile());

ObjectMapper objectMapper = new ObjectMapper(new YAMLFactory());
ObjectMapper objectMapper = new YAMLMapper();

Security config = objectMapper.readValue(file, Security.class);

Expand All @@ -115,7 +116,7 @@ public void testCqlEnabledWithNothing()
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
File file = new File(classLoader.getResource("security/enabled_nokeystore_nopem_cql.yml").getFile());

ObjectMapper objectMapper = new ObjectMapper(new YAMLFactory());
ObjectMapper objectMapper = new YAMLMapper();

assertThatExceptionOfType(ValueInstantiationException.class).isThrownBy(() -> objectMapper.readValue(file, Security.class));
}
Expand All @@ -126,7 +127,7 @@ public void testJmxEnabledWithNothing()
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
File file = new File(classLoader.getResource("security/enabled_nokeystore_nopem_jmx.yml").getFile());

ObjectMapper objectMapper = new ObjectMapper(new YAMLFactory());
ObjectMapper objectMapper = new YAMLMapper();

assertThatExceptionOfType(ValueInstantiationException.class).isThrownBy(() -> objectMapper.readValue(file, Security.class));
}
Expand Down
Loading