-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gjør dokarkiv-klient synlig, fjern pdl-klient (#1197)
- Loading branch information
Showing
11 changed files
with
71 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
...n/java/no/nav/vedtak/felles/integrasjon/skjerming/AbstractSkjermetPersonOnPremKlient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package no.nav.vedtak.felles.integrasjon.skjerming; | ||
|
||
import no.nav.foreldrepenger.konfig.Environment; | ||
import no.nav.vedtak.felles.integrasjon.rest.RestClient; | ||
import no.nav.vedtak.felles.integrasjon.rest.RestConfig; | ||
import no.nav.vedtak.felles.integrasjon.rest.RestRequest; | ||
|
||
// OBS på propertynavn vs GCP-versjon skjermet.person.onprem.rs.url=http://skjermede-personer-pip.nom/skjermet | ||
// Extend og annoter med endpoint+default + tokenConfig = STS_CC | ||
//@RestClientConfig(tokenConfig = TokenFlow.STS_CC, endpointProperty = "skjermet.person.onprem.rs.url", endpointDefault = "http://skjermede-personer-pip.nom/skjermet" | ||
public abstract class AbstractSkjermetPersonOnPremKlient implements Skjerming { | ||
|
||
private static final boolean TESTENV = Environment.current().isLocal(); | ||
|
||
private final RestClient client; | ||
private final RestConfig restConfig; | ||
|
||
protected AbstractSkjermetPersonOnPremKlient() { | ||
this(RestClient.client()); | ||
} | ||
|
||
protected AbstractSkjermetPersonOnPremKlient(RestClient restClient) { | ||
this.client = restClient; | ||
this.restConfig = RestConfig.forClient(this.getClass()); | ||
} | ||
|
||
|
||
@Override | ||
public boolean erSkjermet(String fnr) { | ||
if (TESTENV || fnr == null) return false; | ||
|
||
var request = RestRequest.newPOSTJson(new SkjermetRequestDto(fnr), restConfig.endpoint(), restConfig); | ||
|
||
var skjermet = client.send(request, String.class); | ||
return "true".equalsIgnoreCase(skjermet); | ||
} | ||
|
||
private boolean kallMedSjekk(RestRequest request) { | ||
var skjermet = client.send(request, String.class); | ||
return "true".equalsIgnoreCase(skjermet); | ||
} | ||
|
||
private record SkjermetRequestDto(String personident) {} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
24 changes: 0 additions & 24 deletions
24
integrasjon/pdl-klient/src/main/java/no/nav/vedtak/felles/integrasjon/pdl/PdlKlient.java
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
...-klient/src/main/java/no/nav/vedtak/felles/integrasjon/pdl/RestSupportClientProducer.java
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters