Skip to content

Commit 50a0e0f

Browse files
authored
Merge branch 'main' into feat/openapi/optional-spring-base
2 parents cde369f + 12d3794 commit 50a0e0f

File tree

872 files changed

+1016
-980
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

872 files changed

+1016
-980
lines changed

.github/dependabot.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ updates:
3030
test:
3131
dependency-type: "development"
3232
ignore:
33+
- dependency-name: "org.springframework.boot:*"
34+
versions: [ ">=4.0.0" ]
35+
- dependency-name: "org.springframework:*"
36+
versions: [ ">=7.0.0" ]
3337
# updating leads to ignoring our formatting rules
3438
- dependency-name: 'net.revelc.code.formatter:formatter-maven-plugin'
3539
# updating leads to unintended formatting of POM files
@@ -45,6 +49,9 @@ updates:
4549
versions: ['3.6.1', '3.6.2']
4650
- dependency-name: 'com.sap.cloud.security:env'
4751
versions: ['3.6.1', '3.6.2']
52+
# needs Java 21
53+
- dependency-name: 'com.puppycrawl.tools:checkstyle'
54+
versions: [ ">=13.0.0" ]
4855

4956
# archetype updates
5057
# Dependabot seems to be unable to handle those, so this is disabled for now

.github/workflows/cache-maven-dependencies.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
GH_TOKEN: ${{ secrets.BOT_SDK_JS_FOR_DOCS_REPO_PR }}
4040

4141
- name: "Cache Dependencies"
42-
uses: actions/cache/save@v4
42+
uses: actions/cache/save@v5
4343
with:
4444
path: ${{ env.MAVEN_CACHE_DIR }}
4545
key: ${{ env.MAVEN_CACHE_KEY }}

.github/workflows/continuous-integration.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ jobs:
120120

121121
- name: "Restore Dependencies"
122122
id: restore-dependencies
123-
uses: actions/cache/restore@v4
123+
uses: actions/cache/restore@v5
124124
with:
125125
key: ${{ env.MAVEN_CACHE_KEY }}
126126
path: ${{ env.MAVEN_CACHE_DIR }}
@@ -143,14 +143,14 @@ jobs:
143143
fi
144144
145145
- name: "Upload SDK M2"
146-
uses: actions/upload-artifact@v5
146+
uses: actions/upload-artifact@v6
147147
with:
148148
name: ${{ env.SDK_M2_NAME }}
149149
path: ${{ env.SDK_M2_PATH }}
150150
retention-days: 1
151151

152152
- name: "Upload SDK Targets"
153-
uses: actions/upload-artifact@v5
153+
uses: actions/upload-artifact@v6
154154
with:
155155
name: ${{ env.SDK_TARGETS_NAME }}
156156
path: ${{ env.SDK_TARGETS_PATH }}
@@ -174,19 +174,19 @@ jobs:
174174

175175
- name: "Restore Dependencies"
176176
id: restore-dependencies
177-
uses: actions/cache/restore@v4
177+
uses: actions/cache/restore@v5
178178
with:
179179
key: ${{ env.MAVEN_CACHE_KEY }}
180180
path: ${{ env.M2_ROOT }}
181181

182182
- name: "Restore SDK M2"
183-
uses: actions/download-artifact@v6
183+
uses: actions/download-artifact@v7
184184
with:
185185
name: ${{ env.SDK_M2_NAME }}
186186
path: ${{ env.M2_ROOT }}
187187

188188
- name: "Restore SDK Targets"
189-
uses: actions/download-artifact@v6
189+
uses: actions/download-artifact@v7
190190
with:
191191
name: ${{ env.SDK_TARGETS_NAME }}
192192

@@ -235,19 +235,19 @@ jobs:
235235

236236
- name: "Restore Dependencies"
237237
id: restore-dependencies
238-
uses: actions/cache/restore@v4
238+
uses: actions/cache/restore@v5
239239
with:
240240
key: ${{ env.MAVEN_CACHE_KEY }}
241241
path: ${{ env.M2_ROOT }}
242242

243243
- name: "Restore SDK M2"
244-
uses: actions/download-artifact@v6
244+
uses: actions/download-artifact@v7
245245
with:
246246
name: ${{ env.SDK_M2_NAME }}
247247
path: ${{ env.M2_ROOT }}
248248

249249
- name: "Restore SDK Targets"
250-
uses: actions/download-artifact@v6
250+
uses: actions/download-artifact@v7
251251
with:
252252
name: ${{ env.SDK_TARGETS_NAME }}
253253

@@ -276,7 +276,7 @@ jobs:
276276

277277
- name: "Restore Dependencies"
278278
id: restore-dependencies
279-
uses: actions/cache/restore@v4
279+
uses: actions/cache/restore@v5
280280
with:
281281
key: ${{ env.MAVEN_CACHE_KEY }}
282282
path: ${{ env.MAVEN_CACHE_DIR }}
@@ -319,13 +319,13 @@ jobs:
319319

320320
- name: "Restore Dependencies"
321321
id: restore-dependencies
322-
uses: actions/cache/restore@v4
322+
uses: actions/cache/restore@v5
323323
with:
324324
key: ${{ env.MAVEN_CACHE_KEY }}
325325
path: ${{ env.MAVEN_CACHE_DIR }}
326326

327327
- name: "Restore SDK M2"
328-
uses: actions/download-artifact@v6
328+
uses: actions/download-artifact@v7
329329
with:
330330
name: ${{ env.SDK_M2_NAME }}
331331
path: ${{ env.M2_ROOT }}

cloudplatform/connectivity-apache-httpclient5/src/test/java/com/sap/cloud/sdk/cloudplatform/connectivity/ClientCertificateAuthenticationLocalTest.java

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,14 @@
3737

3838
class ClientCertificateAuthenticationLocalTest
3939
{
40-
private static final String CCA_PASSWORD = "cca-password";
41-
private static final String JKS_PATH =
42-
"src/test/resources/" + ClientCertificateAuthenticationLocalTest.class.getSimpleName() + "/client-cert.pkcs12";
40+
private static final String JKS_PREFIX =
41+
"src/test/resources/" + ClientCertificateAuthenticationLocalTest.class.getSimpleName();
42+
private static final String SERVER_TRUST_STORE = JKS_PREFIX + "/certs/truststore.jks";
43+
private static final String SERVER_TRUST_STORE_PASS = "changeit";
44+
private static final String SERVER_KEY_STORE = JKS_PREFIX + "/certs/server.jks";
45+
private static final String SERVER_KEY_STORE_PASS = "changeit";
46+
private static final String CLIENT_KEY_STORE = JKS_PREFIX + "/certs/client1.p12";
47+
private static final String CLIENT_KEY_STORE_PASS = "changeit";
4348

4449
@RegisterExtension
4550
static final WireMockExtension server =
@@ -71,7 +76,7 @@ void testClientCorrectlyConfigured()
7176
.authenticationType(AuthenticationType.CLIENT_CERTIFICATE_AUTHENTICATION)
7277
.proxyType(ProxyType.INTERNET)
7378
.keyStore(getClientKeyStore())
74-
.keyStorePassword(CCA_PASSWORD)
79+
.keyStorePassword(CLIENT_KEY_STORE_PASS)
7580
.trustAllCertificates()
7681
.build());
7782

@@ -82,7 +87,7 @@ void testClientCorrectlyConfigured()
8287

8388
assertThat(context.getUserToken()).isNotNull();
8489
assertThat(context.getUserToken()).isInstanceOf(X500Principal.class);
85-
assertThat(((X500Principal) context.getUserToken()).getName()).contains("CN=localhost");
90+
assertThat(((X500Principal) context.getUserToken()).getName()).contains("CN=client1");
8691

8792
// assert keystore methods have been used
8893
Mockito.verify(destination).getKeyStorePassword();
@@ -122,8 +127,11 @@ private static WireMockConfiguration buildWireMockConfiguration()
122127
.httpDisabled(true)
123128
.dynamicHttpsPort()
124129
.needClientAuth(true)
125-
.trustStorePath(JKS_PATH)
126-
.trustStorePassword(CCA_PASSWORD)
130+
.keystorePath(SERVER_KEY_STORE)
131+
.keystorePassword(SERVER_KEY_STORE_PASS)
132+
.keyManagerPassword(SERVER_KEY_STORE_PASS)
133+
.trustStorePath(SERVER_TRUST_STORE)
134+
.trustStorePassword(SERVER_TRUST_STORE_PASS)
127135
.trustStoreType("JKS");
128136
}
129137

@@ -134,7 +142,7 @@ private static KeyStore getClientKeyStore()
134142
NoSuchAlgorithmException
135143
{
136144
final KeyStore keyStore = KeyStore.getInstance("PKCS12");
137-
keyStore.load(new FileInputStream(JKS_PATH), CCA_PASSWORD.toCharArray());
145+
keyStore.load(new FileInputStream(CLIENT_KEY_STORE), CLIENT_KEY_STORE_PASS.toCharArray());
138146
return keyStore;
139147
}
140148
}

cloudplatform/connectivity-apache-httpclient5/src/test/resources/ClientCertificateAuthenticationLocalTest/README.md

Lines changed: 103 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,112 @@ The credential files are generated from command line. This process can be automa
55

66
## CREATE CLIENT CREDENTIALS
77

8-
* Generate key pair
9-
```bash
10-
openssl req -x509 -newkey rsa:2048 -utf8 -days 3650 -nodes -config client-cert.conf -keyout client-cert.key -out client-cert.crt
8+
* Client keystore
119
```
10+
docker run --rm -v $(pwd)/certs:/certs eclipse-temurin:17-jre \
11+
keytool -genkeypair \
12+
-alias client1 \
13+
-keyalg RSA \
14+
-keysize 2048 \
15+
-validity 3650 \
16+
-storetype JKS \
17+
-keystore /certs/client1.jks \
18+
-storepass changeit \
19+
-keypass changeit \
20+
-dname "CN=client1"
21+
```
22+
23+
<details><summary>(Windows)</summary>
1224

13-
* Generate _PKCS#12_ keystore
14-
```bash
15-
openssl pkcs12 -export -inkey client-cert.key -in client-cert.crt -out client-cert.p12 -password "pass:cca-password"
25+
```
26+
docker run --rm -v ${pwd}/certs:/certs eclipse-temurin:17-jre keytool -genkeypair -alias client1 -keyalg RSA -keysize 2048 -validity 3650 -storetype JKS -keystore /certs/client1.jks -storepass changeit -keypass changeit -dname "CN=client1"
1627
```
1728

18-
* Transform to JKS
29+
</details>
30+
31+
* Export client certificate
32+
```
33+
docker run --rm -v $(pwd)/certs:/certs eclipse-temurin:17-jre \
34+
keytool -exportcert \
35+
-alias client1 \
36+
-keystore /certs/client1.jks \
37+
-storepass changeit \
38+
-file /certs/client1.cer
39+
```
40+
41+
<details><summary>(Windows)</summary>
42+
43+
```
44+
docker run --rm -v ${pwd}/certs:/certs eclipse-temurin:17-jre keytool -exportcert -alias client1 -keystore /certs/client1.jks -storepass changeit -file /certs/client1.cer
45+
```
1946

20-
```bash
21-
keytool -importkeystore -deststorepass "cca-password" -destkeypass "cca-password" -srckeystore client-cert.p12 -srcstorepass "cca-password" -deststoretype pkcs12 -destkeystore client-cert.pkcs12
47+
</details>
48+
49+
* PKCS12 keystore for client
50+
51+
```
52+
docker run --rm -v $(pwd)/certs:/certs eclipse-temurin:17-jre \
53+
keytool -importkeystore \
54+
-srckeystore /certs/client1.jks \
55+
-srcstoretype JKS \
56+
-srcstorepass changeit \
57+
-destkeystore /certs/client1.p12 \
58+
-deststoretype PKCS12 \
59+
-deststorepass changeit \
60+
-destkeypass changeit
2261
```
62+
63+
<details><summary>(Windows)</summary>
64+
65+
```
66+
docker run --rm -v ${pwd}/certs:/certs eclipse-temurin:17-jre keytool -importkeystore -srckeystore /certs/client1.jks -srcstoretype JKS -srcstorepass changeit -destkeystore /certs/client1.p12 -deststoretype PKCS12 -deststorepass changeit -destkeypass changeit
67+
```
68+
69+
</details>
70+
71+
72+
## CREATE SERVER CREDENTIALS
73+
74+
* Server keystore. Run once
75+
```
76+
docker run --rm -v $(pwd)/certs:/certs eclipse-temurin:17-jre \
77+
keytool -genkeypair \
78+
-alias wiremock-server \
79+
-keyalg RSA \
80+
-keysize 2048 \
81+
-validity 3650 \
82+
-storetype JKS \
83+
-keystore /certs/server.jks \
84+
-storepass changeit \
85+
-keypass changeit \
86+
-dname "CN=localhost" \
87+
-ext SAN=dns:localhost,ip:127.0.0.1
88+
```
89+
90+
<details><summary>(Windows)</summary>
91+
92+
```
93+
docker run --rm -v ${pwd}/certs:/certs eclipse-temurin:17-jre keytool -genkeypair -alias wiremock-server -keyalg RSA -keysize 2048 -validity 3650 -storetype JKS -keystore /certs/server.jks -storepass changeit -keypass changeit -dname "CN=localhost" -ext SAN=dns:localhost,ip:127.0.0.1
94+
```
95+
96+
</details>
97+
98+
* Truststore for wiremock
99+
100+
```
101+
docker run --rm -v $(pwd)/certs:/certs eclipse-temurin:17-jre \
102+
keytool -importcert \
103+
-alias client1 \
104+
-file /certs/client1.cer \
105+
-keystore /certs/truststore.jks \
106+
-storepass changeit \
107+
-noprompt
108+
```
109+
110+
<details><summary>(Windows)</summary>
111+
112+
```
113+
docker run --rm -v ${pwd}/certs:/certs eclipse-temurin:17-jre keytool -importcert -alias client1 -file /certs/client1.cer -keystore /certs/truststore.jks -storepass changeit -noprompt
114+
```
115+
116+
</details>

0 commit comments

Comments
 (0)