mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-07-01 08:12:14 +00:00
Update to Kotlin 2.2
This commit is contained in:
parent
8fd2401a2e
commit
00ead7f24d
@ -1,5 +1,6 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id "java-gradle-plugin"
|
id "java-gradle-plugin"
|
||||||
|
id "groovy-gradle-plugin"
|
||||||
id "java"
|
id "java"
|
||||||
id "groovy"
|
id "groovy"
|
||||||
}
|
}
|
||||||
@ -76,6 +77,7 @@ dependencies {
|
|||||||
implementation libs.com.github.spullara.mustache.java.compiler
|
implementation libs.com.github.spullara.mustache.java.compiler
|
||||||
implementation libs.io.spring.javaformat.spring.javaformat.gradle.plugin
|
implementation libs.io.spring.javaformat.spring.javaformat.gradle.plugin
|
||||||
implementation libs.io.spring.nohttp.nohttp.gradle
|
implementation libs.io.spring.nohttp.nohttp.gradle
|
||||||
|
implementation libs.org.jetbrains.kotlin.kotlin.gradle.plugin
|
||||||
implementation (libs.net.sourceforge.htmlunit) {
|
implementation (libs.net.sourceforge.htmlunit) {
|
||||||
exclude group: 'org.eclipse.jetty.websocket', module: 'websocket-client'
|
exclude group: 'org.eclipse.jetty.websocket', module: 'websocket-client'
|
||||||
}
|
}
|
||||||
|
17
buildSrc/src/main/groovy/security-kotlin.gradle
Normal file
17
buildSrc/src/main/groovy/security-kotlin.gradle
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
id 'kotlin'
|
||||||
|
}
|
||||||
|
|
||||||
|
project.plugins.withId("org.jetbrains.kotlin.jvm", (kotlinProject) -> {
|
||||||
|
project.tasks.withType(KotlinCompile).configureEach {
|
||||||
|
kotlinOptions {
|
||||||
|
languageVersion = '2.2'
|
||||||
|
apiVersion = '2.2'
|
||||||
|
freeCompilerArgs = ["-Xjsr305=strict", "-Xsuppress-version-warnings"]
|
||||||
|
jvmTarget = '17'
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
@ -4,7 +4,7 @@ import trang.RncToXsd
|
|||||||
|
|
||||||
apply plugin: 'io.spring.convention.spring-module'
|
apply plugin: 'io.spring.convention.spring-module'
|
||||||
apply plugin: 'trang'
|
apply plugin: 'trang'
|
||||||
apply plugin: 'kotlin'
|
apply plugin: 'security-kotlin'
|
||||||
|
|
||||||
configurations {
|
configurations {
|
||||||
opensaml5 {
|
opensaml5 {
|
||||||
@ -153,15 +153,6 @@ tasks.named('sourcesJar', Jar).configure {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(KotlinCompile).configureEach {
|
|
||||||
kotlinOptions {
|
|
||||||
languageVersion = "1.7"
|
|
||||||
apiVersion = "1.7"
|
|
||||||
freeCompilerArgs = ["-Xjsr305=strict", "-Xsuppress-version-warnings"]
|
|
||||||
jvmTarget = "17"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
configure(project.tasks.withType(Test)) {
|
configure(project.tasks.withType(Test)) {
|
||||||
doFirst {
|
doFirst {
|
||||||
systemProperties['springSecurityVersion'] = version
|
systemProperties['springSecurityVersion'] = version
|
||||||
|
@ -205,7 +205,7 @@ class ServerX509DslTests {
|
|||||||
@Nullable httpHandlerBuilder: WebHttpHandlerBuilder?,
|
@Nullable httpHandlerBuilder: WebHttpHandlerBuilder?,
|
||||||
@Nullable connector: ClientHttpConnector?) {
|
@Nullable connector: ClientHttpConnector?) {
|
||||||
val filter = SetSslInfoWebFilter(certificate)
|
val filter = SetSslInfoWebFilter(certificate)
|
||||||
httpHandlerBuilder!!.filters { filters: MutableList<WebFilter?> -> filters.add(0, filter) }
|
httpHandlerBuilder!!.filters { filters: MutableList<WebFilter> -> filters.add(0, filter) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
||||||
|
|
||||||
import java.util.concurrent.Callable
|
import java.util.concurrent.Callable
|
||||||
|
|
||||||
apply plugin: 'io.spring.convention.spring-module'
|
apply plugin: 'io.spring.convention.spring-module'
|
||||||
apply plugin: 'kotlin'
|
apply plugin: 'security-kotlin'
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
management platform(project(":spring-security-dependencies"))
|
management platform(project(":spring-security-dependencies"))
|
||||||
@ -66,12 +64,3 @@ Callable<String> springVersion() {
|
|||||||
return (Callable<String>) { project.configurations.compileClasspath.resolvedConfiguration.resolvedArtifacts
|
return (Callable<String>) { project.configurations.compileClasspath.resolvedConfiguration.resolvedArtifacts
|
||||||
.find { it.name == 'spring-core' }.moduleVersion.id.version }
|
.find { it.name == 'spring-core' }.moduleVersion.id.version }
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(KotlinCompile).configureEach {
|
|
||||||
kotlinOptions {
|
|
||||||
languageVersion = "1.7"
|
|
||||||
apiVersion = "1.7"
|
|
||||||
freeCompilerArgs = ["-Xjsr305=strict", "-Xsuppress-version-warnings"]
|
|
||||||
jvmTarget = "17"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'org.antora' version '1.0.0'
|
id 'org.antora' version '1.0.0'
|
||||||
id 'io.spring.antora.generate-antora-yml' version '0.0.1'
|
id 'io.spring.antora.generate-antora-yml' version '0.0.1'
|
||||||
id 'io.spring.convention.repository'
|
id 'io.spring.convention.repository'
|
||||||
id 'kotlin'
|
id 'security-kotlin'
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: 'io.spring.convention.docs'
|
apply plugin: 'io.spring.convention.docs'
|
||||||
@ -100,12 +98,3 @@ def resolvedVersions(Configuration configuration) {
|
|||||||
test {
|
test {
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(KotlinCompile).configureEach {
|
|
||||||
kotlinOptions {
|
|
||||||
languageVersion = "1.7"
|
|
||||||
apiVersion = "1.7"
|
|
||||||
freeCompilerArgs = ["-Xjsr305=strict", "-Xsuppress-version-warnings"]
|
|
||||||
jvmTarget = "17"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -54,11 +54,11 @@ class ServerWebClientHttpInterfaceIntegrationConfiguration {
|
|||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
fun groupConfigurer(server: MockWebServer): WebClientHttpServiceGroupConfigurer {
|
fun groupConfigurer(server: MockWebServer): WebClientHttpServiceGroupConfigurer {
|
||||||
return WebClientHttpServiceGroupConfigurer { groups: HttpServiceGroupConfigurer.Groups<WebClient.Builder?>? ->
|
return WebClientHttpServiceGroupConfigurer { groups: HttpServiceGroupConfigurer.Groups<WebClient.Builder> ->
|
||||||
val baseUrl = server.url("").toString()
|
val baseUrl = server.url("").toString()
|
||||||
groups!!
|
groups!!
|
||||||
.forEachClient(ClientCallback { group: HttpServiceGroup?, builder: WebClient.Builder? ->
|
.forEachClient(ClientCallback { group: HttpServiceGroup, builder: WebClient.Builder ->
|
||||||
builder!!
|
builder
|
||||||
.baseUrl(baseUrl)
|
.baseUrl(baseUrl)
|
||||||
.defaultHeader("Accept", "application/vnd.github.v3+json")
|
.defaultHeader("Accept", "application/vnd.github.v3+json")
|
||||||
})
|
})
|
||||||
|
@ -28,6 +28,7 @@ import org.springframework.security.test.web.reactive.server.WebTestClientBuilde
|
|||||||
import org.springframework.security.web.authentication.preauth.x509.X509TestUtils
|
import org.springframework.security.web.authentication.preauth.x509.X509TestUtils
|
||||||
import org.springframework.test.web.reactive.server.WebTestClient
|
import org.springframework.test.web.reactive.server.WebTestClient
|
||||||
import org.springframework.test.web.reactive.server.WebTestClientConfigurer
|
import org.springframework.test.web.reactive.server.WebTestClientConfigurer
|
||||||
|
import org.springframework.util.Assert
|
||||||
import org.springframework.web.server.ServerWebExchange
|
import org.springframework.web.server.ServerWebExchange
|
||||||
import org.springframework.web.server.WebFilter
|
import org.springframework.web.server.WebFilter
|
||||||
import org.springframework.web.server.WebFilterChain
|
import org.springframework.web.server.WebFilterChain
|
||||||
@ -108,18 +109,19 @@ class X509ConfigurationTests {
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private fun x509(certificate: X509Certificate): WebTestClientConfigurer {
|
private fun x509(certificate: X509Certificate): WebTestClientConfigurer {
|
||||||
return WebTestClientConfigurer { builder: WebTestClient.Builder, httpHandlerBuilder: WebHttpHandlerBuilder, connector: ClientHttpConnector? ->
|
return WebTestClientConfigurer { builder: WebTestClient.Builder, httpHandlerBuilder: WebHttpHandlerBuilder?, connector: ClientHttpConnector? ->
|
||||||
|
|
||||||
val sslInfo: SslInfo = object : SslInfo {
|
val sslInfo: SslInfo = object : SslInfo {
|
||||||
override fun getSessionId(): String {
|
override fun getSessionId(): String {
|
||||||
return "sessionId"
|
return "sessionId"
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getPeerCertificates(): Array<X509Certificate?> {
|
override fun getPeerCertificates(): Array<X509Certificate> {
|
||||||
return arrayOf(certificate)
|
return arrayOf(certificate)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
httpHandlerBuilder.filters(Consumer { filters: MutableList<WebFilter> ->
|
Assert.notNull(httpHandlerBuilder, "httpHandlerBuilder should not be null")
|
||||||
|
httpHandlerBuilder!!.filters(Consumer { filters: MutableList<WebFilter> ->
|
||||||
filters.add(
|
filters.add(
|
||||||
0,
|
0,
|
||||||
SslInfoOverrideWebFilter(sslInfo)
|
SslInfoOverrideWebFilter(sslInfo)
|
||||||
|
@ -8,7 +8,7 @@ org-apache-maven-resolver = "1.9.23"
|
|||||||
org-aspectj = "1.9.24"
|
org-aspectj = "1.9.24"
|
||||||
org-bouncycastle = "1.80"
|
org-bouncycastle = "1.80"
|
||||||
org-eclipse-jetty = "11.0.25"
|
org-eclipse-jetty = "11.0.25"
|
||||||
org-jetbrains-kotlin = "1.9.25"
|
org-jetbrains-kotlin = "2.2.0"
|
||||||
org-jetbrains-kotlinx = "1.10.2"
|
org-jetbrains-kotlinx = "1.10.2"
|
||||||
org-mockito = "5.17.0"
|
org-mockito = "5.17.0"
|
||||||
org-opensaml = "4.3.2"
|
org-opensaml = "4.3.2"
|
||||||
@ -67,7 +67,7 @@ org-hamcrest = "org.hamcrest:hamcrest:2.2"
|
|||||||
org-hibernate-orm-hibernate-core = "org.hibernate.orm:hibernate-core:7.0.1.Final"
|
org-hibernate-orm-hibernate-core = "org.hibernate.orm:hibernate-core:7.0.1.Final"
|
||||||
org-hsqldb = "org.hsqldb:hsqldb:2.7.4"
|
org-hsqldb = "org.hsqldb:hsqldb:2.7.4"
|
||||||
org-jetbrains-kotlin-kotlin-bom = { module = "org.jetbrains.kotlin:kotlin-bom", version.ref = "org-jetbrains-kotlin" }
|
org-jetbrains-kotlin-kotlin-bom = { module = "org.jetbrains.kotlin:kotlin-bom", version.ref = "org-jetbrains-kotlin" }
|
||||||
org-jetbrains-kotlin-kotlin-gradle-plugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.25"
|
org-jetbrains-kotlin-kotlin-gradle-plugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:2.2.0"
|
||||||
org-jetbrains-kotlinx-kotlinx-coroutines-bom = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-bom", version.ref = "org-jetbrains-kotlinx" }
|
org-jetbrains-kotlinx-kotlinx-coroutines-bom = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-bom", version.ref = "org-jetbrains-kotlinx" }
|
||||||
org-junit-junit-bom = "org.junit:junit-bom:5.12.2"
|
org-junit-junit-bom = "org.junit:junit-bom:5.12.2"
|
||||||
org-mockito-mockito-bom = { module = "org.mockito:mockito-bom", version.ref = "org-mockito" }
|
org-mockito-mockito-bom = { module = "org.mockito:mockito-bom", version.ref = "org-mockito" }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user