Skip to content

Commit

Permalink
Bruker maskinporten
Browse files Browse the repository at this point in the history
  • Loading branch information
mettok committed Dec 9, 2024
1 parent ecad956 commit 3a3fdb0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion lps-client-backend/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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/"

Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3a3fdb0

Please sign in to comment.