Skip to content

Commit 39220e0

Browse files
author
Stian S. Douzette
committed
Merge remote-tracking branch 'origin/java_versjon_oppgradering' into java_versjon_oppgradering
2 parents 70deae6 + 4495e69 commit 39220e0

File tree

25 files changed

+205
-552
lines changed

25 files changed

+205
-552
lines changed

deploy/preprod.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,29 +74,34 @@ spec:
7474
- host: udi-proxy.dev-fss-pub.nais.io
7575
- host: aareg-services-q1.dev-fss-pub.nais.io
7676
- host: ereg-services.dev.intern.nav.no
77-
- host: medlemskap-medl-proxy.dev-fss-pub.nais.io
77+
- host: medlemskap-medl-api.dev-fss-pub.nais.io
78+
- host: oppgave.dev-fss-pub.nais.io
7879
env:
7980
- name: SECURITY_TOKEN_SERVICE_URL
8081
value: https://api-gw-q1.oera.no/sts/SecurityTokenServiceProvider/
8182
- name: SECURITY_TOKEN_SERVICE_REST_URL
8283
value: https://api-gw-q1.oera.no/security-token-service
8384
- name: MEDL2_BASE_URL
84-
value: https://medlemskap-medl-proxy.dev-fss-pub.nais.io
85+
value: https://medlemskap-medl-api.dev-fss-pub.nais.io
8586
- name: AAREG_BASE_URL
8687
value: https://aareg-services-q1.dev-fss-pub.nais.io/api
8788
- name: SAF_BASE_URL
8889
value: https://saf.dev-fss-pub.nais.io/graphql
8990
- name: OPPGAVE_BASE_URL
90-
value: https://api-gw-q1.oera.no/oppgave
91+
value: https://oppgave.dev-fss-pub.nais.io
9192
- name: PDL_BASE_URL
9293
value: https://pdl-api.dev-fss-pub.nais.io/graphql
9394
- name: EREG_BASE_URL
9495
value: https://api-gw-q1.oera.no/ereg-services/api
9596
- name: UDI_BASE_URL
9697
value: https://udi-proxy.dev-fss-pub.nais.io
98+
- name: AZURE_SCOPE_OPPGAVE
99+
value: api://dev-fss.oppgavehandtering.oppgave/.default
97100
- name: AZURE_SCOPE_UDI
98101
value: api://dev-fss.medlemskap.udi-proxy/.default
99102
- name: AZURE_SCOPE_MEDL
100103
value: api://dev-fss.team-rocket.medlemskap-medl-api/.default
101104
- name: AZURE_SCOPE_PDL
102-
value: api://dev-fss.pdl.pdl-api/.default
105+
value: api://dev-fss.pdl.pdl-api/.default
106+
- name: AZURE_SCOPE_AAREG
107+
value: api://dev-fss.arbeidsforhold.aareg-services-nais/.default

deploy/prod.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ spec:
6565
- host: udi-proxy.prod-fss-pub.nais.io
6666
- host: aareg-services.prod-fss-pub.nais.io
6767
- host: ereg-services.dev.intern.nav.no
68-
- host: medlemskap-medl-proxy.prod-fss-pub.nais.io
68+
- host: medlemskap-medl-api.prod-fss-pub.nais.io
69+
- host: oppgave.prod-fss-pub.nais.io
6970
kafka:
7071
pool: nav-prod
7172

@@ -75,22 +76,26 @@ spec:
7576
- name: SECURITY_TOKEN_SERVICE_REST_URL
7677
value: https://api-gw.oera.no/security-token-service
7778
- name: MEDL2_BASE_URL
78-
value: https://medlemskap-medl-proxy.prod-fss-pub.nais.io
79+
value: https://medlemskap-medl-api.prod-fss-pub.nais.io
7980
- name: AAREG_BASE_URL
8081
value: https://aareg-services.prod-fss-pub.nais.io/api
8182
- name: SAF_BASE_URL
8283
value: https://saf.prod-fss-pub.nais.io/graphql
8384
- name: OPPGAVE_BASE_URL
84-
value: https://api-gw.oera.no/oppgave
85+
value: https://oppgave.prod-fss-pub.nais.io
8586
- name: PDL_BASE_URL
8687
value: https://pdl-api.prod-fss-pub.nais.io/graphql
8788
- name: EREG_BASE_URL
8889
value: https://api-gw.oera.no/ereg-services/api
8990
- name: UDI_BASE_URL
9091
value: https://udi-proxy.prod-fss-pub.nais.io
92+
- name: AZURE_SCOPE_OPPGAVE
93+
value: api://prod-fss.oppgavehandtering.oppgave/.default
9194
- name: AZURE_SCOPE_UDI
9295
value: api://prod-fss.medlemskap.udi-proxy/.default
9396
- name: AZURE_SCOPE_MEDL
9497
value: api://prod-fss.team-rocket.medlemskap-medl-api/.default
9598
- name: AZURE_SCOPE_PDL
96-
value: api://prod-fss.pdl.pdl-api/.default
99+
value: api://prod-fss.pdl.pdl-api/.default
100+
- name: AZURE_SCOPE_AAREG
101+
value: api://prod-fss.arbeidsforhold.aareg-services-nais/.default

pdl-client/src/main/resources/pdl/hentPerson.graphql

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,29 @@ query($ident: ID!, $bostedHistorikk: Boolean!, $statsborgerskapHistorikk: Boolea
3838
historisk
3939
}
4040
},
41+
opphold(historikk: true){
42+
type
43+
oppholdFra
44+
oppholdTil
45+
metadata{
46+
historisk
47+
master
48+
endringer{
49+
type,
50+
kilde,
51+
registrert,
52+
registrertAv,
53+
systemkilde
54+
}
55+
}
56+
folkeregistermetadata {
57+
aarsak,
58+
ajourholdstidspunkt,
59+
gyldighetstidspunkt,
60+
opphoerstidspunkt,
61+
kilde
62+
}
63+
},
4164
doedsfall{
4265
doedsdato
4366
},
@@ -71,9 +94,11 @@ query($ident: ID!, $bostedHistorikk: Boolean!, $statsborgerskapHistorikk: Boolea
7194
historisk
7295
},
7396
folkeregistermetadata {
97+
aarsak
7498
ajourholdstidspunkt,
7599
gyldighetstidspunkt,
76-
opphoerstidspunkt
100+
opphoerstidspunkt,
101+
kilde
77102
}
78103
},
79104
utflyttingFraNorge{

src/main/kotlin/no/nav/medlemskap/HttpServer.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ import io.ktor.server.plugins.callid.*
1212
import io.ktor.server.plugins.callloging.*
1313
import io.ktor.server.plugins.contentnegotiation.*
1414
import io.ktor.server.plugins.statuspages.*
15-
import io.ktor.server.request.*
16-
import io.ktor.server.response.*
1715
import io.ktor.server.routing.*
1816
import io.micrometer.core.instrument.binder.jvm.ClassLoaderMetrics
1917
import io.micrometer.core.instrument.binder.jvm.JvmGcMetrics
@@ -35,7 +33,6 @@ import no.nav.medlemskap.config.getAadConfig
3533
import no.nav.medlemskap.domene.Datagrunnlag
3634
import no.nav.medlemskap.domene.Request
3735
import no.nav.medlemskap.routes.*
38-
import org.slf4j.event.*
3936
import org.slf4j.event.Level
4037
import java.util.*
4138

@@ -102,7 +99,9 @@ createHttpServer(
10299
val requestContextService = RequestContextService()
103100
if (useAuthentication) {
104101
routing {
105-
naisRoutes(readinessCheck = { applicationState.initialized }, livenessCheck = { applicationState.running }, collectorRegistry = CollectorRegistry.defaultRegistry)
102+
naisRoutes(
103+
readinessCheck = { applicationState.initialized }, livenessCheck = { applicationState.running }, collectorRegistry = CollectorRegistry.defaultRegistry
104+
)
106105
if (services.configuration.cluster == "dev-gcp") setupSwaggerDocApi()
107106
evalueringRoute(services, configuration, requestContextService, createDatagrunnlag)
108107
reglerRoute()

src/main/kotlin/no/nav/medlemskap/clients/RestClients.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ class RestClients(
2929

3030
private val httpClient = cioHttpClient
3131

32-
fun aaReg(endpointUrl: String) = AaRegClient(endpointUrl, configuration.sts.username, stsClientRest, httpClient, configuration.register.aaRegApiKey, aaRegRetry)
32+
fun aaReg(endpointUrl: String) = AaRegClient(endpointUrl, azureAdClient, httpClient, configuration, configuration.register.aaRegApiKey, aaRegRetry)
3333
fun medl2(endpointBaseUrl: String) = MedlClient(endpointBaseUrl, azureAdClient, configuration, httpClient, medlRetry)
3434
fun saf(endpointBaseUrl: String) = SafClient(endpointBaseUrl, stsClientRest, configuration.sts.username, httpClient, configuration.register.safApiKey, safRetry)
35-
fun oppgaver(endpointBaseUrl: String) = OppgaveClient(endpointBaseUrl, stsClientRest, httpClient, configuration.register.oppgaveApiKey, oppgaveRetry)
35+
fun oppgaver(endpointBaseUrl: String) = OppgaveClient(endpointBaseUrl, azureAdClient, configuration, httpClient, oppgaveRetry)
3636
fun pdl(endpointBaseURl: String) = PdlClient(endpointBaseURl, azureAdClient, configuration, configuration.sts.username, httpClient, pdlRetry, configuration.register.pdlApiKey)
3737
fun ereg(endpointBaseUrl: String) = EregClient(endpointBaseUrl, httpClient, configuration, configuration.register.eregApiKey, eregRetry)
3838
fun udi(endpointBaseUrl: String) = UdiClient(endpointBaseUrl, azureAdClient, httpClient, udiRetry)

src/main/kotlin/no/nav/medlemskap/clients/aareg/AaRegClient.kt

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@ import io.ktor.client.plugins.*
77
import io.ktor.client.request.*
88
import io.ktor.http.*
99
import mu.KotlinLogging
10+
import no.nav.medlemskap.clients.azuread.AzureAdClient
1011
import no.nav.medlemskap.clients.runWithRetryAndMetrics
11-
import no.nav.medlemskap.clients.sts.StsRestClient
12+
import no.nav.medlemskap.config.Configuration
1213
import java.time.LocalDate
1314
import java.time.format.DateTimeFormatter
1415

1516
class AaRegClient(
1617
private val baseUrl: String,
17-
private val username: String,
18-
private val stsClient: StsRestClient,
18+
private val azureAdClient: AzureAdClient,
1919
private val httpClient: HttpClient,
20+
private val configuration: Configuration,
2021
private val aaRegApiKey: String,
2122
private val retry: Retry? = null
2223
) {
@@ -27,16 +28,15 @@ class AaRegClient(
2728
}
2829

2930
suspend fun hentArbeidsforhold(fnr: String, callId: String, fraOgMed: LocalDate? = null, tilOgMed: LocalDate? = null): List<AaRegArbeidsforhold> {
30-
val oidcToken = stsClient.oidcToken()
31+
val token = azureAdClient.hentToken(configuration.register.aaregScope)
3132
return runCatching {
3233
runWithRetryAndMetrics("AaReg", "ArbeidsforholdV1", retry) {
3334
httpClient.get() {
3435
url("$baseUrl/v1/arbeidstaker/arbeidsforhold")
35-
header(HttpHeaders.Authorization, "Bearer $oidcToken")
36+
header(HttpHeaders.Authorization, "Bearer ${token.token}")
3637
header(HttpHeaders.Accept, ContentType.Application.Json)
3738
header("Nav-Call-Id", callId)
3839
header("Nav-Personident", fnr)
39-
header("Nav-Consumer-Token", "Bearer $oidcToken")
4040
header("x-nav-apiKey", aaRegApiKey)
4141
fraOgMed?.let { parameter("ansettelsesperiodeFom", fraOgMed.tilIsoFormat()) }
4242
tilOgMed?.let { parameter("ansettelsesperiodeTom", tilOgMed.tilIsoFormat()) }
@@ -63,16 +63,15 @@ class AaRegClient(
6363
}
6464

6565
suspend fun hentArbeidsforholdV2(fnr: String, callId: String, fraOgMed: LocalDate? = null, tilOgMed: LocalDate? = null): List<no.nav.medlemskap.clients.aareg.Arbeidsforhold> {
66-
val oidcToken = stsClient.oidcToken()
66+
val token = azureAdClient.hentToken(configuration.register.aaregScope)
6767
return runCatching {
6868
runWithRetryAndMetrics("AaReg", "ArbeidsforholdV2", retry) {
6969
httpClient.get() {
7070
url("$baseUrl/v2/arbeidstaker/arbeidsforhold")
71-
header(HttpHeaders.Authorization, "Bearer $oidcToken")
71+
header(HttpHeaders.Authorization, "Bearer ${token.token}")
7272
header(HttpHeaders.Accept, ContentType.Application.Json)
7373
header("Nav-Call-Id", callId)
7474
header("Nav-Personident", fnr)
75-
header("Nav-Consumer-Token", "Bearer $oidcToken")
7675
header("x-nav-apiKey", aaRegApiKey)
7776
parameter("historikk", "true")
7877
parameter("arbeidsforholdstatus", "AKTIV,AVSLUTTET,FREMTIDIG")

src/main/kotlin/no/nav/medlemskap/clients/inntekt/InntektClient.kt

Lines changed: 0 additions & 82 deletions
This file was deleted.

0 commit comments

Comments
 (0)