Skip to content

Commit cbb66cd

Browse files
Merge branch 'main' into generator-bot-21212955245/serverupdate
2 parents ac9fdfb + ed12cd7 commit cbb66cd

File tree

17 files changed

+218
-211
lines changed

17 files changed

+218
-211
lines changed

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ updates:
1010
directory: "/"
1111
schedule:
1212
interval: "daily"
13+
ignore:
14+
- dependency-name: "org.junit.jupiter:junit-jupiter-api"
15+
versions: ["[6.0.0,)"]
16+
- dependency-name: "org.junit.jupiter:junit-jupiter-engine"
17+
versions: ["[6.0.0,)"]
18+
- dependency-name: "org.junit.platform:junit-platform-launcher"
19+
versions: ["[6.0.0,)"]
20+
groups:
21+
junit:
22+
patterns: ["org.junit.*"]
1323
cooldown:
1424
default-days: 7
1525
exclude: ["cloud.stackit*"]

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
version: [11, 17, 21]
15+
version: [17, 21, 25]
1616
steps:
1717
- name: Checkout
1818
uses: actions/checkout@v6

build.gradle

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ plugins {
55
id 'eclipse'
66
id 'pmd'
77

8-
id 'com.diffplug.spotless' version '6.21.0'
8+
id 'com.diffplug.spotless' version '8.1.0'
99

1010
/* We have to use this 3rd party plugin for publishing to MavenCentral because as of AUG-2025 there is no official
1111
* plugin which supports publishing to MavenCentral Portal. */
12-
id "com.vanniktech.maven.publish.base" version "0.34.0"
12+
id "com.vanniktech.maven.publish.base" version "0.36.0"
1313
}
1414

1515
allprojects {
@@ -69,7 +69,7 @@ allprojects {
6969

7070
pmd {
7171
consoleOutput = true
72-
toolVersion = "7.12.0"
72+
toolVersion = "7.20.0"
7373

7474
// This tells PMD to use your custom ruleset file.
7575
ruleSetFiles = rootProject.files("config/pmd/pmd-ruleset.xml")
@@ -215,7 +215,8 @@ subprojects {
215215
implementation project(':core')
216216
}
217217

218-
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.11.0'
219-
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.11.0'
218+
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.14.2'
219+
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.14.2'
220+
testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.14.2'
220221
}
221222
}

core/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

22
dependencies {
33
implementation 'com.auth0:java-jwt:4.5.0'
4-
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
5-
implementation 'com.google.code.gson:gson:2.9.1'
4+
implementation 'com.squareup.okhttp3:okhttp:5.3.2'
5+
implementation 'com.google.code.gson:gson:2.13.2'
66

7-
testImplementation 'com.squareup.okhttp3:mockwebserver:4.9.0'
8-
testImplementation 'org.mockito:mockito-core:5.18.0'
9-
testImplementation 'org.mockito:mockito-junit-jupiter:5.18.0'
7+
testImplementation 'com.squareup.okhttp3:mockwebserver:5.3.2'
8+
testImplementation 'org.mockito:mockito-core:5.21.0'
9+
testImplementation 'org.mockito:mockito-junit-jupiter:5.21.0'
1010
}

core/src/main/java/cloud/stackit/sdk/core/KeyFlowAuthenticator.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import java.security.NoSuchAlgorithmException;
2020
import java.security.interfaces.RSAPrivateKey;
2121
import java.security.spec.InvalidKeySpecException;
22-
import java.util.Date;
22+
import java.time.Instant;
2323
import java.util.Map;
2424
import java.util.UUID;
2525
import java.util.concurrent.ConcurrentHashMap;
@@ -200,7 +200,7 @@ public KeyFlowTokenResponse(
200200
}
201201

202202
protected boolean isExpired() {
203-
return expiresIn < new Date().toInstant().getEpochSecond();
203+
return expiresIn < Instant.now().getEpochSecond();
204204
}
205205

206206
protected String getAccessToken() {
@@ -342,8 +342,8 @@ private String generateSelfSignedJWT()
342342
.withSubject(saKey.getCredentials().getSub())
343343
.withJWTId(UUID.randomUUID().toString())
344344
.withAudience(saKey.getCredentials().getAud())
345-
.withIssuedAt(new Date())
346-
.withExpiresAt(new Date().toInstant().plusSeconds(10 * 60))
345+
.withIssuedAt(Instant.now())
346+
.withExpiresAt(Instant.now().plusSeconds(10 * 60))
347347
.withHeader(jwtHeader)
348348
.sign(algorithm);
349349
}

core/src/main/java/cloud/stackit/sdk/core/auth/SetupAuth.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ protected static String readValueFromCredentialsFile(
327327
} catch (ClassCastException ignored) {
328328
}
329329
if (Utils.isStringSet(keyPath)) {
330-
return new String(Files.readAllBytes(Paths.get(keyPath)));
330+
return new String(Files.readAllBytes(Paths.get(keyPath)), StandardCharsets.UTF_8);
331331
}
332332
throw new CredentialsInFileNotFoundException(
333333
"could not find " + valueKey + " or " + pathKey + " in " + path);

examples/alb/src/main/java/cloud/stackit/sdk/alb/examples/AlbExample.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ private AlbExample() {}
1818
"PMD.CognitiveComplexity",
1919
"PMD.CommentSize",
2020
"PMD.CyclomaticComplexity",
21-
"PMD.NPathComplexity",
2221
"PMD.NcssCount",
2322
"PMD.SystemPrintln",
2423
"PMD.AvoidThrowingRawExceptionTypes"

examples/authentication/src/main/java/cloud/stackit/sdk/authentication/examples/AuthenticationExample.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import java.io.File;
88
import java.io.FileNotFoundException;
99
import java.io.IOException;
10+
import java.nio.charset.StandardCharsets;
1011
import java.util.Scanner;
1112

1213
final class AuthenticationExample {
@@ -53,7 +54,7 @@ public static void main(String[] args) throws IOException {
5354
"examples/authentication/src/main/java/cloud/stackit/sdk/authentication/examples/dummy_credentials/dummy-service-account-key.json";
5455
File serviceAccountKeyFile = new File(serviceAccountKeyPath);
5556
StringBuilder serviceAccountKeyContent = new StringBuilder();
56-
try (Scanner myReader = new Scanner(serviceAccountKeyFile)) {
57+
try (Scanner myReader = new Scanner(serviceAccountKeyFile, StandardCharsets.UTF_8.name())) {
5758
while (myReader.hasNextLine()) {
5859
serviceAccountKeyContent.append(myReader.nextLine());
5960
}
@@ -66,7 +67,7 @@ public static void main(String[] args) throws IOException {
6667
"examples/authentication/src/main/java/cloud/stackit/sdk/authentication/examples/dummy_credentials/dummy-private-key.pem";
6768
File privateKeyFile = new File(privateKeyPath);
6869
StringBuilder privateKeyContent = new StringBuilder();
69-
try (Scanner myReader = new Scanner(privateKeyFile)) {
70+
try (Scanner myReader = new Scanner(privateKeyFile, StandardCharsets.UTF_8.name())) {
7071
while (myReader.hasNextLine()) {
7172
privateKeyContent.append(myReader.nextLine());
7273
}

examples/loadbalancer/src/main/java/cloud/stackit/sdk/loadbalancer/examples/LoadBalancerExample.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ private LoadBalancerExample() {}
1818
"PMD.CognitiveComplexity",
1919
"PMD.CommentSize",
2020
"PMD.CyclomaticComplexity",
21-
"PMD.NPathComplexity",
2221
"PMD.NcssCount",
2322
"PMD.SystemPrintln",
2423
"PMD.AvoidThrowingRawExceptionTypes"

examples/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/examples/ObjectStorageExample.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ private ObjectStorageExample() {}
1919

2020
@SuppressWarnings({
2121
"PMD.CyclomaticComplexity",
22-
"PMD.CognitiveComplexity",
23-
"PMD.NPathComplexity",
2422
"PMD.NcssCount",
2523
"PMD.SystemPrintln",
2624
"PMD.AvoidThrowingRawExceptionTypes"

0 commit comments

Comments
 (0)