Skip to content

Commit e4d6b7a

Browse files
Oppgraderer til java 21, pakker og plugins. (#461)
* Bump the gradle group with 21 updates Bumps the gradle group with 21 updates: | Package | From | To | | --- | --- | --- | | [no.nav.security:token-validation-spring](https://github.com/navikt/token-support) | `3.2.0` | `4.1.4` | | [no.nav.security:token-client-spring](https://github.com/navikt/token-support) | `3.2.0` | `4.1.4` | | [no.nav.security:token-validation-spring-test](https://github.com/navikt/token-support) | `3.2.0` | `4.1.4` | | org.springframework.cloud:spring-cloud-starter-contract-stub-runner | `4.1.1` | `4.1.2` | | [org.springdoc:springdoc-openapi-starter-webmvc-ui](https://github.com/springdoc/springdoc-openapi) | `2.3.0` | `2.5.0` | | [org.postgresql:postgresql](https://github.com/pgjdbc/pgjdbc) | `42.7.1` | `42.7.3` | | [org.testcontainers:junit-jupiter](https://github.com/testcontainers/testcontainers-java) | `1.19.4` | `1.19.7` | | [org.testcontainers:postgresql](https://github.com/testcontainers/testcontainers-java) | `1.19.4` | `1.19.7` | | [org.testcontainers:testcontainers](https://github.com/testcontainers/testcontainers-java) | `1.19.4` | `1.19.7` | | [io.confluent:kafka-connect-avro-converter](https://github.com/confluentinc/schema-registry) | `7.5.3` | `7.6.1` | | [io.confluent:kafka-avro-serializer](https://github.com/confluentinc/schema-registry) | `7.5.3` | `7.6.1` | | [com.github.jknack:handlebars](https://github.com/jknack/handlebars.java) | `4.3.1` | `4.4.0` | | [org.json:json](https://github.com/douglascrockford/JSON-java) | `20231013` | `20240303` | | [com.google.guava:guava](https://github.com/google/guava) | `33.0.0-jre` | `33.1.0-jre` | | [org.awaitility:awaitility-kotlin](https://github.com/awaitility/awaitility) | `4.2.0` | `4.2.1` | | [io.mockk:mockk](https://github.com/mockk/mockk) | `1.13.9` | `1.13.10` | | [jvm](https://github.com/JetBrains/kotlin) | `1.9.22` | `1.9.23` | | [plugin.spring](https://github.com/JetBrains/kotlin) | `1.9.22` | `1.9.23` | | [plugin.jpa](https://github.com/JetBrains/kotlin) | `1.9.22` | `1.9.23` | | [org.springframework.boot](https://github.com/spring-projects/spring-boot) | `3.2.2` | `3.2.4` | | org.sonarqube | `4.4.1.3373` | `5.0.0.4638` | Updates `no.nav.security:token-validation-spring` from 3.2.0 to 4.1.4 - [Release notes](https://github.com/navikt/token-support/releases) - [Commits](navikt/token-support@3.2.0...4.1.4) Updates `no.nav.security:token-client-spring` from 3.2.0 to 4.1.4 - [Release notes](https://github.com/navikt/token-support/releases) - [Commits](navikt/token-support@3.2.0...4.1.4) Updates `no.nav.security:token-validation-spring-test` from 3.2.0 to 4.1.4 - [Release notes](https://github.com/navikt/token-support/releases) - [Commits](navikt/token-support@3.2.0...4.1.4) Updates `no.nav.security:token-client-spring` from 3.2.0 to 4.1.4 - [Release notes](https://github.com/navikt/token-support/releases) - [Commits](navikt/token-support@3.2.0...4.1.4) Updates `no.nav.security:token-validation-spring-test` from 3.2.0 to 4.1.4 - [Release notes](https://github.com/navikt/token-support/releases) - [Commits](navikt/token-support@3.2.0...4.1.4) Updates `org.springframework.cloud:spring-cloud-starter-contract-stub-runner` from 4.1.1 to 4.1.2 Updates `org.springdoc:springdoc-openapi-starter-webmvc-ui` from 2.3.0 to 2.5.0 - [Release notes](https://github.com/springdoc/springdoc-openapi/releases) - [Changelog](https://github.com/springdoc/springdoc-openapi/blob/main/CHANGELOG.md) - [Commits](springdoc/springdoc-openapi@v2.3.0...v2.5.0) Updates `org.postgresql:postgresql` from 42.7.1 to 42.7.3 - [Release notes](https://github.com/pgjdbc/pgjdbc/releases) - [Changelog](https://github.com/pgjdbc/pgjdbc/blob/master/CHANGELOG.md) - [Commits](pgjdbc/pgjdbc@REL42.7.1...REL42.7.3) Updates `org.testcontainers:junit-jupiter` from 1.19.4 to 1.19.7 - [Release notes](https://github.com/testcontainers/testcontainers-java/releases) - [Changelog](https://github.com/testcontainers/testcontainers-java/blob/main/CHANGELOG.md) - [Commits](testcontainers/testcontainers-java@1.19.4...1.19.7) Updates `org.testcontainers:postgresql` from 1.19.4 to 1.19.7 - [Release notes](https://github.com/testcontainers/testcontainers-java/releases) - [Changelog](https://github.com/testcontainers/testcontainers-java/blob/main/CHANGELOG.md) - [Commits](testcontainers/testcontainers-java@1.19.4...1.19.7) Updates `org.testcontainers:testcontainers` from 1.19.4 to 1.19.7 - [Release notes](https://github.com/testcontainers/testcontainers-java/releases) - [Changelog](https://github.com/testcontainers/testcontainers-java/blob/main/CHANGELOG.md) - [Commits](testcontainers/testcontainers-java@1.19.4...1.19.7) Updates `org.testcontainers:postgresql` from 1.19.4 to 1.19.7 - [Release notes](https://github.com/testcontainers/testcontainers-java/releases) - [Changelog](https://github.com/testcontainers/testcontainers-java/blob/main/CHANGELOG.md) - [Commits](testcontainers/testcontainers-java@1.19.4...1.19.7) Updates `io.confluent:kafka-connect-avro-converter` from 7.5.3 to 7.6.1 - [Commits](https://github.com/confluentinc/schema-registry/commits) Updates `io.confluent:kafka-avro-serializer` from 7.5.3 to 7.6.1 - [Commits](https://github.com/confluentinc/schema-registry/commits) Updates `io.confluent:kafka-avro-serializer` from 7.5.3 to 7.6.1 - [Commits](https://github.com/confluentinc/schema-registry/commits) Updates `com.github.jknack:handlebars` from 4.3.1 to 4.4.0 - [Release notes](https://github.com/jknack/handlebars.java/releases) - [Commits](jknack/handlebars.java@v4.3.1...v4.4.0) Updates `org.json:json` from 20231013 to 20240303 - [Release notes](https://github.com/douglascrockford/JSON-java/releases) - [Changelog](https://github.com/stleary/JSON-java/blob/master/docs/RELEASES.md) - [Commits](https://github.com/douglascrockford/JSON-java/commits) Updates `com.google.guava:guava` from 33.0.0-jre to 33.1.0-jre - [Release notes](https://github.com/google/guava/releases) - [Commits](https://github.com/google/guava/commits) Updates `org.awaitility:awaitility-kotlin` from 4.2.0 to 4.2.1 - [Changelog](https://github.com/awaitility/awaitility/blob/master/changelog.txt) - [Commits](awaitility/awaitility@awaitility-4.2.0...awaitility-4.2.1) Updates `io.mockk:mockk` from 1.13.9 to 1.13.10 - [Release notes](https://github.com/mockk/mockk/releases) - [Commits](mockk/mockk@1.13.9...1.13.10) Updates `org.testcontainers:testcontainers` from 1.19.4 to 1.19.7 - [Release notes](https://github.com/testcontainers/testcontainers-java/releases) - [Changelog](https://github.com/testcontainers/testcontainers-java/blob/main/CHANGELOG.md) - [Commits](testcontainers/testcontainers-java@1.19.4...1.19.7) Updates `jvm` from 1.9.22 to 1.9.23 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.9.23/ChangeLog.md) - [Commits](JetBrains/kotlin@v1.9.22...v1.9.23) Updates `plugin.spring` from 1.9.22 to 1.9.23 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.9.23/ChangeLog.md) - [Commits](JetBrains/kotlin@v1.9.22...v1.9.23) Updates `plugin.jpa` from 1.9.22 to 1.9.23 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.9.23/ChangeLog.md) - [Commits](JetBrains/kotlin@v1.9.22...v1.9.23) Updates `org.springframework.boot` from 3.2.2 to 3.2.4 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](spring-projects/spring-boot@v3.2.2...v3.2.4) Updates `org.sonarqube` from 4.4.1.3373 to 5.0.0.4638 --- updated-dependencies: - dependency-name: no.nav.security:token-validation-spring dependency-type: direct:production update-type: version-update:semver-major dependency-group: gradle - dependency-name: no.nav.security:token-client-spring dependency-type: direct:production update-type: version-update:semver-major dependency-group: gradle - dependency-name: no.nav.security:token-validation-spring-test dependency-type: direct:production update-type: version-update:semver-major dependency-group: gradle - dependency-name: no.nav.security:token-client-spring dependency-type: direct:production update-type: version-update:semver-major dependency-group: gradle - dependency-name: no.nav.security:token-validation-spring-test dependency-type: direct:production update-type: version-update:semver-major dependency-group: gradle - dependency-name: org.springframework.cloud:spring-cloud-starter-contract-stub-runner dependency-type: direct:production update-type: version-update:semver-patch dependency-group: gradle - dependency-name: org.springdoc:springdoc-openapi-starter-webmvc-ui dependency-type: direct:production update-type: version-update:semver-minor dependency-group: gradle - dependency-name: org.postgresql:postgresql dependency-type: direct:production update-type: version-update:semver-patch dependency-group: gradle - dependency-name: org.testcontainers:junit-jupiter dependency-type: direct:production update-type: version-update:semver-patch dependency-group: gradle - dependency-name: org.testcontainers:postgresql dependency-type: direct:production update-type: version-update:semver-patch dependency-group: gradle - dependency-name: org.testcontainers:testcontainers dependency-type: direct:production update-type: version-update:semver-patch dependency-group: gradle - dependency-name: org.testcontainers:postgresql dependency-type: direct:production update-type: version-update:semver-patch dependency-group: gradle - dependency-name: io.confluent:kafka-connect-avro-converter dependency-type: direct:production update-type: version-update:semver-minor dependency-group: gradle - dependency-name: io.confluent:kafka-avro-serializer dependency-type: direct:production update-type: version-update:semver-minor dependency-group: gradle - dependency-name: io.confluent:kafka-avro-serializer dependency-type: direct:production update-type: version-update:semver-minor dependency-group: gradle - dependency-name: com.github.jknack:handlebars dependency-type: direct:production update-type: version-update:semver-minor dependency-group: gradle - dependency-name: org.json:json dependency-type: direct:production update-type: version-update:semver-major dependency-group: gradle - dependency-name: com.google.guava:guava dependency-type: direct:production update-type: version-update:semver-minor dependency-group: gradle - dependency-name: org.awaitility:awaitility-kotlin dependency-type: direct:production update-type: version-update:semver-patch dependency-group: gradle - dependency-name: io.mockk:mockk dependency-type: direct:production update-type: version-update:semver-patch dependency-group: gradle - dependency-name: org.testcontainers:testcontainers dependency-type: direct:production update-type: version-update:semver-patch dependency-group: gradle - dependency-name: jvm dependency-type: direct:production update-type: version-update:semver-patch dependency-group: gradle - dependency-name: plugin.spring dependency-type: direct:production update-type: version-update:semver-patch dependency-group: gradle - dependency-name: plugin.jpa dependency-type: direct:production update-type: version-update:semver-patch dependency-group: gradle - dependency-name: org.springframework.boot dependency-type: direct:production update-type: version-update:semver-patch dependency-group: gradle - dependency-name: org.sonarqube dependency-type: direct:production update-type: version-update:semver-major dependency-group: gradle ... Signed-off-by: dependabot[bot] <[email protected]> * Oppgraderer java, pakker og plugins. --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 2d19365 commit e4d6b7a

File tree

9 files changed

+30
-27
lines changed

9 files changed

+30
-27
lines changed

.github/workflows/build-and-deploy.yml

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
with:
2121
readertoken: true
2222
buildcommand: './gradlew check'
23+
javaversion: 21
2324

2425
codeql:
2526
uses: navikt/sif-gha-workflows/.github/workflows/gradle-codeql.yml@main
@@ -33,6 +34,7 @@ jobs:
3334
readertoken: true
3435
package-command: './gradlew clean build -x test'
3536
branch: master
37+
javaversion: 21
3638

3739
build:
3840
uses: navikt/sif-gha-workflows/.github/workflows/gradle-build.yml@main
@@ -45,6 +47,7 @@ jobs:
4547
team: dusseldorf
4648
readertoken: true
4749
buildcommand: '--configuration-cache build -x test'
50+
javaversion: 21
4851

4952
trivy:
5053
needs: [ build ]

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM amazoncorretto:17-alpine3.15
1+
FROM amazoncorretto:21-alpine3.15
22

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

build.gradle.kts

+18-18
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,46 @@ import com.expediagroup.graphql.plugin.gradle.tasks.GraphQLGenerateClientTask
22
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
33

44
plugins {
5-
kotlin("jvm") version "1.9.22"
6-
kotlin("plugin.spring") version "1.9.22"
7-
kotlin("plugin.jpa") version "1.9.22"
8-
id("org.springframework.boot") version "3.2.2"
5+
kotlin("jvm") version "1.9.23"
6+
kotlin("plugin.spring") version "1.9.23"
7+
kotlin("plugin.jpa") version "1.9.23"
8+
id("org.springframework.boot") version "3.2.4"
99
id("io.spring.dependency-management") version "1.1.4"
1010
id("com.expediagroup.graphql") version "7.0.2"
11-
id("org.sonarqube") version "4.4.1.3373"
11+
id("org.sonarqube") version "5.0.0.4638"
1212
jacoco
1313
}
1414

1515
group = "no.nav"
1616
version = "0.0.1-SNAPSHOT"
17-
java.sourceCompatibility = JavaVersion.VERSION_17
17+
java.sourceCompatibility = JavaVersion.VERSION_21
1818

1919
configurations {
2020
compileOnly {
2121
extendsFrom(configurations.annotationProcessor.get())
2222
}
2323
}
2424

25-
val confluentVersion = "7.5.3"
26-
val springCloudVersion = "4.1.1"
25+
val confluentVersion = "7.6.1"
26+
val springCloudVersion = "4.1.2"
2727
val logstashLogbackEncoderVersion = "7.4"
28-
val tokenSupportVersion = "3.2.0"
28+
val tokenSupportVersion = "4.1.4"
2929
val retryVersion = "2.0.5"
3030
val zalandoVersion = "0.27.0"
3131
val openhtmltopdfVersion = "1.0.10"
32-
val handlebarsVersion = "4.3.1"
33-
val postgresqlVersion = "42.7.1"
34-
val awailitilityKotlinVersion = "4.2.0"
32+
val handlebarsVersion = "4.4.0"
33+
val postgresqlVersion = "42.7.3"
34+
val awailitilityKotlinVersion = "4.2.1"
3535
val assertkJvmVersion = "0.28.0"
3636
val springMockkVersion = "4.0.2"
37-
val mockkVersion = "1.13.9"
38-
val guavaVersion = "33.0.0-jre"
39-
val orgJsonVersion = "20231013"
37+
val mockkVersion = "1.13.10"
38+
val guavaVersion = "33.1.0-jre"
39+
val orgJsonVersion = "20240303"
4040
val graphQLKotlinVersion = "7.0.2"
4141
val k9FormatVersion = "8.3.4"
4242
val teamDokumenthåndteringAvroSchemaVersion = "357738b9"
43-
val testContainersVersion = "1.19.4"
44-
val springdocVersion = "2.3.0"
43+
val testContainersVersion = "1.19.7"
44+
val springdocVersion = "2.5.0"
4545

4646
repositories {
4747
mavenCentral()
@@ -161,7 +161,7 @@ tasks.withType<Test> {
161161
tasks.withType<KotlinCompile> {
162162
kotlinOptions {
163163
freeCompilerArgs = listOf("-Xjsr305=strict")
164-
jvmTarget = "17"
164+
jvmTarget = "21"
165165
}
166166
}
167167

src/main/kotlin/no/nav/sifinnsynapi/filter/LoggerInterceptor.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class LoggerInterceptor(private val tokenValidationContextHolder: TokenValidatio
1414
private val logger = LoggerFactory.getLogger(LoggerInterceptor::class.java)
1515
}
1616
override fun preHandle(request: HttpServletRequest, response: HttpServletResponse, handler: Any): Boolean {
17-
val jwtToken = tokenValidationContextHolder.tokenValidationContext.firstValidToken.orElse(null)
17+
val jwtToken = tokenValidationContextHolder.getTokenValidationContext().firstValidToken
1818
if (jwtToken !== null) {
1919
logger.info("Issuer [${jwtToken.issuer}]")
2020
}

src/main/kotlin/no/nav/sifinnsynapi/k9sakinnsynapi/K9SakInnsynApiClientConfig.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class K9SakInnsynApiClientConfig(
5151
private fun bearerTokenInterceptor(): ClientHttpRequestInterceptor {
5252
return ClientHttpRequestInterceptor { request: HttpRequest, body: ByteArray, execution: ClientHttpRequestExecution ->
5353
val response = oAuth2AccessTokenService.getAccessToken(tokenxK9SakInnsynApiClientProperties)
54-
request.headers.setBearerAuth(response.accessToken)
54+
request.headers.setBearerAuth(response.accessToken!!)
5555
execution.execute(request, body)
5656
}
5757
}

src/main/kotlin/no/nav/sifinnsynapi/oppslag/OppslagsKlientKonfig.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ class OppslagsKlientKonfig(
8585
else -> {
8686
val response = oAuth2AccessTokenService.getAccessToken(tokenxK9SelvbetjeningOppslagClientProperties)
8787
val expiresIn = response.expiresIn
88-
logger.debug("Utveklset token utgår kl. {}, ({} min)", ZonedDateTime.now(UTC).plusSeconds(expiresIn.toLong()), expiresIn/60)
89-
request.headers.setBearerAuth(response.accessToken)
88+
logger.debug("Utveklset token utgår kl. {}, ({} min)", ZonedDateTime.now(UTC).plusSeconds(expiresIn!!.toLong()), expiresIn/60)
89+
request.headers.setBearerAuth(response.accessToken!!)
9090
}
9191
}
9292
execution.execute(request, body)

src/main/kotlin/no/nav/sifinnsynapi/saf/SafClientConfig.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,6 @@ class SafClientConfig(
6161
)
6262

6363
private fun accessToken(clientProperties: ClientProperties): String {
64-
return oAuth2AccessTokenService.getAccessToken(clientProperties).accessToken
64+
return oAuth2AccessTokenService.getAccessToken(clientProperties).accessToken!!
6565
}
6666
}

src/main/kotlin/no/nav/sifinnsynapi/safselvbetjening/SafSelvbetjeningClientsConfig.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class SafSelvbetjeningClientsConfig(
8686
): ClientHttpRequestInterceptor {
8787
return ClientHttpRequestInterceptor { request: HttpRequest, body: ByteArray, execution: ClientHttpRequestExecution ->
8888
val response = oAuth2AccessTokenService.getAccessToken(clientProperties)
89-
request.headers.setBearerAuth(response.accessToken)
89+
request.headers.setBearerAuth(response.accessToken!!)
9090
execution.execute(request, body)
9191
}
9292
}

src/main/kotlin/no/nav/sifinnsynapi/util/TokenUtils.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ object TokenClaims {
1111
}
1212

1313
fun SpringTokenValidationContextHolder.personIdent(): String {
14-
val jwtToken = tokenValidationContext.firstValidToken
15-
.orElseThrow { IllegalStateException("Ingen gyldige tokens i Authorization headeren") }
14+
val jwtToken = getTokenValidationContext().firstValidToken
15+
?: throw IllegalStateException("Ingen gyldige tokens i Authorization headeren")
1616

1717
val pid = jwtToken.jwtTokenClaims.getStringClaim(TokenClaims.CLAIM_PID)
1818
val sub = jwtToken.jwtTokenClaims.getStringClaim(TokenClaims.CLAIM_SUB)

0 commit comments

Comments
 (0)