Skip to content

Commit

Permalink
Merge branch 'refs/heads/master' into change/from_vault_to_secretmanager
Browse files Browse the repository at this point in the history
# Conflicts:
#	apps/sykemelding-api/src/main/java/no/nav/registre/testnorge/sykemelding/config/LocalVaultConfig.java
#	apps/sykemelding-api/src/main/resources/application.yml
#	apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/config/LocalVaultConfig.java
#	apps/synt-sykemelding-api/src/main/resources/application-dev.yml
#	apps/synt-sykemelding-api/src/main/resources/application.yml
  • Loading branch information
rfc3092 committed Nov 29, 2024
2 parents 467c34a + ea26d4c commit 1fbb776
Show file tree
Hide file tree
Showing 80 changed files with 1,294 additions and 338 deletions.
1 change: 1 addition & 0 deletions .github/workflows/app.sykemelding-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
cluster: "dev-gcp"
working-directory: "apps/sykemelding-api"
deploy-tag: "#deploy-sykemelding-api"
deploy-tag-test: "#deploy-test-sykemelding-api"
permissions:
contents: read
id-token: write
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/app.synt-sykemelding-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
with:
working-directory: "apps/synt-sykemelding-api"
deploy-tag: "#deploy-synt-sykemelding-api"
deploy-tag-test: "#deploy-test-synt-sykemelding-api"
permissions:
contents: read
id-token: write
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/proxy.sykemelding-proxy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: sykemelding-proxy

on:
push:
paths:
- "plugins/**"
- "libs/reactive-core/**"
- "libs/reactive-proxy/**"
- "libs/security-token-service/**"
- "proxies/sykemelding-proxy/**"
- ".github/workflows/proxy.sykemelding-proxy.yml"

jobs:
workflow:
uses: ./.github/workflows/common.workflow.backend.yml
with:
cluster: "dev-gcp"
working-directory: "proxies/sykemelding-proxy"
deploy-tag: "#deploy-proxy-sykemelding"
permissions:
contents: read
id-token: write
secrets: inherit
2 changes: 2 additions & 0 deletions apps/arbeidsforhold-service/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ spec:
cluster: dev-gcp
- application: testnav-synt-sykemelding-api
cluster: dev-gcp
- application: testnav-synt-sykemelding-api-dev
cluster: dev-gcp
outbound:
external:
- host: testnav-aareg-proxy.dev-fss-pub.nais.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ public class ArbeidsforholdApiApplicationStarter {
public static void main(String[] args) {
SpringApplication.run(ArbeidsforholdApiApplicationStarter.class, args);
}
}
}
2 changes: 2 additions & 0 deletions apps/dolly-backend/config.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ spec:
- application: testnav-person-service
- application: testnav-skattekort-service
- application: testnav-sykemelding-api
- application: testnav-sykemelding-api-dev
- application: testnav-synt-sykemelding-api
- application: testnav-synt-sykemelding-api-dev
- application: testnav-tps-messaging-service
- application: testnav-yrkesskade-proxy
- application: testnorge-profil-api-dev
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ public static void main(String[] args) {

SpringApplication.run(DollyBackendApplicationStarter.class, args);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ private void saveTransaksjonId(SykemeldingResponse sykemelding, Long bestillingI

log.info("Lagrer transaksjon for {} i q1 ", sykemelding.getIdent());

sykemelding.getSykemeldingRequest().setSykemeldingId(sykemelding.getMsgId());
transaksjonMappingService.save(TransaksjonMapping.builder()
.ident(sykemelding.getIdent())
.bestillingId(bestillingId)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package no.nav.dolly.bestilling.sykemelding.command;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import no.nav.dolly.bestilling.sykemelding.domain.DetaljertSykemeldingRequest;
import no.nav.dolly.bestilling.sykemelding.dto.SykemeldingResponse;
import no.nav.testnav.libs.dto.sykemelding.v1.SykemeldingResponseDTO;
import no.nav.testnav.libs.reactivecore.utils.WebClientFilter;
import no.nav.testnav.libs.securitycore.config.UserConstant;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.web.reactive.function.client.WebClient;
import reactor.core.publisher.Mono;
import reactor.util.retry.Retry;
Expand All @@ -16,6 +17,7 @@

import static no.nav.dolly.util.TokenXUtil.getUserJwt;

@Slf4j
@RequiredArgsConstructor
public class SykemeldingPostCommand implements Callable<Mono<SykemeldingResponse>> {

Expand All @@ -35,10 +37,10 @@ public Mono<SykemeldingResponse> call() {
.header(UserConstant.USER_HEADER_JWT, getUserJwt())
.bodyValue(request)
.retrieve()
.toBodilessEntity()
.timeout(Duration.ofMinutes(4))
.bodyToMono(SykemeldingResponseDTO.class)
.map(response -> SykemeldingResponse.builder()
.status(HttpStatus.valueOf(response.getStatusCode().value()))
.status(response.getStatus())
.msgId(response.getSykemeldingId())
.ident(request.getPasient().getIdent())
.sykemeldingRequest(SykemeldingResponse.SykemeldingRequest.builder()
.detaljertSykemeldingRequest(request)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import lombok.RequiredArgsConstructor;
import no.nav.dolly.bestilling.sykemelding.domain.SyntSykemeldingRequest;
import no.nav.dolly.bestilling.sykemelding.dto.SykemeldingResponse;
import no.nav.testnav.libs.dto.sykemelding.v1.SykemeldingResponseDTO;
import no.nav.testnav.libs.reactivecore.utils.WebClientFilter;
import no.nav.testnav.libs.securitycore.config.UserConstant;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.web.reactive.function.client.WebClient;
import reactor.core.publisher.Mono;
import reactor.util.retry.Retry;
Expand Down Expand Up @@ -34,10 +34,10 @@ public Mono<SykemeldingResponse> call() {
.header(UserConstant.USER_HEADER_JWT, getUserJwt())
.bodyValue(sykemeldingRequest)
.retrieve()
.toBodilessEntity()
.timeout(Duration.ofMinutes(4))
.bodyToMono(SykemeldingResponseDTO.class)
.map(response -> SykemeldingResponse.builder()
.status(HttpStatus.valueOf(response.getStatusCode().value()))
.status(response.getStatus())
.msgId(response.getSykemeldingId())
.ident(sykemeldingRequest.getIdent())
.sykemeldingRequest(SykemeldingResponse.SykemeldingRequest.builder()
.syntSykemeldingRequest(sykemeldingRequest)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class SykemeldingResponse {
private HttpStatus status;
private String avvik;
private SykemeldingRequest sykemeldingRequest;
private String msgId;
private String ident;

@Data
Expand All @@ -27,6 +28,7 @@ public class SykemeldingResponse {
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public static class SykemeldingRequest {

private String sykemeldingId;
private SyntSykemeldingRequest syntSykemeldingRequest;
private DetaljertSykemeldingRequest detaljertSykemeldingRequest;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import no.nav.testnav.libs.dto.kodeverkservice.v1.KodeverkDTO;
import no.nav.testnav.libs.reactivecore.utils.WebClientFilter;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.web.reactive.function.client.WebClient;
import reactor.core.publisher.Mono;
import reactor.util.retry.Retry;
Expand Down Expand Up @@ -31,6 +32,10 @@ public Mono<KodeverkDTO> call() {
.header(HttpHeaders.AUTHORIZATION, "Bearer " + token)
.retrieve()
.bodyToMono(KodeverkDTO.class)
.map(kodeverket -> {
kodeverket.setStatus(HttpStatus.OK);
return kodeverket;
})
.doOnError(WebClientFilter::logErrorMessage)
.onErrorResume(error -> Mono.just(KodeverkDTO.builder()
.kodeverknavn(kodeverk)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ public String getStatusMessage(String json) {
if (json.contains("{")) {
try {
Map<String, Object> status = objectMapper.readValue(json, Map.class);
if (status.containsKey(ERROR) && isNotBlank((String) status.get(ERROR))) {
builder.append("error=").append(status.get(ERROR)).append("; ");
} else if (status.containsKey(MESSAGE) && isNotBlank((String) status.get(MESSAGE))) {
if (status.containsKey(MESSAGE) && isNotBlank((String) status.get(MESSAGE))) {
builder.append("message=").append(encodeStatus((String) status.get(MESSAGE))).append("; ");
} else if (status.containsKey(ERROR) && isNotBlank((String) status.get(ERROR))) {
builder.append("error=").append(status.get(ERROR)).append("; ");
} else if (status.containsKey(MELDING) && isNotBlank((String) status.get(MELDING))) {
builder.append(encodeStatus((String) status.get(MELDING)));
} else if (status.containsKey(DETAILS) && status.get(DETAILS) instanceof List) {
Expand Down
6 changes: 6 additions & 0 deletions apps/dolly-backend/src/main/resources/application-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@ consumers:
testnav-pdl-forvalter:
name: testnav-pdl-forvalter-dev
url: http://testnav-pdl-forvalter-dev.dolly.svc.cluster.local
testnav-sykemelding-api:
name: testnav-sykemelding-api-dev
url: http://testnav-sykemelding-api-dev.dolly.svc.cluster.local
testnav-synt-sykemelding-api:
name: testnav-synt-sykemelding-api-dev
url: http://testnav-synt-sykemelding-api-dev.dolly.svc.cluster.local
6 changes: 4 additions & 2 deletions apps/dolly-backend/src/main/resources/application-local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@ consumers:
testnav-organisasjon-service:
url: https://testnav-organisasjon-service.intern.dev.nav.no
testnav-synt-sykemelding-api:
url: https://testnav-synt-sykemelding-api.intern.dev.nav.no
name: testnav-synt-sykemelding-api-dev
url: https://testnav-synt-sykemelding-api-dev.intern.dev.nav.no
testnav-sykemelding-api:
url: http://testnav-sykemelding-api.intern.dev.nav.no
name: testnav-sykemelding-api-dev
url: https://testnav-sykemelding-api-dev.intern.dev.nav.no
testnav-miljoer-service:
url: https://testnav-miljoer-service.intern.dev.nav.no
testnav-arbeidsplassencv-proxy:
Expand Down
Loading

0 comments on commit 1fbb776

Please sign in to comment.