Skip to content

Commit

Permalink
Fikset merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
betsytraran committed Dec 6, 2024
2 parents 93d52fe + 2464b3f commit cf75c35
Show file tree
Hide file tree
Showing 752 changed files with 3,391 additions and 3,349 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
2 changes: 1 addition & 1 deletion .github/workflows/app.udi-stub.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: testnav-udi-stub
name: udi-stub

on:
push:
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
name: Integration Tests
on:
push:
branches:
- master
paths:
- 'apps/bruker-service/**'
- 'apps/person-organisasjon-tilgang-service/**'
pull_request:
paths:
- 'apps/bruker-service/**'
- 'apps/person-organisasjon-tilgang-service/**'
types: [ ready_for_review, review_requested ]
workflow_dispatch:

jobs:
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
66 changes: 10 additions & 56 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,62 +7,16 @@
Info/lenker til Team Dollys interne verktøy finnes [her](https://navikt.github.io/testnorge/).

## Bygging/Kjøring
### Kjør lokalt

**NB: `navtunnel` må kjøre, eller man må være logget inn med `naisdevice`**

For å kunne hente ned alle avheningehter må det opprettes en Personal access tokens fra https://github.com/settings/tokens. Denne token må legges inn i system variabler NAV_TOKEN.

Fra Mac
```
/etc/profile
export NAV_TOKEN=xxxx-yyyy-zzzz
```

Gradle følger med prosjektet og `./gradlew build` vil derfor fungere. `gradle build` bruker lokalt installert Gradle.


### Utviklerimage
- Opprett Personal access tokens i Github og legg til token som systemvariabelen NAV_TOKEN (se forklaring over)
- Opprett `gradle.properties` under `C:/Users/%USERNAME%/.gradle` med innhold (bytt ut truststorepassord og -path):
```
systemProp.http.proxyHost=webproxy-utvikler.nav.no
systemProp.http.proxyPort=8088
systemProp.http.nonProxyHosts=localhost|127.0.0.1|*.local|*.adeo.no|*.nav.no|*.aetat.no|*.devillo.no|*.oera.no|*devel
systemProp.https.proxyHost=webproxy-utvikler.nav.no
systemProp.https.proxyPort=8088
systemProp.https.nonProxyHosts=localhost|127.0.0.1|*.local|*.adeo.no|*.nav.no|*.aetat.no|*.devillo.no|*.oera.no|*devel
systemProp.javax.net.ssl.trustStorePassword=TRUSTSTORE_PASS
systemProp.javax.net.ssl.trustStore=TRUSTSTORE_PATH
```
- Legg til sertifikat til truststore: https://plugins.gradle.org og https://repository-cdn.liferay.com/nexus/content/groups/public
- Åpne URL i nettleser
- Trykk på hengelås til venstre for URL og klikk på "Sertifikat"
- Velg fanen "Detaljer" og klikk "Kopier til fil". Last ned DER-kodet binær. Merk at sertifikatet får filformat .cer
- Sertifikat legges til TrustStore ved hjelp av kommandoen:
``keytool -import -trustcacerts -alias ALIAS -file DIN_DOWNLOAD_DIR/SERTIFIKAT_FILNAVN.cer -keystore PATH_TIL_KEYSTORE/KEYSTORE_FILNAVN.jts``
- Hvis punktene over ikke er tilstrekkelig og prosjektet sliter med å hente pakker fra maven, forsøk å legge til denne
under repositories i `java-conventions.gradle` (MERK! Denne må fjernes igjen før commit):
```
maven {
url = uri('https://repo.adeo.no/repository/github-package-registry-navikt')
}
```
## Dokumentasjon
Enhver applikasjon skal ha dokumentasjon i fila `<min-testnorge-app>/README.md`. Hver av disse filene må starte med
```
---
layout: default
title: min-app
parent: Applikasjoner
---
# min-app
[...]
```
for å bli vist på riktig måte under https://navikt.github.io/testnorge.
README-filen skal beskrive kort hva appen er til, og hvordan den fungerer. Det er også fint om du beskriver kort
info om lokal kjøring osv.
> **Mac:**
>
> For å kjøre tester som bruker Testcontainers eller kjøre en applikasjon lokalt som krever en tjeneste kjørende i Docker så må disse miljøvariablene settes:
>
> `DOCKER_HOST=unix://${HOME}/.colima/default/docker.sock`\
> `TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE=/var/run/docker.sock`\
> `TESTCONTAINERS_RYUK_DISABLED=true`
### Lokal kjøring
Se `README.md` for hver enkelt applikasjon/proxy. Felles dokumentasjon ligger i [/docs](./docs).

## Migrering inn i monorepo

Expand Down
19 changes: 2 additions & 17 deletions apps/adresse-service/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,7 @@
# Adresse-service
Adresse-service gir tilgang til adresser fra PDL.
Søk kan gjøres på postnummer, kommunenummer, fritekstsøk, mm

## Swagger
Swagger finnes under [/swagger](https://testnav-adresse-service.intern.dev.nav.no/swagger) -endepunktet til
applikasjonen.

## Lokal kjøring
Ha naisdevice kjørende og kjør AdresseServiceApplicationStarter med følgende argumenter:
```
-Dspring.cloud.vault.token=[kopier token fra vault]
-Dspring.profiles.active=local
--add-opens java.base/java.lang=ALL-UNNAMED
```

### Utviklerimage
I utviklerimage brukes ikke naisdevice og du må legge til følgende ekstra argumenter:
```
-Djavax.net.ssl.trustStore=[path til lokal truststore]
-Djavax.net.ssl.trustStorePassword=[passord til lokal truststore]
```
* [Generelt.](../../docs/local_general.md)
* [Secret Manager.](../../docs/local_secretmanager.md)
1 change: 0 additions & 1 deletion apps/adresse-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ dependencies {
implementation "no.nav.testnav.libs:servlet-core"
implementation "no.nav.testnav.libs:servlet-security"
implementation "no.nav.testnav.libs:data-transfer-objects"
implementation "no.nav.testnav.libs:vault"

implementation "org.springframework.boot:spring-boot-starter-security"
implementation "org.springframework.boot:spring-boot-starter-web"
Expand Down
1 change: 0 additions & 1 deletion apps/adresse-service/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ includeBuild '../../libs/data-transfer-objects'
includeBuild '../../libs/security-core'
includeBuild '../../libs/servlet-core'
includeBuild '../../libs/servlet-security'
includeBuild '../../libs/vault'

develocity {
buildScan {
Expand Down

This file was deleted.

11 changes: 10 additions & 1 deletion apps/adresse-service/src/main/resources/application-local.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
TOKEN_X_CLIENT_ID: dev-gcp:dolly:testnav-adresse-service
TOKEN_X_CLIENT_ID: dev-gcp:dolly:testnav-adresse-service

spring:
config:
import: "sm://"
security:
oauth2:
resourceserver:
aad:
accepted-audience: ${sm://azure-app-client-id}, api://${sm://azure-app-client-id}
2 changes: 1 addition & 1 deletion apps/adresse-service/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,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}
tokenx:
issuer-uri: ${TOKEN_X_ISSUER}
jwk-set-uri: ${TOKEN_X_JWKS_URI}
Expand Down

This file was deleted.

7 changes: 7 additions & 0 deletions apps/adresse-service/src/test/resources/application-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
TOKEN_X_ISSUER: dummy

spring:
cloud:
gcp:
secretmanager:
enabled: false
18 changes: 2 additions & 16 deletions apps/amelding-service/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
# Amelding-service
Service for å sende syntetiske arbeidsmeldinger videre til oppsummerings-dokument-service.

## Swagger
Swagger finnes under [/swagger](https://testnav-amelding-service.intern.dev.nav.no/swagger) -endepunktet til
applikasjonen.

## Lokal kjøring
For å kjøre lokalt (AMeldingServiceApplicationStarter) må active profile settes til `dev`. I tillegg, må cloud vault token
hentes fra Vault. Vault token hentes ved at man logger inn i Vault, trykker på nedtrekksmenyen oppe til høyre, og
trykker på "Copy token".

Disse verdiene fylles deretter inn i VM Options på IDE:

Run -> Edit Configurations -> VM Options

```
-Dspring.cloud.vault.token=(Copy token fra Vault)
-Dspring.profiles.active=dev
```
* [Generelt.](../../docs/local_general.md)
* [Secret Manager.](../../docs/local_secretmanager.md)
1 change: 0 additions & 1 deletion apps/amelding-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ dependencies {
implementation "no.nav.testnav.libs:security-core"
implementation "no.nav.testnav.libs:reactive-core"
implementation "no.nav.testnav.libs:reactive-security"
implementation "no.nav.testnav.libs:vault"

implementation "no.nav.testnav.libs:commands"
implementation "no.nav.testnav.libs:avro-schema"
Expand Down
1 change: 0 additions & 1 deletion apps/amelding-service/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ includeBuild '../../libs/data-transfer-objects'
includeBuild '../../libs/reactive-core'
includeBuild '../../libs/reactive-security'
includeBuild '../../libs/security-core'
includeBuild '../../libs/vault'

develocity {
buildScan {
Expand Down

This file was deleted.

8 changes: 8 additions & 0 deletions apps/amelding-service/src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
spring:
config:
import: "sm://"
security:
oauth2:
resourceserver:
aad:
accepted-audience: ${sm://azure-app-client-id}, api://${sm://azure-app-client-id}

consumers:
oppsummeringsdokument-service:
Expand Down
2 changes: 1 addition & 1 deletion apps/amelding-service/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,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
4 changes: 0 additions & 4 deletions apps/amelding-service/src/main/resources/bootstrap.yml

This file was deleted.

This file was deleted.

7 changes: 7 additions & 0 deletions apps/amelding-service/src/test/resources/application-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
TOKEN_X_ISSUER: dummy

spring:
cloud:
gcp:
secretmanager:
enabled: false
22 changes: 7 additions & 15 deletions apps/app-tilgang-analyse-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,16 @@ Swagger finnes under [/swagger](https://testnav-app-tilgang-analyse-service.inte
applikasjonen.

## Lokal kjøring
* [Generelt.](../../docs/local_general.md)
* [Secret Manager.](../../docs/local_secretmanager.md)

### In Memmory DB
Ha naisdevice kjørende og kjør AppTilgangAnalyseServiceApplicationStarter med følgende argumenter:
```
-Dspring.cloud.vault.token=[kopier token fra vault]
-Dspring.profiles.active=local
```

### GCP DB
En egen Spring profile _localdb_ er satt opp for å kjøre med proxy mot applikasjonens reelle DB.

Kjør opp `cloud_sql_proxy`
Kjør `cloud_sql_proxy` i bakgrunnen.
```
./cloud_sql_proxy -instances=dolly-dev-ff83:europe-north1:testnav-app-tilgang-analyse-service=tcp:3306
> cloud_sql_proxy -instances=dolly-dev-ff83:europe-north1:testnav-app-tilgang-analyse-service=tcp:3306
```

Ha naisdevice kjørende og kjør AppTilgangAnalyseServiceApplicationStarter med følgende argumenter:
Start applikasjonen med Spring profile _localdb_ og definer DB_PASSORD (kan hentes fra pod).
```
-Dspring.cloud.vault.token=[kopier token fra vault]
-Dspring.profiles.active=localdb
-DDB_PASSWORD=[passord for testnav-app-tilgang-analyse-service-db]
```
```
1 change: 0 additions & 1 deletion apps/app-tilgang-analyse-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ dependencies {
implementation "no.nav.testnav.libs:data-transfer-objects"
implementation "no.nav.testnav.libs:reactive-core"
implementation "no.nav.testnav.libs:reactive-security"
implementation "no.nav.testnav.libs:vault"

implementation "org.springframework.boot:spring-boot-starter-data-r2dbc"
implementation "org.springframework.boot:spring-boot-starter-security"
Expand Down
1 change: 0 additions & 1 deletion apps/app-tilgang-analyse-service/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ includeBuild "../../plugins/java"
includeBuild '../../libs/data-transfer-objects'
includeBuild '../../libs/reactive-core'
includeBuild '../../libs/reactive-security'
includeBuild '../../libs/vault'

develocity {
buildScan {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
spring:
config:
import: "sm://"
flyway:
url: jdbc:h2:mem:testdb
username: sa
password:
password:
security:
oauth2:
resourceserver:
aad:
accepted-audience: ${sm://azure-app-client-id}, api://${sm://azure-app-client-id}

Loading

0 comments on commit cf75c35

Please sign in to comment.