diff --git a/lps-client-backend/build.gradle.kts b/lps-client-backend/build.gradle.kts index d9ea6a9..c9bfecf 100644 --- a/lps-client-backend/build.gradle.kts +++ b/lps-client-backend/build.gradle.kts @@ -60,7 +60,7 @@ dependencies { implementation("org.bouncycastle:bcprov-jdk15on:1.70") implementation("io.ktor:ktor-server-cors-jvm:2.3.12") - implementation("no.nav.helsearbeidsgiver:maskinporten-client:0.2.0.9-SNAPSHOT") + implementation("no.nav.helsearbeidsgiver:maskinporten-client:0.2.1.0-SNAPSHOT") testImplementation("io.ktor:ktor-server-test-host-jvm") testImplementation("org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version") diff --git a/lps-client-backend/src/main/kotlin/no/nav/helsearbeidsgiver/lps/LpsClient.kt b/lps-client-backend/src/main/kotlin/no/nav/helsearbeidsgiver/lps/LpsClient.kt index eff1e13..258e2d6 100644 --- a/lps-client-backend/src/main/kotlin/no/nav/helsearbeidsgiver/lps/LpsClient.kt +++ b/lps-client-backend/src/main/kotlin/no/nav/helsearbeidsgiver/lps/LpsClient.kt @@ -9,8 +9,11 @@ import io.ktor.client.request.url import io.ktor.http.ContentType import io.ktor.http.contentType import no.nav.helsearbeidsgiver.maskinporten.MaskinportenClient +import no.nav.helsearbeidsgiver.maskinporten.MaskinportenClientConfig import no.nav.helsearbeidsgiver.maskinporten.MaskinportenClientConfigPkey import no.nav.helsearbeidsgiver.maskinporten.createHttpClient +import no.nav.helsearbeidsgiver.maskinporten.getConsumerOrgClaim +import no.nav.helsearbeidsgiver.maskinporten.getSystemBrukerClaim private const val LPS_API_ENDPOINT = "https://sykepenger-im-lps-api.ekstern.dev.nav.no/" @@ -39,15 +42,14 @@ class LpsClient { consumerOrgNr: String, ) = MaskinportenClient( maskinportenClientConfig = - MaskinportenClientConfigPkey( - kid = kid, - privateKey = privateKey, - issuer = iss, - consumerOrgNr = consumerOrgNr, - scope = "nav:inntektsmelding/lps.write", - aud = "https://test.maskinporten.no/", - endpoint = "https://test.maskinporten.no/token", - ), + MaskinportenClientConfigPkey( + kid = kid, + privateKey = privateKey, + issuer = "https://test.maskinporten.no/", + scope = "nav:inntektsmelding/lps.write", + clientId = iss, + endpoint = "https://test.maskinporten.no/token", + ) ) suspend fun filtrerInntektsmeldinger( diff --git a/lps-client-backend/src/main/kotlin/no/nav/helsearbeidsgiver/plugins/Routing.kt b/lps-client-backend/src/main/kotlin/no/nav/helsearbeidsgiver/plugins/Routing.kt index eb6f8e0..452fd06 100644 --- a/lps-client-backend/src/main/kotlin/no/nav/helsearbeidsgiver/plugins/Routing.kt +++ b/lps-client-backend/src/main/kotlin/no/nav/helsearbeidsgiver/plugins/Routing.kt @@ -131,10 +131,10 @@ private fun Routing.filtererInntektsmeldinger() { try { val hentInntektsmeldinger = LpsClient().filtrerInntektsmeldinger( - privateKey, - kid, - issuer, - consumerOrgNr, + privateKey = privateKey, + kid = kid, + iss = issuer, + consumerOrgNr = consumerOrgNr, request = InntektsmeldingRequest(fnr, forespoerselId, datoFra, datoTil), ) call.respond(HttpStatusCode.OK, hentInntektsmeldinger)