Skip to content

Commit

Permalink
Merge branch 'master' into bugfix/altinn3-tilgang
Browse files Browse the repository at this point in the history
  • Loading branch information
krharum committed Dec 19, 2024
2 parents bff29b5 + 1a967b5 commit f551b77
Show file tree
Hide file tree
Showing 90 changed files with 714 additions and 276 deletions.
2 changes: 2 additions & 0 deletions apps/brreg-stub/docker-compose.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SELECT 'CREATE DATABASE "testnav-brregstub"'
WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'testnav-brregstub')\gexec
11 changes: 11 additions & 0 deletions apps/brreg-stub/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
services:

postgresql:
image: postgres
network_mode: host
shm_size: 128mb
environment:
POSTGRES_PASSWORD: ""
POSTGRES_HOST_AUTH_METHOD: trust
volumes:
- ./docker-compose.sql:/docker-entrypoint-initdb.d/init.sql
28 changes: 28 additions & 0 deletions apps/dolly-backend/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
services:

cloud_sql_proxy:
image: gcr.io/cloud-sql-connectors/cloud-sql-proxy:2.14.2
network_mode: host
command:
- "dolly-dev-ff83:europe-north1:testnav-dolly-backend-local"
- "--credentials-file=/application_default_credentials.json"
- "--run-connection-test"
volumes:
- type: bind
# Set a variable $DOLLY_APPLICATION_CREDENTIALS. We don't use
# GOOGLE_APPLICATION_CREDENTIALS, as this causes an extra step during login.
#
# - $HOME/.config/gcloud/application_default_credentials.json for Linux/macOS.
# - $APPDATA/gcloud/application_default_credentials.json for Windows.
source: $DOLLY_APPLICATION_CREDENTIALS
target: /application_default_credentials.json

opensearch:
image: opensearchproject/opensearch:latest
ports:
- "9200:9200"
- "9600:9600"
environment:
discovery.type: single-node
plugins.security.disabled: "true"
OPENSEARCH_INITIAL_ADMIN_PASSWORD: YLAgOm}rz#o6#Aq
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import no.nav.dolly.mapper.MappingStrategy;
import org.springframework.stereotype.Component;

import static java.util.Objects.nonNull;
import static no.nav.dolly.domain.resultset.inst.TssEksternId.ADAMSTUEN_SYKEHJEM;
import static no.nav.dolly.domain.resultset.inst.TssEksternId.HELGELANDSSYKEHUSET_HF;
import static no.nav.dolly.domain.resultset.inst.TssEksternId.INDRE_OSTFOLD_FENGSEL;
Expand All @@ -29,12 +28,6 @@ public void mapAtoB(RsInstdata rsInstdata, Instdata instdata, MappingContext con
instdata.setNorskident((String) context.getProperty("ident"));
instdata.setRegistrertAv("Dolly");

if (nonNull(rsInstdata.getForventetSluttdato())) {
instdata.setSluttdato(rsInstdata.getForventetSluttdato().toLocalDate());
}
if (nonNull(rsInstdata.getFaktiskSluttdato())) {
instdata.setSluttdato(rsInstdata.getFaktiskSluttdato().toLocalDate());
}
instdata.setOppholdstype(nullcheckSetDefaultValue(rsInstdata.getKategori(),
decideKategori(instdata.getInstitusjonstype())).name());
instdata.setTssEksternId(nullcheckSetDefaultValue(instdata.getTssEksternId(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class Instdata {

private LocalDate startdato;
private LocalDate sluttdato;
private LocalDate forventetSluttdato;

private String registrertAv;
}
Original file line number Diff line number Diff line change
Expand Up @@ -1722,6 +1722,7 @@ const mapInst = (bestillingData, data) => {
institusjonstype: i.institusjonstype,
varighet: i.varighet,
startdato: i.startdato,
forventetSluttdato: i.forventetSluttdato,
sluttdato: i.sluttdato,
})
})
Expand All @@ -1739,6 +1740,7 @@ const mapInst = (bestillingData, data) => {
obj('Institusjonstype', showLabel('institusjonstype', inst.institusjonstype)),
obj('Varighet', inst.varighet && showLabel('varighet', inst.varighet)),
obj('Startdato', formatDate(inst.startdato)),
obj('Forventet sluttdato', formatDate(inst.forventetSluttdato)),
obj('Sluttdato', formatDate(inst.sluttdato)),
])
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ InstitusjonsoppholdPanel.initialValues = ({ set, del, has }) => ({
{
institusjonstype: runningE2ETest() ? 'AS' : '',
startdato: runningE2ETest() ? new Date() : '',
forventetSluttdato: '',
sluttdato: '',
},
])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { useFormContext } from 'react-hook-form'
export const initialValues = {
institusjonstype: '',
startdato: '',
forventetSluttdato: '',
sluttdato: '',
}
export const instAttributt = 'instdata'
Expand Down Expand Up @@ -56,6 +57,12 @@ export const InstForm = () => {
excludeDates={excludeDates}
maxDate={maxDate}
/>
<FormDatepicker
name={`${path}.forventetSluttdato`}
label="Forventet sluttdato"
excludeDates={excludeDates}
maxDate={maxDate}
/>
<FormDatepicker
name={`${path}.sluttdato`}
label="Sluttdato"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export const validation = {
Yup.object({
institusjonstype: requiredString,
startdato: datoOverlapperIkkeAndreOppholdTest(requiredDate, true),
forventetSluttdato: Yup.string().nullable(),
sluttdato: datoOverlapperIkkeAndreOppholdTest(Yup.string().nullable(), false),
}),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ export const InstVisning = ({ data, loading, bestillingIdListe, tilgjengeligMilj
value={showLabel('institusjonstype', opphold.institusjonstype)}
/>
<TitleValue title="Startdato" value={formatStringDates(opphold.startdato)} />
<TitleValue
title="Forventet sluttdato"
value={formatStringDates(opphold.forventetSluttdato)}
/>
<TitleValue title="Sluttdato" value={formatStringDates(opphold.sluttdato)} />
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ spring:
application:
version: application.version.todo #TODO Finn ut hvordan denne kan settes fra gradle
name: endringsmelding-service
desciption: Tjeneste for å sende endringsmeldinger
description: Tjeneste for å sende endringsmeldinger
security:
oauth2:
resourceserver:
Expand Down
11 changes: 11 additions & 0 deletions apps/oppsummeringsdokument-service/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
services:

opensearch:
image: opensearchproject/opensearch:latest
ports:
- "9200:9200"
- "9600:9600"
environment:
discovery.type: single-node
plugins.security.disabled: "true"
OPENSEARCH_INITIAL_ADMIN_PASSWORD: YLAgOm}rz#o6#Aq
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

@Profile("prod")
@Configuration
public class OpensearchConfig extends AbstractOpenSearchConfiguration {
public class OpenSearchConfig extends AbstractOpenSearchConfiguration {

@Value("${open.search.username}")
private String username;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package no.nav.testnav.apps.oppsummeringsdokumentservice.config;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.opensearch.client.RestHighLevelClient;
import org.opensearch.data.client.orhlc.AbstractOpenSearchConfiguration;
Expand All @@ -9,13 +8,12 @@
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories;

import java.time.Duration;

@Slf4j
@Configuration
@Profile("dev")
@Profile("local")
public class OpenSearchLocalConfig extends AbstractOpenSearchConfiguration {

@Value("${open.search.uri}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

@EnableWebSecurity
@Configuration
@Profile({ "prod", "dev" })
@Profile({ "prod", "local" })
public class SecurityConfig {

@Bean
Expand Down
18 changes: 18 additions & 0 deletions apps/organisasjon-forvalter/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
services:

cloud_sql_proxy:
image: gcr.io/cloud-sql-connectors/cloud-sql-proxy:2.14.2
network_mode: host
command:
- "dolly-dev-ff83:europe-north1:testnav-organisasjon-forvalter-local"
- "--credentials-file=/application_default_credentials.json"
- "--run-connection-test"
volumes:
- type: bind
# Set a variable $DOLLY_APPLICATION_CREDENTIALS. We don't use
# GOOGLE_APPLICATION_CREDENTIALS, as this causes an extra step during login.
#
# - $HOME/.config/gcloud/application_default_credentials.json for Linux/macOS.
# - $APPDATA/gcloud/application_default_credentials.json for Windows.
source: $DOLLY_APPLICATION_CREDENTIALS
target: /application_default_credentials.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ spring:
application:
version: application.version.todo
name: testnav-organisasjon-tilgang-service
desciption: Tjeneste for hente og sette tilganger for orgnisasjoner
description: Tjeneste for hente og sette tilganger for orgnisasjoner
security:
oauth2:
resourceserver:
Expand Down
18 changes: 18 additions & 0 deletions apps/pdl-forvalter/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
services:

cloud_sql_proxy:
image: gcr.io/cloud-sql-connectors/cloud-sql-proxy:2.14.2
network_mode: host
command:
- "dolly-dev-ff83:europe-north1:testnav-pdl-forvalter-local"
- "--credentials-file=/application_default_credentials.json"
- "--run-connection-test"
volumes:
- type: bind
# Set a variable $DOLLY_APPLICATION_CREDENTIALS. We don't use
# GOOGLE_APPLICATION_CREDENTIALS, as this causes an extra step during login.
#
# - $HOME/.config/gcloud/application_default_credentials.json for Linux/macOS.
# - $APPDATA/gcloud/application_default_credentials.json for Windows.
source: $DOLLY_APPLICATION_CREDENTIALS
target: /application_default_credentials.json
11 changes: 11 additions & 0 deletions apps/person-search-service/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
services:

opensearch:
image: opensearchproject/opensearch:latest
ports:
- "9200:9200"
- "9600:9600"
environment:
discovery.type: single-node
plugins.security.disabled: "true"
OPENSEARCH_INITIAL_ADMIN_PASSWORD: YLAgOm}rz#o6#Aq
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

@EnableWebSecurity
@Configuration
@Profile({ "prod", "dev" })
@Profile({ "prod", "local" })
public class SecurityConfig {

@Bean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
AZURE_APP_CLIENT_ID: ${sm://azure-app-client-id}
AZURE_APP_CLIENT_SECRET: ${sm://azure-app-client-secret}
TOKEN_X_ISSUER: https://tokenx.dev-gcp.nav.cloud.nais.io

spring:
config:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package no.nav.registre.testnorge.profil.service;

import lombok.extern.slf4j.Slf4j;
import no.nav.testnav.libs.securitycore.domain.azuread.AzureClientCredential;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
Expand All @@ -15,21 +16,19 @@

import no.nav.testnav.libs.securitycore.command.azuread.OnBehalfOfExchangeCommand;
import no.nav.testnav.libs.securitycore.domain.AccessToken;
import no.nav.testnav.libs.securitycore.domain.azuread.AzureNavClientCredential;
import no.nav.testnav.libs.securitycore.domain.azuread.ClientCredential;
import no.nav.testnav.libs.servletsecurity.action.GetAuthenticatedToken;

@Slf4j
@Service
public class AzureAdTokenService {
private final WebClient webClient;
private final ClientCredential clientCredential;
private final AzureClientCredential clientCredential;
private final GetAuthenticatedToken getAuthenticatedToken;

public AzureAdTokenService(
@Value("${http.proxy:#{null}}") String proxyHost,
@Value("${AAD_ISSUER_URI}") String issuerUrl,
AzureNavClientCredential clientCredential,
AzureClientCredential clientCredential,
GetAuthenticatedToken getAuthenticatedToken
) {
log.info("Init custom AzureAd token exchange.");
Expand Down
2 changes: 1 addition & 1 deletion apps/profil-api/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ spring:
application:
version: application.version.todo #TODO Finn ut hvordan denne kan settes fra gradle
name: testnorge-profil-api
desciption: API for hente ut profil fra Azure Ad
description: API for hente ut profil fra Azure Ad
cluster: dev-gcp
namespace: dolly
security:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<springProfile name="prod">
<appender name="stdout_json" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="no.nav.testnav.libs.servletcore.logging.TestnavLogbackEncoder">
<addCauses>true</addCauses>
<throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
<rootCauseFirst>true</rootCauseFirst>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ spring:
application:
version: 1
name: testnav-tenor-search-service
desciption: Tjeneste som formidler søk til Tenor testdata hos Skatteetaten
description: Tjeneste som formidler søk til Tenor testdata hos Skatteetaten
security:
oauth2:
resourceserver:
Expand Down
1 change: 0 additions & 1 deletion apps/testnav-ident-pool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ Identer kan frigjøres og benyttes om igjen
## Lokal kjøring
* [Generelt.](../../docs/local_general.md)
* [Secret Manager.](../../docs/local_secretmanager.md)
* [Lokal PostgreSQL.](../../docs/local_db.md)

2 changes: 2 additions & 0 deletions apps/tps-messaging-service/docker-compose.mqsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DEFINE CHANNEL('Q1_TESTNAV_TPS_MSG_S') CHLTYPE(SVRCONN) MCAUSER('app') REPLACE
SET CHLAUTH('Q1_TESTNAV_TPS_MSG_S') TYPE(ADDRESSMAP) ADDRESS('*') USERSRC(CHANNEL) CHCKCLNT(REQUIRED) DESCR('Allows connection via APP channel') ACTION(REPLACE)
16 changes: 16 additions & 0 deletions apps/tps-messaging-service/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
services:

mq:
image: icr.io/ibm-messaging/mq:latest
environment:
LICENSE: accept
MQ_QMGR_NAME: QM1
MQ_APP_USER: app
MQ_APP_PASSWORD: passw0rd
MQ_ADMIN_USER: admin
MQ_ADMIN_PASSWORD: passw0rd
ports:
- "127.0.0.1:1414:1414"
- "127.0.0.1:9443:9443"
volumes:
- ./docker-compose.mqsc:/etc/mqm/20-config.mqsc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spring:
aad:
issuer-uri: ${AAD_ISSUER_URI}/v2.0
jwk-set-uri: ${AAD_ISSUER_URI}/discovery/v2.0/keys
accepted-audience: ${AZURE_APP_CLIENT_ID}, api:// ${AZURE_APP_CLIENT_ID}
accepted-audience: ${AZURE_APP_CLIENT_ID}, api://${AZURE_APP_CLIENT_ID}

springdoc:
swagger-ui:
Expand Down
2 changes: 2 additions & 0 deletions apps/udi-stub/docker-compose.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SELECT 'CREATE DATABASE "testnav-udistub"'
WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'testnav-udistub')\gexec
11 changes: 11 additions & 0 deletions apps/udi-stub/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
services:

postgresql:
image: postgres
network_mode: host
shm_size: 128mb
environment:
POSTGRES_PASSWORD: ""
POSTGRES_HOST_AUTH_METHOD: trust
volumes:
- ./docker-compose.sql:/docker-entrypoint-initdb.d/init.sql
Loading

0 comments on commit f551b77

Please sign in to comment.