Skip to content

Commit

Permalink
Fixed/Updated dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
milux committed Nov 30, 2023
1 parent 551ba33 commit e5a9196
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 24 deletions.
52 changes: 47 additions & 5 deletions clearing-house-processors/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.io.FileInputStream
import java.util.*
Expand All @@ -8,6 +9,7 @@ plugins {
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.spring.dependencyManagement)
`maven-publish`
alias(libs.plugins.versions)
}

group = "de.fhg.aisec.ids.clearinghouse"
Expand Down Expand Up @@ -100,9 +102,43 @@ repositories {
}

dependencies {
val versions = rootProject.libs.versions
// Some versions are downgraded for unknown reasons, fix this here
val groupPins = mapOf(
"org.jetbrains.kotlin" to mapOf(
"*" to versions.kotlin.get()
),
"org.jetbrains.kotlinx" to mapOf(
Regex("kotlinx-coroutines-.*") to versions.kotlinx.coroutines.get(),
Regex("kotlinx-serialization-.*") to versions.kotlinx.serialization.get()
),
"org.eclipse.jetty" to mapOf(
"*" to versions.jetty.get()
)
)
// We need to explicitly specify the kotlin version for all kotlin dependencies,
// because otherwise something (maybe a plugin) downgrades the kotlin version,
// which produces errors in the kotlin compiler. This is really nasty.
configurations.all {
resolutionStrategy.eachDependency {
groupPins[requested.group]?.let { pins ->
pins["*"]?.let {
// Pin all names when asterisk is set
useVersion(it)
} ?: pins[requested.name]?.let { pin ->
// Pin only for specific names given in map
useVersion(pin)
} ?: pins.entries.firstOrNull { e ->
e.key.let {
it is Regex && it.matches(requested.name)
}
}?.let { useVersion(it.value) }
}
}
}

// Imported from IDS feature in TC at runtime
implementation(libs.infomodel.model)
implementation(libs.infomodel.serializer)

implementation(libs.camel.idscp2)
implementation(libs.camel.core)
Expand All @@ -115,6 +151,8 @@ dependencies {
implementation(libs.commons.fileupload)
implementation(libs.ktor.auth)
implementation(libs.ktor.auth.jwt)
implementation(libs.jackson.databind)
implementation(libs.jackson.annotations)
compileOnly(libs.spring.context)

testApi(libs.slf4j.simple)
Expand All @@ -137,9 +175,13 @@ tasks.withType<JavaCompile> {
targetCompatibility = JavaVersion.VERSION_17.toString()
}

tasks.jar {
manifest {
attributes(mapOf(Pair("Bundle-Vendor", "Fraunhofer AISEC"),
Pair("-noee", true)))
val versionRegex = ".*((rc|beta)-?[0-9]*|-(b|alpha)[0-9.]+)$".toRegex(RegexOption.IGNORE_CASE)

tasks.withType<DependencyUpdatesTask> {
rejectVersionIf {
// Reject release candidates and betas and pin Apache Camel to 3.18 LTS version
versionRegex.matches(candidate.version)
|| (candidate.group in setOf("org.apache.camel", "org.apache.camel.springboot")
&& !candidate.version.startsWith("3.18"))
}
}
41 changes: 23 additions & 18 deletions clearing-house-processors/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
[versions]
idscp2 = "0.19.2"
ktlint = "0.48.2"

# Kotlin library/compiler version
kotlin = "1.8.0"
kotlinxCoroutines = "1.6.4"
kotlinxSerialization = "1.4.0"
kotlin = "1.9.21"
kotlinx-serialization = "1.6.1"

# HTTP client
ktor = "2.2.3"
okhttp = "4.9.1"
ktor = "2.3.6"
okhttp = "4.12.0"

# The used version of the infomodel from IESE
infomodel = "4.1.3"

camel = "3.18.5"
slf4j = "2.0.0"
junit5 = "5.9.2"
mockito = "5.1.1"
httpcore = "4.4.15"
camel = "3.18.8"
slf4j = "2.0.9"
junit5 = "5.10.1"
mockito = "5.7.0"
httpcore = "4.4.16"
httpclient = "4.5.14"
jackson = "2.16.0"

# Needed for camel multipart processor
commonsFileUpload = "1.4"
commonsFileUpload = "1.5"

springBoot = "3.0.2"
springframework = "6.0.4"
springBoot = "3.2.0"
springframework = "6.1.1"

# Needed for version pinning
kotlinx-coroutines = "1.7.3"
jetty = "9.4.53.v20231009"

[libraries]
# common libraries
Expand All @@ -37,12 +40,14 @@ okhttp3 = { group = "com.squareup.okhttp3", name = "okhttp", version.ref = "okht
ktor-auth = { group = "io.ktor", name = "ktor-server-auth", version.ref = "ktor" }
ktor-auth-jwt = { group = "io.ktor", name = "ktor-server-auth-jwt", version.ref = "ktor" }
spring-context = { group = "org.springframework", name = "spring-context", version.ref = "springframework"}
jackson-annotations = { group = "com.fasterxml.jackson.core", name = "jackson-annotations", version.ref = "jackson" }
jackson-databind = { group = "com.fasterxml.jackson.core", name = "jackson-databind", version.ref = "jackson" }

# common test libraries
mockito = { group = "org.mockito", name = "mockito-core", version.ref = "mockito" }
camel-test = { group = "org.apache.camel", name = "camel-test", version.ref = "camel" }
junit5 = { group = "org.junit.jupiter", name = "junit-jupiter", version.ref = "junit5" }
kotlin-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "kotlinxSerialization" }
kotlin-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "kotlinx-serialization" }

# camel-multipart-processor
camel-jetty = { group = "org.apache.camel", name = "camel-jetty", version.ref = "camel" }
Expand All @@ -54,8 +59,7 @@ commons-fileupload = { group = "commons-fileupload", name = "commons-fileupload"

# camel-processors
camel-idscp2 = { group = "de.fhg.aisec.ids", name = "camel-idscp2", version.ref = "idscp2" }
infomodel-model = { group = "de.fraunhofer.iais.eis.ids.infomodel", name = "java", version.ref = "infomodel" }
infomodel-serializer = { group = "de.fraunhofer.iais.eis.ids", name = "infomodel-serializer", version.ref = "infomodel" }
infomodel-model = { group = "de.fhg.aisec.ids", name = "infomodel", version.ref = "infomodel" }

# for tests
idscp2-core = { group = "de.fhg.aisec.ids", name = "idscp2-core", version.ref = "idscp2" }
Expand All @@ -65,7 +69,8 @@ test5 = ["junit5", "mockito"]

[plugins]
springboot = { id = "org.springframework.boot", version.ref = "springBoot" }
spring-dependencyManagement = { id = "io.spring.dependency-management", version = "1.0.13.RELEASE" }
spring-dependencyManagement = { id = "io.spring.dependency-management", version = "1.1.4" }
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-plugin-spring = { id = "org.jetbrains.kotlin.plugin.spring", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
versions = { id = "com.github.ben-manes.versions", version = "0.50.0" }
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
*/
package de.fhg.aisec.ids.clearinghouse.idscp2

import de.fhg.aisec.ids.idscp2.api.FastLatch
import de.fhg.aisec.ids.idscp2.api.configuration.Idscp2Configuration
import de.fhg.aisec.ids.idscp2.api.connection.Idscp2ConnectionAdapter
import de.fhg.aisec.ids.idscp2.api.raregistry.RaProverDriverRegistry
import de.fhg.aisec.ids.idscp2.api.raregistry.RaVerifierDriverRegistry
import de.fhg.aisec.ids.idscp2.applayer.AppLayerConnection
import de.fhg.aisec.ids.idscp2.core.FastLatch
import de.fhg.aisec.ids.idscp2.defaultdrivers.remoteattestation.dummy.RaProverDummy2
import de.fhg.aisec.ids.idscp2.defaultdrivers.remoteattestation.dummy.RaVerifierDummy2
import de.fhg.aisec.ids.idscp2.defaultdrivers.securechannel.tls13.NativeTLSDriver
Expand Down

0 comments on commit e5a9196

Please sign in to comment.