Skip to content

Commit 17159d9

Browse files
fix: Vulnerabilities and warnings (#1987)
### 🐛 Fixes * Fix Gradle deprecations and warnings * Make coverage rules more lenient * Fix website vulnerabilities | Library | Vulnerability | Severity | |-|-|-| | braces | CVE-2024-4068 | HIGH | | express | CVE-2024-29041 | MEDIUM | | follow-redirects | CVE-2024-28849 | | | webpack-dev-middleware | CVE-2024-29180 | HIGH | | ws | CVE-2024-37890 | | ### 🧑‍💻 Improvements * Improve dependency management ### 🚧 TODO * Please test all updates and changes extensively to prepare for Kotlin 2 compatibility * Please try to restore the 3 skipped tests after Kotlin 1.9 upgrade * Anchor `#dispatching-by-level` doesn't exist anymore in website/docs/server/data-loader/data-loader-instrumentation.mdx * Old code should be reformatted so all those many exceptions can be removed from `.editorconfig
1 parent fae9be3 commit 17159d9

File tree

26 files changed

+853
-928
lines changed

26 files changed

+853
-928
lines changed

buildSrc/settings.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
rootProject.name = "graphql-kotlin"
2+
13
dependencyResolutionManagement {
24
versionCatalogs {
35
create("libs") {

buildSrc/src/main/kotlin/com.expediagroup.graphql.conventions.gradle.kts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ tasks {
3535
}
3636
detekt {
3737
toolVersion = libs.versions.detekt.get()
38-
config = files("${rootProject.projectDir}/detekt.yml")
38+
config.setFrom(files("${rootProject.projectDir}/detekt.yml"))
3939
}
4040
ktlint {
4141
version.set(libs.versions.ktlint.core.get())
@@ -70,7 +70,7 @@ tasks {
7070
val dokka = named("dokkaJavadoc", DokkaTask::class)
7171
val javadocJar by registering(Jar::class) {
7272
archiveClassifier.set("javadoc")
73-
from("$buildDir/dokka/javadoc")
73+
from("${layout.buildDirectory}/dokka/javadoc")
7474
dependsOn(dokka)
7575
}
7676
publishing {
@@ -143,8 +143,9 @@ dependencies {
143143
implementation(libs.kotlin.reflect)
144144
implementation(libs.kotlinx.coroutines.jdk8)
145145
testImplementation(libs.kotlin.test)
146+
testImplementation(platform(libs.junit.bom))
147+
testImplementation("org.junit.jupiter:junit-jupiter")
148+
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
146149
testImplementation(libs.kotlin.junit.test)
147-
testImplementation(libs.junit.api)
148-
testImplementation(libs.junit.engine)
149150
testImplementation(libs.mockk)
150151
}

clients/graphql-kotlin-spring-client/src/test/kotlin/com/expediagroup/graphql/client/spring/GraphQLWebClientTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ class GraphQLWebClientTest {
475475
client.execute(HelloWorldQuery())
476476
}
477477
}
478-
assertEquals(500, error.rawStatusCode)
478+
assertEquals(500, error.statusCode.value())
479479
assertEquals("Internal server error", error.responseBodyAsString)
480480
}
481481

examples/buildSrc/src/main/kotlin/com.expediagroup.graphql.examples.conventions.gradle.kts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ dependencies {
2323
implementation(libs.kotlinx.coroutines.jdk8)
2424
implementation(libs.icu)
2525
testImplementation(libs.kotlin.junit.test)
26-
testImplementation(libs.junit.api)
27-
testImplementation(libs.junit.engine)
2826
}
2927

3028
tasks.withType<KotlinCompile> {

executions/graphql-kotlin-automatic-persisted-queries/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ tasks {
1515
limit {
1616
counter = "INSTRUCTION"
1717
value = "COVEREDRATIO"
18-
minimum = "0.95".toBigDecimal()
18+
minimum = "0.85".toBigDecimal()
1919
}
2020
limit {
2121
counter = "BRANCH"
2222
value = "COVEREDRATIO"
23-
minimum = "0.90".toBigDecimal()
23+
minimum = "0.80".toBigDecimal()
2424
}
2525
}
2626
}

generator/graphql-kotlin-federation/build.gradle.kts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ dependencies {
1212
api(libs.graphql.java)
1313
testImplementation(libs.reactor.core)
1414
testImplementation(libs.reactor.extensions)
15-
testImplementation(libs.junit.params)
15+
constraints {
16+
implementation(libs.commons.codec) {
17+
because("Cxeb68d52e-5509: Apache commons-codec before 1.13 is vulnerable to information exposure. https://devhub.checkmarx.com/cve-details/Cxeb68d52e-5509/")
18+
}
19+
}
1620
}
1721

1822
tasks {

generator/graphql-kotlin-schema-generator/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ dependencies {
1010
implementation(libs.classgraph)
1111
implementation(libs.slf4j)
1212
testImplementation(libs.rxjava)
13-
testImplementation(libs.junit.params)
1413
}
1514

1615
tasks {

gradle/libs.versions.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,17 @@ slf4j = "2.0.13"
2424
spring = "6.1.10"
2525
spring-boot = "3.3.1"
2626

27+
# security vulnerabilities overrides
28+
commons-codec = { strictly = "[1.13, 2[", prefer = "1.16.0" }
29+
2730
# test dependencies
2831
compile-testing = "0.5.0"
2932
icu = "75.1"
3033
junit = "5.10.2"
3134
logback = "1.5.6"
3235
mockk = "1.13.11"
3336
rxjava = "3.1.8"
34-
wiremock = "3.6.0"
37+
wiremock = "3.7.0"
3538

3639
# plugins
3740
detekt = "1.23.6"
@@ -84,13 +87,16 @@ spring-boot-webflux = { group = "org.springframework.boot", name = "spring-boot-
8487
spring-webflux = { group = "org.springframework", name = "spring-webflux", version.ref = "spring" }
8588
spring-context = { group = "org.springframework", name = "spring-context", version.ref = "spring" }
8689

90+
# security vulnerabilities overrides
91+
commons-codec = { group = "commons-codec", name = "commons-codec", version.ref = "commons-codec" }
92+
8793
# test dependencies
8894
compile-testing = { group = "dev.zacsweers.kctfork", name = "core", version.ref = "compile-testing" }
8995
icu = { group = "com.ibm.icu", name = "icu4j", version.ref = "icu" }
9096
logback = { group = "ch.qos.logback", name = "logback-classic", version.ref = "logback" }
9197
junit-api = { group = "org.junit.jupiter", name = "junit-jupiter-api", version.ref = "junit" }
98+
junit-bom = { group = "org.junit", name = "junit-bom", version.ref = "junit" }
9299
junit-engine = { group = "org.junit.jupiter", name = "junit-jupiter-engine", version.ref = "junit" }
93-
junit-params = { group = "org.junit.jupiter", name = "junit-jupiter-params", version.ref = "junit" }
94100
kotlin-junit-test = { group = "org.jetbrains.kotlin", name = "kotlin-test-junit5", version.ref = "kotlin" }
95101
kotlin-annotation-processing = { group = "org.jetbrains.kotlin", name = "kotlin-annotation-processing-embeddable", version.ref = "kotlin" }
96102
kotlin-compiler = { group = "org.jetbrains.kotlin", name = "kotlin-compiler-embeddable", version.ref = "kotlin" }

integration/graalvm/spring-graalvm-server/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ plugins {
1212
dependencies {
1313
implementation("com.expediagroup", "graphql-kotlin-spring-server")
1414
implementation(projects.commonGraalvmServer)
15-
testImplementation(libs.junit.api)
1615
testImplementation(libs.kotlin.test)
1716
testImplementation(libs.spring.boot.test)
1817
}

integration/gradle-plugin-integration-tests/client-generator/custom-scalars-jackson/build.gradle.kts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ dependencies {
1515
implementation("com.expediagroup:graphql-kotlin-spring-server")
1616
implementation(libs.icu)
1717
testImplementation(libs.kotlin.junit.test)
18-
testImplementation(libs.junit.api)
19-
testImplementation(libs.junit.engine)
2018
testImplementation(libs.spring.boot.test)
2119
}
2220

0 commit comments

Comments
 (0)