Skip to content

Commit

Permalink
IS-2477: Remove kafka embedded and flatten versions for dependabot (#252
Browse files Browse the repository at this point in the history
)

* Remove kafka embedded

* Flatten versions for dependabot
  • Loading branch information
andersrognstad authored Jul 1, 2024
1 parent 1c72de5 commit e4afe0a
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 138 deletions.
12 changes: 9 additions & 3 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ updates:
- package-ecosystem: gradle
directory: "/"
schedule:
interval: daily
time: "07:00"
open-pull-requests-limit: 10
interval: weekly
open-pull-requests-limit: 10
groups:
minor-and-patch:
patterns:
- "*"
update-types:
- "minor"
- "patch"
198 changes: 87 additions & 111 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,37 @@ import org.apache.tools.ant.taskdefs.condition.Os
group = "no.nav.syfo"
version = "1.0.0"

object Versions {
const val arenaDialogNotatVersion = "1.e1999cf"
const val base64containerVersion = "1.5ac2176"
const val dialogmeldingVersion = "1.5d21db9"
const val fellesformat2Version = "1.0329dd1"
const val flywayVersion = "9.22.3"
const val hikariVersion = "5.1.0"
const val ibmMqVersion = "9.3.4.1"
const val jacksonVersion = "2.16.0"
const val javaTimeAdapterVersion = "1.1.3"
const val kafkaEmbeddedVersion = "3.2.3"
const val kafkaVersion = "3.6.1"
const val kithApprecVersion = "2019.07.30-04-23-2a0d1388209441ec05d2e92a821eed4f796a3ae2"
const val kithHodemeldingVersion = "2019.07.30-12-26-5c924ef4f04022bbb850aaf299eb8e4464c1ca6a"
const val kluentVersion = "1.73"
const val ktorVersion = "2.3.8"
const val logbackVersion = "1.4.14"
const val logstashEncoderVersion = "7.4"
const val javaxAnnotationApiVersion = "1.3.2"
const val javaxActivationVersion = "1.2.0"
const val jaxbApiVersion = "2.4.0-b180830.0359"
const val jaxbRuntimeVersion = "2.4.0-b180830.0438"
const val jaxwsApiVersion = "2.3.1"
const val jaxwsToolsVersion = "2.3.7"
const val junitJupiterVersion = "5.8.2"
const val micrometerRegistry = "1.12.2"
const val mockkVersion = "1.13.8"
const val nimbusJoseJwt = "9.37.2"
const val pdfboxVersion = "2.0.24"
val postgresEmbedded = if (Os.isFamily(Os.FAMILY_MAC)) "1.0.0" else "0.13.4"
const val postgresVersion = "42.7.2"
const val scala = "2.13.9"
const val spek = "2.0.19"
}
val arenaDialogNotatVersion = "1.e1999cf"
val base64containerVersion = "1.5ac2176"
val dialogmeldingVersion = "1.5d21db9"
val fellesformat2Version = "1.0329dd1"
val flywayVersion = "9.22.3"
val hikariVersion = "5.1.0"
val ibmMqVersion = "9.3.4.1"
val jacksonVersion = "2.16.0"
val javaTimeAdapterVersion = "1.1.3"
val kafkaVersion = "3.6.1"
val kithApprecVersion = "2019.07.30-04-23-2a0d1388209441ec05d2e92a821eed4f796a3ae2"
val kithHodemeldingVersion = "2019.07.30-12-26-5c924ef4f04022bbb850aaf299eb8e4464c1ca6a"
val kluentVersion = "1.73"
val ktorVersion = "2.3.8"
val logbackVersion = "1.4.14"
val logstashEncoderVersion = "7.4"
val javaxAnnotationApiVersion = "1.3.2"
val javaxActivationVersion = "1.2.0"
val jaxbApiVersion = "2.4.0-b180830.0359"
val jaxbRuntimeVersion = "2.4.0-b180830.0438"
val jaxwsApiVersion = "2.3.1"
val jaxwsToolsVersion = "2.3.7"
val junitJupiterVersion = "5.8.2"
val micrometerRegistry = "1.12.2"
val mockkVersion = "1.13.8"
val nimbusJoseJwt = "9.37.2"
val pdfboxVersion = "2.0.24"
val postgresEmbedded = if (Os.isFamily(Os.FAMILY_MAC)) "1.0.0" else "0.13.4"
val postgresVersion = "42.7.2"
val scala = "2.13.9"
val spek = "2.0.19"

plugins {
java
Expand Down Expand Up @@ -66,105 +63,84 @@ dependencies {
implementation(kotlin("reflect"))
implementation(kotlin("stdlib"))

implementation("io.ktor:ktor-server-auth-jwt:${Versions.ktorVersion}")
implementation("io.ktor:ktor-server-call-id:${Versions.ktorVersion}")
implementation("io.ktor:ktor-server-status-pages:${Versions.ktorVersion}")
implementation("io.ktor:ktor-server-netty:${Versions.ktorVersion}")
implementation("io.ktor:ktor-server-content-negotiation:${Versions.ktorVersion}")
implementation("io.ktor:ktor-client-apache:${Versions.ktorVersion}")
implementation("io.ktor:ktor-client-jackson:${Versions.ktorVersion}")
implementation("io.ktor:ktor-client-auth-jvm:${Versions.ktorVersion}")
implementation("io.ktor:ktor-client-content-negotiation:${Versions.ktorVersion}")
implementation("io.ktor:ktor-serialization-jackson:${Versions.ktorVersion}")

implementation("io.ktor:ktor-server-metrics-micrometer:${Versions.ktorVersion}")
implementation("io.micrometer:micrometer-registry-prometheus:${Versions.micrometerRegistry}")

implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${Versions.jacksonVersion}")

implementation("org.apache.pdfbox:pdfbox:${Versions.pdfboxVersion}")

implementation("ch.qos.logback:logback-classic:${Versions.logbackVersion}")
implementation("net.logstash.logback:logstash-logback-encoder:${Versions.logstashEncoderVersion}")

implementation("no.nav.helse.xml:xmlfellesformat2:${Versions.fellesformat2Version}")
implementation("no.nav.helse.xml:kith-hodemelding:${Versions.kithHodemeldingVersion}")
implementation("no.nav.helse.xml:kith-apprec:${Versions.kithApprecVersion}")
implementation("no.nav.helse.xml:dialogmelding:${Versions.dialogmeldingVersion}")
implementation("no.nav.helse.xml:base64Container:${Versions.base64containerVersion}")
implementation("no.nav.helse.xml:arenaDialogNotat:${Versions.arenaDialogNotatVersion}")

implementation("org.postgresql:postgresql:${Versions.postgresVersion}")
implementation("com.zaxxer:HikariCP:${Versions.hikariVersion}")
implementation("org.flywaydb:flyway-core:${Versions.flywayVersion}")

implementation("javax.xml.ws:jaxws-api:${Versions.jaxwsApiVersion}")
implementation("javax.annotation:javax.annotation-api:${Versions.javaxAnnotationApiVersion}")
implementation("javax.xml.bind:jaxb-api:${Versions.jaxbApiVersion}")
implementation("org.glassfish.jaxb:jaxb-runtime:${Versions.jaxbRuntimeVersion}")
implementation("com.sun.activation:javax.activation:${Versions.javaxActivationVersion}")
implementation("com.sun.xml.ws:jaxws-tools:${Versions.jaxwsToolsVersion}") {
implementation("io.ktor:ktor-server-auth-jwt:$ktorVersion")
implementation("io.ktor:ktor-server-call-id:$ktorVersion")
implementation("io.ktor:ktor-server-status-pages:$ktorVersion")
implementation("io.ktor:ktor-server-netty:$ktorVersion")
implementation("io.ktor:ktor-server-content-negotiation:$ktorVersion")
implementation("io.ktor:ktor-client-apache:$ktorVersion")
implementation("io.ktor:ktor-client-jackson:$ktorVersion")
implementation("io.ktor:ktor-client-auth-jvm:$ktorVersion")
implementation("io.ktor:ktor-client-content-negotiation:$ktorVersion")
implementation("io.ktor:ktor-serialization-jackson:$ktorVersion")

implementation("io.ktor:ktor-server-metrics-micrometer:$ktorVersion")
implementation("io.micrometer:micrometer-registry-prometheus:$micrometerRegistry")

implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jacksonVersion")

implementation("org.apache.pdfbox:pdfbox:$pdfboxVersion")

implementation("ch.qos.logback:logback-classic:$logbackVersion")
implementation("net.logstash.logback:logstash-logback-encoder:$logstashEncoderVersion")

implementation("no.nav.helse.xml:xmlfellesformat2:$fellesformat2Version")
implementation("no.nav.helse.xml:kith-hodemelding:$kithHodemeldingVersion")
implementation("no.nav.helse.xml:kith-apprec:$kithApprecVersion")
implementation("no.nav.helse.xml:dialogmelding:$dialogmeldingVersion")
implementation("no.nav.helse.xml:base64Container:$base64containerVersion")
implementation("no.nav.helse.xml:arenaDialogNotat:$arenaDialogNotatVersion")

implementation("org.postgresql:postgresql:$postgresVersion")
implementation("com.zaxxer:HikariCP:$hikariVersion")
implementation("org.flywaydb:flyway-core:$flywayVersion")

implementation("javax.xml.ws:jaxws-api:$jaxwsApiVersion")
implementation("javax.annotation:javax.annotation-api:$javaxAnnotationApiVersion")
implementation("javax.xml.bind:jaxb-api:$jaxbApiVersion")
implementation("org.glassfish.jaxb:jaxb-runtime:$jaxbRuntimeVersion")
implementation("com.sun.activation:javax.activation:$javaxActivationVersion")
implementation("com.sun.xml.ws:jaxws-tools:$jaxwsToolsVersion") {
exclude(group = "com.sun.xml.ws", module = "policy")
}
implementation("com.migesok:jaxb-java-time-adapters:${Versions.javaTimeAdapterVersion}")
implementation("com.migesok:jaxb-java-time-adapters:$javaTimeAdapterVersion")

implementation("com.ibm.mq:com.ibm.mq.allclient:${Versions.ibmMqVersion}")
implementation("com.ibm.mq:com.ibm.mq.allclient:$ibmMqVersion")

val excludeLog4j = fun ExternalModuleDependency.() {
exclude(group = "log4j")
}
implementation("org.apache.kafka:kafka_2.13:${Versions.kafkaVersion}", excludeLog4j)
implementation("org.apache.kafka:kafka_2.13:$kafkaVersion", excludeLog4j)
constraints {
implementation("org.apache.zookeeper:zookeeper") {
because("org.apache.kafka:kafka_2.13:${Versions.kafkaVersion} -> https://www.cve.org/CVERecord?id=CVE-2023-44981")
because("org.apache.kafka:kafka_2.13:$kafkaVersion -> https://www.cve.org/CVERecord?id=CVE-2023-44981")
version {
require("3.8.3")
}
}
implementation("org.scala-lang:scala-library") {
because("org.apache.kafka:kafka_2.13:${Versions.kafkaVersion} -> https://www.cve.org/CVERecord?id=CVE-2022-36944")
version {
require(Versions.scala)
}
}
}
testImplementation("no.nav:kafka-embedded-env:${Versions.kafkaEmbeddedVersion}", excludeLog4j)
constraints {
implementation("org.yaml:snakeyaml") {
because("no.nav:kafka-embedded-env:${Versions.kafkaEmbeddedVersion} -> https://advisory.checkmarx.net/advisory/vulnerability/CVE-2022-25857/")
version {
require("1.33")
}
}
implementation("org.eclipse.jetty.http2:http2-server") {
because("no.nav:kafka-embedded-env:${Versions.kafkaEmbeddedVersion} -> https://advisory.checkmarx.net/advisory/vulnerability/CVE-2022-2048/")
version {
require("9.4.54.v20240208")
}
}
implementation("com.google.protobuf:protobuf-java") {
because("no.nav:kafka-embedded-env:${Versions.kafkaEmbeddedVersion} -> https://cwe.mitre.org/data/definitions/400.html")
because("org.apache.kafka:kafka_2.13:$kafkaVersion -> https://www.cve.org/CVERecord?id=CVE-2022-36944")
version {
require("3.21.7")
require(scala)
}
}
}

testImplementation(kotlin("test"))
testImplementation("com.nimbusds:nimbus-jose-jwt:${Versions.nimbusJoseJwt}")
testImplementation("org.amshove.kluent:kluent:${Versions.kluentVersion}")
testImplementation("org.junit.jupiter:junit-jupiter-api:${Versions.junitJupiterVersion}")
testImplementation("org.junit.jupiter:junit-jupiter-params:${Versions.junitJupiterVersion}")
testImplementation("org.junit.jupiter:junit-jupiter-engine:${Versions.junitJupiterVersion}")
testImplementation("io.mockk:mockk:${Versions.mockkVersion}")
testImplementation("io.ktor:ktor-client-mock:${Versions.ktorVersion}")
testImplementation("com.opentable.components:otj-pg-embedded:${Versions.postgresEmbedded}")
testImplementation("io.ktor:ktor-server-test-host:${Versions.ktorVersion}")
testImplementation("org.spekframework.spek2:spek-dsl-jvm:${Versions.spek}") {
testImplementation("com.nimbusds:nimbus-jose-jwt:$nimbusJoseJwt")
testImplementation("org.amshove.kluent:kluent:$kluentVersion")
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion")
testImplementation("org.junit.jupiter:junit-jupiter-params:$junitJupiterVersion")
testImplementation("org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion")
testImplementation("io.mockk:mockk:$mockkVersion")
testImplementation("io.ktor:ktor-client-mock:$ktorVersion")
testImplementation("com.opentable.components:otj-pg-embedded:$postgresEmbedded")
testImplementation("io.ktor:ktor-server-test-host:$ktorVersion")
testImplementation("org.spekframework.spek2:spek-dsl-jvm:$spek") {
exclude(group = "org.jetbrains.kotlin")
}
testRuntimeOnly("org.junit.vintage:junit-vintage-engine:${Versions.junitJupiterVersion}")
testRuntimeOnly("org.spekframework.spek2:spek-runner-junit5:${Versions.spek}") {
testRuntimeOnly("org.junit.vintage:junit-vintage-engine:$junitJupiterVersion")
testRuntimeOnly("org.spekframework.spek2:spek-runner-junit5:$spek") {
exclude(group = "org.jetbrains.kotlin")
}
}
Expand Down
5 changes: 0 additions & 5 deletions src/test/kotlin/no/nav/syfo/ExternalMockEnvironment.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package no.nav.syfo

import io.ktor.server.netty.*
import no.nav.common.KafkaEnvironment
import no.nav.syfo.application.ApplicationState
import no.nav.syfo.client.wellknown.WellKnown
import no.nav.syfo.mock.*
Expand All @@ -10,7 +9,6 @@ import java.nio.file.Paths
class ExternalMockEnvironment private constructor() {
val applicationState: ApplicationState = testAppState()
val database = TestDatabase()
val embeddedEnvironment: KafkaEnvironment = testKafka()
val wellKnownInternalAzureAD = wellKnownInternalAzureAD()

val azureAdV2Mock = AzureAdV2Mock()
Expand Down Expand Up @@ -38,7 +36,6 @@ class ExternalMockEnvironment private constructor() {
)

var environment = testEnvironment(
kafkaBootstrapServers = embeddedEnvironment.brokersURL,
azureTokenEndpoint = azureAdV2Mock.url,
clamAvURL = clamAvMock.url,
dokarkivUrl = dokarkivMock.url,
Expand Down Expand Up @@ -72,13 +69,11 @@ fun wellKnownInternalAzureAD(): WellKnown {
fun ExternalMockEnvironment.startExternalMocks() {
this.externalApplicationMockMap.start()
this.database.start()
this.embeddedEnvironment.start()
}

fun ExternalMockEnvironment.stopExternalMocks() {
this.externalApplicationMockMap.stop()
this.database.stop()
this.embeddedEnvironment.tearDown()
}

fun HashMap<String, NettyApplicationEngine>.start() {
Expand Down
3 changes: 1 addition & 2 deletions src/test/kotlin/no/nav/syfo/TestEnvironment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import no.nav.syfo.util.configuredJacksonMapper
import java.net.ServerSocket

fun testEnvironment(
kafkaBootstrapServers: String,
azureTokenEndpoint: String = "azureTokenEndpoint",
clamAvURL: String,
dokarkivUrl: String,
Expand All @@ -30,7 +29,7 @@ fun testEnvironment(
databasePassword = "password",
cluster = "dev-gcp",
kafka = ApplicationEnvironmentKafka(
bootstrapServers = kafkaBootstrapServers,
bootstrapServers = "kafkaBootstrapServers",
aivenCredstorePassword = "credstorepassord",
aivenTruststoreLocation = "truststore",
aivenKeystoreLocation = "keystore",
Expand Down
17 changes: 0 additions & 17 deletions src/test/kotlin/no/nav/syfo/TestKafka.kt

This file was deleted.

0 comments on commit e4afe0a

Please sign in to comment.