diff --git a/.nais/naiserator-dev.yaml b/.nais/naiserator-dev.yaml index 6e8f9d93..a0d1616b 100644 --- a/.nais/naiserator-dev.yaml +++ b/.nais/naiserator-dev.yaml @@ -53,8 +53,8 @@ spec: port: 1413 protocol: TCP - host: "dokarkiv.dev-fss-pub.nais.io" - - host: "isproxy.dev-fss-pub.nais.io" - host: "pdl-api.dev-fss-pub.nais.io" + - host: "btsys.dev-fss-pub.nais.io" rules: - application: padm2pdfgen - application: clamav @@ -112,9 +112,9 @@ spec: - name: HELSENETT_ENDPOINT_URL value: http://syfohelsenettproxy.teamsykmelding - name: LEGE_SUSPENSJON_CLIENT_ID - value: dev-fss.teamsykefravr.isproxy + value: dev-fss.team-rocket.btsys - name: LEGE_SUSPENSJON_ENDPOINT_URL - value: https://isproxy.dev-fss-pub.nais.io + value: https://btsys.dev-fss-pub.nais.io - name: SMTSS_CLIENT_ID value: dev-gcp.teamsykmelding.smtss - name: SMTSS_URL diff --git a/.nais/naiserator-prod.yaml b/.nais/naiserator-prod.yaml index ef144f53..cf0a6c7b 100644 --- a/.nais/naiserator-prod.yaml +++ b/.nais/naiserator-prod.yaml @@ -53,8 +53,8 @@ spec: port: 1414 protocol: TCP - host: "dokarkiv.prod-fss-pub.nais.io" - - host: "isproxy.prod-fss-pub.nais.io" - host: "pdl-api.prod-fss-pub.nais.io" + - host: "btsys.prod-fss-pub.nais.io" rules: - application: padm2pdfgen - application: clamav @@ -112,9 +112,9 @@ spec: - name: HELSENETT_ENDPOINT_URL value: http://syfohelsenettproxy.teamsykmelding - name: LEGE_SUSPENSJON_CLIENT_ID - value: prod-fss.teamsykefravr.isproxy + value: prod-fss.team-rocket.btsys - name: LEGE_SUSPENSJON_ENDPOINT_URL - value: https://isproxy.prod-fss-pub.nais.io + value: https://btsys.prod-fss-pub.nais.io - name: SMTSS_CLIENT_ID value: prod-gcp.teamsykmelding.smtss - name: SMTSS_URL diff --git a/src/main/kotlin/no/nav/syfo/application/DialogmeldingProcessor.kt b/src/main/kotlin/no/nav/syfo/application/DialogmeldingProcessor.kt index 3f3f7dab..f78646c3 100644 --- a/src/main/kotlin/no/nav/syfo/application/DialogmeldingProcessor.kt +++ b/src/main/kotlin/no/nav/syfo/application/DialogmeldingProcessor.kt @@ -61,6 +61,7 @@ class DialogmeldingProcessor( azureAdV2Client = azureAdV2Client, endpointUrl = env.legeSuspensjonEndpointURL, endpointClientId = env.legeSuspensjonClientId, + applicationName = env.applicationName, httpClient = httpClient, ) val padm2ReglerService = RuleService( diff --git a/src/main/kotlin/no/nav/syfo/client/LegeSuspensjonClient.kt b/src/main/kotlin/no/nav/syfo/client/LegeSuspensjonClient.kt index a90a6f2f..a8de0f10 100644 --- a/src/main/kotlin/no/nav/syfo/client/LegeSuspensjonClient.kt +++ b/src/main/kotlin/no/nav/syfo/client/LegeSuspensjonClient.kt @@ -13,7 +13,8 @@ class LegeSuspensjonClient( private val azureAdV2Client: AzureAdV2Client, private val endpointUrl: String, private val endpointClientId: String, - private val httpClient: HttpClient + private val httpClient: HttpClient, + private val applicationName: String, ) { suspend fun sjekkSuspensjon( @@ -24,10 +25,11 @@ class LegeSuspensjonClient( val token = azureAdV2Client.getSystemToken(endpointClientId) ?: throw RuntimeException("Failed to sjekk suspensjon: No token was found") - val httpResponse: HttpResponse = httpClient.get("$endpointUrl/api/v1/btsys/suspensjon/status") { + val httpResponse: HttpResponse = httpClient.get("$endpointUrl/api/v1/suspensjon/status") { accept(ContentType.Application.Json) headers { append("Nav-Call-Id", ediloggid) + append("Nav-Consumer-Id", applicationName) append("Nav-Personident", behandlerId) append("Authorization", "Bearer ${token.accessToken}") } @@ -35,8 +37,8 @@ class LegeSuspensjonClient( } if (httpResponse.status != HttpStatusCode.OK) { - logger.error("Btsys (via isproxy) svarte med kode {} for ediloggId {}, {}", httpResponse.status, ediloggid) - throw IOException("Btsys svarte (via isproxy) med uventet kode ${httpResponse.status} for $ediloggid") + logger.error("Btsys svarte med kode {} for ediloggId {}", httpResponse.status, ediloggid) + throw IOException("Btsys svarte med uventet kode ${httpResponse.status} for $ediloggid") } return httpResponse.call.response.body() diff --git a/src/test/kotlin/no/nav/syfo/mock/LegeSuspensjonEndpointMock.kt b/src/test/kotlin/no/nav/syfo/mock/LegeSuspensjonEndpointMock.kt index e1352a2b..27fe430d 100644 --- a/src/test/kotlin/no/nav/syfo/mock/LegeSuspensjonEndpointMock.kt +++ b/src/test/kotlin/no/nav/syfo/mock/LegeSuspensjonEndpointMock.kt @@ -13,7 +13,7 @@ import no.nav.syfo.util.configure class LegeSuspensjonEndpointMock { private val port = getRandomPort() - private val path = "/api/v1/btsys/suspensjon/status" + private val path = "/api/v1/suspensjon/status" val url = "http://localhost:$port" val name = "legeSuspensjonEndpoint"