diff --git a/config-examples/pom.xml b/config-examples/pom.xml index 6c9066c4..bcd3cb17 100644 --- a/config-examples/pom.xml +++ b/config-examples/pom.xml @@ -1,5 +1,7 @@ - + io.scalecube @@ -10,35 +12,12 @@ scalecube-config-examples - - 2.17.1 - - io.scalecube scalecube-config ${project.version} - - io.scalecube - scalecube-config-mongo - ${project.version} - - - io.scalecube - scalecube-config-http-server - ${project.version} - - - org.apache.logging.log4j - log4j-slf4j-impl - ${log4j.version} - - - org.apache.logging.log4j - log4j-core - ${log4j.version} - + diff --git a/config-examples/src/main/java/io/scalecube/config/examples/ConfigRegistryExample.java b/config-examples/src/main/java/io/scalecube/config/examples/ConfigRegistryExample.java index 57a5bfaf..5a2b1111 100644 --- a/config-examples/src/main/java/io/scalecube/config/examples/ConfigRegistryExample.java +++ b/config-examples/src/main/java/io/scalecube/config/examples/ConfigRegistryExample.java @@ -4,7 +4,6 @@ import io.scalecube.config.ConfigRegistrySettings; import io.scalecube.config.StringConfigProperty; import io.scalecube.config.audit.Slf4JConfigEventListener; -import io.scalecube.config.http.server.ConfigRegistryHttpServer; import io.scalecube.config.source.ClassPathConfigSource; import io.scalecube.config.source.FileDirectoryConfigSource; import java.nio.file.Path; @@ -37,8 +36,5 @@ public static void main(String[] args) { StringConfigProperty orderedProp1 = configRegistry.stringProperty("orderedProp1"); System.out.println("### Matched by first predicate orderedProp1=" + orderedProp1.value().get()); - - // Start REST HTTP Server - ConfigRegistryHttpServer.create(configRegistry, 5050); } } diff --git a/config-examples/src/main/java/io/scalecube/config/examples/DemoConfig.java b/config-examples/src/main/java/io/scalecube/config/examples/DemoConfig.java index 8adf4958..5e35a7cd 100644 --- a/config-examples/src/main/java/io/scalecube/config/examples/DemoConfig.java +++ b/config-examples/src/main/java/io/scalecube/config/examples/DemoConfig.java @@ -4,11 +4,6 @@ import io.scalecube.config.ConfigRegistrySettings; import io.scalecube.config.StringConfigProperty; import io.scalecube.config.audit.Slf4JConfigEventListener; -import io.scalecube.config.http.server.ConfigRegistryHttpServer; -import io.scalecube.config.keyvalue.KeyValueConfigSource; -import io.scalecube.config.mongo.MongoConfigConnector; -import io.scalecube.config.mongo.MongoConfigEventListener; -import io.scalecube.config.mongo.MongoConfigRepository; import io.scalecube.config.source.FileDirectoryConfigSource; import java.nio.file.Path; import java.util.function.Predicate; @@ -28,14 +23,6 @@ public static void main(String[] args) { String configSourceCollectionName = "MongoConfigRepository"; String auditLogCollectionName = "TestConfigurationAuditLog"; - MongoConfigConnector connector = MongoConfigConnector.builder().forUri(uri).build(); - - KeyValueConfigSource mongoConfigSource = - KeyValueConfigSource.withRepository( - new MongoConfigRepository(connector), configSourceCollectionName) - .groups("group2", "group1", "root") - .build(); - // Local resource cfg source init Predicate propsPredicate = path -> path.toString().endsWith(".props"); String basePath = "config-examples/config"; @@ -46,9 +33,7 @@ public static void main(String[] args) { ConfigRegistrySettings.builder() .addLastSource( "ConfigDirectory", new FileDirectoryConfigSource(basePath, propsPredicate)) - .addLastSource("MongoConfig", mongoConfigSource) .addListener(new Slf4JConfigEventListener()) - .addListener(new MongoConfigEventListener(connector, auditLogCollectionName)) .keepRecentConfigEvents(10) .reloadIntervalSec(3) .jmxEnabled(true) @@ -57,9 +42,6 @@ public static void main(String[] args) { // Inject cfgReg into target component SomeComponent component = new SomeComponent(configRegistry); - - // Start REST HTTP Server - ConfigRegistryHttpServer.create(configRegistry, 5050); } static class SomeComponent { diff --git a/config-examples/src/main/java/io/scalecube/config/examples/JsonObjectExample.java b/config-examples/src/main/java/io/scalecube/config/examples/JsonObjectExample.java deleted file mode 100644 index 93ba70d5..00000000 --- a/config-examples/src/main/java/io/scalecube/config/examples/JsonObjectExample.java +++ /dev/null @@ -1,67 +0,0 @@ -package io.scalecube.config.examples; - -import com.fasterxml.jackson.databind.ObjectMapper; -import io.scalecube.config.ConfigRegistry; -import io.scalecube.config.ConfigRegistrySettings; -import io.scalecube.config.audit.Slf4JConfigEventListener; -import io.scalecube.config.source.SystemPropertiesConfigSource; -import io.scalecube.config.utils.ThrowableUtil; -import java.util.function.Function; - -public class JsonObjectExample { - - private static final int RELOAD_INTERVAL_SEC = 3; - - private static final ObjectMapper objectMapper = new ObjectMapper(); - - /** - * Main method of example of how to read json value from config registry. - * - * @param args program arguments - */ - public static void main(String[] args) { - System.setProperty("jsonKey", "{\"name\":\"property\",\"value\":1322134}"); - - ConfigRegistrySettings configRegistrySettings = - ConfigRegistrySettings.builder() - .reloadIntervalSec(RELOAD_INTERVAL_SEC) - .jmxEnabled(false) - .addListener(new Slf4JConfigEventListener()) - .addLastSource("systemProperties", new SystemPropertiesConfigSource()) - .build(); - - ConfigRegistry configRegistry = ConfigRegistry.create(configRegistrySettings); - - JsonEntity entity = - configRegistry.objectProperty("jsonKey", mapper(JsonEntity.class)).value(null); - System.out.println("entity = " + entity); - } - - static class JsonEntity { - private String name; - private Integer value; - - public void setName(String name) { - this.name = name; - } - - public void setValue(Integer value) { - this.value = value; - } - - @Override - public String toString() { - return name + ":" + value; - } - } - - private static Function mapper(Class clazz) { - return value -> { - try { - return objectMapper.readValue(value, clazz); - } catch (Exception e) { - throw ThrowableUtil.propagate(e); - } - }; - } -} diff --git a/config-examples/src/main/java/io/scalecube/config/examples/MongoConfigExample.java b/config-examples/src/main/java/io/scalecube/config/examples/MongoConfigExample.java deleted file mode 100644 index f0a65394..00000000 --- a/config-examples/src/main/java/io/scalecube/config/examples/MongoConfigExample.java +++ /dev/null @@ -1,93 +0,0 @@ -package io.scalecube.config.examples; - -import io.scalecube.config.ConfigRegistry; -import io.scalecube.config.ConfigRegistrySettings; -import io.scalecube.config.StringConfigProperty; -import io.scalecube.config.audit.Slf4JConfigEventListener; -import io.scalecube.config.keyvalue.KeyValueConfigSource; -import io.scalecube.config.mongo.MongoConfigConnector; -import io.scalecube.config.mongo.MongoConfigEventListener; -import io.scalecube.config.mongo.MongoConfigRepository; - -/** - * For program properly functioning add some data to mogno. - * - *
    - *
  • Collection {@code group1.config_source} must have: {@code prop1->value-from-group1} - *
  • Collection {@code group2.config_source} must have: {@code prop1->value-from-group2} - *
  • Collection {@code group3.config_source} must have: {@code prop2->value-from-group3} - *
  • Collection {@code config_source} must have: {@code propRoot->value-from-root} - *
- * - *

NOTE: A document in certain collection comes in format: - * - *

- *   {
- *     "config" :
- *     [ {
- *         "propName" : "prop_name_1",
- *         "propValue" : "prop_value_1"
- *       },
- *       ...
- *       {
- *         "propName" : "prop_name_N",
- *         "propValue" : "prop_value_N"
- *       }
- *     ]
- *   }
- * 
- */ -public class MongoConfigExample { - - /** - * Main method of example of mongo config. - * - * @param args program arguments - */ - public static void main(String[] args) { - String databaseName = - args[0] != null ? args[0] : "MongoConfigExample" + System.currentTimeMillis(); - String uri = "mongodb://localhost:27017/" + databaseName; - String configSourceCollectionName = "MongoConfigRepository"; - String auditLogCollectionName = "TestConfigurationAuditLog"; - - MongoConfigConnector connector = MongoConfigConnector.builder().forUri(uri).build(); - - KeyValueConfigSource mongoConfigSource = - KeyValueConfigSource.withRepository( - new MongoConfigRepository(connector), configSourceCollectionName) - .groups("group1", "group2", "group3") - .build(); - - ConfigRegistry configRegistry = - ConfigRegistry.create( - ConfigRegistrySettings.builder() - .addLastSource("MongoConfig", mongoConfigSource) - .addListener(new Slf4JConfigEventListener()) - .addListener(new MongoConfigEventListener(connector, auditLogCollectionName)) - .keepRecentConfigEvents(3) - .reloadIntervalSec(1) - .build()); - - StringConfigProperty prop1 = configRegistry.stringProperty("prop1"); - System.out.println( - "### Initial mongo config property: prop1=" - + prop1.value().get() - + ", group=" - + prop1.origin().get()); - - StringConfigProperty prop2 = configRegistry.stringProperty("prop2"); - System.out.println( - "### Initial mongo config property: prop2=" - + prop2.value().get() - + ", group=" - + prop2.origin().get()); - - StringConfigProperty propRoot = configRegistry.stringProperty("propRoot"); - System.out.println( - "### Initial mongo config **root** property: propRoot=" - + propRoot.value().get() - + ", group=" - + propRoot.origin().get()); - } -} diff --git a/config-http-server/pom.xml b/config-http-server/pom.xml deleted file mode 100644 index 23ed146b..00000000 --- a/config-http-server/pom.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - io.scalecube - scalecube-config-parent - 0.4.17-SNAPSHOT - - 4.0.0 - - scalecube-config-http-server - - - - io.scalecube - scalecube-config - ${project.version} - - - org.glassfish.jersey.containers - jersey-container-jetty-http - - - org.glassfish.jersey.inject - jersey-hk2 - - - org.glassfish.jersey.media - jersey-media-json-jackson - - - com.fasterxml.jackson.datatype - jackson-datatype-jdk8 - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - - - diff --git a/config-http-server/src/main/java/io/scalecube/config/http/server/ConfigRegistryHttpServer.java b/config-http-server/src/main/java/io/scalecube/config/http/server/ConfigRegistryHttpServer.java deleted file mode 100644 index 191451fb..00000000 --- a/config-http-server/src/main/java/io/scalecube/config/http/server/ConfigRegistryHttpServer.java +++ /dev/null @@ -1,66 +0,0 @@ -package io.scalecube.config.http.server; - -import io.scalecube.config.ConfigRegistry; -import java.net.URI; -import org.eclipse.jetty.server.Server; -import org.glassfish.jersey.jackson.JacksonFeature; -import org.glassfish.jersey.jetty.JettyHttpContainerFactory; -import org.glassfish.jersey.server.ResourceConfig; -import org.glassfish.jersey.server.filter.RolesAllowedDynamicFeature; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ConfigRegistryHttpServer { - private static final Logger LOGGER = LoggerFactory.getLogger(ConfigRegistryHttpServer.class); - - private final ConfigRegistry configRegistry; - private final int port; - - private ConfigRegistryHttpServer(ConfigRegistry configRegistry, int port) { - this.configRegistry = configRegistry; - this.port = port; - } - - /** - * Creates http server for given {@link ConfigRegistry} and port. - * - * @param configRegistry config registry - * @param port listen port - * @return server instance - */ - public static ConfigRegistryHttpServer create(ConfigRegistry configRegistry, int port) { - ConfigRegistryHttpServer server = new ConfigRegistryHttpServer(configRegistry, port); - server.start(); - return server; - } - - private void start() { - URI uri; - try { - uri = URI.create("http://0.0.0.0:" + port + "/"); - ResourceConfig resourceConfig = - new ResourceConfig(JacksonFeature.class, ObjectMapperProvider.class); - resourceConfig.register(RolesAllowedDynamicFeature.class); - resourceConfig.register(new ConfigRegistryResource(configRegistry)); - Server server = JettyHttpContainerFactory.createServer(uri, resourceConfig, true /* start */); - Runtime.getRuntime() - .addShutdownHook( - new Thread( - () -> { - try { - server.stop(); - } catch (Exception e) { - LOGGER.warn("Exception occurred on stop of {}, cause: {}", toString(), e); - } - })); - LOGGER.info("Started: {}", toString()); - } catch (Exception e) { - LOGGER.warn("Exception on start of {}, cause: {}", toString(), e); - } - } - - @Override - public String toString() { - return "ConfigRegistryHttpServer {port=" + port + '}'; - } -} diff --git a/config-http-server/src/main/java/io/scalecube/config/http/server/ConfigRegistryResource.java b/config-http-server/src/main/java/io/scalecube/config/http/server/ConfigRegistryResource.java deleted file mode 100644 index f561b1e1..00000000 --- a/config-http-server/src/main/java/io/scalecube/config/http/server/ConfigRegistryResource.java +++ /dev/null @@ -1,48 +0,0 @@ -package io.scalecube.config.http.server; - -import io.scalecube.config.ConfigPropertyInfo; -import io.scalecube.config.ConfigRegistry; -import io.scalecube.config.ConfigRegistrySettings; -import io.scalecube.config.audit.ConfigEvent; -import io.scalecube.config.source.ConfigSourceInfo; -import java.util.Collection; -import javax.annotation.security.PermitAll; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; - -@Path("/_config/") -@Produces(MediaType.APPLICATION_JSON) -@PermitAll // TODO: Require basic auth here instead (see @RolesAllowed) -public class ConfigRegistryResource { - private final ConfigRegistry configRegistry; - - public ConfigRegistryResource(ConfigRegistry configRegistry) { - this.configRegistry = configRegistry; - } - - @GET - @Path("sources") - public Collection getSources() { - return configRegistry.getConfigSources(); - } - - @GET - @Path("properties") - public Collection getProperties() { - return configRegistry.getConfigProperties(); - } - - @GET - @Path("events") - public Collection getEvents() { - return configRegistry.getRecentConfigEvents(); - } - - @GET - @Path("settings") - public ConfigRegistrySettings getSettings() { - return configRegistry.getSettings(); - } -} diff --git a/config-http-server/src/main/java/io/scalecube/config/http/server/ObjectMapperProvider.java b/config-http-server/src/main/java/io/scalecube/config/http/server/ObjectMapperProvider.java deleted file mode 100644 index e359cbb7..00000000 --- a/config-http-server/src/main/java/io/scalecube/config/http/server/ObjectMapperProvider.java +++ /dev/null @@ -1,47 +0,0 @@ -package io.scalecube.config.http.server; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.PropertyAccessor; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; -import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -import javax.ws.rs.ext.ContextResolver; -import javax.ws.rs.ext.Provider; - -@Provider -public class ObjectMapperProvider implements ContextResolver { - - @Override - public ObjectMapper getContext(final Class type) { - return ObjectMapperHolder.objectMapper; - } - - /** - * Holder class for {@link ObjectMapper}. - * - * @author Anton Kharenko - */ - private static class ObjectMapperHolder { - - private static ObjectMapper objectMapper = initMapper(); - - private static ObjectMapper initMapper() { - ObjectMapper mapper = - new ObjectMapper() // - .registerModule(new Jdk8Module()) - .registerModule(new JavaTimeModule()); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); - mapper.configure(DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_AS_NULL, true); - mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); - mapper.configure(SerializationFeature.WRITE_ENUMS_USING_TO_STRING, true); - - mapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); - mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); - return mapper; - } - } -} diff --git a/config-mongo/pom.xml b/config-mongo/pom.xml deleted file mode 100644 index b51a609d..00000000 --- a/config-mongo/pom.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - io.scalecube - scalecube-config-parent - 0.4.17-SNAPSHOT - - 4.0.0 - - scalecube-config-mongo - - - - io.scalecube - scalecube-config - ${project.version} - - - de.undercouch - bson4jackson - - - org.mongodb - mongo-java-driver - - - diff --git a/config-mongo/src/main/java/io/scalecube/config/mongo/MongoConfigConnector.java b/config-mongo/src/main/java/io/scalecube/config/mongo/MongoConfigConnector.java deleted file mode 100644 index fd53afb2..00000000 --- a/config-mongo/src/main/java/io/scalecube/config/mongo/MongoConfigConnector.java +++ /dev/null @@ -1,52 +0,0 @@ -package io.scalecube.config.mongo; - -import com.mongodb.MongoClient; -import com.mongodb.MongoClientURI; -import com.mongodb.client.MongoDatabase; -import java.util.Objects; - -public class MongoConfigConnector { - private final MongoDatabase database; - private final MongoClientURI clientUri; - - private MongoConfigConnector(Builder builder) { - this.database = builder.database; - this.clientUri = builder.clientUri; - } - - public MongoDatabase getDatabase() { - return database; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private MongoDatabase database; - private MongoClientURI clientUri; - - /** - * Creates builder for given URI. - * - * @param uri URI - * @return builder instance - */ - public Builder forUri(String uri) { - this.clientUri = new MongoClientURI(uri); - String databaseName = clientUri.getDatabase(); - Objects.requireNonNull(databaseName, "Mongo uri must contain database"); - this.database = new MongoClient(clientUri).getDatabase(databaseName); - return this; - } - - public MongoConfigConnector build() { - return new MongoConfigConnector(this); - } - } - - @Override - public String toString() { - return "MongoConfigConnector{" + "database=" + clientUri + '}'; - } -} diff --git a/config-mongo/src/main/java/io/scalecube/config/mongo/MongoConfigEventListener.java b/config-mongo/src/main/java/io/scalecube/config/mongo/MongoConfigEventListener.java deleted file mode 100644 index 825d2dc1..00000000 --- a/config-mongo/src/main/java/io/scalecube/config/mongo/MongoConfigEventListener.java +++ /dev/null @@ -1,198 +0,0 @@ -package io.scalecube.config.mongo; - -import com.fasterxml.jackson.databind.ObjectMapper; -import io.scalecube.config.audit.ConfigEvent; -import io.scalecube.config.audit.ConfigEventListener; -import io.scalecube.config.utils.ThrowableUtil; -import java.io.ByteArrayOutputStream; -import java.util.Collection; -import java.util.Date; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.Executor; -import java.util.concurrent.Executors; -import java.util.concurrent.ThreadFactory; -import java.util.stream.Collectors; -import org.bson.RawBsonDocument; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class MongoConfigEventListener implements ConfigEventListener { - private static final Logger LOGGER = LoggerFactory.getLogger(MongoConfigEventListener.class); - - private static final ThreadFactory threadFactory; - - static { - threadFactory = - r -> { - Thread thread = new Thread(r); - thread.setDaemon(true); - thread.setName("mongo-config-auditor"); - thread.setUncaughtExceptionHandler((t, e) -> LOGGER.error("Exception occurred: " + e, e)); - return thread; - }; - } - - private static final Executor executor = Executors.newSingleThreadExecutor(threadFactory); - - private final MongoConfigConnector connector; - private final String collectionName; - - public MongoConfigEventListener( - MongoConfigConnector connector, String collectionName) { - this.connector = connector; - this.collectionName = collectionName; - } - - @Override - public void onEvents(Collection events) { - CompletableFuture.runAsync( - () -> { - ObjectMapper objectMapper = MongoConfigObjectMapper.getInstance(); - connector - .getDatabase() - .getCollection(collectionName, RawBsonDocument.class) - .insertMany( - events - .stream() - .map( - event -> { - AuditLogEntity entity = new AuditLogEntity(); - entity.setName(event.getName()); - entity.setTimestamp(event.getTimestamp()); - entity.setHost(event.getHost()); - entity.setType(event.getType().toString()); - entity.setNewSource(event.getNewSource()); - entity.setNewOrigin(event.getNewOrigin()); - entity.setNewValue(event.getNewValue()); - entity.setOldSource(event.getOldSource()); - entity.setOldOrigin(event.getOldOrigin()); - entity.setOldValue(event.getOldValue()); - return entity; - }) - .map( - entity -> { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - try { - objectMapper.writer().writeValue(baos, entity); - } catch (Exception e) { - LOGGER.error( - "Exception at converting obj: {} to bson, cause: {}", entity, e); - throw ThrowableUtil.propagate(e); - } - return new RawBsonDocument(baos.toByteArray()); - }) - .collect(Collectors.toList())); - }, - executor); - } - - private static class AuditLogEntity { - private String name; - private Date timestamp; - private String type; - private String host; - private String oldSource; - private String oldOrigin; - private String oldValue; - private String newSource; - private String newOrigin; - private String newValue; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public Date getTimestamp() { - return timestamp; - } - - public void setTimestamp(Date timestamp) { - this.timestamp = timestamp; - } - - public String getHost() { - return host; - } - - public void setHost(String host) { - this.host = host; - } - - public String getOldSource() { - return oldSource; - } - - public void setOldSource(String oldSource) { - this.oldSource = oldSource; - } - - public String getOldOrigin() { - return oldOrigin; - } - - public void setOldOrigin(String oldOrigin) { - this.oldOrigin = oldOrigin; - } - - public String getOldValue() { - return oldValue; - } - - public void setOldValue(String oldValue) { - this.oldValue = oldValue; - } - - public String getNewSource() { - return newSource; - } - - public void setNewSource(String newSource) { - this.newSource = newSource; - } - - public String getNewOrigin() { - return newOrigin; - } - - public void setNewOrigin(String newOrigin) { - this.newOrigin = newOrigin; - } - - public String getNewValue() { - return newValue; - } - - public void setNewValue(String newValue) { - this.newValue = newValue; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("AuditLogEntity{"); - sb.append("name='").append(name).append('\''); - sb.append(", timestamp=").append(timestamp); - sb.append(", type='").append(type).append('\''); - sb.append(", host='").append(host).append('\''); - sb.append(", oldSource='").append(oldSource).append('\''); - sb.append(", oldOrigin='").append(oldOrigin).append('\''); - sb.append(", oldValue='").append(oldValue).append('\''); - sb.append(", newSource='").append(newSource).append('\''); - sb.append(", newOrigin='").append(newOrigin).append('\''); - sb.append(", newValue='").append(newValue).append('\''); - sb.append('}'); - return sb.toString(); - } - } -} diff --git a/config-mongo/src/main/java/io/scalecube/config/mongo/MongoConfigObjectMapper.java b/config-mongo/src/main/java/io/scalecube/config/mongo/MongoConfigObjectMapper.java deleted file mode 100644 index 4a324366..00000000 --- a/config-mongo/src/main/java/io/scalecube/config/mongo/MongoConfigObjectMapper.java +++ /dev/null @@ -1,29 +0,0 @@ -package io.scalecube.config.mongo; - -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import de.undercouch.bson4jackson.BsonFactory; -import de.undercouch.bson4jackson.BsonModule; -import de.undercouch.bson4jackson.BsonParser; - -public class MongoConfigObjectMapper { - - private static final ObjectMapper objectMapper = - new ObjectMapper(new BsonFactory().enable(BsonParser.Feature.HONOR_DOCUMENT_LENGTH)); - - static { - objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - objectMapper.configure( - SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); // gives mongo type date in db - objectMapper.registerModule(new BsonModule()); // gives mongo types in db - } - - private MongoConfigObjectMapper() { - // Do not instantiate - } - - public static ObjectMapper getInstance() { - return objectMapper; - } -} diff --git a/config-mongo/src/main/java/io/scalecube/config/mongo/MongoConfigRepository.java b/config-mongo/src/main/java/io/scalecube/config/mongo/MongoConfigRepository.java deleted file mode 100644 index 45967641..00000000 --- a/config-mongo/src/main/java/io/scalecube/config/mongo/MongoConfigRepository.java +++ /dev/null @@ -1,66 +0,0 @@ -package io.scalecube.config.mongo; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.ObjectReader; -import com.mongodb.client.MongoCollection; -import com.mongodb.client.MongoCursor; -import io.scalecube.config.keyvalue.KeyValueConfigEntity; -import io.scalecube.config.keyvalue.KeyValueConfigName; -import io.scalecube.config.keyvalue.KeyValueConfigRepository; -import java.io.ByteArrayInputStream; -import java.util.Collections; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; -import org.bson.RawBsonDocument; - -public class MongoConfigRepository implements KeyValueConfigRepository { - private final MongoConfigConnector connector; - - public MongoConfigRepository(MongoConfigConnector connector) { - this.connector = Objects.requireNonNull(connector); - } - - @Override - public List findAll(KeyValueConfigName configName) - throws Exception { - Objects.requireNonNull(configName); - - String collectionName = configName.getQualifiedName(); - MongoCollection collection = - connector.getDatabase().getCollection(collectionName, RawBsonDocument.class); - - MongoCursor it = collection.find().iterator(); - if (!it.hasNext()) { - return Collections.emptyList(); - } - - RawBsonDocument document = it.next(); - ByteArrayInputStream bin = new ByteArrayInputStream(document.getByteBuffer().array()); - ObjectMapper objectMapper = MongoConfigObjectMapper.getInstance(); - ObjectReader objectReader = objectMapper.readerFor(MongoConfigEntity.class); - List result = - ((MongoConfigEntity) objectReader.readValue(bin)).getConfig(); - - // set groupName on returned config key-value pairs - return result - .stream() - .map(input -> input.setConfigName(configName)) - .collect(Collectors.toList()); - } - - // Helper class for mapping bson document - private static class MongoConfigEntity { - private List config; - - public MongoConfigEntity() {} - - public List getConfig() { - return config; - } - - public void setConfig(List config) { - this.config = config; - } - } -} diff --git a/config-vault/pom.xml b/config-vault/pom.xml index e1600a2d..e622f60e 100644 --- a/config-vault/pom.xml +++ b/config-vault/pom.xml @@ -1,5 +1,7 @@ - + 4.0.0 @@ -10,11 +12,6 @@ scalecube-config-vault - - 5.1.0 - 1.15.2 - - io.scalecube @@ -24,13 +21,13 @@ com.bettercloud vault-java-driver - ${vault-java-driver.version} + org.testcontainers vault - ${testcontainers.version} test + diff --git a/config/pom.xml b/config/pom.xml index 6a59b69b..3c1a93f1 100644 --- a/config/pom.xml +++ b/config/pom.xml @@ -1,5 +1,7 @@ - + io.scalecube @@ -10,32 +12,17 @@ scalecube-config - - 2.13.3 - - org.slf4j slf4j-api - - - - com.fasterxml.jackson.datatype - jackson-datatype-jdk8 - test - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - test - + com.google.guava guava - 29.0-jre test + diff --git a/config/src/main/java/io/scalecube/config/source/ClassPathConfigSource.java b/config/src/main/java/io/scalecube/config/source/ClassPathConfigSource.java index 67115499..b295b8ed 100644 --- a/config/src/main/java/io/scalecube/config/source/ClassPathConfigSource.java +++ b/config/src/main/java/io/scalecube/config/source/ClassPathConfigSource.java @@ -219,7 +219,7 @@ private static void scanJar(File file, Collection collector) throws IOExce private static void scanJarFile(JarFile file, Path path, Collection collector) throws IOException { - try (FileSystem zipfs = FileSystems.newFileSystem(path, null)) { + try (FileSystem zipfs = FileSystems.newFileSystem(path, (ClassLoader) null)) { Enumeration entries = file.entries(); while (entries.hasMoreElements()) { JarEntry entry = entries.nextElement(); diff --git a/config/src/test/java/io/scalecube/config/JsonDocumentConfigPropertyTest.java b/config/src/test/java/io/scalecube/config/JsonDocumentConfigPropertyTest.java deleted file mode 100644 index 1300ccc6..00000000 --- a/config/src/test/java/io/scalecube/config/JsonDocumentConfigPropertyTest.java +++ /dev/null @@ -1,543 +0,0 @@ -package io.scalecube.config; - -import static io.scalecube.config.TestUtil.WAIT_FOR_RELOAD_PERIOD_MILLIS; -import static io.scalecube.config.TestUtil.mapBuilder; -import static io.scalecube.config.TestUtil.newConfigRegistry; -import static io.scalecube.config.TestUtil.toConfigProps; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertNull; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.PropertyAccessor; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; -import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -import io.scalecube.config.source.ConfigSource; -import io.scalecube.config.utils.ThrowableUtil; -import java.time.Duration; -import java.util.Objects; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; -import java.util.function.Function; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestInfo; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@ExtendWith(MockitoExtension.class) -class JsonDocumentConfigPropertyTest { - - private static ObjectMapper objectMapper = initMapper(); - - @Mock private ConfigSource configSource; - - @Mock private SideEffect sideEffect; - - private TestInfo testInfo; - - @BeforeEach - public void setUp(TestInfo testInfo) { - this.testInfo = testInfo; - } - - // Normal scenarios - - @Test - public void testObjectProperty() { - when(configSource.loadConfig()) - .thenAnswer( - answer -> - toConfigProps( - mapBuilder() - .put( - "testObjectProperty", - "{\"maxCount\":42,\"timeout\":\"PT0.1S\",\"isEnabled\":\"true\"}") - .build())); - - ConfigRegistryImpl configRegistry = newConfigRegistry(configSource); - - Class configClass = TestConfig.class; - - ObjectConfigProperty objectProperty = - configRegistry.objectProperty("testObjectProperty", mapper(configClass)); - - TestConfig config = objectProperty.value(null); - assertNotNull(config); - assertEquals(42, config.maxCount); - assertEquals(Duration.ofMillis(100), config.timeout); - assertTrue(config.isEnabled); - } - - @Test - public void testObjectPropertyValidationPassed() { - - String documentKey = "testObjectPropertyValidationPassed"; - when(configSource.loadConfig()) - .thenReturn( - toConfigProps( - mapBuilder() - .put( - documentKey, - "{\"maxCount\":100,\"timeout\":\"PT0.100S\",\"isEnabled\":true}") - .build())); - ConfigRegistryImpl configRegistry = newConfigRegistry(configSource); - - Class configClass = TestConfig.class; - ObjectConfigProperty objectProperty = - configRegistry.objectProperty(documentKey, mapper(configClass)); - - objectProperty.addValidator( - input -> - input.isEnabled - && input.maxCount >= 1 - && input.timeout.compareTo(Duration.ofMillis(100)) == 0); - - TestConfig config = objectProperty.value(null); - - assertNotNull(config); - assertEquals(100, config.maxCount); - assertEquals(Duration.ofMillis(100), config.timeout); - assertTrue(config.isEnabled); - } - - @Test - public void testReloadObjectPropertyValidationPassed() throws Exception { - String documentKey = testInfo.getTestMethod().get().getName(); - when(configSource.loadConfig()) - .thenReturn( - toConfigProps( - mapBuilder() - .put(documentKey, "{\"maxCount\":1,\"timeout\":\"PT1s\",\"isEnabled\":true}") - .build())) - .thenReturn( - toConfigProps( - mapBuilder() - .put(documentKey, "{\"maxCount\":42,\"timeout\":\"PT1s\",\"isEnabled\":true}") - .build())); - - ConfigRegistryImpl configRegistry = newConfigRegistry(configSource); - - Class configClass = TestConfig.class; - ObjectConfigProperty objectProperty = - configRegistry.objectProperty(documentKey, mapper(configClass)); - - objectProperty.addValidator(input -> input.isEnabled && input.maxCount >= 1); - objectProperty.addCallback((o1, o2) -> sideEffect.apply(o1, o2)); - - TestConfig config = objectProperty.value(null); - - assertNotNull(config); - assertEquals(1, config.maxCount); - assertEquals(Duration.ofSeconds(1), config.timeout); - assertTrue(config.isEnabled); - - TimeUnit.MILLISECONDS.sleep(WAIT_FOR_RELOAD_PERIOD_MILLIS); - - TestConfig config1 = objectProperty.value(null); - assertEquals(42, config1.maxCount); - assertEquals(Duration.ofSeconds(1), config1.timeout); // note value retained after reload - assertTrue(config1.isEnabled); // note value retained after reload - verify(sideEffect).apply(config, config1); - // as oppose to ObjectConfigProperty, in JSON if the value did not change - no execution will - // happen. - // that's why it's never(). - } - - @Test - public void testCallbacksNotAppliedOnReloadWhenNothingChanged() throws Exception { - String documentKey = "testCallbacksNotAppliedOnReloadWhenNothingChanged"; - when(configSource.loadConfig()) - .thenReturn( - toConfigProps(mapBuilder().put(documentKey, "{\"anInt\":42,\"aDouble\":42.0}").build())) - .thenReturn( - toConfigProps( - mapBuilder().put(documentKey, "{\"anInt\":42,\"aDouble\":42.0}").build())); - - ConfigRegistryImpl configRegistry = newConfigRegistry(configSource); - - Class configClass = SimpleConfig.class; - ObjectConfigProperty objectProperty = - configRegistry.objectProperty(documentKey, mapper(configClass)); - objectProperty.addCallback((cfg1, cfg2) -> sideEffect.apply(cfg1, cfg2)); - - SimpleConfig config = objectProperty.value(null); - assertNotNull(config); - assertEquals(42, config.anInt); - assertEquals(42.0, config.aDouble); - - TimeUnit.MILLISECONDS.sleep(WAIT_FOR_RELOAD_PERIOD_MILLIS); - - SimpleConfig config1 = objectProperty.value(null); - assertEquals(42, config1.anInt); - assertEquals(42.0, config1.aDouble); - verify(sideEffect, never()).apply(any(), any()); - } - - @Test - public void testObjectValuesRemovedOnReloadAndNoValidationDefined() throws Exception { - String documentName = "testObjectValuesRemovedOnReloadAndNoValidationDefined"; - when(configSource.loadConfig()) - .thenReturn( - toConfigProps( - mapBuilder() - .put(documentName, "{\"isEnabled1\":\"true\",\"isEnabled2\":true}") - .build())) - .thenAnswer(a -> toConfigProps(mapBuilder().put(documentName, "{}").build())); - - ConfigRegistryImpl configRegistry = newConfigRegistry(configSource); - - Class configClass = ConfigValueSoonWillDisappear.class; - ObjectConfigProperty objectProperty = - configRegistry.objectProperty(documentName, mapper(configClass)); - objectProperty.addCallback((cfg1, cfg2) -> sideEffect.apply(cfg1, cfg2)); - - ConfigValueSoonWillDisappear config = objectProperty.value(null); - - assertNotNull(config); - assertTrue(config.isEnabled1); - assertTrue(config.isEnabled2); - - Throwable t = new TimeoutException(); - CountDownLatch latch = new CountDownLatch(1); - objectProperty.addCallback( - (oldVal, newVal) -> { - try { - assertFalse(newVal.isEnabled1); - assertFalse(newVal.isEnabled2); - } catch (AssertionError collected) { - t.addSuppressed(collected); - } finally { - latch.countDown(); - } - }); - if (!latch.await(WAIT_FOR_RELOAD_PERIOD_MILLIS + 10, TimeUnit.MILLISECONDS) - || t.getSuppressed().length > 0) { - Assertions.fail(t); - } - // verify(sideEffect).apply(config, null); - } - - @Test - public void testObjectValuesAddedOnReloadAndNoValidationDefined() throws Exception { - String documentKey = testInfo.getTestMethod().get().getName(); - when(configSource.loadConfig()) - .thenReturn( - toConfigProps(mapBuilder().build())) // note that no config props defined at start - .thenReturn(toConfigProps(mapBuilder().put(documentKey, "{\"i\":1,\"j\":1}").build())); - - ConfigRegistryImpl configRegistry = newConfigRegistry(configSource); - - Class configClass = ConfigValueWillBeAdded.class; - ObjectConfigProperty objectProperty = - configRegistry.objectProperty(documentKey, mapper(configClass)); - objectProperty.addCallback((cfg1, cfg2) -> sideEffect.apply(cfg1, cfg2)); - - assertFalse(objectProperty.value().isPresent()); - assertNull(objectProperty.value(null)); - - TimeUnit.MILLISECONDS.sleep(WAIT_FOR_RELOAD_PERIOD_MILLIS); - - assertTrue(objectProperty.value().isPresent()); - ConfigValueWillBeAdded config = objectProperty.value(null); - assertNotNull(config); - assertEquals(1, config.i); - assertEquals(1, config.j); - verify(sideEffect).apply(null, config); - } - - @Test - public void testObjectPropertyNotDefinedInConfigSource() { - when(configSource.loadConfig()).thenReturn(toConfigProps(mapBuilder().build())); - - ConfigRegistryImpl configRegistry = newConfigRegistry(configSource); - Class configClass = NotDefinedObjectPropertyConfig.class; - ObjectConfigProperty objectProperty = - configRegistry.objectProperty(configClass.getName(), mapper(configClass)); - - assertFalse(objectProperty.value().isPresent()); - assertNull(objectProperty.value(null)); - } - - @Test - public void testPartiallyDefinedValueConfig() { - when(configSource.loadConfig()) - .thenReturn( - toConfigProps( - mapBuilder().put("testPartiallyDefinedValueConfig", "{\"d2\":42}").build())); - - ConfigRegistryImpl configRegistry = newConfigRegistry(configSource); - - Class configClass = PartiallyDefinedValueConfig.class; - PartiallyDefinedValueConfig config = - configRegistry - .objectProperty("testPartiallyDefinedValueConfig", mapper(configClass)) - .value() - .get(); - - assertEquals(1e7, config.d1); // default value not changed - assertEquals(42, config.d2); // value came from config - } - - @Test - public void testSkipStaticOrFinalFieldInObjectPropertryClass() { - String documentKey = testInfo.getTestMethod().get().getName(); - - when(configSource.loadConfig()) - .thenReturn( - toConfigProps( - mapBuilder().put(documentKey, "{\"anInt\":42, \"finalInt\":100}").build())); - - ConfigRegistryImpl configRegistry = newConfigRegistry(configSource); - - Class configClass = ConfigClassWithStaticOrFinalField.class; - ConfigClassWithStaticOrFinalField config = - configRegistry.objectProperty(documentKey, mapper(configClass)).value().get(); - - assertEquals(42, config.anInt); - // fields with modifier 'final' are not taken into account, even if defined in config source - assertEquals(1, config.finalInt); - } - - // Failure scenarios - - @Test - public void testValueAbsentAndValidationNotPassed() { - ConfigRegistryImpl configRegistry = newConfigRegistry(configSource); - - ObjectConfigProperty objectProperty = - configRegistry.objectProperty("connector", mapper(ConnectorSettings.class)); - - assertThrows( - IllegalArgumentException.class, - () -> { - objectProperty.addValidator(Objects::nonNull); - objectProperty.addValidator( - settings -> settings.user != null && settings.password != null); - }, - "Validation failed"); - } - - @Test - public void testValueRemovedOnReloadValidationNotPassed() throws Exception { - String documentKey = "connector"; - when(configSource.loadConfig()) - .thenReturn( - toConfigProps( - mapBuilder().put(documentKey, "{\"user\":\"yada\",\"password\":\"yada\"}").build())) - .thenReturn(toConfigProps(mapBuilder().build())); // -> prorperties gone - ConfigRegistryImpl configRegistry = newConfigRegistry(configSource); - - ObjectConfigProperty objectProperty = - configRegistry.objectProperty(documentKey, mapper(ConnectorSettings.class)); - objectProperty.addValidator(Objects::nonNull); - objectProperty.addValidator(settings -> settings.user != null && settings.password != null); - objectProperty.addCallback((i1, i2) -> sideEffect.apply(i1, i2)); - - assertEquals("yada", objectProperty.value().get().user); - assertEquals("yada", objectProperty.value().get().password); - - TimeUnit.MILLISECONDS.sleep(WAIT_FOR_RELOAD_PERIOD_MILLIS); - - assertTrue(objectProperty.value().isPresent()); - assertEquals("yada", objectProperty.value().get().user); - assertEquals("yada", objectProperty.value().get().password); - verify(sideEffect, never()).apply(any(), any()); - } - - @Test - public void testValueParserFailingOnReload() throws Exception { - String documentKey = "com.acme"; - when(configSource.loadConfig()) - .thenReturn(toConfigProps(mapBuilder().put(documentKey, "{\"anInt\":1}").build())) - .thenReturn( - toConfigProps(mapBuilder().put(documentKey, "{\"anInt\":\"not an int\"}").build())); - ConfigRegistryImpl configRegistry = newConfigRegistry(configSource); - - ObjectConfigProperty objectProperty = - configRegistry.objectProperty(documentKey, mapper(IntObjectSettings.class)); - objectProperty.addValidator(Objects::nonNull); - objectProperty.addValidator(settings -> settings.anInt >= 1); - objectProperty.addCallback((i1, i2) -> sideEffect.apply(i1, i2)); - - assertEquals(1, objectProperty.value().get().anInt); - - TimeUnit.MILLISECONDS.sleep(WAIT_FOR_RELOAD_PERIOD_MILLIS); - - assertTrue(objectProperty.value().isPresent()); - assertEquals(1, objectProperty.value().get().anInt); - verify(sideEffect, never()).apply(any(), any()); - } - - @Test - public void testValidationNotPassed() { - when(configSource.loadConfig()) - .thenReturn(toConfigProps(mapBuilder().put("com.acme", "{\"anInt\":1}").build())); - ConfigRegistryImpl configRegistry = newConfigRegistry(configSource); - - ObjectConfigProperty objectProperty = - configRegistry.objectProperty("com.acme", mapper(IntObjectSettings.class)); - - assertThrows( - IllegalArgumentException.class, - () -> objectProperty.addValidator(settings -> settings.anInt >= 42), - "Validation failed"); - } - - public static class TestConfig { - private int maxCount; - private Duration timeout; - private boolean isEnabled; - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - - TestConfig that = (TestConfig) o; - - if (maxCount != that.maxCount) { - return false; - } - if (isEnabled != that.isEnabled) { - return false; - } - return Objects.equals(timeout, that.timeout); - } - - @Override - public int hashCode() { - int result = maxCount; - result = 31 * result + (timeout != null ? timeout.hashCode() : 0); - result = 31 * result + (isEnabled ? 1 : 0); - return result; - } - } - - public static class IncorrectIntegerValueConfig { - private int incorrectInt; - private String str; - } - - public static class PartiallyDefinedValueConfig { - private double d1 = 1e7; - private double d2 = 1e7; - } - - public static class NotDefinedObjectPropertyConfig { - public int iii = 42; - } - - public static class ConfigClassWithStaticOrFinalField { - public static final Logger LOGGER = LoggerFactory.getLogger("logger"); - public static final ConfigClassWithStaticOrFinalField defaultInstance = - new ConfigClassWithStaticOrFinalField(); - - private int anInt = 1; - private final int finalInt = 1; - } - - public static class SimpleConfig { - private int anInt = 100; - private double aDouble = 200.0; - } - - public static class ConfigValueSoonWillDisappear { - private boolean isEnabled1; - private boolean isEnabled2; - } - - public static class ConfigValueSoonWillDisappearPartially { - private long x; - private long primLong; - private Long objLong; - } - - public static class ConfigValueWillBeAdded { - private int i = -1; - private int j = -1; - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - - ConfigValueWillBeAdded that = (ConfigValueWillBeAdded) o; - - if (i != that.i) { - return false; - } - return j == that.j; - } - - @Override - public int hashCode() { - int result = i; - result = 31 * result + j; - return result; - } - } - - public interface SideEffect { - boolean apply(Object t1, Object t2); - } - - public static class ConnectorSettings { - private String user; - private String password; - } - - public static class IntObjectSettings { - private int anInt; - } - - private static ObjectMapper initMapper() { - ObjectMapper mapper = - new ObjectMapper() // - .registerModule(new Jdk8Module()) - .registerModule(new JavaTimeModule()); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); - mapper.configure(DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_AS_NULL, true); - mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); - mapper.configure(SerializationFeature.WRITE_ENUMS_USING_TO_STRING, true); - - mapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); - mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); - return mapper; - } - - private static Function mapper(Class clazz) { - return value -> { - try { - return objectMapper.readValue(value, clazz); - } catch (Exception e) { - throw ThrowableUtil.propagate(e); - } - }; - } -} diff --git a/pom.xml b/pom.xml index 14bed7c7..df71c5bb 100644 --- a/pom.xml +++ b/pom.xml @@ -38,88 +38,63 @@ - false - UTF-8 - UTF-8 - - 2.11.0 - 2.7.0 - 3.4.2 1.7.7 - 2.26-b09 - 2.6 - - 2.13.3 2.27.0 5.1.1 1.3 - - 5.5.0 + 2.17.1 + 5.1.0 + 1.17.4 + 29.0-jre + + false + UTF-8 + UTF-8 config - config-mongo - config-http-server config-examples config-vault - - com.fasterxml.jackson - jackson-bom - ${jackson.version} - pom - import - - - de.undercouch - bson4jackson - ${bson4jackson.version} - - - org.mongodb - mongo-java-driver - ${mongo-java-driver.version} - org.slf4j slf4j-api ${slf4j.version} - org.glassfish.jersey.containers - jersey-container-jetty-http - ${jersey.version} + org.apache.logging.log4j + log4j-slf4j-impl + ${log4j.version} - org.glassfish.jersey.inject - jersey-hk2 - ${jersey.version} + org.apache.logging.log4j + log4j-core + ${log4j.version} - org.glassfish.jersey.media - jersey-media-json-jackson - ${jersey.version} + org.testcontainers + vault + ${testcontainers.version} - commons-io - commons-io - ${commons-io.version} + com.bettercloud + vault-java-driver + ${vault-java-driver.version} - net.java.dev.jna - jna - ${jna.version} - test + com.google.guava + guava + ${guava.version} - + org.junit.jupiter junit-jupiter-engine @@ -144,12 +119,6 @@ ${hamcrest.version} test - - org.hamcrest - hamcrest-core - ${hamcrest.version} - test - org.apache.logging.log4j log4j-slf4j-impl