diff --git a/apps/api-start-stopp-perioder/build.gradle.kts b/apps/api-start-stopp-perioder/build.gradle.kts index 12db9db9..1cdcd08a 100644 --- a/apps/api-start-stopp-perioder/build.gradle.kts +++ b/apps/api-start-stopp-perioder/build.gradle.kts @@ -1,6 +1,4 @@ -import org.gradle.configurationcache.extensions.capitalized import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import org.openapitools.generator.gradle.plugin.tasks.GenerateTask plugins { @@ -23,6 +21,7 @@ dependencies { implementation(project(":lib:kafka")) implementation(project(":lib:hoplite-config")) implementation(project(":lib:kafka-key-generator-client")) + implementation(project(":lib:pdl-client")) implementation(project(":domain:arbeidssoeker-regler")) implementation(libs.bundles.ktorServerWithNettyAndMicrometer) implementation(libs.micrometer.registryPrometheus) @@ -36,7 +35,6 @@ dependencies { implementation(libs.nav.common.auditLog) implementation(libs.nav.common.log) implementation(libs.poao.tilgangClient) - implementation(libs.paw.pdl.client) implementation(libs.logbackClassic) implementation(libs.logstashLogbackEncoder) implementation(libs.kafka.clients) diff --git a/apps/bekreftelse-api/src/main/kotlin/no/nav/paw/bekreftelse/api/model/AccessToken.kt b/apps/bekreftelse-api/src/main/kotlin/no/nav/paw/bekreftelse/api/model/AccessToken.kt index 1c0cbc23..21e4d0cf 100644 --- a/apps/bekreftelse-api/src/main/kotlin/no/nav/paw/bekreftelse/api/model/AccessToken.kt +++ b/apps/bekreftelse-api/src/main/kotlin/no/nav/paw/bekreftelse/api/model/AccessToken.kt @@ -1,9 +1,6 @@ package no.nav.paw.bekreftelse.api.model import no.nav.paw.bekreftelse.api.exception.UgyldigBearerTokenException -import no.nav.paw.bekreftelse.api.model.ResolveToken.AzureToken -import no.nav.paw.bekreftelse.api.model.ResolveToken.IdPortenToken -import no.nav.paw.bekreftelse.api.model.ResolveToken.TokenXToken import no.nav.security.token.support.core.context.TokenValidationContext import no.nav.security.token.support.core.jwt.JwtToken import java.util.* @@ -39,14 +36,11 @@ data object OID : Claim("oid", UUID::fromString) data object Name : Claim("name", { it }) data object NavIdent : Claim("NAVident", { it }) -private sealed class ResolveToken( - val issuer: Issuer, - val claims: List> -) { - data object IdPortenToken : ResolveToken(IdPorten, listOf(PID)) - data object TokenXToken : ResolveToken(TokenX, listOf(PID)) - data object AzureToken : ResolveToken(Azure, listOf(OID, Name, NavIdent)) -} +sealed class ResolveToken(val issuer: Issuer, val claims: List>) + +data object IdPortenToken : ResolveToken(IdPorten, listOf(PID)) +data object TokenXToken : ResolveToken(TokenX, listOf(PID)) +data object AzureToken : ResolveToken(Azure, listOf(OID, Name, NavIdent)) private val validTokens: List = listOf(IdPortenToken, TokenXToken, AzureToken) diff --git a/apps/bekreftelse-api/src/main/kotlin/no/nav/paw/bekreftelse/api/plugins/custom/KafkaConsumerPlugin.kt b/apps/bekreftelse-api/src/main/kotlin/no/nav/paw/bekreftelse/api/plugins/custom/KafkaConsumerPlugin.kt index 6e7c9583..499f33e7 100644 --- a/apps/bekreftelse-api/src/main/kotlin/no/nav/paw/bekreftelse/api/plugins/custom/KafkaConsumerPlugin.kt +++ b/apps/bekreftelse-api/src/main/kotlin/no/nav/paw/bekreftelse/api/plugins/custom/KafkaConsumerPlugin.kt @@ -64,6 +64,7 @@ val KafkaConsumerPlugin: ApplicationPlugin = application.log.info("Stopper Kafka Consumer") pollingFlag.set(false) consumeJob?.cancel() + consumer.unsubscribe() consumer.close(shutDownTimeout) } diff --git a/apps/kafka-key-generator/build.gradle.kts b/apps/kafka-key-generator/build.gradle.kts index c72fccaa..1b8cd089 100644 --- a/apps/kafka-key-generator/build.gradle.kts +++ b/apps/kafka-key-generator/build.gradle.kts @@ -13,7 +13,7 @@ val jvmMajorVersion: String by project dependencies { // PAW implementation(project(":lib:hoplite-config")) - implementation(libs.paw.pdl.client) + implementation(project(":lib:pdl-client")) // NAV implementation(libs.nav.common.log) diff --git a/apps/utgang-pdl/build.gradle.kts b/apps/utgang-pdl/build.gradle.kts index 43849d55..df0a953a 100644 --- a/apps/utgang-pdl/build.gradle.kts +++ b/apps/utgang-pdl/build.gradle.kts @@ -20,15 +20,15 @@ dependencies { implementation(project(":domain:arbeidssoekerregisteret-kotlin")) implementation(project(":domain:arbeidssoeker-regler")) - implementation(project(":lib:kafka-key-generator-client")) + implementation(project(":lib:hoplite-config")) implementation(project(":lib:kafka")) implementation(project(":lib:kafka-streams")) - implementation(project(":lib:hoplite-config")) + implementation(project(":lib:kafka-key-generator-client")) + implementation(project(":lib:pdl-client")) api(libs.arrow.core.core) implementation(libs.kafka.streams.core) - implementation(libs.paw.pdl.client) implementation(libs.bundles.ktorServerWithNettyAndMicrometer) implementation(libs.micrometer.registryPrometheus) diff --git a/domain/arbeidssoeker-regler/build.gradle.kts b/domain/arbeidssoeker-regler/build.gradle.kts index ff3acf54..d2ae55f6 100644 --- a/domain/arbeidssoeker-regler/build.gradle.kts +++ b/domain/arbeidssoeker-regler/build.gradle.kts @@ -1,5 +1,3 @@ -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile - plugins { kotlin("jvm") id("org.openapi.generator") @@ -11,8 +9,8 @@ val baseImage: String by project val jvmMajorVersion: String by project dependencies { + implementation(project(":lib:pdl-client")) implementation(project(":domain:interne-hendelser")) - implementation(libs.paw.pdl.client) api(libs.micrometer.registryPrometheus) api(libs.arrow.core.core) testImplementation(libs.ktor.server.testJvm) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 06f0d234..6ab64a9b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,4 @@ [versions] -pawPdlClientVersion = "24.10.18.41-1" -pawAaregClientVersion = "24.07.04.18-1" noNavSecurityVersion = "5.0.5" noNavCommonVersion = "3.2024.05.23_05.46-2b29fa343e8e" arbeidssokerregisteretVersion = "1.9348086045.48-1" @@ -68,8 +66,6 @@ opentelemetry-ktor = { group = "io.opentelemetry.instrumentation", name = "opent opentelemetry-annotations = { group = "io.opentelemetry.instrumentation", name = "opentelemetry-instrumentation-annotations", version.ref = "otelInstrumentationVersion" } micrometerCore = { group = "io.micrometer", name = "micrometer-core", version.ref = "micrometerVersion" } micrometer-registryPrometheus = { group = "io.micrometer", name = "micrometer-registry-prometheus", version.ref = "micrometerVersion" } -paw-pdl-client = { group = "no.nav.paw", name = "pdl-client", version.ref = "pawPdlClientVersion" } -paw-aareg-client = { group = "no.nav.paw", name = "aareg-client", version.ref = "pawAaregClientVersion" } paw-schema-main = { group = "no.nav.paw.arbeidssokerregisteret.api", name = "main-avro-schema", version.ref = "arbeidssokerregisteretVersion" } kafka-clients = { group = "org.apache.kafka", name = "kafka-clients", version.ref = "orgApacheKafkaVersion" } kafka-streams-core = { group = "org.apache.kafka", name = "kafka-streams", version.ref = "orgApacheKafkaVersion" }