Skip to content

Commit

Permalink
Merge branch 'master' into feature/dolly-sok-inkluder-opprettede-pers…
Browse files Browse the repository at this point in the history
…oner
  • Loading branch information
krharum authored Feb 21, 2025
2 parents 5c8593c + c46d73b commit b69624e
Show file tree
Hide file tree
Showing 33 changed files with 63 additions and 152 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@ name: Integration Tests
on:
push:
paths:
- 'apps/bruker-service/**'
- "apps/altinn3-tilgang-service/**"
- "apps/bruker-service/**"
- "mocks/maskinporten-mock/**"
- "mocks/tokendings-mock/**"
workflow_dispatch:

jobs:
bruker-service:
if: github.event.pull_request.draft == false
uses: ./.github/workflows/common.integration-test.yml
with:
working-directory: 'apps/bruker-service/'
healthcheck: 'http://localhost:8002/internal/isAlive'
working-directory: "apps/bruker-service/"
healthcheck: "http://localhost:8002/internal/isAlive"
secrets:
NAV_TOKEN: ${{ secrets.NAV_TOKEN }}
7 changes: 7 additions & 0 deletions apps/brreg-stub/99-dolly-set-vault-token.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env sh

#
# Load the contents of the NAIS provided Vault token into a Spring Boot friendly environment variable.
#
SPRING_CLOUD_VAULT_TOKEN=$(cat /var/run/secrets/nais.io/vault/vault_token)
export SPRING_CLOUD_VAULT_TOKEN
3 changes: 2 additions & 1 deletion apps/brreg-stub/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ LABEL maintainer="Team Dolly"

ENV JAVA_OPTS="-Dspring.profiles.active=prod"

COPY build/libs/app.jar app.jar
COPY /99-dolly-set-vault-token.sh /init-scripts/
COPY /build/libs/app.jar app.jar

EXPOSE 8080
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
package no.nav.brregstub;

import no.nav.dolly.libs.nais.NaisEnvironmentApplicationContextInitializer;
import no.nav.dolly.libs.vault.VaultTokenApplicationContextInitializer;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;


@SpringBootApplication
public class BrregApplicationLauncher {
public static void main(String[] args) {
new SpringApplicationBuilder(BrregApplicationLauncher.class)
.initializers(
new VaultTokenApplicationContextInitializer(),
new NaisEnvironmentApplicationContextInitializer())
.initializers(new NaisEnvironmentApplicationContextInitializer())
.run(args);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
public class LagreAlderspensjonCommand implements Callable<Flux<PensjonforvalterResponse>> {

private static final String PENSJON_AP_VEDTAK_URL = "/api/v4/vedtak/ap";
private static final String PENSJON_AP_SOKNAD_URL = "/api/v3/vedtak/ap/soknad";
private static final String PENSJON_AP_SOKNAD_URL = "/api/v4/vedtak/ap/soknad";

private final WebClient webClient;

Expand Down Expand Up @@ -77,4 +77,4 @@ public Flux<PensjonforvalterResponse> call() {
.toList())
.build()));
}
}
}
2 changes: 1 addition & 1 deletion apps/dolly-backend/src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<encoder class="no.nav.testnav.libs.servletcore.logging.TestnavLogbackEncoder">
<maxStackTraceLength>-1</maxStackTraceLength>
<addCauses>true</addCauses>
<stackTraceIncludePrefix>-</stackTraceIncludePrefix>
<!-- <stackTraceIncludePrefix>-</stackTraceIncludePrefix>-->
<!-- <throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">-->
<!-- <rootCauseFirst>true</rootCauseFirst>-->
<!-- -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default ({ onSubmit, loading = false }: Props) => {
<DollySelect
name="kommunenummer"
label="Kommunenummer"
kodeverk={AdresseKodeverk.Kommunenummer2024}
kodeverk={AdresseKodeverk.Kommunenummer}
size="grow"
value={kommunenummer}
onChange={(e: any) => setKommunenummer(e ? e.value : null)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default ({ onSubmit, loading = false }: Props) => {
<DollySelect
name="kommunenummer"
label="Kommunenummer"
kodeverk={AdresseKodeverk.Kommunenummer2024}
kodeverk={AdresseKodeverk.Kommunenummer}
size="grow"
value={kommunenummer}
onChange={(e: any) => setKommunenummer(e ? e.value : null)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const Adresser = ({ formMethods, path }: AdresserProps) => {
<FormSelect
name={`${path}.forretningsadresse.kommunenr`}
label="Kommunenummer"
kodeverk={AdresseKodeverk.Kommunenummer2024}
kodeverk={AdresseKodeverk.Kommunenummer}
size="large"
/>
</>
Expand Down Expand Up @@ -100,7 +100,7 @@ export const Adresser = ({ formMethods, path }: AdresserProps) => {
<FormSelect
name={`${path}.postadresse.kommunenr`}
label="Kommunenummer"
kodeverk={AdresseKodeverk.Kommunenummer2024}
kodeverk={AdresseKodeverk.Kommunenummer}
size="large"
/>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const Matrikkeladresse = ({ path }: MatrikkeladresseValues) => {
<FormSelect
name={`${path}.kommunenummer`}
label="Kommunenummer"
kodeverk={AdresseKodeverk.Kommunenummer2024}
kodeverk={AdresseKodeverk.Kommunenummer}
size="large"
isClearable={false}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const UkjentBosted = ({ path }: UkjentBostedValues) => {
<FormSelect
name={`${path}.bostedskommune`}
label="Bostedskommune"
kodeverk={AdresseKodeverk.Kommunenummer2024}
kodeverk={AdresseKodeverk.Kommunenummer}
size="large"
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const VegadresseVelger = ({ formMethods, path }: VegadressevelgerValues)
<FormSelect
name={`${path}.kommunenummer`}
label="Kommunenummer"
kodeverk={AdresseKodeverk.Kommunenummer2024}
kodeverk={AdresseKodeverk.Kommunenummer}
size="large"
isClearable={false}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const FoedestedForm = ({ formMethods, path }: FoedestedTypes) => {
<FormSelect
name={`${path}.foedekommune`}
label="Fødekommune"
kodeverk={AdresseKodeverk.Kommunenummer2024}
kodeverk={AdresseKodeverk.Kommunenummer}
size="large"
isDisabled={
formMethods.watch(`${path}.foedeland`) !== 'NOR' &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const FoedselForm = ({ formMethods, path }: FoedselTypes) => {
<FormSelect
name={`${path}.foedekommune`}
label="Fødekommune"
kodeverk={AdresseKodeverk.Kommunenummer2024}
kodeverk={AdresseKodeverk.Kommunenummer}
size="large"
isDisabled={
formMethods.watch(`${path}.foedeland`) !== 'NOR' &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export enum AdresseKodeverk {
Postnummer = 'Postnummer',
PostnummerUtenPostboks = 'Postnummer vegadresser',
Kommunenummer = 'Kommuner',
Kommunenummer2024 = 'Kommuner2024',

PostadresseLand = 'LandAdresserFreg',
StatsborgerskapLand = 'StatsborgerskapFreg',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const EnhetsregisteretForetaksregisteret = ({ handleChange }: any) => {
<FormSelect
name="forretningsadresse.kommunenummer"
label="Kommunenummer"
kodeverk={AdresseKodeverk.Kommunenummer2024}
kodeverk={AdresseKodeverk.Kommunenummer}
size={'large'}
onChange={(val: Option) =>
handleChange(val?.value || null, 'forretningsadresse.kommunenummer')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const FolkeregisteretAdresse = ({ handleChange }: any) => {
<FormSelect
name="adresser.kommunenummer"
label="Kommunenummer"
kodeverk={AdresseKodeverk.Kommunenummer2024}
kodeverk={AdresseKodeverk.Kommunenummer}
onChange={(val: Option) => handleChange(val?.value, 'adresser.kommunenummer')}
size="large"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export const SortKodeverkArray = (data) => {
data.name === 'Postnummer' ||
data.name === 'Postnummer vegadresser' ||
data.name === 'Kommuner' ||
data.name === 'Kommuner2024' ||
data.name === 'Bydeler' ||
data.name === 'Næringskoder' ||
data.name === 'Sektorkoder'
Expand Down
5 changes: 3 additions & 2 deletions apps/kodeverk-service/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Testnav-Kodeverk-Service
Henter, formatterer, og cacher data fra felles kodeverk.</br>
Lagt til eget kodeverk, Kommuner2024, som henter Kommuner og fjerner gamle kommunenummere

Henter, formatterer, og cacher data fra felles kodeverk

## Lokal kjøring

* [Generelt.](../../docs/local_general.md)
* [Secret Manager.](../../docs/local_secretmanager.md)
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import no.nav.testnav.kodeverkservice.config.Consumers;
import no.nav.testnav.kodeverkservice.consumer.command.KodeverkGetCommand;
import no.nav.testnav.kodeverkservice.dto.KodeverkBetydningerResponse;
import no.nav.testnav.kodeverkservice.utility.FilterUtility;
import no.nav.testnav.libs.securitycore.domain.ServerProperties;
import no.nav.testnav.libs.standalone.servletsecurity.exchange.TokenExchange;
import org.springframework.stereotype.Service;
Expand Down Expand Up @@ -41,7 +40,7 @@ public Mono<KodeverkBetydningerResponse> getKodeverk(String kodeverk) {

return tokenService.exchange(serverProperties)
.flatMap(token -> new KodeverkGetCommand(webClient,
FilterUtility.hentKodeverk(kodeverk),
kodeverk,
token.getTokenValue()).call());
}
}

This file was deleted.

2 changes: 1 addition & 1 deletion apps/kodeverk-service/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
spring:
application:
name: testnav-kodeverk-service
description: Tjeneste for å hente fra felles kodeverk.</br>Lagt til eget kodeverk, Kommuner2024, som henter Kommuner og fjerner gamle kommunenummere.
description: Tjeneste for å hente fra felles kodeverk.
security:
oauth2:
resourceserver:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class KodeverkConsumer {

private static final String POSTNUMMER = "Postnummer";
private static final String LANDKODER = "Landkoder";
private static final String KOMMUNER = "Kommuner2024";
private static final String KOMMUNER = "Kommuner";
private static final String EMBETER = "Vergemål_Fylkesmannsembeter";
private static final Random random = new SecureRandom();

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

SERVICEUSER_USERNAME=$(cat /var/run/secrets/nais.io/serviceuser/password)
export SERVICEUSER_USERNAME

SERVICEUSER_PASSWORD=$(cat /secret/serviceuser/password)
export SERVICEUSER_PASSWORD
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env sh

#
# Load the contents of the NAIS provided Vault token into a Spring Boot friendly environment variable.
#
SPRING_CLOUD_VAULT_TOKEN=$(cat /var/run/secrets/nais.io/vault/vault_token)
export SPRING_CLOUD_VAULT_TOKEN
3 changes: 2 additions & 1 deletion apps/testnorge-statisk-data-forvalter/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM ghcr.io/navikt/baseimages/temurin:21
LABEL maintainer="Team Dolly"

COPY /init.sh /init-scripts/init.sh
COPY /98-dolly-set-serviceuser.sh /init-scripts/
COPY /99-dolly-set-vault-token.sh /init-scripts/
COPY /build/libs/app.jar /app/app.jar

ENV JAVA_OPTS="-Dspring.profiles.active=prod"
Expand Down
4 changes: 0 additions & 4 deletions apps/testnorge-statisk-data-forvalter/init.sh

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
package no.nav.registre.sdforvalter;

import no.nav.dolly.libs.nais.NaisEnvironmentApplicationContextInitializer;
import no.nav.dolly.libs.vault.VaultTokenApplicationContextInitializer;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;

@SpringBootApplication
public class StatiskDataForvalterApplicationStarter {
public static void main(String[] args) {
new SpringApplicationBuilder(StatiskDataForvalterApplicationStarter.class)
.initializers(
new VaultTokenApplicationContextInitializer(),
new NaisEnvironmentApplicationContextInitializer()
)
.initializers(new NaisEnvironmentApplicationContextInitializer())
.run(args);
}
}
7 changes: 7 additions & 0 deletions apps/udi-stub/99-dolly-set-vault-token.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env sh

#
# Load the contents of the NAIS provided Vault token into a Spring Boot friendly environment variable.
#
SPRING_CLOUD_VAULT_TOKEN=$(cat /var/run/secrets/nais.io/vault/vault_token)
export SPRING_CLOUD_VAULT_TOKEN
3 changes: 2 additions & 1 deletion apps/udi-stub/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ LABEL maintainer="Team Dolly"

ENV JAVA_OPTS="-Dspring.profiles.active=prod --add-opens java.base/java.lang=ALL-UNNAMED"

COPY build/libs/app.jar app.jar
COPY /99-dolly-set-vault-token.sh /init-scripts/
COPY /build/libs/app.jar app.jar

EXPOSE 8080
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
package no.nav.udistub;

import no.nav.dolly.libs.nais.NaisEnvironmentApplicationContextInitializer;
import no.nav.dolly.libs.vault.VaultTokenApplicationContextInitializer;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;

@SpringBootApplication
public class UdiStubApplicationStarter {
public static void main(String[] args) {
new SpringApplicationBuilder(UdiStubApplicationStarter.class)
.initializers(
new VaultTokenApplicationContextInitializer(),
new NaisEnvironmentApplicationContextInitializer()
)
.initializers(new NaisEnvironmentApplicationContextInitializer())
.run(args);
}
}

This file was deleted.

Loading

0 comments on commit b69624e

Please sign in to comment.