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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ hamcrestVersion=2.2
# Note: if changing this, we might need to match with the picard version in the SequenceAnalysis module build.gradle
htsjdkVersion=4.3.0

httpclient5Version=5.5.2
httpclient5Version=5.6.4
httpcore5Version=5.4.3

# Not used directly, but these are widely used transitive dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.jspecify.annotations.NonNull;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.EnvironmentPostProcessor;
import org.springframework.boot.SpringApplication;
import org.springframework.core.Ordered;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.EnumerablePropertySource;
Expand Down Expand Up @@ -58,8 +58,9 @@
* <p>SSM initialization also runs when {@code context.awsParameterStore.prefix} is explicitly
* configured (even with no {@code ssm:} values), so that the CloudServices module can create its
* own {@code SsmClient} for on-demand {@code SecretService} lookups. When active, this processor
* publishes {@code labkey.aws.ssm.region} and optionally {@code labkey.aws.ssm.secretsPrefix} as
* JVM system properties without any cross-classloader reflection.
* publishes {@code labkey.aws.ssm.enabled}, {@code labkey.aws.ssm.region}, and
* {@code labkey.aws.ssm.secretsPrefix} as JVM system properties without any cross-classloader
* reflection.
*
* <p>{@code context.awsParameterStore.secretsPrefix} controls where {@code SecretProperty}
* values are looked up at runtime. A relative value (no leading {@code /}) is resolved against
Expand Down Expand Up @@ -137,16 +138,17 @@ public void postProcessEnvironment(ConfigurableEnvironment environment, SpringAp
secretsPrefix = prefix;
}

if (!secretsPrefix.isEmpty() && !secretsPrefix.endsWith("/") && !secretsPrefix.endsWith("::"))
if (!secretsPrefix.endsWith("/") && !secretsPrefix.endsWith("::"))
throw new IllegalStateException(
"[LabKey AWS] Resolved secretsPrefix must end with '/' or '::' (got: '" + secretsPrefix +
"'). Check " + SECRETS_PREFIX_PROPERTY + " and " + PREFIX_PROPERTY + " in application.properties");

String regionOverride = environment.getProperty(REGION_PROPERTY);
Region region = resolveRegion(regionOverride);

// Publish config as system properties so the CloudServices module can create its own
// SsmClient for on-demand SecretProperty lookups via SecretService at runtime.
// Publish config as system properties so the CloudServices module can create its own SsmClient
// for on-demand SecretProperty lookups via SecretService at runtime, enabled per the class-level JavaDoc
System.setProperty("labkey.aws.ssm.enabled", "true");
System.setProperty("labkey.aws.ssm.region", region.id());
System.setProperty("labkey.aws.ssm.secretsPrefix", secretsPrefix);

Expand Down
Loading