From 0093aa979109d860f2768d0612c7243afe117c7f Mon Sep 17 00:00:00 2001 From: Joffrey Bion Date: Sun, 3 Jul 2022 00:18:11 +0200 Subject: Upgrade Spring boot to 2.7.1 --- sw-server/build.gradle.kts | 2 +- .../org/luxons/sevenwonders/server/config/WebSecurityConfig.kt | 10 +++++----- .../kotlin/org/luxons/sevenwonders/server/SevenWondersTest.kt | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sw-server/build.gradle.kts b/sw-server/build.gradle.kts index 5c2a647e..f7bea3b1 100644 --- a/sw-server/build.gradle.kts +++ b/sw-server/build.gradle.kts @@ -2,7 +2,7 @@ plugins { kotlin("jvm") kotlin("plugin.spring") kotlin("plugin.serialization") - id("org.springframework.boot") version "2.5.4" + id("org.springframework.boot") version "2.7.1" } apply(plugin = "io.spring.dependency-management") diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/WebSecurityConfig.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/WebSecurityConfig.kt index aa080189..f590c1e7 100644 --- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/WebSecurityConfig.kt +++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/WebSecurityConfig.kt @@ -1,14 +1,14 @@ package org.luxons.sevenwonders.server.config +import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration import org.springframework.security.config.annotation.web.builders.HttpSecurity -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter +import org.springframework.security.web.SecurityFilterChain @Configuration -class WebSecurityConfig : WebSecurityConfigurerAdapter() { +class WebSecurityConfig { // this disables default authentication settings - override fun configure(httpSecurity: HttpSecurity) { - http.cors().and().csrf().disable() - } + @Bean + fun filterChain(http: HttpSecurity): SecurityFilterChain? = http.cors().and().csrf().disable().build() } diff --git a/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/SevenWondersTest.kt b/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/SevenWondersTest.kt index 549ef267..3c96fc25 100644 --- a/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/SevenWondersTest.kt +++ b/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/SevenWondersTest.kt @@ -9,7 +9,7 @@ import org.luxons.sevenwonders.model.api.events.GameListEvent import org.luxons.sevenwonders.server.test.* import org.springframework.boot.test.context.SpringBootTest import org.springframework.boot.test.context.SpringBootTest.WebEnvironment -import org.springframework.boot.web.server.LocalServerPort +import org.springframework.boot.test.web.server.LocalServerPort import org.springframework.test.context.junit4.SpringRunner import kotlin.test.Test import kotlin.test.assertEquals -- cgit