Skip to content

Commit

Permalink
Oppdaterte apps til å bruke nye client-libs
Browse files Browse the repository at this point in the history
  • Loading branch information
naviktthomas committed Oct 25, 2024
1 parent 3b594a2 commit dbb4098
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 25 deletions.
4 changes: 1 addition & 3 deletions apps/api-start-stopp-perioder/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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)
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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.*
Expand Down Expand Up @@ -39,14 +36,11 @@ data object OID : Claim<UUID>("oid", UUID::fromString)
data object Name : Claim<String>("name", { it })
data object NavIdent : Claim<String>("NAVident", { it })

private sealed class ResolveToken(
val issuer: Issuer,
val claims: List<Claim<*>>
) {
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<Claim<*>>)

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<ResolveToken> = listOf(IdPortenToken, TokenXToken, AzureToken)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ val KafkaConsumerPlugin: ApplicationPlugin<KafkaConsumerPluginConfig> =
application.log.info("Stopper Kafka Consumer")
pollingFlag.set(false)
consumeJob?.cancel()
consumer.unsubscribe()
consumer.close(shutDownTimeout)
}

Expand Down
2 changes: 1 addition & 1 deletion apps/kafka-key-generator/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions apps/utgang-pdl/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 1 addition & 3 deletions domain/arbeidssoeker-regler/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm")
id("org.openapi.generator")
Expand All @@ -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)
Expand Down
4 changes: 0 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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" }
Expand Down

0 comments on commit dbb4098

Please sign in to comment.