Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bare returnere true for har nivaaa 4 kallet #273

Merged
merged 2 commits into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions nais-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ spec:
mountPath: /var/run/secrets/nais.io/service_user_sbs
- kvPath: /kv/preprod/fss/veilarbperson/q1
mountPath: /var/run/secrets/nais.io/vault
- kvPath: /apikey/apigw/dev/eksternapp.difi.idporten.authlevel/veilarbperson_q1
mountPath: /var/run/secrets/nais.io/authlevel
azure:
application:
enabled: true
Expand Down Expand Up @@ -76,10 +74,6 @@ spec:
cluster: dev-gcp

env:
- name: DIFI_IDPORTEN_AUTHLEVEL_URL
value: https://api-gw-q1.adeo.no/ekstern/difi/authlevel/rest/v1/sikkerhetsnivaa/
- name: DIFI_IDPORTEN_TOKEN_URL
value: https://api-gw-q1.adeo.no/ekstern/difi/idporten-oidc-provider/token
- name: KODEVERK_URL
value: http://kodeverk.default.svc.nais.local
- name: KONTAKT_OG_RESERVASJONSREGISTERET_API_URL
Expand Down
6 changes: 0 additions & 6 deletions nais-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ spec:
mountPath: /var/run/secrets/nais.io/service_user_sbs
- kvPath: /kv/prod/fss/veilarbperson/default
mountPath: /var/run/secrets/nais.io/vault
- kvPath: /apikey/apigw/prod/eksternapp.difi.idporten.authlevel/veilarbperson
mountPath: /var/run/secrets/nais.io/authlevel
azure:
application:
enabled: true
Expand Down Expand Up @@ -73,10 +71,6 @@ spec:
cluster: prod-gcp

env:
- name: DIFI_IDPORTEN_AUTHLEVEL_URL
value: https://api-gw.adeo.no/ekstern/difi/authlevel/rest/v1/sikkerhetsnivaa/
- name: DIFI_IDPORTEN_TOKEN_URL
value: https://api-gw.adeo.no/ekstern/difi/idporten-oidc-provider/token
- name: KODEVERK_URL
value: http://kodeverk.default.svc.nais.local
- name: KONTAKT_OG_RESERVASJONSREGISTERET_API_URL
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package no.nav.veilarbperson.client.difi;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import no.nav.common.types.identer.Fnr;


// TODO: 21/08/2023 denne skal slettes etter vi har ryddet opp i kode i de andre appene da dkif slutter å tilby tjenesten
@Data
@Accessors(chain = true)
public class HarLoggetInnRespons {
Expand Down

This file was deleted.

5 changes: 0 additions & 5 deletions src/main/java/no/nav/veilarbperson/config/CacheConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public class CacheConfig {
public static final String NOM_SKJERMEDE_PERSONER_CACHE_NAME = "nom_skjermede_personer_cache";
public static final String SIKKERHETSTILTAK_CACHE_NAME = "sikkerhetstiltak_cache";
public static final String DIGDIR_KONTAKTINFO_CACHE_NAME = "digdir_kontaktinfo_cache";
public static final String DIFI_HAR_NIVA_4_CACHE_NAME = "difi_har_niva_4_cache";
public static final String KODEVERK_BETYDNING_CACHE_NAME = "kodeverk_betydning_cache";

public static final String KONTOREGISTER_CACHE_NAME = "kontoregister_person_cache";
Expand Down Expand Up @@ -46,10 +45,6 @@ public Cache digdirKontaktinfoCache() {
return litenCache(DIGDIR_KONTAKTINFO_CACHE_NAME);
}

@Bean
public Cache difiHarNiva4Cache() {
return litenCache(DIFI_HAR_NIVA_4_CACHE_NAME);
}

@Bean
public Cache kodeverkBetydningCache() {
Expand Down
25 changes: 2 additions & 23 deletions src/main/java/no/nav/veilarbperson/config/ClientConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,19 @@
import no.nav.common.token_client.client.AzureAdMachineToMachineTokenClient;
import no.nav.common.token_client.client.AzureAdOnBehalfOfTokenClient;
import no.nav.common.token_client.client.MachineToMachineTokenClient;
import no.nav.common.utils.Credentials;
import no.nav.common.utils.NaisUtils;
import no.nav.veilarbperson.client.difi.DifiAccessTokenProviderImpl;
import no.nav.veilarbperson.client.difi.DifiClient;
import no.nav.veilarbperson.client.difi.DifiClientImpl;
import no.nav.veilarbperson.client.difi.SbsServiceUser;
import no.nav.veilarbperson.client.digdir.DigdirClient;
import no.nav.veilarbperson.client.digdir.DigdirClientImpl;
import no.nav.veilarbperson.client.kodeverk.KodeverkClient;
import no.nav.veilarbperson.client.kodeverk.KodeverkClientImpl;
import no.nav.veilarbperson.client.kontoregister.KontoregisterClient;
import no.nav.veilarbperson.client.kontoregister.KontoregisterClientImpl;
import no.nav.veilarbperson.client.nom.SkjermetClient;
import no.nav.veilarbperson.client.nom.SkjermetClientImpl;
import no.nav.veilarbperson.client.pam.PamClient;
import no.nav.veilarbperson.client.pam.PamClientImpl;
import no.nav.veilarbperson.client.pdl.PdlClient;
import no.nav.veilarbperson.client.pdl.PdlClientImpl;
import no.nav.veilarbperson.client.kontoregister.KontoregisterClient;
import no.nav.veilarbperson.client.kontoregister.KontoregisterClientImpl;
import no.nav.veilarbperson.client.veilarboppfolging.VeilarboppfolgingClient;
import no.nav.veilarbperson.client.veilarboppfolging.VeilarboppfolgingClientImpl;
import no.nav.veilarbperson.client.veilarbregistrering.VeilarbregistreringClient;
Expand All @@ -40,7 +35,6 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import static no.nav.common.utils.NaisUtils.getCredentials;

@Slf4j
@Configuration
Expand Down Expand Up @@ -100,15 +94,6 @@ public PdlClient pdlClient(EnvironmentProperties properties, AuthService authSer
() -> tokenClient.createMachineToMachineToken(properties.getPdlApiScope()));
}

@Bean
public DifiAccessTokenProviderImpl accessTokenRepository(EnvironmentProperties properties, SbsServiceUser sbsServiceUser) {
return new DifiAccessTokenProviderImpl(sbsServiceUser, properties.getDifiTokenUrl());
}

@Bean
public DifiClient difiClient(EnvironmentProperties properties, String xNavApikey, DifiAccessTokenProviderImpl difiAccessTokenProvider) {
return new DifiClientImpl(difiAccessTokenProvider, xNavApikey, properties.getDifiAuthlevelUrl());
}

@Bean
public VeilarbregistreringClient veilarbregistreringClient(EnvironmentProperties properties, AzureAdMachineToMachineTokenClient aadMachineToMachineTokenClient) {
Expand All @@ -122,12 +107,6 @@ public String xNavApikey() {
return NaisUtils.getFileContent("/var/run/secrets/nais.io/authlevel/x-nav-apiKey");
}

@Bean
public SbsServiceUser sbsServiceUser() {
Credentials service_user_sbs = getCredentials("service_user_sbs");
return new SbsServiceUser(service_user_sbs.username, service_user_sbs.password);
}

@Bean
public AzureAdMachineToMachineTokenClient azureAdMachineToMachineTokenClient() {
return AzureAdTokenClientBuilder.builder().withNaisDefaults().buildMachineToMachineTokenClient();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
@ConfigurationProperties(prefix = "app.env")
public class EnvironmentProperties {
private String abacUrl;
private String difiAuthlevelUrl;
private String difiTokenUrl;
private String kodeverkUrl;
private String krrScope;
private String krrUrl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
import lombok.AllArgsConstructor;
import no.nav.common.types.identer.Fnr;
import no.nav.veilarbperson.client.difi.HarLoggetInnRespons;
import no.nav.veilarbperson.domain.*;
import no.nav.veilarbperson.domain.AktoerId;
import no.nav.veilarbperson.domain.GeografiskTilknytning;
import no.nav.veilarbperson.domain.Malform;
import no.nav.veilarbperson.domain.PersonNavn;
import no.nav.veilarbperson.service.AuthService;
import no.nav.veilarbperson.service.CvJobbprofilService;
import no.nav.veilarbperson.service.PersonV2Service;
Expand Down Expand Up @@ -52,11 +55,15 @@ public boolean tilgangTilBruker(@PathVariable("fodselsnummer") Fnr fodselsnummer
return authService.harLesetilgang(fodselsnummer);
}

// TODO: 21/08/2023 denne skal slettes etter vi har ryddet opp i kode i de andre appene da dkif slutter å tilby tjenesten
@GetMapping("/{fodselsnummer}/harNivaa4")
public HarLoggetInnRespons harNivaa4(@PathVariable("fodselsnummer") Fnr fodselsnummer) {
authService.stoppHvisEksternBruker();
authService.sjekkLesetilgang(fodselsnummer);
return personV2Service.hentHarNivaa4(fodselsnummer);
return new HarLoggetInnRespons()
.setErRegistrertIdPorten(true)
.setHarbruktnivaa4(true)
.setPersonidentifikator(fodselsnummer);
}

@GetMapping("/geografisktilknytning")
Expand Down
20 changes: 2 additions & 18 deletions src/main/java/no/nav/veilarbperson/service/PersonV2Service.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@
import lombok.extern.slf4j.Slf4j;
import no.nav.common.client.norg2.Norg2Client;
import no.nav.common.types.identer.Fnr;
import no.nav.veilarbperson.client.difi.DifiClient;
import no.nav.veilarbperson.client.difi.HarLoggetInnRespons;
import no.nav.veilarbperson.client.digdir.DigdirClient;
import no.nav.veilarbperson.client.digdir.DigdirKontaktinfo;
import no.nav.veilarbperson.client.kontoregister.HentKontoRequestDTO;
import no.nav.veilarbperson.client.kontoregister.HentKontoResponseDTO;
import no.nav.veilarbperson.client.kontoregister.KontoregisterClient;
import no.nav.veilarbperson.client.nom.SkjermetClient;
import no.nav.veilarbperson.client.pdl.HentPerson;
import no.nav.veilarbperson.client.pdl.PdlClient;
import no.nav.veilarbperson.client.pdl.domain.*;
import no.nav.veilarbperson.client.kontoregister.KontoregisterClient;
import no.nav.veilarbperson.domain.*;
import no.nav.veilarbperson.utils.PersonV2DataMapper;
import no.nav.veilarbperson.utils.VergeOgFullmaktDataMapper;
Expand All @@ -30,9 +28,7 @@

import static java.util.Optional.ofNullable;
import static no.nav.veilarbperson.client.kontoregister.KontoregisterClientImpl.Mappers.fraNorg2Enhet;
import static no.nav.veilarbperson.utils.PersonV2DataMapper.getFirstElement;
import static no.nav.veilarbperson.utils.PersonV2DataMapper.parseZonedDateToDateString;
import static no.nav.veilarbperson.utils.PersonV2DataMapper.sivilstandMapper;
import static no.nav.veilarbperson.utils.PersonV2DataMapper.*;
import static no.nav.veilarbperson.utils.VergeOgFullmaktDataMapper.toVergeOgFullmaktData;

@Slf4j
Expand All @@ -44,14 +40,12 @@ public class PersonV2Service {
private final Norg2Client norg2Client;
private final SkjermetClient skjermetClient;
private final KodeverkService kodeverkService;
private final DifiClient difiClient;
private final UnleashService unleashService;

private final KontoregisterClient kontoregisterClient;

@Autowired
public PersonV2Service(PdlClient pdlClient,
DifiClient difiClient,
AuthService authService,
DigdirClient digdirClient,
Norg2Client norg2Client,
Expand All @@ -65,7 +59,6 @@ public PersonV2Service(PdlClient pdlClient,
this.norg2Client = norg2Client;
this.skjermetClient = skjermetClient;
this.kodeverkService = kodeverkService;
this.difiClient = difiClient;
this.unleashService = unleashService;
this.kontoregisterClient = kontoregisterClient;
}
Expand Down Expand Up @@ -378,13 +371,4 @@ public PersonNavnV2 hentNavn(Fnr fnr) {
return PersonV2DataMapper.navnMapper(personNavn.getNavn());
}

public HarLoggetInnRespons hentHarNivaa4(Fnr fodselsnummer) {
if (unleashService.sjekkNivaa4()) {
return new HarLoggetInnRespons()
.setErRegistrertIdPorten(true)
.setHarbruktnivaa4(true)
.setPersonidentifikator(fodselsnummer);
}
return difiClient.harLoggetInnSiste18mnd(fodselsnummer);
}
}
Loading
Loading