Skip to content

Commit

Permalink
Oppgraderer til java 21, pakker og plugins. (#461)
Browse files Browse the repository at this point in the history
* 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] <support@github.com>

* Oppgraderer java, pakker og plugins.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
ramrock93 and dependabot[bot] authored Apr 12, 2024
1 parent 2d19365 commit e4d6b7a
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 27 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
with:
readertoken: true
buildcommand: './gradlew check'
javaversion: 21

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

build:
uses: navikt/sif-gha-workflows/.github/workflows/gradle-build.yml@main
Expand All @@ -45,6 +47,7 @@ jobs:
team: dusseldorf
readertoken: true
buildcommand: '--configuration-cache build -x test'
javaversion: 21

trivy:
needs: [ build ]
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM amazoncorretto:17-alpine3.15
FROM amazoncorretto:21-alpine3.15

COPY build/libs/*.jar app.jar

Expand Down
36 changes: 18 additions & 18 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,46 @@ import com.expediagroup.graphql.plugin.gradle.tasks.GraphQLGenerateClientTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm") version "1.9.22"
kotlin("plugin.spring") version "1.9.22"
kotlin("plugin.jpa") version "1.9.22"
id("org.springframework.boot") version "3.2.2"
kotlin("jvm") version "1.9.23"
kotlin("plugin.spring") version "1.9.23"
kotlin("plugin.jpa") version "1.9.23"
id("org.springframework.boot") version "3.2.4"
id("io.spring.dependency-management") version "1.1.4"
id("com.expediagroup.graphql") version "7.0.2"
id("org.sonarqube") version "4.4.1.3373"
id("org.sonarqube") version "5.0.0.4638"
jacoco
}

group = "no.nav"
version = "0.0.1-SNAPSHOT"
java.sourceCompatibility = JavaVersion.VERSION_17
java.sourceCompatibility = JavaVersion.VERSION_21

configurations {
compileOnly {
extendsFrom(configurations.annotationProcessor.get())
}
}

val confluentVersion = "7.5.3"
val springCloudVersion = "4.1.1"
val confluentVersion = "7.6.1"
val springCloudVersion = "4.1.2"
val logstashLogbackEncoderVersion = "7.4"
val tokenSupportVersion = "3.2.0"
val tokenSupportVersion = "4.1.4"
val retryVersion = "2.0.5"
val zalandoVersion = "0.27.0"
val openhtmltopdfVersion = "1.0.10"
val handlebarsVersion = "4.3.1"
val postgresqlVersion = "42.7.1"
val awailitilityKotlinVersion = "4.2.0"
val handlebarsVersion = "4.4.0"
val postgresqlVersion = "42.7.3"
val awailitilityKotlinVersion = "4.2.1"
val assertkJvmVersion = "0.28.0"
val springMockkVersion = "4.0.2"
val mockkVersion = "1.13.9"
val guavaVersion = "33.0.0-jre"
val orgJsonVersion = "20231013"
val mockkVersion = "1.13.10"
val guavaVersion = "33.1.0-jre"
val orgJsonVersion = "20240303"
val graphQLKotlinVersion = "7.0.2"
val k9FormatVersion = "8.3.4"
val teamDokumenthåndteringAvroSchemaVersion = "357738b9"
val testContainersVersion = "1.19.4"
val springdocVersion = "2.3.0"
val testContainersVersion = "1.19.7"
val springdocVersion = "2.5.0"

repositories {
mavenCentral()
Expand Down Expand Up @@ -161,7 +161,7 @@ tasks.withType<Test> {
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "17"
jvmTarget = "21"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class LoggerInterceptor(private val tokenValidationContextHolder: TokenValidatio
private val logger = LoggerFactory.getLogger(LoggerInterceptor::class.java)
}
override fun preHandle(request: HttpServletRequest, response: HttpServletResponse, handler: Any): Boolean {
val jwtToken = tokenValidationContextHolder.tokenValidationContext.firstValidToken.orElse(null)
val jwtToken = tokenValidationContextHolder.getTokenValidationContext().firstValidToken
if (jwtToken !== null) {
logger.info("Issuer [${jwtToken.issuer}]")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class K9SakInnsynApiClientConfig(
private fun bearerTokenInterceptor(): ClientHttpRequestInterceptor {
return ClientHttpRequestInterceptor { request: HttpRequest, body: ByteArray, execution: ClientHttpRequestExecution ->
val response = oAuth2AccessTokenService.getAccessToken(tokenxK9SakInnsynApiClientProperties)
request.headers.setBearerAuth(response.accessToken)
request.headers.setBearerAuth(response.accessToken!!)
execution.execute(request, body)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ class OppslagsKlientKonfig(
else -> {
val response = oAuth2AccessTokenService.getAccessToken(tokenxK9SelvbetjeningOppslagClientProperties)
val expiresIn = response.expiresIn
logger.debug("Utveklset token utgår kl. {}, ({} min)", ZonedDateTime.now(UTC).plusSeconds(expiresIn.toLong()), expiresIn/60)
request.headers.setBearerAuth(response.accessToken)
logger.debug("Utveklset token utgår kl. {}, ({} min)", ZonedDateTime.now(UTC).plusSeconds(expiresIn!!.toLong()), expiresIn/60)
request.headers.setBearerAuth(response.accessToken!!)
}
}
execution.execute(request, body)
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/no/nav/sifinnsynapi/saf/SafClientConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ class SafClientConfig(
)

private fun accessToken(clientProperties: ClientProperties): String {
return oAuth2AccessTokenService.getAccessToken(clientProperties).accessToken
return oAuth2AccessTokenService.getAccessToken(clientProperties).accessToken!!
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class SafSelvbetjeningClientsConfig(
): ClientHttpRequestInterceptor {
return ClientHttpRequestInterceptor { request: HttpRequest, body: ByteArray, execution: ClientHttpRequestExecution ->
val response = oAuth2AccessTokenService.getAccessToken(clientProperties)
request.headers.setBearerAuth(response.accessToken)
request.headers.setBearerAuth(response.accessToken!!)
execution.execute(request, body)
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/no/nav/sifinnsynapi/util/TokenUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ object TokenClaims {
}

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

val pid = jwtToken.jwtTokenClaims.getStringClaim(TokenClaims.CLAIM_PID)
val sub = jwtToken.jwtTokenClaims.getStringClaim(TokenClaims.CLAIM_SUB)
Expand Down

0 comments on commit e4d6b7a

Please sign in to comment.