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
Original file line number Diff line number Diff line change
Expand Up @@ -141,17 +141,18 @@ private Stream<EvaluationResult> evaluate(JavaClasses javaClasses) {

private void withCompileClasspath(Callable<?> callable) throws Exception {
ClassLoader previous = Thread.currentThread().getContextClassLoader();
try {
List<URL> urls = new ArrayList<>();
for (File file : getCompileClasspath().getFiles()) {
urls.add(file.toURI().toURL());
}
ClassLoader classLoader = new URLClassLoader(urls.toArray(new URL[0]), getClass().getClassLoader());
Thread.currentThread().setContextClassLoader(classLoader);
callable.call();
List<URL> urls = new ArrayList<>();
for (File file : getCompileClasspath().getFiles()) {
urls.add(file.toURI().toURL());
}
finally {
Thread.currentThread().setContextClassLoader(previous);
try (URLClassLoader classLoader = new URLClassLoader(urls.toArray(new URL[0]), getClass().getClassLoader())) {
Thread.currentThread().setContextClassLoader(classLoader);
try {
callable.call();
}
finally {
Thread.currentThread().setContextClassLoader(previous);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"messages"
]
},
{
{
"name": "spring.resources.add-mappings",
"type": "java.lang.Boolean",
"deprecation": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@
}
]
},
{
{
"name": "logging.structured.json.stacktrace.printer",
"values": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@
"defaultValue": true
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
},
{
"name": "management.wavefront.api-token-type",
"type": "org.springframework.boot.actuate.autoconfigure.wavefront.WavefrontProperties$TokenType",
"type": "java.lang.String",
"deprecation": {
"level": "error",
"reason": "Wavefront is end-of-life.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@
}
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@
}
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
"defaultValue": true
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.core.io.Resource;
import org.springframework.util.StringUtils;

/**
* Configuration properties for Cassandra.
Expand Down Expand Up @@ -237,7 +238,7 @@ public static class Ssl {
private @Nullable String bundle;

public boolean isEnabled() {
return (this.enabled != null) ? this.enabled : this.bundle != null;
return (this.enabled != null) ? this.enabled : StringUtils.hasText(this.bundle);
}

public void setEnabled(boolean enabled) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,11 @@ void defaultValuesInManualMetadataAreConsistent() {
assertThat(driverDefaults.get(TypedDriverOption.HEARTBEAT_TIMEOUT)).isEqualTo(Duration.ofSeconds(5));
}

@Test
void sslIsNotEnabledWhenBundleIsEmpty() {
CassandraProperties properties = new CassandraProperties();
properties.getSsl().setBundle("");
assertThat(properties.getSsl().isEnabled()).isFalse();
}

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"properties": [
{
{
"name": "management.health.mongo.enabled",
"deprecation": {
"level": "error",
Expand Down Expand Up @@ -43,4 +43,4 @@
]
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.jspecify.annotations.Nullable;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.util.StringUtils;

/**
* Configuration properties for Redis.
Expand Down Expand Up @@ -463,7 +464,7 @@ public static class Ssl {
private @Nullable String bundle;

public boolean isEnabled() {
return (this.enabled != null) ? this.enabled : this.bundle != null;
return (this.enabled != null) ? this.enabled : StringUtils.hasText(this.bundle);
}

public void setEnabled(boolean enabled) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*
* @author Stephane Nicoll
*/
class RedisPropertiesTests {
class DataRedisPropertiesTests {

@Test
void lettuceDefaultsAreConsistent() {
Expand All @@ -39,4 +39,11 @@ void lettuceDefaultsAreConsistent() {
.isEqualTo(defaultClusterTopologyRefreshOptions.useDynamicRefreshSources());
}

@Test
void sslIsNotEnabledWhenBundleIsEmpty() {
DataRedisProperties properties = new DataRedisProperties();
properties.getSsl().setBundle("");
assertThat(properties.getSsl().isEnabled()).isFalse();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@
}
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -210,4 +210,4 @@
}
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@
}
],
"hints": [
{
"name": "spring.graphql.cors.allowed-headers",
{
"name": "spring.graphql.cors.allowed-headers",
"values": [
{
"value": "*"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,5 @@
"description": "Whether to enable CSRF protection.",
"defaultValue": false
}

]
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"properties": [
{
"name": "spring.http.codecs.preferred-json-mapper",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
},
{
"name": "spring.datasource.initialization-mode",
"type": "org.springframework.boot.jdbc.DataSourceInitializationMode",
"type": "org.springframework.boot.sql.init.DatabaseInitializationMode",
"deprecation": {
"level": "error",
"replacement": "spring.sql.init.mode",
Expand Down Expand Up @@ -210,4 +210,4 @@
}
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
"defaultValue": true
}
],
"hints": [
]
"hints": []
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"properties": [
{
{
"name": "spring.kafka.admin.ssl.keystore-location",
"type": "org.springframework.core.io.Resource",
"description": "Location of the key store file.",
Expand Down Expand Up @@ -303,4 +303,4 @@
]
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
"defaultValue": true
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@
]
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private void applyProperties(MailProperties properties, JavaMailSenderImpl sende
if (ssl.isEnabled()) {
javaMailProperties.setProperty("mail." + protocol + ".ssl.enable", "true");
}
if (ssl.getBundle() != null) {
if (StringUtils.hasLength(ssl.getBundle())) {
Assert.state(sslBundles != null, "'sslBundles' must not be null");
SslBundle sslBundle = sslBundles.getBundle(ssl.getBundle());
javaMailProperties.put("mail." + protocol + ".ssl.socketFactory",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
{
"name": "spring.mail.test-connection",
"description": "Whether to test that the mail server is available on startup.",
"sourceType": "org.springframework.boot.autoconfigure.mail.MailProperties",
"sourceType": "org.springframework.boot.mail.autoconfigure.MailSenderValidatorAutoConfiguration",
"type": "java.lang.Boolean",
"defaultValue": false
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,21 @@ void connectionOnStartupNotCalled() {
});
}

@Test
@WithPackageResources("test.jks")
void sslIsNotEnabledWhenBundleIsEmpty() {
this.contextRunner
.withPropertyValues("spring.mail.host:localhost", "spring.mail.ssl.bundle: ",
"spring.ssl.bundle.jks.test-bundle.keystore.location:classpath:test.jks",
"spring.ssl.bundle.jks.test-bundle.keystore.password:secret",
"spring.ssl.bundle.jks.test-bundle.key.password:password")
.run((context) -> {
assertThat(context).hasSingleBean(JavaMailSenderImpl.class);
JavaMailSenderImpl mailSender = context.getBean(JavaMailSenderImpl.class);
assertThat(mailSender.getJavaMailProperties().get("mail.smtp.ssl.socketFactory")).isNull();
});
}

@Test
void smtpSslEnabled() {
this.contextRunner.withPropertyValues("spring.mail.host:localhost", "spring.mail.ssl.enabled:true")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"since": "2.1.0"
}
},
{
{
"name": "management.metrics.export.appoptics.api-token",
"type": "java.lang.String",
"deprecation": {
Expand Down Expand Up @@ -1393,7 +1393,7 @@
},
{
"name": "management.metrics.export.prometheus.pushgateway.shutdown-operation",
"type": "org.springframework.boot.actuate.metrics.export.prometheus.PrometheusPushGatewayManager$ShutdownOperation",
"type": "org.springframework.boot.micrometer.metrics.export.prometheus.PrometheusPushGatewayManager$ShutdownOperation",
"deprecation": {
"level": "error",
"replacement": "management.prometheus.metrics.export.pushgateway.shutdown-operation",
Expand Down Expand Up @@ -1756,7 +1756,7 @@
"since": "3.0.0"
}
},
{
{
"name": "management.metrics.web.server.auto-time-requests",
"type": "java.lang.Boolean",
"deprecation": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.jspecify.annotations.Nullable;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.util.StringUtils;

/**
* Configuration properties for Mongo.
Expand Down Expand Up @@ -238,7 +239,7 @@ public static class Ssl {
private @Nullable String bundle;

public boolean isEnabled() {
return (this.enabled != null) ? this.enabled : this.bundle != null;
return (this.enabled != null) ? this.enabled : StringUtils.hasText(this.bundle);
}

public void setEnabled(boolean enabled) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ void canBindCharArrayPassword() {
});
}

@Test
void sslIsNotEnabledWhenBundleIsEmpty() {
MongoProperties properties = new MongoProperties();
properties.getSsl().setBundle("");
assertThat(properties.getSsl().isEnabled()).isFalse();
}

private UuidRepresentation springDataDefaultUuidRepresentation() {
return new MongoConfigurationSupport() {

Expand Down
Loading
Loading