diff --git a/changelog/@unreleased/pr-547.v2.yml b/changelog/@unreleased/pr-547.v2.yml new file mode 100644 index 00000000..1aa2e18e --- /dev/null +++ b/changelog/@unreleased/pr-547.v2.yml @@ -0,0 +1,5 @@ +type: break +break: + description: The `encrypted-config-value-bundle-dropwizard1` library has been removed. + links: + - https://github.com/palantir/encrypted-config-value/pull/547 diff --git a/encrypted-config-value-bundle-dropwizard1/baseline-class-uniqueness.lock b/encrypted-config-value-bundle-dropwizard1/baseline-class-uniqueness.lock deleted file mode 100644 index a99bed56..00000000 --- a/encrypted-config-value-bundle-dropwizard1/baseline-class-uniqueness.lock +++ /dev/null @@ -1,11 +0,0 @@ -# Danger! Multiple jars contain identically named classes. This may cause different behaviour depending on classpath ordering. -# Run ./gradlew checkClassUniqueness --write-locks to update this file - -## runtimeClasspath -[javax.inject:javax.inject, org.glassfish.hk2.external:javax.inject] - - javax.inject.Inject - - javax.inject.Named - - javax.inject.Provider - - javax.inject.Qualifier - - javax.inject.Scope - - javax.inject.Singleton diff --git a/encrypted-config-value-bundle-dropwizard1/build.gradle b/encrypted-config-value-bundle-dropwizard1/build.gradle deleted file mode 100644 index e161b0ee..00000000 --- a/encrypted-config-value-bundle-dropwizard1/build.gradle +++ /dev/null @@ -1,32 +0,0 @@ -apply plugin: 'com.palantir.external-publish-jar' -apply from: "${rootDir}/gradle/immutables-processors.gradle" - -dependencies { - api project(':encrypted-config-value-module') - api 'com.google.guava:guava' - api 'com.fasterxml.jackson.core:jackson-databind' - api 'io.dropwizard:dropwizard-core', { - exclude module: 'jakarta.activation-api' - exclude module: 'jakarta.xml.bind-api' - } - - implementation 'io.dropwizard:dropwizard-configuration' - implementation 'javax.validation:validation-api' - implementation 'net.sourceforge.argparse4j:argparse4j' - implementation project(':encrypted-config-value') - - testImplementation 'com.fasterxml.jackson.core:jackson-annotations' - testImplementation 'com.google.code.findbugs:jsr305' - testImplementation 'com.google.errorprone:error_prone_annotations' - testImplementation 'io.dropwizard:dropwizard-jackson' - testImplementation 'io.dropwizard:dropwizard-jersey' - testImplementation 'io.dropwizard:dropwizard-testing' - testImplementation 'org.assertj:assertj-core' - testImplementation 'org.junit.jupiter:junit-jupiter' - testImplementation 'org.junit.jupiter:junit-jupiter-api' - testImplementation 'org.mockito:mockito-core' - testImplementation 'org.mockito:mockito-junit-jupiter' -} - -tasks.check.dependsOn(javadoc) - diff --git a/encrypted-config-value-bundle-dropwizard1/src/main/java/com/palantir/config/crypto/ConfigurationDecryptionException.java b/encrypted-config-value-bundle-dropwizard1/src/main/java/com/palantir/config/crypto/ConfigurationDecryptionException.java deleted file mode 100644 index 0553be61..00000000 --- a/encrypted-config-value-bundle-dropwizard1/src/main/java/com/palantir/config/crypto/ConfigurationDecryptionException.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * (c) Copyright 2018 Palantir Technologies Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.palantir.config.crypto; - -import io.dropwizard.configuration.ConfigurationException; -import java.util.Collection; - -public class ConfigurationDecryptionException extends ConfigurationException { - private static final long serialVersionUID = 1L; - - public ConfigurationDecryptionException(String path, Collection errors, Throwable cause) { - super(path, errors, cause); - } -} diff --git a/encrypted-config-value-bundle-dropwizard1/src/main/java/com/palantir/config/crypto/EncryptConfigValueCommand.java b/encrypted-config-value-bundle-dropwizard1/src/main/java/com/palantir/config/crypto/EncryptConfigValueCommand.java deleted file mode 100644 index ecc98443..00000000 --- a/encrypted-config-value-bundle-dropwizard1/src/main/java/com/palantir/config/crypto/EncryptConfigValueCommand.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * (c) Copyright 2018 Palantir Technologies Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.palantir.config.crypto; - -import com.palantir.config.crypto.algorithm.Algorithm; -import io.dropwizard.cli.Command; -import io.dropwizard.setup.Bootstrap; -import java.nio.file.Paths; -import net.sourceforge.argparse4j.inf.Namespace; -import net.sourceforge.argparse4j.inf.Subparser; - -public final class EncryptConfigValueCommand extends Command { - - public static final String KEYFILE = "keyfile"; - public static final String VALUE = "value"; - - EncryptConfigValueCommand() { - super("encrypt-config-value", "Encrypts a configuration value so it can be stored securely"); - } - - @Override - public void configure(Subparser subparser) { - subparser - .addArgument("-k", "--keyfile") - .required(false) - .type(String.class) - .dest(KEYFILE) - .setDefault(KeyFileUtils.DEFAULT_PUBLIC_KEY_PATH) - .help("The location of the (public) key file"); - - subparser - .addArgument("-v", "--value") - .required(true) - .type(String.class) - .dest(VALUE) - .help("The value to encrypt"); - } - - @Override - @SuppressWarnings("BanSystemOut") - public void run(Bootstrap _bootstrap, Namespace namespace) throws Exception { - String keyfile = namespace.getString(KEYFILE); - String value = namespace.getString(VALUE); - - KeyWithType keyWithType = KeyFileUtils.keyWithTypeFromPath(Paths.get(keyfile)); - Algorithm algorithm = keyWithType.getType().getAlgorithm(); - - EncryptedValue encryptedValue = algorithm.newEncrypter().encrypt(keyWithType, value); - - // print the resulting encrypted value to the console - System.out.println(encryptedValue); - } -} diff --git a/encrypted-config-value-bundle-dropwizard1/src/main/java/com/palantir/config/crypto/EncryptedConfigValueBundle.java b/encrypted-config-value-bundle-dropwizard1/src/main/java/com/palantir/config/crypto/EncryptedConfigValueBundle.java deleted file mode 100644 index adb60f87..00000000 --- a/encrypted-config-value-bundle-dropwizard1/src/main/java/com/palantir/config/crypto/EncryptedConfigValueBundle.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * (c) Copyright 2018 Palantir Technologies Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.palantir.config.crypto; - -import com.fasterxml.jackson.databind.JsonNode; -import com.palantir.config.crypto.jackson.JsonNodeStringReplacer; -import com.palantir.config.crypto.jackson.JsonNodeVisitor; -import io.dropwizard.Bundle; -import io.dropwizard.Configuration; -import io.dropwizard.setup.Bootstrap; -import io.dropwizard.setup.Environment; - -public final class EncryptedConfigValueBundle implements Bundle { - - // Generically capture configuration type T from Bootstrap, though we don't actually care about it - private static void setConfigurationFactoryFactory( - Bootstrap bootstrap, final JsonNodeVisitor replacer) { - bootstrap.setConfigurationFactoryFactory(new SubstitutingConfigurationFactory.Factory(replacer)); - } - - @Override - public void initialize(Bootstrap bootstrap) { - bootstrap.addCommand(new GenerateKeyCommand()); - bootstrap.addCommand(new EncryptConfigValueCommand()); - setConfigurationFactoryFactory(bootstrap, new JsonNodeStringReplacer(new DecryptingVariableSubstitutor())); - } - - @Override - public void run(Environment _environment) {} -} diff --git a/encrypted-config-value-bundle-dropwizard1/src/main/java/com/palantir/config/crypto/GenerateKeyCommand.java b/encrypted-config-value-bundle-dropwizard1/src/main/java/com/palantir/config/crypto/GenerateKeyCommand.java deleted file mode 100644 index 88c874fe..00000000 --- a/encrypted-config-value-bundle-dropwizard1/src/main/java/com/palantir/config/crypto/GenerateKeyCommand.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * (c) Copyright 2018 Palantir Technologies Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.palantir.config.crypto; - -import com.palantir.config.crypto.algorithm.Algorithm; -import io.dropwizard.cli.Command; -import io.dropwizard.setup.Bootstrap; -import java.nio.file.Path; -import java.nio.file.Paths; -import net.sourceforge.argparse4j.inf.Namespace; -import net.sourceforge.argparse4j.inf.Subparser; - -public final class GenerateKeyCommand extends Command { - - public static final String FILE = "file"; - public static final String ALGORITHM = "algorithm"; - - GenerateKeyCommand() { - super("generate-random-key", "Generates a random key for encrypting config values"); - } - - @Override - public void configure(Subparser subparser) { - subparser - .addArgument("-a", "--algorithm") - .required(true) - .type(String.class) - .dest(ALGORITHM) - .help("The algorithm to use (see" - + " https://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#KeyGenerator" - + " for a list of valid algorithms)"); - - subparser - .addArgument("-f", "--file") - .required(false) - .type(String.class) - .dest(FILE) - .setDefault(KeyFileUtils.DEFAULT_PUBLIC_KEY_PATH) - .help("The location to write the key"); - } - - @Override - @SuppressWarnings("BanSystemOut") - public void run(Bootstrap _bootstrap, Namespace namespace) throws Exception { - String algorithmType = namespace.getString(ALGORITHM); - String file = namespace.getString(FILE); - Path path = Paths.get(file); - - Algorithm algorithm = Algorithm.valueOf(algorithmType); - KeyPair keyPair = algorithm.newKeyPair(); - KeyPairFiles keyPairFiles = KeyFileUtils.keyPairToFile(keyPair, path); - - // print to console, notifying that we did something - System.out.println("Wrote key to " + path); - if (!keyPairFiles.pathsEqual()) { - System.out.println("Wrote private key to " + keyPairFiles.decryptionKeyFile()); - } - } -} diff --git a/encrypted-config-value-bundle-dropwizard1/src/main/java/com/palantir/config/crypto/SubstitutingConfigurationFactory.java b/encrypted-config-value-bundle-dropwizard1/src/main/java/com/palantir/config/crypto/SubstitutingConfigurationFactory.java deleted file mode 100644 index 283515f3..00000000 --- a/encrypted-config-value-bundle-dropwizard1/src/main/java/com/palantir/config/crypto/SubstitutingConfigurationFactory.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * (c) Copyright 2018 Palantir Technologies Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * This file was derived from io.dropwizard.configuration.SubstitutingSourceProvider - * https://github.com/dropwizard/dropwizard/blob/2183fd25d60f7f6da8ab3994ac27d8923098fd57/dropwizard-configuration/src/main/java/io/dropwizard/configuration/SubstitutingSourceProvider.java - * - * The original file is - * Copyright 2010-2013 Coda Hale and Yammer, Inc., 2014-2015 Dropwizard Team - * Licensed under the Apache License, Version 2.0 - * - * The modifications to the original file are - * - make the class final (to pass checkstyle) - * - switch from Objects.requireNotNull to using Preconditions.checkNotNull - */ - -package com.palantir.config.crypto; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.common.collect.ImmutableList; -import com.palantir.config.crypto.jackson.JsonNodeVisitor; -import com.palantir.config.crypto.jackson.JsonNodeVisitors; -import com.palantir.config.crypto.util.StringSubstitutionException; -import io.dropwizard.configuration.ConfigurationException; -import io.dropwizard.configuration.ConfigurationFactory; -import io.dropwizard.configuration.ConfigurationFactoryFactory; -import io.dropwizard.configuration.YamlConfigurationFactory; -import java.io.IOException; -import javax.validation.Validator; - -/** - * A {@link ConfigurationFactory} subclass which filters parsed JSON through a - * {@link JsonNodeVisitor} before additional parsing. - * - * @param the type of the configuration objects to produce - */ -public final class SubstitutingConfigurationFactory extends YamlConfigurationFactory { - private final JsonNodeVisitor substitutor; - - /** - * Creates a new configuration factory for the given class. - * - * @param klass the configuration class - * @param validator the validator to use - * @param objectMapper the Jackson {@link ObjectMapper} to use - * @param propertyPrefix the system property name prefix used by overrides - * @param substitutor The custom {@link JsonNodeVisitor} implementation. - */ - public SubstitutingConfigurationFactory( - Class klass, - Validator validator, - ObjectMapper objectMapper, - String propertyPrefix, - JsonNodeVisitor substitutor) { - super(klass, validator, objectMapper, propertyPrefix); - this.substitutor = substitutor; - } - - @Override - protected T build(JsonNode node, String path) throws IOException, ConfigurationException { - try { - JsonNode substitutedNode = JsonNodeVisitors.dispatch(node, substitutor); - return super.build(substitutedNode, path); - } catch (StringSubstitutionException e) { - String error = - String.format("The value '%s' for field '%s' could not be replaced", e.getValue(), e.getField()); - throw new ConfigurationDecryptionException(path, ImmutableList.of(error), e); - } - } - - /** - * A {@link ConfigurationFactoryFactory} which returns {@link SubstitutingConfigurationFactory}. - * - * @param the type of the configuration objects to produce - */ - public static final class Factory implements ConfigurationFactoryFactory { - - private final JsonNodeVisitor substitutor; - - public Factory(JsonNodeVisitor substitutor) { - this.substitutor = substitutor; - } - - @Override - public ConfigurationFactory create( - Class klass, Validator validator, ObjectMapper objectMapper, String propertyPrefix) { - return new SubstitutingConfigurationFactory<>(klass, validator, objectMapper, propertyPrefix, substitutor); - } - } -} diff --git a/encrypted-config-value-bundle-dropwizard1/src/test/java/com/palantir/config/crypto/EncryptConfigValueCommandTest.java b/encrypted-config-value-bundle-dropwizard1/src/test/java/com/palantir/config/crypto/EncryptConfigValueCommandTest.java deleted file mode 100644 index f1d8298b..00000000 --- a/encrypted-config-value-bundle-dropwizard1/src/test/java/com/palantir/config/crypto/EncryptConfigValueCommandTest.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * (c) Copyright 2018 Palantir Technologies Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.palantir.config.crypto; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; - -import com.google.common.collect.ImmutableMap; -import com.palantir.config.crypto.algorithm.Algorithm; -import java.io.ByteArrayOutputStream; -import java.io.PrintStream; -import java.io.UnsupportedEncodingException; -import java.nio.file.Files; -import java.nio.file.NoSuchFileException; -import java.nio.file.Path; -import net.sourceforge.argparse4j.inf.Namespace; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -public final class EncryptConfigValueCommandTest { - private static final String CHARSET = "UTF8"; - private static final String plaintext = "this is a secret message"; - - private final ByteArrayOutputStream outContent = new ByteArrayOutputStream(); - private final EncryptConfigValueCommand command = new EncryptConfigValueCommand(); - - private PrintStream originalSystemOut; - - @BeforeEach - public void setUpStreams() throws UnsupportedEncodingException { - originalSystemOut = System.out; - System.setOut(new PrintStream(outContent, false, CHARSET)); - } - - @AfterEach - public void cleanUpStreams() { - System.setOut(originalSystemOut); - } - - private void weEncryptAndPrintAValue(Algorithm algorithm) throws Exception { - Path tempFilePath = Files.createTempDirectory("temp-key-directory").resolve("test.key"); - - KeyPair keyPair = algorithm.newKeyPair(); - KeyFileUtils.keyPairToFile(keyPair, tempFilePath); - - Namespace namespace = new Namespace(ImmutableMap.of( - EncryptConfigValueCommand.KEYFILE, - tempFilePath.toString(), - EncryptConfigValueCommand.VALUE, - plaintext)); - - command.run(null, namespace); - - String output = outContent.toString(CHARSET).trim(); - - EncryptedValue configValue = EncryptedValue.fromString(output); - KeyWithType decryptionKey = keyPair.decryptionKey(); - String decryptedValue = configValue.decrypt(decryptionKey); - - assertThat(decryptedValue).isEqualTo(plaintext); - } - - @Test - public void weEncryptAndPrintAValueUsingAes() throws Exception { - weEncryptAndPrintAValue(Algorithm.AES); - } - - @Test - public void weEncryptAndPrintAValueUsingRsa() throws Exception { - weEncryptAndPrintAValue(Algorithm.RSA); - } - - @Test - public void weFailIfTheKeyfileDoesNotExist() { - assertThatThrownBy(() -> { - Path tempFilePath = - Files.createTempDirectory("temp-key-directory").resolve("test.key"); - - Namespace namespace = new Namespace(ImmutableMap.of( - EncryptConfigValueCommand.KEYFILE, - tempFilePath.toString(), - EncryptConfigValueCommand.VALUE, - plaintext)); - - command.run(null, namespace); - }) - .isInstanceOf(NoSuchFileException.class); - } -} diff --git a/encrypted-config-value-bundle-dropwizard1/src/test/java/com/palantir/config/crypto/GenerateKeyCommandTest.java b/encrypted-config-value-bundle-dropwizard1/src/test/java/com/palantir/config/crypto/GenerateKeyCommandTest.java deleted file mode 100644 index 0a527924..00000000 --- a/encrypted-config-value-bundle-dropwizard1/src/test/java/com/palantir/config/crypto/GenerateKeyCommandTest.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * (c) Copyright 2018 Palantir Technologies Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.palantir.config.crypto; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; - -import com.google.common.collect.ImmutableMap; -import com.palantir.config.crypto.algorithm.Algorithm; -import java.nio.file.FileAlreadyExistsException; -import java.nio.file.Files; -import java.nio.file.Path; -import net.sourceforge.argparse4j.inf.Namespace; -import org.junit.jupiter.api.Test; - -public final class GenerateKeyCommandTest { - private final GenerateKeyCommand command = new GenerateKeyCommand(); - - private void weGenerateAValidKey(Algorithm algorithm) throws Exception { - Path tempFilePath = Files.createTempDirectory("temp-key-directory").resolve("test.key"); - - Namespace namespace = new Namespace(ImmutableMap.of( - GenerateKeyCommand.ALGORITHM, algorithm.toString(), - GenerateKeyCommand.FILE, tempFilePath.toString())); - - command.run(null, namespace); - - KeyPair keyPair = KeyFileUtils.keyPairFromPath(tempFilePath); - assertThat(keyPair.encryptionKey().getType().getAlgorithm()).isEqualTo(algorithm); - } - - @Test - public void weGenerateAValidRsaKey() throws Exception { - weGenerateAValidKey(Algorithm.RSA); - } - - @Test - public void weGenerateAValidAesKey() throws Exception { - weGenerateAValidKey(Algorithm.AES); - } - - @Test - public void weDoNotOverwriteAnExistingKeyfile() { - assertThatThrownBy(() -> { - Path tempFilePath = - Files.createTempDirectory("temp-key-directory").resolve("test.key"); - String algorithm = "AES"; - - // create the file - Files.createFile(tempFilePath); - - Namespace namespace = new Namespace(ImmutableMap.of( - GenerateKeyCommand.ALGORITHM, algorithm, GenerateKeyCommand.FILE, tempFilePath.toString())); - - command.run(null, namespace); - }) - .isInstanceOf(FileAlreadyExistsException.class); - } -} diff --git a/encrypted-config-value-bundle-dropwizard1/src/test/java/com/palantir/config/crypto/SubstitutingConfigurationFactoryTest.java b/encrypted-config-value-bundle-dropwizard1/src/test/java/com/palantir/config/crypto/SubstitutingConfigurationFactoryTest.java deleted file mode 100644 index a5996b9b..00000000 --- a/encrypted-config-value-bundle-dropwizard1/src/test/java/com/palantir/config/crypto/SubstitutingConfigurationFactoryTest.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * (c) Copyright 2018 Palantir Technologies Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.palantir.config.crypto; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.failBecauseExceptionWasNotThrown; - -import com.palantir.config.crypto.jackson.JsonNodeStringReplacer; -import com.palantir.config.crypto.util.Person; -import com.palantir.config.crypto.util.TestConfig; -import io.dropwizard.configuration.ConfigurationException; -import io.dropwizard.jackson.Jackson; -import io.dropwizard.jersey.validation.Validators; -import java.io.File; -import java.io.IOException; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - -public class SubstitutingConfigurationFactoryTest { - private static String previousProperty; - private static SubstitutingConfigurationFactory factory; - - @BeforeAll - public static void beforeClass() throws IOException { - previousProperty = System.getProperty(KeyFileUtils.KEY_PATH_PROPERTY); - System.setProperty(KeyFileUtils.KEY_PATH_PROPERTY, "src/test/resources/test.key"); - - factory = new SubstitutingConfigurationFactory( - TestConfig.class, - Validators.newValidator(), - Jackson.newObjectMapper(), - "", - new JsonNodeStringReplacer(new DecryptingVariableSubstitutor())); - } - - @AfterAll - public static void afterClass() { - if (previousProperty != null) { - System.setProperty(KeyFileUtils.KEY_PATH_PROPERTY, previousProperty); - } - } - - @Test - public final void decryptionSucceeds() throws IOException, ConfigurationException { - TestConfig config = factory.build(new File("src/test/resources/testConfig.yml")); - - assertThat(config.getEncrypted()).isEqualTo("value"); - assertThat(config.getUnencrypted()).isEqualTo("value"); - assertThat(config.getEncryptedWithSingleQuote()).isEqualTo("don't use quotes"); - assertThat(config.getEncryptedWithDoubleQuote()).isEqualTo("double quote is \""); - assertThat(config.getEncryptedMalformedYaml()).isEqualTo("[oh dear"); - assertThat(config.getArrayWithSomeEncryptedValues()) - .containsExactly("value", "value", "other value", "[oh dear"); - assertThat(config.getPojoWithEncryptedValues()).isEqualTo(Person.of("some-user", "value")); - } - - @Test - public final void decryptionFailsWithNiceMessage() throws IOException, ConfigurationException { - try { - factory.build(new File("src/test/resources/testConfigWithError.yml")); - failBecauseExceptionWasNotThrown(ConfigurationDecryptionException.class); - } catch (ConfigurationDecryptionException e) { - assertThat(e.getMessage()).contains("src/test/resources/testConfigWithError.yml has an error"); - assertThat(e.getMessage()) - .contains( - "The value 'enc:ERROR' for field 'arrayWithSomeEncryptedValues[3]' could not be replaced"); - } - } -} diff --git a/encrypted-config-value-bundle-dropwizard1/src/test/java/com/palantir/config/crypto/VariableSubstitutionTest.java b/encrypted-config-value-bundle-dropwizard1/src/test/java/com/palantir/config/crypto/VariableSubstitutionTest.java deleted file mode 100644 index d52531b3..00000000 --- a/encrypted-config-value-bundle-dropwizard1/src/test/java/com/palantir/config/crypto/VariableSubstitutionTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * (c) Copyright 2018 Palantir Technologies Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.palantir.config.crypto; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.palantir.config.crypto.util.TestConfig; -import io.dropwizard.Application; -import io.dropwizard.setup.Bootstrap; -import io.dropwizard.setup.Environment; -import io.dropwizard.testing.junit5.DropwizardAppExtension; -import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; - -@ExtendWith(DropwizardExtensionsSupport.class) -public final class VariableSubstitutionTest { - - static { - System.setProperty(KeyFileUtils.KEY_PATH_PROPERTY, "src/test/resources/test.key"); - } - - private static final DropwizardAppExtension dropwizard = - new DropwizardAppExtension<>(TestApplication.class, "src/test/resources/testConfig.yml"); - - @Test - public void testCanDecryptValueInConfig() { - assertThat(dropwizard.getConfiguration().getUnencrypted()).isEqualTo("value"); - assertThat(dropwizard.getConfiguration().getEncrypted()).isEqualTo("value"); - assertThat(dropwizard.getConfiguration().getEncryptedWithSingleQuote()).isEqualTo("don't use quotes"); - assertThat(dropwizard.getConfiguration().getEncryptedWithDoubleQuote()).isEqualTo("double quote is \""); - assertThat(dropwizard.getConfiguration().getEncryptedMalformedYaml()).isEqualTo("[oh dear"); - - assertThat(dropwizard.getConfiguration().getArrayWithSomeEncryptedValues()) - .containsExactly("value", "value", "other value", "[oh dear"); - assertThat(dropwizard.getConfiguration().getPojoWithEncryptedValues()).satisfies(person -> { - assertThat(person.getUsername()).isEqualTo("some-user"); - assertThat(person.getPassword()).isEqualTo("value"); - }); - } - - public static final class TestApplication extends Application { - @Override - public void initialize(Bootstrap bootstrap) { - bootstrap.addBundle(new EncryptedConfigValueBundle()); - } - - @Override - public void run(TestConfig _configuration, Environment _environment) {} - } -} diff --git a/encrypted-config-value-bundle-dropwizard1/src/test/java/com/palantir/config/crypto/jackson/JsonNodeStringReplacerTest.java b/encrypted-config-value-bundle-dropwizard1/src/test/java/com/palantir/config/crypto/jackson/JsonNodeStringReplacerTest.java deleted file mode 100644 index cf9c6ff5..00000000 --- a/encrypted-config-value-bundle-dropwizard1/src/test/java/com/palantir/config/crypto/jackson/JsonNodeStringReplacerTest.java +++ /dev/null @@ -1,181 +0,0 @@ -/* - * (c) Copyright 2018 Palantir Technologies Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.palantir.config.crypto.jackson; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.failBecauseExceptionWasNotThrown; -import static org.mockito.Mockito.doThrow; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.BinaryNode; -import com.fasterxml.jackson.databind.node.BooleanNode; -import com.fasterxml.jackson.databind.node.IntNode; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import com.fasterxml.jackson.databind.node.MissingNode; -import com.fasterxml.jackson.databind.node.NullNode; -import com.fasterxml.jackson.databind.node.NumericNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.fasterxml.jackson.databind.node.POJONode; -import com.fasterxml.jackson.databind.node.TextNode; -import com.google.common.collect.ImmutableMap; -import com.palantir.config.crypto.util.StringSubstitutionException; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; -import org.mockito.junit.jupiter.MockitoSettings; -import org.mockito.quality.Strictness; - -@ExtendWith(MockitoExtension.class) -@MockitoSettings(strictness = Strictness.LENIENT) -public final class JsonNodeStringReplacerTest { - - @Mock - private Substitutor substitutor; - - @Mock - private Throwable cause; - - private JsonNodeStringReplacer jsonNodeStringReplacer; - - @BeforeEach - public void before() { - jsonNodeStringReplacer = new JsonNodeStringReplacer(substitutor); - } - - @Test - public void visitTextDelegatesToStrSubstitutor() { - TextNode textNode = new TextNode("abc"); - when(substitutor.replace("abc")).thenReturn("def"); - assertThat(jsonNodeStringReplacer.visitText(textNode)).isEqualTo(new TextNode("def")); - } - - @Test - public void visitArrayDispatchesToChildren() { - ArrayNode arrayNode = new ArrayNode(JsonNodeFactory.instance); - arrayNode.add("abc"); - arrayNode.add(1); - - when(substitutor.replace("abc")).thenReturn("def"); - - ArrayNode expected = new ArrayNode(JsonNodeFactory.instance); - expected.add("def"); - expected.add(1); - - assertThat(jsonNodeStringReplacer.visitArray(arrayNode)).isEqualTo(expected); - } - - @Test - public void visitArrayExtendsStringSubstitutionException() { - ArrayNode arrayNode = new ArrayNode(JsonNodeFactory.instance); - arrayNode.add(1); - arrayNode.add(2); - arrayNode.add(new ObjectNode( - JsonNodeFactory.instance, ImmutableMap.of("key", new TextNode("abc")))); - arrayNode.add(4); - - doThrow(new StringSubstitutionException(cause, "abc")).when(substitutor).replace("abc"); - - try { - jsonNodeStringReplacer.visitArray(arrayNode); - failBecauseExceptionWasNotThrown(StringSubstitutionException.class); - } catch (StringSubstitutionException e) { - assertThat(e.getValue()).isEqualTo("abc"); - assertThat(e.getField()).isEqualTo("[2].key"); - } - } - - @Test - public void visitObjectDispatchesToChildren() { - ObjectNode objectNode = new ObjectNode( - JsonNodeFactory.instance, - ImmutableMap.of( - "key1", new TextNode("abc"), - "key2", new IntNode(1))); - - when(substitutor.replace("abc")).thenReturn("def"); - - ObjectNode expected = new ObjectNode( - JsonNodeFactory.instance, - ImmutableMap.of( - "key1", new TextNode("def"), - "key2", new IntNode(1))); - - assertThat(jsonNodeStringReplacer.visitObject(objectNode)).isEqualTo(expected); - } - - @Test - public void visitObjectExtendsStringSubstitutionException() { - ArrayNode arrayNode = new ArrayNode(JsonNodeFactory.instance); - arrayNode.add(1); - arrayNode.add(2); - arrayNode.add(new ObjectNode( - JsonNodeFactory.instance, ImmutableMap.of("key", new TextNode("abc")))); - arrayNode.add(4); - - ObjectNode objectNode = new ObjectNode( - JsonNodeFactory.instance, ImmutableMap.of("key1", new IntNode(1), "key2", arrayNode)); - - doThrow(new StringSubstitutionException(cause, "abc")).when(substitutor).replace("abc"); - - try { - jsonNodeStringReplacer.visitObject(objectNode); - failBecauseExceptionWasNotThrown(StringSubstitutionException.class); - } catch (StringSubstitutionException e) { - assertThat(e.getValue()).isEqualTo("abc"); - assertThat(e.getField()).isEqualTo("key2[2].key"); - } - } - - @Test - public void visitBinaryPassesThrough() { - BinaryNode binaryNode = mock(BinaryNode.class); - assertThat(jsonNodeStringReplacer.visitBinary(binaryNode)).isEqualTo(binaryNode); - } - - @Test - public void visitBooleanPassesThrough() { - BooleanNode booleanNode = mock(BooleanNode.class); - assertThat(jsonNodeStringReplacer.visitBoolean(booleanNode)).isEqualTo(booleanNode); - } - - @Test - public void visitNumericPassesThrough() { - NumericNode numericNode = mock(NumericNode.class); - assertThat(jsonNodeStringReplacer.visitNumeric(numericNode)).isEqualTo(numericNode); - } - - @Test - public void visitPojoPassesThrough() { - POJONode pojoNode = mock(POJONode.class); - assertThat(jsonNodeStringReplacer.visitPojo(pojoNode)).isEqualTo(pojoNode); - } - - @Test - public void visitNullReturnsNullNodeInstance() { - assertThat(jsonNodeStringReplacer.visitNull()).isEqualTo(NullNode.getInstance()); - } - - @Test - public void visitMissingReturnsMissingNodeInstance() { - assertThat(jsonNodeStringReplacer.visitMissing()).isEqualTo(MissingNode.getInstance()); - } -} diff --git a/encrypted-config-value-bundle-dropwizard1/src/test/java/com/palantir/config/crypto/util/Person.java b/encrypted-config-value-bundle-dropwizard1/src/test/java/com/palantir/config/crypto/util/Person.java deleted file mode 100644 index 600dafa8..00000000 --- a/encrypted-config-value-bundle-dropwizard1/src/test/java/com/palantir/config/crypto/util/Person.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * (c) Copyright 2018 Palantir Technologies Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.palantir.config.crypto.util; - -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import org.immutables.value.Value; - -@Value.Immutable -@JsonSerialize(as = ImmutablePerson.class) -@JsonDeserialize(as = ImmutablePerson.class) -public abstract class Person { - @Value.Parameter - public abstract String getUsername(); - - @Value.Parameter - public abstract String getPassword(); - - public static Person of(String username, String password) { - return ImmutablePerson.of(username, password); - } -} diff --git a/encrypted-config-value-bundle-dropwizard1/src/test/java/com/palantir/config/crypto/util/TestConfig.java b/encrypted-config-value-bundle-dropwizard1/src/test/java/com/palantir/config/crypto/util/TestConfig.java deleted file mode 100644 index 215df961..00000000 --- a/encrypted-config-value-bundle-dropwizard1/src/test/java/com/palantir/config/crypto/util/TestConfig.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * (c) Copyright 2018 Palantir Technologies Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.palantir.config.crypto.util; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.dropwizard.Configuration; -import java.util.List; - -public final class TestConfig extends Configuration { - private final String unencrypted; - private final String encrypted; - private final String encryptedWithSingleQuote; - private final String encryptedWithDoubleQuote; - private final String encryptedMalformedYaml; - private final List arrayWithSomeEncryptedValues; - private final Person pojoWithEncryptedValues; - - public TestConfig( - @JsonProperty("unencrypted") String unencrypted, - @JsonProperty("encrypted") String encrypted, - @JsonProperty("encryptedWithSingleQuote") String encryptedWithSingleQuote, - @JsonProperty("encryptedWithDoubleQuote") String encryptedWithDoubleQuote, - @JsonProperty("encryptedMalformedYaml") String encryptedMalformedYaml, - @JsonProperty("arrayWithSomeEncryptedValues") List arrayWithSomeEncryptedValues, - @JsonProperty("pojoWithEncryptedValues") Person pojoWithEncryptedValues) { - this.unencrypted = unencrypted; - this.encrypted = encrypted; - this.encryptedWithSingleQuote = encryptedWithSingleQuote; - this.encryptedWithDoubleQuote = encryptedWithDoubleQuote; - this.encryptedMalformedYaml = encryptedMalformedYaml; - this.arrayWithSomeEncryptedValues = arrayWithSomeEncryptedValues; - this.pojoWithEncryptedValues = pojoWithEncryptedValues; - } - - public String getUnencrypted() { - return unencrypted; - } - - public String getEncrypted() { - return encrypted; - } - - public String getEncryptedWithSingleQuote() { - return encryptedWithSingleQuote; - } - - public String getEncryptedWithDoubleQuote() { - return encryptedWithDoubleQuote; - } - - public String getEncryptedMalformedYaml() { - return encryptedMalformedYaml; - } - - public List getArrayWithSomeEncryptedValues() { - return arrayWithSomeEncryptedValues; - } - - public Person getPojoWithEncryptedValues() { - return pojoWithEncryptedValues; - } -} diff --git a/encrypted-config-value-bundle-dropwizard1/src/test/resources/test.key b/encrypted-config-value-bundle-dropwizard1/src/test/resources/test.key deleted file mode 100644 index 2de683b9..00000000 --- a/encrypted-config-value-bundle-dropwizard1/src/test/resources/test.key +++ /dev/null @@ -1 +0,0 @@ -AES:vgwWG0UUo39Hhfru2dD7Nw== \ No newline at end of file diff --git a/encrypted-config-value-bundle-dropwizard1/src/test/resources/testConfig.yml b/encrypted-config-value-bundle-dropwizard1/src/test/resources/testConfig.yml deleted file mode 100644 index af36e310..00000000 --- a/encrypted-config-value-bundle-dropwizard1/src/test/resources/testConfig.yml +++ /dev/null @@ -1,13 +0,0 @@ -unencrypted: value -encrypted: ${enc:INNv4cGkVF45MLWZhgVZdIsgQ4zKvbMoJ978Es3MIKgrtz5eeTuOCLM1vPbQm97ejz2EK6M=} -encryptedWithSingleQuote: ${enc:NcsMVEFTDL7mpCDlHe3aMPriDohAnTbmy/Eh3Ix2KC1hibsuFYFuU0X7a9CqAiLZHCGfAth0i8kzBOji7yRxpQ==} -encryptedWithDoubleQuote: ${enc:CfaCBbD7T1rcTe0LhLt34n77pHwx8R4IPx5XoPDcJirRqRMfsrc/ngd+vd5AJItNu56UQagYnVqHuRWZIhGC0s4=} -encryptedMalformedYaml: ${enc:edhPbHr7h2sFrTiCBzOpltIKDboXHqiEhsLSeYAdmxGJdXe+safSnDmZxCLQm5tADUkYgWZqHF8=} -arrayWithSomeEncryptedValues: - - ${enc:INNv4cGkVF45MLWZhgVZdIsgQ4zKvbMoJ978Es3MIKgrtz5eeTuOCLM1vPbQm97ejz2EK6M=} - - value - - other value - - ${enc:edhPbHr7h2sFrTiCBzOpltIKDboXHqiEhsLSeYAdmxGJdXe+safSnDmZxCLQm5tADUkYgWZqHF8=} -pojoWithEncryptedValues: - username: some-user - password: ${enc:INNv4cGkVF45MLWZhgVZdIsgQ4zKvbMoJ978Es3MIKgrtz5eeTuOCLM1vPbQm97ejz2EK6M=} diff --git a/encrypted-config-value-bundle-dropwizard1/src/test/resources/testConfigWithError.yml b/encrypted-config-value-bundle-dropwizard1/src/test/resources/testConfigWithError.yml deleted file mode 100644 index 267d59c5..00000000 --- a/encrypted-config-value-bundle-dropwizard1/src/test/resources/testConfigWithError.yml +++ /dev/null @@ -1,13 +0,0 @@ -unencrypted: value -encrypted: ${enc:INNv4cGkVF45MLWZhgVZdIsgQ4zKvbMoJ978Es3MIKgrtz5eeTuOCLM1vPbQm97ejz2EK6M=} -encryptedWithSingleQuote: ${enc:NcsMVEFTDL7mpCDlHe3aMPriDohAnTbmy/Eh3Ix2KC1hibsuFYFuU0X7a9CqAiLZHCGfAth0i8kzBOji7yRxpQ==} -encryptedWithDoubleQuote: ${enc:CfaCBbD7T1rcTe0LhLt34n77pHwx8R4IPx5XoPDcJirRqRMfsrc/ngd+vd5AJItNu56UQagYnVqHuRWZIhGC0s4=} -encryptedMalformedYaml: ${enc:edhPbHr7h2sFrTiCBzOpltIKDboXHqiEhsLSeYAdmxGJdXe+safSnDmZxCLQm5tADUkYgWZqHF8=} -arrayWithSomeEncryptedValues: - - ${enc:INNv4cGkVF45MLWZhgVZdIsgQ4zKvbMoJ978Es3MIKgrtz5eeTuOCLM1vPbQm97ejz2EK6M=} - - value - - other value - - ${enc:ERROR} -pojoWithEncryptedValues: - username: some-user - password: ${enc:INNv4cGkVF45MLWZhgVZdIsgQ4zKvbMoJ978Es3MIKgrtz5eeTuOCLM1vPbQm97ejz2EK6M=} diff --git a/settings.gradle b/settings.gradle index 05e1f00c..09169bc3 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,5 +1,4 @@ rootProject.name = 'encrypted-config-value-root' include 'encrypted-config-value' -include 'encrypted-config-value-bundle-dropwizard1' include 'encrypted-config-value-module' diff --git a/versions.lock b/versions.lock index 09a568d4..4fc3de17 100644 --- a/versions.lock +++ b/versions.lock @@ -1,106 +1,22 @@ # Run ./gradlew --write-locks to regenerate this file -ch.qos.logback:logback-access:1.2.3 (1 constraints: b41148e2) -ch.qos.logback:logback-classic:1.2.3 (2 constraints: 8c1d4e13) -ch.qos.logback:logback-core:1.2.3 (3 constraints: 1a28577f) -com.fasterxml:classmate:1.3.1 (1 constraints: a40e4f58) -com.fasterxml.jackson.core:jackson-annotations:2.15.3 (7 constraints: 087abdad) -com.fasterxml.jackson.core:jackson-core:2.15.3 (10 constraints: f6c7c943) -com.fasterxml.jackson.core:jackson-databind:2.15.3 (9 constraints: d2b5adc2) -com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.15.3 (2 constraints: 81160f05) -com.fasterxml.jackson.datatype:jackson-datatype-guava:2.15.3 (1 constraints: b60e755e) -com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.15.3 (1 constraints: b60e755e) -com.fasterxml.jackson.datatype:jackson-datatype-joda:2.15.3 (1 constraints: b60e755e) -com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.15.3 (1 constraints: b60e755e) -com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:2.15.3 (1 constraints: 7a176b3d) -com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:2.15.3 (1 constraints: 5f0e824e) -com.fasterxml.jackson.module:jackson-module-afterburner:2.15.3 (1 constraints: b60e755e) -com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.15.3 (1 constraints: 7a176b3d) -com.fasterxml.jackson.module:jackson-module-parameter-names:2.15.3 (1 constraints: b60e755e) -com.google.code.findbugs:jsr305:3.0.2 (3 constraints: 701c32e5) +com.fasterxml.jackson.core:jackson-annotations:2.15.3 (2 constraints: c717fa71) +com.fasterxml.jackson.core:jackson-core:2.15.3 (3 constraints: 972fc9ea) +com.fasterxml.jackson.core:jackson-databind:2.15.3 (2 constraints: 0d1d31ec) +com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.15.3 (1 constraints: 3d05413b) +com.google.code.findbugs:jsr305:3.0.2 (2 constraints: 1d0fb186) com.google.errorprone:error_prone_annotations:2.11.0 (3 constraints: 8120e256) com.google.guava:failureaccess:1.0.1 (1 constraints: 140ae1b4) -com.google.guava:guava:31.1-jre (5 constraints: 2c4d7146) +com.google.guava:guava:31.1-jre (1 constraints: 47069c47) com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava (1 constraints: bd17c918) com.google.j2objc:j2objc-annotations:1.3 (1 constraints: b809eda0) -com.helger:profiler:1.1.1 (1 constraints: e21053b8) com.palantir.safe-logging:preconditions:3.3.0 (1 constraints: 08050336) com.palantir.safe-logging:safe-logging:3.3.0 (2 constraints: 09168de7) -io.dropwizard:dropwizard-configuration:1.3.29 (2 constraints: 7b12f725) -io.dropwizard:dropwizard-core:1.3.29 (2 constraints: d0133268) -io.dropwizard:dropwizard-jackson:1.3.29 (6 constraints: 9f4f8b2b) -io.dropwizard:dropwizard-jersey:1.3.29 (2 constraints: 7b12f725) -io.dropwizard:dropwizard-jetty:1.3.29 (2 constraints: 651f7ec2) -io.dropwizard:dropwizard-lifecycle:1.3.29 (2 constraints: 3f1cd3c1) -io.dropwizard:dropwizard-logging:1.3.29 (4 constraints: c53bbb5c) -io.dropwizard:dropwizard-metrics:1.3.29 (1 constraints: 790daa2c) -io.dropwizard:dropwizard-request-logging:1.3.29 (1 constraints: 790daa2c) -io.dropwizard:dropwizard-servlets:1.3.29 (1 constraints: 790daa2c) -io.dropwizard:dropwizard-util:1.3.29 (5 constraints: f14aafd5) -io.dropwizard:dropwizard-validation:1.3.29 (6 constraints: dd4f2f64) -io.dropwizard.metrics:metrics-annotation:4.1.16 (2 constraints: ab1f76f2) -io.dropwizard.metrics:metrics-core:4.1.16 (11 constraints: 83a9f700) -io.dropwizard.metrics:metrics-healthchecks:4.1.16 (2 constraints: 901e497c) -io.dropwizard.metrics:metrics-jersey2:4.1.16 (1 constraints: 5f0e744e) -io.dropwizard.metrics:metrics-jetty9:4.1.16 (1 constraints: fd0d303e) -io.dropwizard.metrics:metrics-jmx:4.1.16 (1 constraints: 760daf2c) -io.dropwizard.metrics:metrics-json:4.1.16 (1 constraints: 1b117dc9) -io.dropwizard.metrics:metrics-jvm:4.1.16 (2 constraints: 901e497c) -io.dropwizard.metrics:metrics-logback:4.1.16 (1 constraints: b40e925e) -io.dropwizard.metrics:metrics-servlets:4.1.16 (1 constraints: 760daf2c) -javax.activation:javax.activation-api:1.2.0 (2 constraints: 7223878b) -javax.annotation:javax.annotation-api:1.2 (2 constraints: 2d21193d) -javax.inject:javax.inject:1 (2 constraints: d614a0ab) -javax.servlet:javax.servlet-api:3.1.0 (1 constraints: 830dcc28) -javax.validation:validation-api:1.1.0.Final (3 constraints: dc393f20) -javax.ws.rs:javax.ws.rs-api:2.0.1 (8 constraints: ed9109e8) -javax.xml.bind:jaxb-api:2.3.1 (2 constraints: 592759d6) -joda-time:joda-time:2.10.14 (2 constraints: e523b69d) -net.sourceforge.argparse4j:argparse4j:0.8.1 (1 constraints: 430d3a1f) -org.apache.commons:commons-lang3:3.11 (3 constraints: 712c254a) -org.apache.commons:commons-text:1.9 (1 constraints: b5102f9b) org.checkerframework:checker-qual:3.12.0 (1 constraints: 480a3bbf) -org.eclipse.jetty:jetty-continuation:9.4.35.v20201120 (2 constraints: 6421a041) -org.eclipse.jetty:jetty-http:9.4.35.v20201120 (3 constraints: f130624d) -org.eclipse.jetty:jetty-io:9.4.35.v20201120 (3 constraints: d82ffbaa) -org.eclipse.jetty:jetty-security:9.4.35.v20201120 (1 constraints: 5e102ae2) -org.eclipse.jetty:jetty-server:9.4.35.v20201120 (4 constraints: 46435c4b) -org.eclipse.jetty:jetty-servlet:9.4.35.v20201120 (2 constraints: 092048cc) -org.eclipse.jetty:jetty-servlets:9.4.35.v20201120 (1 constraints: 321072d7) -org.eclipse.jetty:jetty-util:9.4.35.v20201120 (6 constraints: 915eb6b6) -org.eclipse.jetty:jetty-util-ajax:9.4.35.v20201120 (1 constraints: 5e102ae2) -org.eclipse.jetty:jetty-webapp:9.4.35.v20201120 (1 constraints: 94108aeb) -org.eclipse.jetty:jetty-xml:9.4.35.v20201120 (1 constraints: d80f08cb) -org.eclipse.jetty.toolchain.setuid:jetty-setuid-java:1.0.4 (1 constraints: 3f0d2a1f) -org.glassfish:javax.el:3.0.0 (1 constraints: bf0f5484) -org.glassfish.hk2:hk2-api:2.5.0-b32 (5 constraints: 985605c5) -org.glassfish.hk2:hk2-locator:2.5.0-b32 (4 constraints: 3949d563) -org.glassfish.hk2:hk2-utils:2.5.0-b32 (2 constraints: 0519152b) -org.glassfish.hk2:osgi-resource-locator:1.0.1 (2 constraints: 79234465) -org.glassfish.hk2.external:aopalliance-repackaged:2.5.0-b32 (2 constraints: 0519152b) -org.glassfish.hk2.external:javax.inject:2.5.0-b32 (7 constraints: 3e86b56f) -org.glassfish.jersey.bundles.repackaged:jersey-guava:2.25.1 (1 constraints: 251120d4) -org.glassfish.jersey.containers:jersey-container-servlet:2.25.1 (1 constraints: 5d0e764e) -org.glassfish.jersey.containers:jersey-container-servlet-core:2.25.1 (2 constraints: 5c320e27) -org.glassfish.jersey.core:jersey-client:2.25.1 (2 constraints: dc34f938) -org.glassfish.jersey.core:jersey-common:2.25.1 (7 constraints: 0a90843b) -org.glassfish.jersey.core:jersey-server:2.25.1 (6 constraints: 859288bb) -org.glassfish.jersey.ext:jersey-bean-validation:2.25.1 (1 constraints: 5d0e764e) -org.glassfish.jersey.ext:jersey-metainf-services:2.25.1 (1 constraints: 5d0e764e) -org.glassfish.jersey.media:jersey-media-jaxb:2.25.1 (1 constraints: 3311f9d4) -org.hibernate:hibernate-validator:5.4.3.Final (2 constraints: f827fc21) org.immutables:value:2.9.3 (1 constraints: 10051336) -org.javassist:javassist:3.27.0-GA (2 constraints: fb1d1fc2) -org.jboss.logging:jboss-logging:3.3.0.Final (1 constraints: bd10c4b6) org.jetbrains:annotations:24.0.1 (1 constraints: 331164d1) -org.slf4j:jcl-over-slf4j:1.7.36 (1 constraints: b30e965e) -org.slf4j:jul-to-slf4j:1.7.36 (1 constraints: b30e965e) -org.slf4j:log4j-over-slf4j:1.7.36 (1 constraints: b30e965e) -org.slf4j:slf4j-api:1.7.36 (10 constraints: 708c7a54) org.yaml:snakeyaml:2.1 (1 constraints: 3b178a10) [Test dependencies] -io.dropwizard:dropwizard-testing:1.3.29 (1 constraints: 0305f035) -junit:junit:4.13.1 (3 constraints: ed4b45b4) net.bytebuddy:byte-buddy:1.14.4 (2 constraints: c016a64f) net.bytebuddy:byte-buddy-agent:1.14.4 (1 constraints: 440b42de) net.jqwik:jqwik:1.7.3 (1 constraints: 0d050836) @@ -109,10 +25,7 @@ net.jqwik:jqwik-engine:1.7.3 (1 constraints: 9e07fa6c) net.jqwik:jqwik-time:1.7.3 (1 constraints: 9e07fa6c) net.jqwik:jqwik-web:1.7.3 (1 constraints: 9e07fa6c) org.apiguardian:apiguardian-api:1.1.2 (10 constraints: 4f819858) -org.assertj:assertj-core:3.24.2 (2 constraints: 08141f77) -org.glassfish.jersey.test-framework:jersey-test-framework-core:2.25.1 (1 constraints: aa230902) -org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-inmemory:2.25.1 (1 constraints: c90ee65f) -org.hamcrest:hamcrest-core:1.3 (1 constraints: cc05fe3f) +org.assertj:assertj-core:3.24.2 (1 constraints: 3d05473b) org.junit.jupiter:junit-jupiter:5.9.2 (1 constraints: 12052136) org.junit.jupiter:junit-jupiter-api:5.9.2 (5 constraints: 5443e2b5) org.junit.jupiter:junit-jupiter-engine:5.9.2 (1 constraints: 0d0ee23b) @@ -121,5 +34,5 @@ org.junit.platform:junit-platform-commons:1.9.2 (4 constraints: 2534f5b0) org.junit.platform:junit-platform-engine:1.9.2 (2 constraints: ed1abb4e) org.mockito:mockito-core:5.3.0 (2 constraints: cc132265) org.mockito:mockito-junit-jupiter:5.3.0 (1 constraints: 0a050d36) -org.objenesis:objenesis:3.3 (3 constraints: 8f1d121c) +org.objenesis:objenesis:3.3 (2 constraints: 5b0fbd79) org.opentest4j:opentest4j:1.2.0 (6 constraints: 72469adf) diff --git a/versions.props b/versions.props index 54860af4..ce5100f1 100644 --- a/versions.props +++ b/versions.props @@ -4,13 +4,9 @@ com.google.code.findbugs:jsr305 = 3.0.2 com.google.errorprone:error_prone_annotations = 2.9.0 com.google.guava:guava = 31.1-jre com.palantir.safe-logging:* = 3.3.0 -io.dropwizard:* = 1.0.0 -io.dropwizard:dropwizard-validation = 1.3.29 -javax.ws.rs:javax.ws.rs-api = 2.0.1 net.jqwik:* = 1.7.3 org.assertj:assertj-core = 3.24.2 org.immutables:* = 2.9.3 org.junit.jupiter:* = 5.9.2 org.mockito:* = 5.3.0 org.objenesis:objenesis = 3.3 -org.slf4j:* = 1.7.36