Skip to content

Commit

Permalink
Merge branch 'master' into feature/tps-messaging-legge-til-kilde-i-pr…
Browse files Browse the repository at this point in the history
…olog
  • Loading branch information
krharum committed Apr 24, 2024
2 parents 3550757 + b64e52d commit 0fa7790
Show file tree
Hide file tree
Showing 149 changed files with 1,123 additions and 1,633 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/proxy.arbeidsplassencv-proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: ./.github/workflows/common.workflow.backend.yml
with:
working-directory: "proxies/arbeidsplassencv-proxy"
deploy-tag: "#deploy-arbeidsplassencv-proxy"
deploy-tag: "#deploy-proxy"
permissions:
contents: read
id-token: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/proxy.inst-proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
with:
cluster: "dev-fss"
working-directory: "proxies/inst-proxy"
deploy-tag: "#deploy-inst-proxy"
deploy-tag: "#deploy-proxy"
permissions:
contents: read
id-token: write
Expand Down
5 changes: 3 additions & 2 deletions apps/adresse-service/src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<configuration>
<springProfile name="prod">
<appender name="stdout_json" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="net.logstash.logback.encoder.LogstashEncoder">
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="no.nav.testnav.libs.servletcore.logging.TestnavLogbackLayout"/>
<throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
<rootCauseFirst>true</rootCauseFirst>
<maxDepthPerThrowable>256</maxDepthPerThrowable>
Expand Down Expand Up @@ -35,5 +36,5 @@
<appender-ref ref="CONSOLE"/>
</root>
</springProfile>
<logger level="TRACE" name="no.nav.testnav.libs.servletcore.logging.LogRequestInterceptor" />
<logger level="TRACE" name="no.nav.testnav.libs.servletcore.logging.LogRequestInterceptor"/>
</configuration>
3 changes: 2 additions & 1 deletion apps/amelding-service/src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<configuration>
<springProfile name="prod">
<appender name="stdout_json" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="net.logstash.logback.encoder.LogstashEncoder">
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="no.nav.testnav.libs.reactivecore.logging.TestnavLogbackLayout"/>
<throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
<rootCauseFirst>true</rootCauseFirst>
<maxDepthPerThrowable>256</maxDepthPerThrowable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<configuration>
<springProfile name="prod">
<appender name="stdout_json" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="net.logstash.logback.encoder.LogstashEncoder">
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="no.nav.testnav.libs.reactivecore.logging.TestnavLogbackLayout"/>
<throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
<rootCauseFirst>true</rootCauseFirst>
<maxDepthPerThrowable>256</maxDepthPerThrowable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<configuration>
<springProfile name="prod">
<appender name="stdout_json" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="net.logstash.logback.encoder.LogstashEncoder">
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="no.nav.testnav.libs.servletcore.logging.TestnavLogbackLayout"/>
<throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
<rootCauseFirst>true</rootCauseFirst>
<maxDepthPerThrowable>256</maxDepthPerThrowable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<configuration>
<springProfile name="prod">
<appender name="stdout_json" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="net.logstash.logback.encoder.LogstashEncoder">
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="no.nav.testnav.libs.servletcore.logging.TestnavLogbackLayout"/>
<throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
<rootCauseFirst>true</rootCauseFirst>
<maxDepthPerThrowable>256</maxDepthPerThrowable>
Expand Down
3 changes: 2 additions & 1 deletion apps/brreg-stub/src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<configuration>
<springProfile name="prod">
<appender name="stdout_json" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="net.logstash.logback.encoder.LogstashEncoder">
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="no.nav.testnav.libs.servletcore.logging.TestnavLogbackLayout"/>
<throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
<rootCauseFirst>true</rootCauseFirst>
<maxDepthPerThrowable>256</maxDepthPerThrowable>
Expand Down
6 changes: 4 additions & 2 deletions apps/bruker-service/src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<configuration>
<springProfile name="prod">
<appender name="stdout_json" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="net.logstash.logback.encoder.LogstashEncoder">
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="no.nav.testnav.libs.reactivecore.logging.TestnavLogbackLayout"/>
<throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
<rootCauseFirst>true</rootCauseFirst>
<maxDepthPerThrowable>256</maxDepthPerThrowable>
Expand All @@ -24,7 +25,8 @@

<springProfile name="dev">
<appender name="stdout_json" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="net.logstash.logback.encoder.LogstashEncoder">
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="no.nav.testnav.libs.reactivecore.logging.TestnavLogbackLayout"/>
<throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
<rootCauseFirst>true</rootCauseFirst>
<maxDepthPerThrowable>256</maxDepthPerThrowable>
Expand Down
3 changes: 2 additions & 1 deletion apps/budpro-service/src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<configuration>
<springProfile name="prod,dev">
<appender name="stdout_json" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="net.logstash.logback.encoder.LogstashEncoder">
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="no.nav.testnav.libs.servletcore.logging.TestnavLogbackLayout"/>
<throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
<rootCauseFirst>true</rootCauseFirst>
<maxDepthPerThrowable>256</maxDepthPerThrowable>
Expand Down
2 changes: 0 additions & 2 deletions apps/dolly-backend/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ spec:
- application: testnav-oversikt-frontend
- application: etterlatte-testdata
namespace: etterlatte
- application: statuspoll
namespace: navdig
outbound:
rules:
- application: generer-navn-service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import no.nav.dolly.bestilling.ConsumerStatus;
import no.nav.dolly.bestilling.tpsmessagingservice.command.EgenansattDeleteCommand;
import no.nav.dolly.bestilling.tpsmessagingservice.command.EgenansattPostCommand;
import no.nav.dolly.bestilling.tpsmessagingservice.command.PersonGetCommand;
import no.nav.dolly.bestilling.tpsmessagingservice.command.PersonHentCommand;
import no.nav.dolly.bestilling.tpsmessagingservice.command.TpsMessagingPostCommand;
import no.nav.dolly.config.Consumers;
import no.nav.dolly.metrics.Timed;
Expand Down Expand Up @@ -52,7 +52,7 @@ public TpsMessagingConsumer(
.build();
}

@Timed(name = "providers", tags = {"operation", "tps_messaging_createUtenlandskBankkonto"})
@Timed(name = "providers", tags = { "operation", "tps_messaging_createUtenlandskBankkonto" })
public Flux<TpsMeldingResponseDTO> sendUtenlandskBankkontoRequest(String ident, List<String> miljoer,
BankkontonrUtlandDTO body) {

Expand All @@ -61,42 +61,42 @@ public Flux<TpsMeldingResponseDTO> sendUtenlandskBankkontoRequest(String ident,
new TpsMessagingPostCommand(webClient, ident, miljoer, body, UTENLANDSK_BANKKONTO_URL, token.getTokenValue()).call());
}

@Timed(name = "providers", tags = {"operation", "tps_messaging_createNorskBankkonto"})
@Timed(name = "providers", tags = { "operation", "tps_messaging_createNorskBankkonto" })
public Flux<TpsMeldingResponseDTO> sendNorskBankkontoRequest(String ident, List<String> miljoer, BankkontonrNorskDTO body) {

return tokenService.exchange(serverProperties)
.flatMapMany(token ->
new TpsMessagingPostCommand(webClient, ident, miljoer, body, NORSK_BANKKONTO_URL, token.getTokenValue()).call());
}

@Timed(name = "providers", tags = {"operation", "tps_messaging_createSkjerming"})
@Timed(name = "providers", tags = { "operation", "tps_messaging_createSkjerming" })
public Flux<TpsMeldingResponseDTO> sendEgenansattRequest(String ident, List<String> miljoer, LocalDate fraOgMed) {

return tokenService.exchange(serverProperties)
.flatMapMany(token ->
new EgenansattPostCommand(webClient, ident, miljoer, fraOgMed, token.getTokenValue()).call());
}

@Timed(name = "providers", tags = {"operation", "tps_messaging_deleteSkjerming"})
@Timed(name = "providers", tags = { "operation", "tps_messaging_deleteSkjerming" })
public Flux<TpsMeldingResponseDTO> deleteEgenansattRequest(String ident, List<String> miljoer) {

return tokenService.exchange(serverProperties)
.flatMapMany(token -> new EgenansattDeleteCommand(webClient, ident, miljoer, token.getTokenValue()).call());
}

@Timed(name = "providers", tags = {"operation", "tps_messaging_createSpraakkode"})
@Timed(name = "providers", tags = { "operation", "tps_messaging_createSpraakkode" })
public Flux<TpsMeldingResponseDTO> sendSpraakkodeRequest(String ident, List<String> miljoer, SpraakDTO body) {

return tokenService.exchange(serverProperties)
.flatMapMany(token ->
new TpsMessagingPostCommand(webClient, ident, miljoer, body, SPRAAKKODE_URL, token.getTokenValue()).call());
}

@Timed(name = "providers", tags = {"operation", "tps_messaging_getPerson"})
@Timed(name = "providers", tags = { "operation", "tps_messaging_getPerson" })
public Flux<PersonMiljoeDTO> getPerson(String ident, List<String> miljoer) {

return tokenService.exchange(serverProperties)
.flatMapMany(token -> new PersonGetCommand(webClient, ident, miljoer, token.getTokenValue()).call());
.flatMapMany(token -> new PersonHentCommand(webClient, ident, miljoer, token.getTokenValue()).call());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

@RequiredArgsConstructor
@Slf4j
public class PersonGetCommand implements Callable<Flux<PersonMiljoeDTO>> {
public class PersonHentCommand implements Callable<Flux<PersonMiljoeDTO>> {

private static final String MILJOER_PARAM = "miljoer";
private static final String PERSONER_URL = "/api/v1/personer/{ident}";
private static final String PERSONER_URL = "/api/v2/personer/ident";

private final WebClient webClient;
private final String ident;
Expand All @@ -27,11 +27,12 @@ public class PersonGetCommand implements Callable<Flux<PersonMiljoeDTO>> {
@Override
public Flux<PersonMiljoeDTO> call() {

return webClient.get()
return webClient.post()
.uri(uriBuilder -> uriBuilder
.path(PERSONER_URL)
.queryParam(MILJOER_PARAM, miljoer)
.build(ident))
.build())
.bodyValue(ident)
.header(HttpHeaders.AUTHORIZATION, "Bearer " + token)
.retrieve()
.bodyToFlux(PersonMiljoeDTO.class)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
package no.nav.dolly.domain;

import com.fasterxml.jackson.databind.JsonNode;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

import static java.util.Objects.isNull;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class PdlPersonBolk {

private Data data;
private Extensions extensions;
private JsonNode extensions;

@lombok.Data
@Builder
Expand All @@ -30,36 +28,6 @@ public static class Data {
private List<IdenterBolk> hentIdenterBolk;
}

@lombok.Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public static class Extensions {

private List<Warning> warnings;

public List<Warning> getWarnings() {

if (isNull(warnings)) {
warnings = new ArrayList<>();
}
return warnings;
}
}

@lombok.Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public static class Warning {

private String code;
private String details;
private String id;
private String message;
private String query;
}

@lombok.Data
@Builder
@NoArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import no.nav.testnav.libs.servletsecurity.action.GetUserInfo;
import org.apache.commons.collections4.IterableUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.cache.CacheManager;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
Expand All @@ -33,6 +34,7 @@

import static java.util.Objects.isNull;
import static java.util.Objects.nonNull;
import static no.nav.dolly.config.CachingConfig.CACHE_BESTILLING_MAL;
import static no.nav.dolly.util.CurrentAuthentication.getUserId;

@Service
Expand All @@ -49,6 +51,7 @@ public class MalBestillingService {
private final MapperFacade mapperFacade;
private final GetUserInfo getUserInfo;
private final ObjectMapper objectMapper;
private final CacheManager cacheManager;

@Transactional(readOnly = true)
public RsMalBestillingWrapper getMalBestillinger() {
Expand Down Expand Up @@ -138,6 +141,8 @@ public void saveBestillingMal(Bestilling bestilling, String malNavn, Bruker bruk
oppdateEksisterende.setBestKriterier(bestilling.getBestKriterier());
oppdateEksisterende.setMiljoer(bestilling.getMiljoer());
}

cacheManager.getCache(CACHE_BESTILLING_MAL).clear();
}

@Transactional
Expand Down
15 changes: 8 additions & 7 deletions apps/dolly-backend/src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<configuration>
<springProfile name="prod,dev">
<appender name="stdout_json" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="net.logstash.logback.encoder.LogstashEncoder">
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="no.nav.testnav.libs.servletcore.logging.TestnavLogbackLayout"/>
<throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
<rootCauseFirst>true</rootCauseFirst>
<maxDepthPerThrowable>256</maxDepthPerThrowable>
Expand Down Expand Up @@ -37,10 +38,10 @@
</root>
</springProfile>

<logger level="TRACE" name="no.nav.testnav.libs.reactivecore.filter.RequestLogger" />
<logger level="TRACE" name="no.nav.testnav.libs.servletcore.logging.LogRequestInterceptor" />
<logger level="TRACE" name="org.jetbrains.nativecerts" />
<logger level="TRACE" name="com.intellij.util.net.ssl" />
<logger level="ERROR" name="reactor.netty.transport.TransportConnector" />
<logger level="DEBUG" name="reactor.netty.http.client.HttpClient" />
<logger level="TRACE" name="no.nav.testnav.libs.reactivecore.filter.RequestLogger"/>
<logger level="TRACE" name="no.nav.testnav.libs.servletcore.logging.LogRequestInterceptor"/>
<logger level="TRACE" name="org.jetbrains.nativecerts"/>
<logger level="TRACE" name="com.intellij.util.net.ssl"/>
<logger level="ERROR" name="reactor.netty.transport.TransportConnector"/>
<logger level="DEBUG" name="reactor.netty.http.client.HttpClient"/>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const GjenopprettPerson = ({ ident }: GjenopprettProps) => {
return (
<>
<Button onClick={openGjenopprettModal} kind="synchronize">
GJENOPPRETT PERSON
GJENOPPRETT
</Button>
{isGjenopprettModalOpen && (
<GjenopprettModal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export default function BestillingSammendrag({ bestilling }) {
sistOppdatert: bestilling.sistOppdatert,
opprettetFraId: bestilling.opprettetFraId,
opprettetFraGruppeId: bestilling.opprettetFraGruppeId,
navSyntetiskIdent: bestilling.bestilling.pdldata?.opprettNyPerson?.syntetisk,
beskrivelse: bestilling.bestilling.beskrivelse,
navSyntetiskIdent: bestilling?.bestilling?.pdldata?.opprettNyPerson?.syntetisk,
beskrivelse: bestilling?.bestilling?.beskrivelse,
}}
header="Bestillingskriterier"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const Bestillingsveileder = ({ error, sendBestilling }) => {
const navigate = useNavigate()
const [showError, setShowError] = useState(false)
const [navigateRoot, setNavigateRoot] = useState(false)
const { gruppeId, personId } = useParams()
const { gruppeId } = useParams()
const erOrganisasjon = location?.state?.opprettOrganisasjon
const importPersoner = location?.state?.importPersoner

Expand Down Expand Up @@ -46,7 +46,7 @@ export const Bestillingsveileder = ({ error, sendBestilling }) => {
return null
}

const options = BVOptions(location.state, gruppeId, personId)
const options = BVOptions(location.state, gruppeId)
const handleSubmit = (values) => {
sendBestilling(values, options, gruppeId, navigate)
}
Expand Down
Loading

0 comments on commit 0fa7790

Please sign in to comment.