Skip to content

Commit 734e4bb

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents 15fc04d + 23739d6 commit 734e4bb

File tree

21 files changed

+88
-128
lines changed

21 files changed

+88
-128
lines changed

docs/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"dependencies": {
3-
"antora": "3.2.0-alpha.4",
3+
"antora": "3.2.0-alpha.6",
44
"@antora/atlas-extension": "1.0.0-alpha.2",
5-
"@antora/collector-extension": "1.0.0-alpha.3",
5+
"@antora/collector-extension": "1.0.0-beta.2",
66
"@asciidoctor/tabs": "1.0.0-beta.6",
7-
"@springio/antora-extensions": "1.11.1",
8-
"@springio/asciidoctor-extensions": "1.0.0-alpha.13"
7+
"@springio/antora-extensions": "1.14.2",
8+
"@springio/asciidoctor-extensions": "1.0.0-alpha.14"
99
}
1010
}

pom.xml

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828
<properties>
2929
<bintray.package>commons</bintray.package>
3030
<evictor.version>1.0.0</evictor.version>
31-
<!-- Deprecated - reached EOL -->
32-
<spring-security-oauth2-autoconfigure.version>2.5.2</spring-security-oauth2-autoconfigure.version>
31+
<bouncycastle-bcprov-jdk18on.version>1.78.1</bouncycastle-bcprov-jdk18on.version>
3332
</properties>
3433
<build>
3534
<plugins>
@@ -169,21 +168,11 @@
169168
<artifactId>spring-cloud-test-support</artifactId>
170169
<version>${project.version}</version>
171170
</dependency>
172-
<!--<dependency>
173-
<groupId>org.springframework.security.oauth.boot</groupId>
174-
<artifactId>spring-security-oauth2-autoconfigure</artifactId>
175-
<version>${spring-security-oauth2-autoconfigure.version}</version>
176-
<exclusions>
177-
<exclusion>
178-
<groupId>org.springframework.boot</groupId>
179-
<artifactId>spring-boot</artifactId>
180-
</exclusion>
181-
<exclusion>
182-
<groupId>org.springframework.boot</groupId>
183-
<artifactId>spring-boot-autoconfigure</artifactId>
184-
</exclusion>
185-
</exclusions>
186-
</dependency>-->
171+
<dependency>
172+
<groupId>org.bouncycastle</groupId>
173+
<artifactId>bcprov-jdk18on</artifactId>
174+
<version>${bouncycastle-bcprov-jdk18on.version}</version>
175+
</dependency>
187176
</dependencies>
188177
</dependencyManagement>
189178
<modules>

spring-cloud-commons-dependencies/pom.xml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,9 @@
1515
<name>spring-cloud-commons-dependencies</name>
1616
<description>Spring Cloud Commons Dependencies</description>
1717
<properties>
18-
<spring-security-rsa.version>1.1.5</spring-security-rsa.version>
1918
</properties>
2019
<dependencyManagement>
2120
<dependencies>
22-
<dependency>
23-
<groupId>org.springframework.security</groupId>
24-
<artifactId>spring-security-rsa</artifactId>
25-
<version>${spring-security-rsa.version}</version>
26-
<exclusions>
27-
<exclusion>
28-
<groupId>org.springframework</groupId>
29-
<artifactId>spring-core</artifactId>
30-
</exclusion>
31-
<exclusion>
32-
<groupId>org.springframework.security</groupId>
33-
<artifactId>spring-security-crypto</artifactId>
34-
</exclusion>
35-
</exclusions>
36-
</dependency>
3721
<dependency>
3822
<groupId>org.springframework.cloud</groupId>
3923
<artifactId>spring-cloud-commons</artifactId>

spring-cloud-commons/pom.xml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,6 @@
131131
<groupId>org.springframework.security</groupId>
132132
<artifactId>spring-security-crypto</artifactId>
133133
</dependency>
134-
<dependency>
135-
<groupId>org.springframework.security</groupId>
136-
<artifactId>spring-security-rsa</artifactId>
137-
<optional>true</optional>
138-
</dependency>
139134
<dependency>
140135
<groupId>org.springframework.integration</groupId>
141136
<artifactId>spring-integration-jmx</artifactId>
@@ -146,25 +141,6 @@
146141
<artifactId>spring-boot-starter-hateoas</artifactId>
147142
<optional>true</optional>
148143
</dependency>
149-
<!--<dependency>
150-
<groupId>org.springframework.security.oauth.boot</groupId>
151-
<artifactId>spring-security-oauth2-autoconfigure</artifactId>
152-
<optional>true</optional>
153-
<exclusions>
154-
<exclusion>
155-
<groupId>javax.xml.bind</groupId>
156-
<artifactId>jaxb-api</artifactId>
157-
</exclusion>
158-
<exclusion>
159-
<groupId>com.sun.activation</groupId>
160-
<artifactId>jakarta.activation</artifactId>
161-
</exclusion>
162-
<exclusion>
163-
<groupId>javax.activation</groupId>
164-
<artifactId>javax.activation-api</artifactId>
165-
</exclusion>
166-
</exclusions>
167-
</dependency>-->
168144
<dependency>
169145
<groupId>org.springframework.boot</groupId>
170146
<artifactId>spring-boot-starter-aop</artifactId>

spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/ReactiveDiscoveryClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -72,7 +72,7 @@ public interface ReactiveDiscoveryClient extends Ordered {
7272
* within. We are leaving it with a deprecation in order not to bring downstream
7373
* implementations.
7474
*/
75-
@Deprecated
75+
@Deprecated(forRemoval = true)
7676
default void probe() {
7777
if (LOG.isWarnEnabled()) {
7878
LOG.warn("ReactiveDiscoveryClient#probe has been called. If you're calling this method directly, "

spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancerRestClientBuilderBeanPostProcessor.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,28 @@ public class LoadBalancerRestClientBuilderBeanPostProcessor<T extends ClientHttp
3737

3838
private final ApplicationContext context;
3939

40+
/**
41+
* Creates a {@link LoadBalancerRestClientBuilderBeanPostProcessor} instance using a
42+
* provided {@link ClientHttpRequestInterceptor} and application context.
43+
* @param loadBalancerInterceptor a {@link ClientHttpRequestInterceptor} used for
44+
* load-balancing
45+
* @param context {@link ApplicationContext}
46+
* @deprecated in favour of
47+
* {@link LoadBalancerRestClientBuilderBeanPostProcessor#LoadBalancerRestClientBuilderBeanPostProcessor(ObjectProvider, ApplicationContext)}
48+
*/
49+
@Deprecated(forRemoval = true)
4050
public LoadBalancerRestClientBuilderBeanPostProcessor(T loadBalancerInterceptor, ApplicationContext context) {
4151
this.loadBalancerInterceptorProvider = new SimpleObjectProvider<>(loadBalancerInterceptor);
4252
this.context = context;
4353
}
4454

55+
/**
56+
* Creates a {@link LoadBalancerRestClientBuilderBeanPostProcessor} instance using
57+
* interceptor {@link ObjectProvider} and application context.
58+
* @param loadBalancerInterceptorProvider an {@link ObjectProvider} for
59+
* {@link ClientHttpRequestInterceptor} used for load-balancing
60+
* @param context {@link ApplicationContext}
61+
*/
4562
public LoadBalancerRestClientBuilderBeanPostProcessor(ObjectProvider<T> loadBalancerInterceptorProvider,
4663
ApplicationContext context) {
4764
this.loadBalancerInterceptorProvider = loadBalancerInterceptorProvider;

spring-cloud-commons/src/main/java/org/springframework/cloud/commons/util/InetUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -35,10 +35,10 @@
3535

3636
/**
3737
* @author Spencer Gibb
38+
* @author Sergey Tsypanov
3839
*/
3940
public class InetUtils implements Closeable {
4041

41-
// TODO: maybe shutdown the thread pool if it isn't being used?
4242
private final ExecutorService executorService;
4343

4444
private final InetUtilsProperties properties;
@@ -47,7 +47,7 @@ public class InetUtils implements Closeable {
4747

4848
public InetUtils(final InetUtilsProperties properties) {
4949
this.properties = properties;
50-
this.executorService = Executors.newSingleThreadExecutor(r -> {
50+
this.executorService = Executors.newCachedThreadPool(r -> {
5151
Thread thread = new Thread(r);
5252
thread.setName(InetUtilsProperties.PREFIX);
5353
thread.setDaemon(true);

spring-cloud-commons/src/main/java/org/springframework/cloud/configuration/SSLContextFactory.java

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,16 @@
2525

2626
import javax.net.ssl.SSLContext;
2727

28+
import org.apache.commons.logging.Log;
29+
import org.apache.commons.logging.LogFactory;
2830
import org.apache.hc.core5.ssl.SSLContextBuilder;
2931

3032
import org.springframework.core.io.Resource;
3133

3234
public class SSLContextFactory {
3335

36+
private static Log logger = LogFactory.getLog(SSLContextFactory.class);
37+
3438
private TlsProperties properties;
3539

3640
public SSLContextFactory(TlsProperties properties) {
@@ -39,26 +43,32 @@ public SSLContextFactory(TlsProperties properties) {
3943

4044
public SSLContext createSSLContext() throws GeneralSecurityException, IOException {
4145
SSLContextBuilder builder = new SSLContextBuilder();
42-
char[] keyPassword = properties.keyPassword();
43-
KeyStore keyStore = createKeyStore();
4446

45-
try {
46-
builder.loadKeyMaterial(keyStore, keyPassword);
47+
KeyStore trust = createTrustStore();
48+
if (trust != null) {
49+
builder.loadTrustMaterial(trust, null);
4750
}
48-
catch (UnrecoverableKeyException e) {
49-
if (keyPassword.length == 0) {
50-
// Retry if empty password, see
51-
// https://rt.openssl.org/Ticket/Display.html?id=1497&user=guest&pass=guest
52-
builder.loadKeyMaterial(keyStore, new char[] { '\0' });
51+
52+
char[] keyPassword = properties.keyPassword();
53+
try {
54+
KeyStore keyStore = createKeyStore();
55+
56+
try {
57+
builder.loadKeyMaterial(keyStore, keyPassword);
5358
}
54-
else {
55-
throw e;
59+
catch (UnrecoverableKeyException e) {
60+
if (keyPassword.length == 0) {
61+
// Retry if empty password, see
62+
// https://rt.openssl.org/Ticket/Display.html?id=1497&user=guest&pass=guest
63+
builder.loadKeyMaterial(keyStore, new char[] { '\0' });
64+
}
65+
else {
66+
logger.warn("Could not create keystore.", e);
67+
}
5668
}
5769
}
58-
59-
KeyStore trust = createTrustStore();
60-
if (trust != null) {
61-
builder.loadTrustMaterial(trust, null);
70+
catch (KeyStoreException e) {
71+
logger.warn("Could not create keystore.", e);
6272
}
6373

6474
return builder.build();

spring-cloud-commons/src/test/java/org/springframework/cloud/client/loadbalancer/reactive/RetryableLoadBalancerExchangeFilterFunctionIntegrationTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ void correctResponseReturnedAfterRetryingOnSameServiceInstance() {
166166
}
167167

168168
@Test
169+
@Disabled
169170
void correctResponseReturnedAfterRetryingOnNextServiceInstanceWithBackoff() {
170171
loadBalancerProperties.getRetry().getBackoff().setEnabled(true);
171172
loadBalancerProperties.getRetry().setMaxRetriesOnSameServiceInstance(1);

spring-cloud-context/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747
<artifactId>spring-security-crypto</artifactId>
4848
</dependency>
4949
<dependency>
50-
<groupId>org.springframework.security</groupId>
51-
<artifactId>spring-security-rsa</artifactId>
50+
<groupId>org.bouncycastle</groupId>
51+
<artifactId>bcprov-jdk18on</artifactId>
5252
<optional>true</optional>
5353
</dependency>
5454
<dependency>

0 commit comments

Comments
 (0)