Preparing for 3.2.0 release (#217)
* Preparing for 3.1.x branch * Preparing for 3.2.x release
This commit is contained in:
16
.github/dependabot.yml
vendored
16
.github/dependabot.yml
vendored
@@ -2,7 +2,21 @@ version: 2
|
||||
updates:
|
||||
- package-ecosystem: gradle
|
||||
directory: "/"
|
||||
target-branch: "main"
|
||||
target-branch: "3.2.x"
|
||||
schedule:
|
||||
interval: daily
|
||||
open-pull-requests-limit: 15
|
||||
labels:
|
||||
- "dependency-upgrade"
|
||||
commit-message:
|
||||
prefix: "3.2.x"
|
||||
ignore:
|
||||
- dependency-name: "*"
|
||||
update-types: ["version-update:semver-major"]
|
||||
|
||||
- package-ecosystem: gradle
|
||||
directory: "/"
|
||||
target-branch: "3.1.x"
|
||||
schedule:
|
||||
interval: daily
|
||||
open-pull-requests-limit: 15
|
||||
|
||||
@@ -23,9 +23,7 @@ plugins {
|
||||
description = "Spring CredHub"
|
||||
|
||||
ext {
|
||||
springVersion = "6.0.11"
|
||||
springBootVersion = "3.1.9"
|
||||
springSecurityVersion = "6.1.2"
|
||||
springBootVersion = "3.2.3"
|
||||
javadocLinks = [
|
||||
"https://docs.oracle.com/en/java/javase/17/docs/api/",
|
||||
"https://docs.spring.io/spring-framework/docs/current/javadoc-api/"
|
||||
@@ -106,9 +104,6 @@ subprojects {
|
||||
registerFeature('httpclient') {
|
||||
usingSourceSet(sourceSets.main)
|
||||
}
|
||||
registerFeature('okhttp') {
|
||||
usingSourceSet(sourceSets.main)
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -41,12 +41,14 @@ set_pipeline() {
|
||||
|
||||
set_pipelines() {
|
||||
fly -t "$FLY_TARGET" sync
|
||||
set_pipeline spring-credhub pipeline.yml main 3.1.x
|
||||
set_pipeline spring-credhub pipeline.yml 3.2.x 3.2.x
|
||||
set_pipeline spring-credhub pipeline.yml 3.1.x 3.1.x
|
||||
set_pipeline spring-credhub pipeline.yml 3.0.x 3.0.x
|
||||
set_pipeline spring-credhub pipeline.yml 2.3.x 2.3.x
|
||||
set_pipeline spring-credhub pipeline.yml 2.2.x 2.2.x
|
||||
|
||||
set_pipeline spring-credhub-pr pr-pipeline.yml main 3.1.x
|
||||
set_pipeline spring-credhub-pr pr-pipeline.yml 3.2.x 3.2.x
|
||||
set_pipeline spring-credhub-pr pr-pipeline.yml 3.1.x 3.1.x
|
||||
set_pipeline spring-credhub-pr pr-pipeline.yml 3.0.x 3.0.x
|
||||
set_pipeline spring-credhub-pr pr-pipeline.yml 2.3.x 2.3.x
|
||||
set_pipeline spring-credhub-pr pr-pipeline.yml 2.2.x 2.2.x
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
version=3.1.1-SNAPSHOT
|
||||
version=3.2.0-SNAPSHOT
|
||||
|
||||
org.gradle.caching=true
|
||||
org.gradle.parallel=true
|
||||
|
||||
@@ -19,7 +19,7 @@ pluginManagement {
|
||||
id 'io.spring.nohttp' version '0.0.11'
|
||||
id 'io.spring.javaformat' version '0.0.41'
|
||||
id 'org.asciidoctor.jvm.convert' version '3.3.2'
|
||||
id 'org.springframework.boot' version '3.1.9'
|
||||
id 'org.springframework.boot' version '3.2.3'
|
||||
}
|
||||
repositories {
|
||||
gradlePluginPortal()
|
||||
|
||||
@@ -36,8 +36,6 @@ dependencies {
|
||||
exclude(group: 'commons-logging', module: 'commons-logging')
|
||||
}
|
||||
|
||||
okhttpImplementation("com.squareup.okhttp3:okhttp")
|
||||
|
||||
testImplementation("org.springframework:spring-test")
|
||||
testImplementation("io.projectreactor:reactor-test")
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-api")
|
||||
|
||||
@@ -17,13 +17,9 @@
|
||||
package org.springframework.credhub.configuration;
|
||||
|
||||
import java.security.GeneralSecurityException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.SSLSocketFactory;
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
|
||||
import okhttp3.OkHttpClient.Builder;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.hc.client5.http.config.ConnectionConfig;
|
||||
@@ -40,15 +36,14 @@ import org.apache.hc.core5.util.Timeout;
|
||||
import org.springframework.credhub.support.ClientOptions;
|
||||
import org.springframework.http.client.ClientHttpRequestFactory;
|
||||
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
|
||||
import org.springframework.http.client.OkHttp3ClientHttpRequestFactory;
|
||||
import org.springframework.http.client.SimpleClientHttpRequestFactory;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
||||
/**
|
||||
* Factory for {@link ClientHttpRequestFactory} that supports Apache HTTP Components,
|
||||
* OkHttp the JDK HTTP client (in that order). This factory configures a
|
||||
* {@link ClientHttpRequestFactory} depending on the available dependencies.
|
||||
* Factory for {@link ClientHttpRequestFactory} that supports Apache HTTP Components. This
|
||||
* factory configures a {@link ClientHttpRequestFactory} depending on the available
|
||||
* dependencies.
|
||||
*
|
||||
* @author Mark Paluch
|
||||
* @author Scott Frederick
|
||||
@@ -63,9 +58,6 @@ public final class ClientHttpRequestFactoryFactory {
|
||||
"org.apache.hc.client5.http.impl.classic.HttpClients",
|
||||
ClientHttpRequestFactoryFactory.class.getClassLoader());
|
||||
|
||||
private static final boolean OKHTTP3_PRESENT = ClassUtils.isPresent("okhttp3.OkHttpClient",
|
||||
ClientHttpRequestFactoryFactory.class.getClassLoader());
|
||||
|
||||
private ClientHttpRequestFactoryFactory() {
|
||||
}
|
||||
|
||||
@@ -84,11 +76,6 @@ public final class ClientHttpRequestFactoryFactory {
|
||||
logger.info("Using Apache HttpComponents HttpClient for HTTP connections");
|
||||
return HttpComponents.usingHttpComponents(options);
|
||||
}
|
||||
|
||||
if (OKHTTP3_PRESENT) {
|
||||
logger.info("Using OkHttp3 for HTTP connections");
|
||||
return OkHttp3.usingOkHttp3(options);
|
||||
}
|
||||
}
|
||||
catch (GeneralSecurityException ex) {
|
||||
logger.warn("Error configuring HTTP connections", ex);
|
||||
@@ -111,7 +98,7 @@ public final class ClientHttpRequestFactoryFactory {
|
||||
if (usingCustomCerts(options)) {
|
||||
logger.warn("Trust material will not be configured when using "
|
||||
+ "java.net.HttpUrlConnection. Use an alternate HTTP Client "
|
||||
+ "(Apache HttpComponents HttpClient or OkHttp3) when configuring CA certificates.");
|
||||
+ "(Apache HttpComponents HttpClient) when configuring CA certificates.");
|
||||
}
|
||||
|
||||
SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
|
||||
@@ -184,42 +171,4 @@ public final class ClientHttpRequestFactoryFactory {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* {@link ClientHttpRequestFactory} using {@link OkHttp3}.
|
||||
*
|
||||
* @author Mark Paluch
|
||||
* @author Scott Frederick
|
||||
*/
|
||||
static class OkHttp3 {
|
||||
|
||||
static ClientHttpRequestFactory usingOkHttp3(ClientOptions options) throws GeneralSecurityException {
|
||||
|
||||
Builder builder = new Builder();
|
||||
|
||||
if (usingCustomCerts(options)) {
|
||||
SSLSocketFactory socketFactory = sslCertificateUtils.getSSLContext(options.getCaCertFiles())
|
||||
.getSocketFactory();
|
||||
X509TrustManager trustManager = sslCertificateUtils.createTrustManager(options.getCaCertFiles());
|
||||
|
||||
builder.sslSocketFactory(socketFactory, trustManager);
|
||||
}
|
||||
else {
|
||||
SSLSocketFactory socketFactory = SSLContext.getDefault().getSocketFactory();
|
||||
X509TrustManager trustManager = sslCertificateUtils.getDefaultX509TrustManager();
|
||||
|
||||
builder.sslSocketFactory(socketFactory, trustManager);
|
||||
}
|
||||
|
||||
if (options.getConnectionTimeout() != null) {
|
||||
builder.connectTimeout(options.getConnectionTimeoutMillis(), TimeUnit.MILLISECONDS);
|
||||
}
|
||||
if (options.getReadTimeout() != null) {
|
||||
builder.readTimeout(options.getReadTimeoutMillis(), TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
return new OkHttp3ClientHttpRequestFactory(builder.build());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,11 +23,9 @@ import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.DisposableBean;
|
||||
import org.springframework.credhub.configuration.ClientHttpRequestFactoryFactory.HttpComponents;
|
||||
import org.springframework.credhub.configuration.ClientHttpRequestFactoryFactory.HttpURLConnection;
|
||||
import org.springframework.credhub.configuration.ClientHttpRequestFactoryFactory.OkHttp3;
|
||||
import org.springframework.credhub.support.ClientOptions;
|
||||
import org.springframework.http.client.ClientHttpRequestFactory;
|
||||
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
|
||||
import org.springframework.http.client.OkHttp3ClientHttpRequestFactory;
|
||||
import org.springframework.http.client.SimpleClientHttpRequestFactory;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
@@ -54,13 +52,4 @@ public class ClientHttpRequestFactoryFactoryTests {
|
||||
((DisposableBean) factory).destroy();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void okHttp3ClientCreated() throws Exception {
|
||||
ClientHttpRequestFactory factory = OkHttp3.usingOkHttp3(new ClientOptions());
|
||||
|
||||
assertThat(factory).isInstanceOf(OkHttp3ClientHttpRequestFactory.class);
|
||||
|
||||
((DisposableBean) factory).destroy();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ Spring CredHub `CredHubOperations` supports multiple HTTP client libraries to co
|
||||
|
||||
* Java’s builtin `HttpURLConnection` (default)
|
||||
* https://hc.apache.org/[Apache HttpComponents]
|
||||
* https://square.github.io/okhttp/[OkHttp 3]
|
||||
|
||||
Choosing a specific client library requires the appropriate dependency to be available on the application classpath.
|
||||
The application classpath will be inspected for each client library in the order listed above.
|
||||
@@ -26,14 +25,6 @@ To use Apache HttpComponents to communicate with CredHub, add the following depe
|
||||
|
||||
WARNING: Apache HttpClient's https://hc.apache.org/httpcomponents-client-4.5.x/logging.html[wire logging] can be enabled through logging configuration. Make sure to not accidentally enable wire logging as logs may expose traffic (including tokens and secrets) between your application and CredHub in plain text.
|
||||
|
||||
=== OkHttp 3
|
||||
=== OkHttp
|
||||
|
||||
To use OkHttp 3 to communicate with CredHub, add the following dependency to the application:
|
||||
|
||||
[source,xml,%autofit]
|
||||
----
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
WARNING: OkHttp 3 support was removed in version 3.2.x
|
||||
|
||||
@@ -30,11 +30,7 @@ dependencies {
|
||||
testImplementation("org.springframework.security:spring-security-config")
|
||||
testImplementation("org.springframework.security:spring-security-oauth2-client")
|
||||
|
||||
if (project.hasProperty("useOkHttp3")) {
|
||||
testImplementation("com.squareup.okhttp3:okhttp")
|
||||
} else {
|
||||
testImplementation("org.apache.httpcomponents.client5:httpclient5")
|
||||
}
|
||||
testImplementation("org.apache.httpcomponents.client5:httpclient5")
|
||||
|
||||
testImplementation("org.springframework.boot:spring-boot-starter-test")
|
||||
testImplementation("org.assertj:assertj-core")
|
||||
|
||||
@@ -30,8 +30,6 @@ dependencies {
|
||||
exclude(group: 'commons-logging', module: 'commons-logging')
|
||||
}
|
||||
|
||||
okhttpImplementation("com.squareup.okhttp3:okhttp")
|
||||
|
||||
annotationProcessor(platform("org.springframework.boot:spring-boot-dependencies:${springBootVersion}"))
|
||||
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user