diff --git a/bom/application/pom.xml b/bom/application/pom.xml
index fccb16fc3e5721..044e9f8114a888 100644
--- a/bom/application/pom.xml
+++ b/bom/application/pom.xml
@@ -54,8 +54,8 @@
2.1
2.0
3.1
- 2.1.0
- 3.1.3
+ 2.0.0
+ 3.1.4-SNAPSHOT
4.0.1
4.0.0
3.3.0
@@ -3804,6 +3804,11 @@
smallrye-config-common
${smallrye-config.version}
+
+ io.smallrye.config
+ smallrye-config-core
+ ${smallrye-config.version}
+
io.smallrye.config
smallrye-config-validator
@@ -3821,7 +3826,12 @@
io.smallrye.config
- smallrye-config-core
+ smallrye-config-source-keystore
+ ${smallrye-config.version}
+
+
+ io.smallrye.config
+ smallrye-config-crypto
${smallrye-config.version}
diff --git a/core/deployment/src/main/java/io/quarkus/deployment/QuarkusAugmentor.java b/core/deployment/src/main/java/io/quarkus/deployment/QuarkusAugmentor.java
index dba8f2b5eeb887..c5380c77d56644 100644
--- a/core/deployment/src/main/java/io/quarkus/deployment/QuarkusAugmentor.java
+++ b/core/deployment/src/main/java/io/quarkus/deployment/QuarkusAugmentor.java
@@ -13,7 +13,6 @@
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
-import org.eclipse.microprofile.config.spi.ConfigProviderResolver;
import org.jboss.logging.Logger;
import io.quarkus.bootstrap.classloading.QuarkusClassLoader;
@@ -38,6 +37,7 @@
import io.quarkus.paths.PathCollection;
import io.quarkus.runtime.LaunchMode;
import io.quarkus.runtime.util.JavaVersionUtil;
+import io.smallrye.config.SmallRyeConfigProviderResolver;
public class QuarkusAugmentor {
@@ -177,8 +177,8 @@ public BuildResult run() throws Exception {
return buildResult;
} finally {
try {
- ConfigProviderResolver.instance()
- .releaseConfig(ConfigProviderResolver.instance().getConfig(deploymentClassLoader));
+ ((SmallRyeConfigProviderResolver) SmallRyeConfigProviderResolver.instance())
+ .releaseConfig(deploymentClassLoader);
} catch (Exception ignore) {
}
diff --git a/core/deployment/src/main/java/io/quarkus/deployment/steps/ConfigBuildSteps.java b/core/deployment/src/main/java/io/quarkus/deployment/steps/ConfigBuildSteps.java
index 51eab2942912f0..a3bdf3071a2c92 100644
--- a/core/deployment/src/main/java/io/quarkus/deployment/steps/ConfigBuildSteps.java
+++ b/core/deployment/src/main/java/io/quarkus/deployment/steps/ConfigBuildSteps.java
@@ -34,6 +34,8 @@
import io.smallrye.config.ConfigSourceInterceptor;
import io.smallrye.config.ConfigSourceInterceptorFactory;
import io.smallrye.config.ConfigValidator;
+import io.smallrye.config.SecretKeysHandler;
+import io.smallrye.config.SecretKeysHandlerFactory;
import io.smallrye.config.SmallRyeConfigProviderResolver;
class ConfigBuildSteps {
@@ -90,6 +92,8 @@ void nativeServiceProviders(
Converter.class,
ConfigSourceInterceptor.class,
ConfigSourceInterceptorFactory.class,
+ SecretKeysHandler.class,
+ SecretKeysHandlerFactory.class,
ConfigValidator.class)) {
final String serviceName = serviceClass.getName();
final Set names = ServiceUtil.classNamesNamedIn(classLoader, SERVICES_PREFIX + serviceName);
diff --git a/core/runtime/src/main/java/io/quarkus/runtime/configuration/ConfigUtils.java b/core/runtime/src/main/java/io/quarkus/runtime/configuration/ConfigUtils.java
index 5c04a6a4f41997..e9fe18f97ed53a 100644
--- a/core/runtime/src/main/java/io/quarkus/runtime/configuration/ConfigUtils.java
+++ b/core/runtime/src/main/java/io/quarkus/runtime/configuration/ConfigUtils.java
@@ -90,14 +90,8 @@ public static SmallRyeConfigBuilder configBuilder(final boolean runTime, final b
final boolean addDiscovered, final LaunchMode launchMode) {
SmallRyeConfigBuilder builder = emptyConfigBuilder();
- ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
- builder.forClassLoader(classLoader);
- builder.addDefaultSources();
- builder.withSources(new ApplicationPropertiesConfigSourceLoader.InFileSystem());
- builder.withSources(new ApplicationPropertiesConfigSourceLoader.InClassPath());
- builder.withSources(new DotEnvConfigSourceProvider());
if (launchMode.isDevOrTest() && (runTime || bootstrap)) {
- builder.withSources(new RuntimeOverrideConfigSource(classLoader));
+ builder.withSources(new RuntimeOverrideConfigSource(Thread.currentThread().getContextClassLoader()));
}
if (runTime || bootstrap) {
// Validator only for runtime. We cannot use the current validator for build time (chicken / egg problem)
@@ -184,9 +178,16 @@ public OptionalInt getPriority() {
// Ignore unmapped quarkus properties, because properties in the same root may be split between build / runtime
builder.withMappingIgnore("quarkus.**");
- builder.addDefaultInterceptors();
- builder.addDiscoveredInterceptors();
- builder.addDiscoveredConverters();
+ builder.forClassLoader(Thread.currentThread().getContextClassLoader())
+ .addDiscoveredConverters()
+ .addDefaultInterceptors()
+ .addDiscoveredInterceptors()
+ .addDiscoveredSecretKeysHandlers()
+ .addDefaultSources()
+ .withSources(new ApplicationPropertiesConfigSourceLoader.InFileSystem())
+ .withSources(new ApplicationPropertiesConfigSourceLoader.InClassPath())
+ .withSources(new DotEnvConfigSourceProvider());
+
return builder;
}
diff --git a/core/runtime/src/main/java/io/quarkus/runtime/configuration/QuarkusConfigFactory.java b/core/runtime/src/main/java/io/quarkus/runtime/configuration/QuarkusConfigFactory.java
index eafd80022e91bd..9f168ae907e6f8 100644
--- a/core/runtime/src/main/java/io/quarkus/runtime/configuration/QuarkusConfigFactory.java
+++ b/core/runtime/src/main/java/io/quarkus/runtime/configuration/QuarkusConfigFactory.java
@@ -26,7 +26,7 @@ public SmallRyeConfig getConfigFor(final SmallRyeConfigProviderResolver configPr
//TODO: this code path is only hit when start fails in dev mode very early in the process
//the recovery code will fail without this as it cannot read any properties such as
//the HTTP port or logging info
- return ConfigUtils.emptyConfigBuilder().addDefaultSources().addDiscoveredSources().build();
+ return ConfigUtils.emptyConfigBuilder().addDiscoveredSources().build();
}
return config;
}
diff --git a/core/runtime/src/test/java/io/quarkus/runtime/configuration/ConfigExpanderTestCase.java b/core/runtime/src/test/java/io/quarkus/runtime/configuration/ConfigExpanderTestCase.java
index 3c62be1e69f18c..897d54d1c4cf36 100644
--- a/core/runtime/src/test/java/io/quarkus/runtime/configuration/ConfigExpanderTestCase.java
+++ b/core/runtime/src/test/java/io/quarkus/runtime/configuration/ConfigExpanderTestCase.java
@@ -10,7 +10,6 @@
import org.junit.jupiter.api.Test;
-import io.smallrye.config.ExpressionConfigSourceInterceptor;
import io.smallrye.config.PropertiesConfigSource;
import io.smallrye.config.SmallRyeConfig;
import io.smallrye.config.SmallRyeConfigBuilder;
@@ -20,11 +19,10 @@
public class ConfigExpanderTestCase {
private SmallRyeConfig buildConfig(Map configMap) {
- final SmallRyeConfigBuilder builder = new SmallRyeConfigBuilder();
- builder.withInterceptors(new ExpressionConfigSourceInterceptor());
- builder.withSources(new PropertiesConfigSource(configMap, "test input", 500));
- final SmallRyeConfig config = (SmallRyeConfig) builder.build();
- return config;
+ return new SmallRyeConfigBuilder()
+ .addDefaultInterceptors()
+ .withSources(new PropertiesConfigSource(configMap, "test input", 500))
+ .build();
}
private Map maps(Map... maps) {
diff --git a/independent-projects/tools/pom.xml b/independent-projects/tools/pom.xml
index c4846aeaec8cf1..7560284cdbeacd 100644
--- a/independent-projects/tools/pom.xml
+++ b/independent-projects/tools/pom.xml
@@ -66,7 +66,7 @@
999-SNAPSHOT
21
2.11.0
- 1.13.2
+ 2.1.0
3.0.5
diff --git a/integration-tests/smallrye-config/.env b/integration-tests/smallrye-config/.env
index 5d20f3e113b6fd..decac569ed32d5 100644
--- a/integration-tests/smallrye-config/.env
+++ b/integration-tests/smallrye-config/.env
@@ -1,6 +1,6 @@
DOTENV_SERVER_NAME=localhost
DOTENV_SERVER_PORT=8080
-_TEST_QUARKUS_DATASOURCE_DB_KIND=h2
-_TEST_QUARKUS_DATASOURCE_JDBC_URL=jdbc:h2:mem:test;MODE=PostgreSQL;DB_CLOSE_DELAY=-1
-_TEST_QUARKUS_HIBERNATE_ORM_DATABASE_GENERATION=drop-and-create
+QUARKUS_DATASOURCE_DB_KIND=h2
+QUARKUS_DATASOURCE_JDBC_URL=jdbc:h2:mem:test;MODE=PostgreSQL;DB_CLOSE_DELAY=-1
+QUARKUS_HIBERNATE_ORM_DATABASE_GENERATION=drop-and-create
diff --git a/integration-tests/smallrye-config/keystore b/integration-tests/smallrye-config/keystore
new file mode 100644
index 00000000000000..74db4bb9a9dc92
Binary files /dev/null and b/integration-tests/smallrye-config/keystore differ
diff --git a/integration-tests/smallrye-config/pom.xml b/integration-tests/smallrye-config/pom.xml
index ece98c2440a4ca..190438f577f7f2 100644
--- a/integration-tests/smallrye-config/pom.xml
+++ b/integration-tests/smallrye-config/pom.xml
@@ -19,9 +19,14 @@
io.quarkus
quarkus-hibernate-validator
+
io.quarkus
- quarkus-config-yaml
+ quarkus-hibernate-orm
+
+
+ io.quarkus
+ quarkus-jdbc-h2
io.quarkus
@@ -37,10 +42,23 @@
io.quarkus
quarkus-smallrye-opentracing
+
+
+ io.quarkus
+ quarkus-config-yaml
+
io.smallrye.config
smallrye-config-source-file-system
+
+ io.smallrye.config
+ smallrye-config-source-keystore
+
+
+ io.smallrye.config
+ smallrye-config-crypto
+
io.quarkus
@@ -62,23 +80,6 @@
rest-assured
test
-
-
- io.quarkus
- quarkus-hibernate-orm
- test
-
-
- net.bytebuddy
- byte-buddy
-
-
-
-
- io.quarkus
- quarkus-jdbc-h2
- test
-
@@ -96,7 +97,7 @@
io.quarkus
- quarkus-config-yaml-deployment
+ quarkus-hibernate-orm-deployment
${project.version}
pom
test
@@ -109,7 +110,7 @@
io.quarkus
- quarkus-resteasy-reactive-deployment
+ quarkus-jdbc-h2-deployment
${project.version}
pom
test
@@ -122,7 +123,7 @@
io.quarkus
- quarkus-resteasy-reactive-jackson-deployment
+ quarkus-resteasy-reactive-deployment
${project.version}
pom
test
@@ -135,7 +136,7 @@
io.quarkus
- quarkus-smallrye-opentracing-deployment
+ quarkus-resteasy-reactive-jackson-deployment
${project.version}
pom
test
@@ -148,7 +149,7 @@
io.quarkus
- quarkus-hibernate-orm-deployment
+ quarkus-smallrye-opentracing-deployment
${project.version}
pom
test
@@ -161,7 +162,7 @@
io.quarkus
- quarkus-jdbc-h2-deployment
+ quarkus-config-yaml-deployment
${project.version}
pom
test
@@ -172,7 +173,6 @@
-
diff --git a/integration-tests/smallrye-config/src/main/resources/application.properties b/integration-tests/smallrye-config/src/main/resources/application.properties
index d44dc7bbd9af3f..960766adbc554b 100644
--- a/integration-tests/smallrye-config/src/main/resources/application.properties
+++ b/integration-tests/smallrye-config/src/main/resources/application.properties
@@ -22,3 +22,9 @@ smallrye.config.source.file.locations=src/main/smallrye-config-source-file-syste
no.profile=any
profile.main.properties=main
+
+#secrets
+smallrye.config.secret-handler.aes-gcm-nopadding.encryption-key=somearbitrarycrazystringthatdoesnotmatter
+smallrye.config.source.keystore.test.path=keystore
+smallrye.config.source.keystore.test.password=secret
+smallrye.config.source.keystore.test.handler=aes-gcm-nopadding
diff --git a/integration-tests/smallrye-config/src/test/java/io/quarkus/it/smallrye/config/SecretsIT.java b/integration-tests/smallrye-config/src/test/java/io/quarkus/it/smallrye/config/SecretsIT.java
new file mode 100644
index 00000000000000..4ee4c0fc3b5f35
--- /dev/null
+++ b/integration-tests/smallrye-config/src/test/java/io/quarkus/it/smallrye/config/SecretsIT.java
@@ -0,0 +1,7 @@
+package io.quarkus.it.smallrye.config;
+
+import io.quarkus.test.junit.QuarkusIntegrationTest;
+
+@QuarkusIntegrationTest
+public class SecretsIT extends SecretsTest {
+}
diff --git a/integration-tests/smallrye-config/src/test/java/io/quarkus/it/smallrye/config/SecretsTest.java b/integration-tests/smallrye-config/src/test/java/io/quarkus/it/smallrye/config/SecretsTest.java
new file mode 100644
index 00000000000000..3128db83299163
--- /dev/null
+++ b/integration-tests/smallrye-config/src/test/java/io/quarkus/it/smallrye/config/SecretsTest.java
@@ -0,0 +1,21 @@
+package io.quarkus.it.smallrye.config;
+
+import static io.restassured.RestAssured.given;
+import static jakarta.ws.rs.core.Response.Status.OK;
+import static org.hamcrest.Matchers.equalTo;
+
+import org.junit.jupiter.api.Test;
+
+import io.quarkus.test.junit.QuarkusTest;
+
+@QuarkusTest
+public class SecretsTest {
+ @Test
+ void secrets() {
+ given()
+ .get("/config/{name}", "my.secret")
+ .then()
+ .statusCode(OK.getStatusCode())
+ .body("value", equalTo("decoded"));
+ }
+}
diff --git a/integration-tests/test-extension/extension/deployment/src/test/java/io/quarkus/extest/UnknownBuildConfigTest.java b/integration-tests/test-extension/extension/deployment/src/test/java/io/quarkus/extest/UnknownBuildConfigTest.java
index 2bb9c6a755c607..4b9ad31019f5f9 100644
--- a/integration-tests/test-extension/extension/deployment/src/test/java/io/quarkus/extest/UnknownBuildConfigTest.java
+++ b/integration-tests/test-extension/extension/deployment/src/test/java/io/quarkus/extest/UnknownBuildConfigTest.java
@@ -39,7 +39,7 @@ void unknownBuildConfig() {
.orElse(new Object[0]))
.collect(toSet());
- assertEquals(7, logRecords.size());
+ assertEquals(7, unrecognized.size());
assertTrue(unrecognized.contains("quarkus.unknown.prop"));
assertTrue(unrecognized.contains("quarkus.build.unknown.prop"));
assertTrue(unrecognized.contains("quarkus.rename-old.prop"));