Skip to content

Commit 8c3fb7a

Browse files
committed
Java 21.
New version of token-utils.
1 parent b519f69 commit 8c3fb7a

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

.github/workflows/deploy-to-dev.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ jobs:
3131
restore-keys: |
3232
${{ runner.os }}-gradle-
3333
34-
- name: Install Java 17
34+
- name: Install Java 21
3535
uses: actions/setup-java@v4
3636
with:
37-
java-version: 17
37+
java-version: 21
3838
distribution: temurin
3939

4040
- name: Test and build

.github/workflows/pull-requests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
1414
restore-keys: |
1515
${{ runner.os }}-gradle-
16-
- name: Sett opp Java 17
16+
- name: Sett opp Java 21
1717
uses: actions/setup-java@main
1818
with:
19-
java-version: 17
19+
java-version: 21
2020
distribution: temurin
2121
- name: test and build
2222
run: ./gradlew test build

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM gcr.io/distroless/java17-debian12:latest
1+
FROM gcr.io/distroless/java21-debian12:nonroot
22
ENV TZ="Europe/Oslo"
33

44
COPY build/libs/app.jar /app/app.jar

build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ repositories {
1212
}
1313

1414
plugins {
15-
val kotlinVersion = "1.8.0"
15+
val kotlinVersion = "1.9.23"
1616
id("org.springframework.boot") version "3.2.4"
1717
kotlin("jvm") version kotlinVersion
1818
kotlin("plugin.spring") version kotlinVersion
@@ -54,12 +54,12 @@ dependencies {
5454
testImplementation("org.mockito:mockito-inline:5.2.0")
5555
}
5656

57-
java.sourceCompatibility = JavaVersion.VERSION_17
57+
java.sourceCompatibility = JavaVersion.VERSION_21
5858

5959
tasks.withType<KotlinCompile> {
6060
kotlinOptions {
6161
freeCompilerArgs = listOf("-Xjsr305=strict")
62-
jvmTarget = "17"
62+
jvmTarget = "21"
6363
}
6464
}
6565

src/main/kotlin/no/nav/klage/document/api/CommentsController.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ class CommentsController(
165165
}
166166

167167
fun getIdent(): String? =
168-
tokenValidationContextHolder.tokenValidationContext.getJwtToken(ISSUER_AAD)
169-
.jwtTokenClaims?.get("NAVident")?.toString()
168+
tokenValidationContextHolder.getTokenValidationContext().getJwtToken(ISSUER_AAD)
169+
?.jwtTokenClaims?.get("NAVident")?.toString()
170170

171171
}

src/main/kotlin/no/nav/klage/document/util/TokenUtil.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class TokenUtil(
1919
getIdentNullable() ?: throw RuntimeException("NAVident not found in token")
2020

2121
fun getIdentNullable(): String? =
22-
tokenValidationContextHolder.tokenValidationContext.getJwtToken(ISSUER_AAD)
23-
.jwtTokenClaims?.get("NAVident")?.toString()
22+
tokenValidationContextHolder.getTokenValidationContext().getJwtToken(ISSUER_AAD)
23+
?.jwtTokenClaims?.get("NAVident")?.toString()
2424

2525
}

0 commit comments

Comments
 (0)