From 57dca64a1622795ebdff427c76373cee685fed7c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Jan 2025 12:24:47 +0100 Subject: [PATCH] build(deps): bump kotlin from 2.0.21 to 2.1.0 (#189) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build(deps): bump kotlin from 2.0.21 to 2.1.0 Bumps `kotlin` from 2.0.21 to 2.1.0. Updates `org.jetbrains.kotlin:kotlin-bom` from 2.0.21 to 2.1.0 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v2.1.0/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v2.0.21...v2.1.0) Updates `org.jetbrains.kotlin.jvm` from 2.0.21 to 2.1.0 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v2.1.0/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v2.0.21...v2.1.0) Updates `org.jetbrains.kotlin.plugin.spring` from 2.0.21 to 2.1.0 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v2.1.0/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v2.0.21...v2.1.0) --- updated-dependencies: - dependency-name: org.jetbrains.kotlin:kotlin-bom dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: org.jetbrains.kotlin.jvm dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: org.jetbrains.kotlin.plugin.spring dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * chore(deps): use version "1.5.0" of klint to fix the spotlessKotlin task error: ``` java.lang.NoSuchFieldError: Class org.jetbrains.kotlin.lexer.KtTokens does not have member field 'org.jetbrains.kotlin.lexer.KtModifierKeywordToken HEADER_KEYWORD' at com.pinterest.ktlint.rule.engine.core.api.ElementType.(ElementType.kt:274) ``` This is related to an incompatibility with Kotlin 2.1.0. Refs: - https://github.com/diffplug/spotless/issues/2349 - https://github.com/pinterest/ktlint/releases/tag/1.5.0 * chore(deps): use version "1.5.0" of klint run `./gradlew :spotlessApply` to fix spotless issues ✨ --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Eli Flores --- build.gradle.kts | 7 ++++--- gradle/libs.versions.toml | 2 +- .../template/HealthEndpointIntegrationTest.kt | 7 ++++++- .../digitalservice/template/HelloWorldIntegrationTest.kt | 7 ++++++- .../template/SecurityTxtIntegrationTest.kt | 9 ++++++--- .../digitalservice/template/config/SecurityConfig.kt | 5 ++--- 6 files changed, 25 insertions(+), 12 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 76edc1a..c1310eb 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -171,7 +171,8 @@ reporting { reportTask { executionData.from( configurations["aggregateCodeCoverageReportResults"] - .incoming.artifactView { + .incoming + .artifactView { lenient(true) withVariantReselection() attributes { @@ -197,10 +198,10 @@ sonar { spotless { kotlin { - ktlint() + ktlint("1.5.0") } kotlinGradle { - ktlint() + ktlint("1.5.0") } format("misc") { target( diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d725278..24d07f8 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,7 @@ [versions] # @keep jacoco = "0.8.12" -kotlin = "2.0.21" +kotlin = "2.1.0" spring-boot = "3.4.1" [libraries] diff --git a/src/integrationTest/kotlin/de/bund/digitalservice/template/HealthEndpointIntegrationTest.kt b/src/integrationTest/kotlin/de/bund/digitalservice/template/HealthEndpointIntegrationTest.kt index eb9eafe..63e176d 100644 --- a/src/integrationTest/kotlin/de/bund/digitalservice/template/HealthEndpointIntegrationTest.kt +++ b/src/integrationTest/kotlin/de/bund/digitalservice/template/HealthEndpointIntegrationTest.kt @@ -12,6 +12,11 @@ class HealthEndpointIntegrationTest( ) { @Test fun `should expose health endpoint`() { - webTestClient.get().uri("/actuator/health").exchange().expectStatus().isOk() + webTestClient + .get() + .uri("/actuator/health") + .exchange() + .expectStatus() + .isOk() } } diff --git a/src/integrationTest/kotlin/de/bund/digitalservice/template/HelloWorldIntegrationTest.kt b/src/integrationTest/kotlin/de/bund/digitalservice/template/HelloWorldIntegrationTest.kt index cbb73ac..d475feb 100644 --- a/src/integrationTest/kotlin/de/bund/digitalservice/template/HelloWorldIntegrationTest.kt +++ b/src/integrationTest/kotlin/de/bund/digitalservice/template/HelloWorldIntegrationTest.kt @@ -12,6 +12,11 @@ class HelloWorldIntegrationTest( ) { @Test fun `should expose hello world`() { - webTestClient.get().uri("/").exchange().expectStatus().isOk() + webTestClient + .get() + .uri("/") + .exchange() + .expectStatus() + .isOk() } } diff --git a/src/integrationTest/kotlin/de/bund/digitalservice/template/SecurityTxtIntegrationTest.kt b/src/integrationTest/kotlin/de/bund/digitalservice/template/SecurityTxtIntegrationTest.kt index dc58879..d1e6108 100644 --- a/src/integrationTest/kotlin/de/bund/digitalservice/template/SecurityTxtIntegrationTest.kt +++ b/src/integrationTest/kotlin/de/bund/digitalservice/template/SecurityTxtIntegrationTest.kt @@ -16,9 +16,12 @@ class SecurityTxtIntegrationTest( @Test fun `should expose security txt at well known location`() { getSecurityTxt() - .expectStatus().isOk() - .expectHeader().contentType(MediaType.TEXT_PLAIN) - .expectBody().consumeWith { response -> + .expectStatus() + .isOk() + .expectHeader() + .contentType(MediaType.TEXT_PLAIN) + .expectBody() + .consumeWith { response -> Assertions.assertThat(response.responseBody).isNotEmpty } } diff --git a/src/main/kotlin/de/bund/digitalservice/template/config/SecurityConfig.kt b/src/main/kotlin/de/bund/digitalservice/template/config/SecurityConfig.kt index 9fd6859..e97826f 100644 --- a/src/main/kotlin/de/bund/digitalservice/template/config/SecurityConfig.kt +++ b/src/main/kotlin/de/bund/digitalservice/template/config/SecurityConfig.kt @@ -11,8 +11,8 @@ import org.springframework.security.web.server.SecurityWebFilterChain @EnableWebFluxSecurity class SecurityConfig { @Bean - fun springSecurityWebFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain { - return http.invoke { + fun springSecurityWebFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain = + http.invoke { authorizeExchange { authorize("/.well-known/security.txt", permitAll) authorize("/actuator/health", permitAll) @@ -21,5 +21,4 @@ class SecurityConfig { authorize(anyExchange, denyAll) } } - } }