-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40079 from gsmet/config-leak-3.8
[3.8] Do not record local sources in runtime config defaults
- Loading branch information
Showing
12 changed files
with
141 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
...ed/projects/build-mode-quarkus-profile-override/src/main/resources/application.properties
This file was deleted.
Oops, something went wrong.
7 changes: 1 addition & 6 deletions
7
...red/projects/build-mode-quarkus-profile-property/src/main/java/org/acme/HelloService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,13 @@ | ||
package org.acme; | ||
|
||
import io.quarkus.arc.profile.IfBuildProfile; | ||
import org.eclipse.microprofile.config.inject.ConfigProperty; | ||
|
||
import jakarta.enterprise.context.ApplicationScoped; | ||
|
||
@IfBuildProfile("foo") | ||
@ApplicationScoped | ||
public class HelloService { | ||
|
||
@ConfigProperty(name = "name") | ||
String name; | ||
|
||
public String name() { | ||
return name; | ||
return "from foo"; | ||
} | ||
} |
2 changes: 0 additions & 2 deletions
2
...ed/projects/build-mode-quarkus-profile-property/src/main/resources/application.properties
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...on/runtime/src/main/java/io/quarkus/extest/runtime/config/DoNotRecordEnvConfigSource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package io.quarkus.extest.runtime.config; | ||
|
||
import java.util.Map; | ||
|
||
import io.quarkus.runtime.annotations.StaticInitSafe; | ||
import io.smallrye.config.EnvConfigSource; | ||
|
||
@StaticInitSafe | ||
public class DoNotRecordEnvConfigSource extends EnvConfigSource { | ||
public DoNotRecordEnvConfigSource() { | ||
super(Map.of( | ||
"SHOULD_NOT_BE_RECORDED", "value", | ||
"should.not.be.recorded", "value", | ||
"quarkus.rt.do-not-record", "value", | ||
"quarkus.mapping.rt.do-not-record", "value", | ||
"%dev.quarkus.mapping.rt.do-not-record", "dev", | ||
"_PROD_QUARKUS_MAPPING_RT_DO_NOT_RECORD", "prod"), 300); | ||
} | ||
} |
14 changes: 7 additions & 7 deletions
14
...sion/runtime/src/main/java/io/quarkus/extest/runtime/config/EnvBuildTimeConfigSource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
package io.quarkus.extest.runtime.config; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import io.smallrye.config.EnvConfigSource; | ||
|
||
public class EnvBuildTimeConfigSource extends EnvConfigSource { | ||
public EnvBuildTimeConfigSource() { | ||
super(new HashMap<>() { | ||
{ | ||
put("QUARKUS_RT_RT_STRING_OPT", "changed"); | ||
put("BT_DO_NOT_RECORD", "env-source"); | ||
} | ||
}, Integer.MAX_VALUE); | ||
super(Map.of( | ||
"QUARKUS_PROFILE", "record", | ||
"QUARKUS_MAPPING_RT_DO_NOT_RECORD", "value", | ||
"BT_OK_TO_RECORD", "from-env", | ||
"BT_DO_NOT_RECORD", "value", | ||
"DO_NOT_RECORD", "value"), Integer.MAX_VALUE); | ||
} | ||
} |
Oops, something went wrong.