Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add XML messaging service and controller for sending XML messages #3804

Open
wants to merge 47 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
a16bb8e
Add XML messaging service and controller for sending XML messages
krharum Mar 20, 2025
59b98ce
Implement XML messaging functionality with dedicated consumer and con…
krharum Mar 20, 2025
2d516e0
Refactor Dockerfile to use COPY instead of ADD and enhance logging in…
krharum Mar 21, 2025
53fe7ca
Fix parameter order in XML messaging methods for consistency #deploy-…
krharum Mar 21, 2025
080861a
Refactor TpsConsumer to simplify message sending logic and improve lo…
krharum Mar 21, 2025
ea9ce35
Merge branch 'master' into feature/sende-xml-til-tps
krharum Mar 21, 2025
f55b02f
Add initial project structure with frontend components and configurat…
krharum Mar 21, 2025
6a19757
- Endringer for tps-messaging-frontend som benytter useSWR, react-hoo…
stigus Mar 25, 2025
fe866e6
- Endringer for tps-messaging-frontend som benytter useSWR, react-hoo…
stigus Mar 25, 2025
fcc1295
Merge branch 'master' into feature/sende-xml-til-tps
stigus Mar 25, 2025
ec16b31
- Endringer for tps-messaging-frontend som benytter useSWR, react-hoo…
stigus Mar 25, 2025
c3662e5
- Endringer for tps-messaging-frontend som benytter useSWR, react-hoo…
stigus Mar 25, 2025
d55b4ee
- Attempt at better logging
stigus Mar 25, 2025
d94b0a7
- Attempt at better logging
stigus Mar 25, 2025
5bcccd9
- Bruker-service dependancy fix
stigus Mar 25, 2025
10b7061
- tps-messaging-service inbound rule
stigus Mar 25, 2025
de2b521
- Bedre logging av feil
stigus Mar 25, 2025
55290c5
- Bedre logging av feil
stigus Mar 26, 2025
b1732aa
- Fixed profil-api name error that led to timeout when getting profil…
stigus Mar 26, 2025
fbb1d70
- Fixed profil-api name error that led to timeout when getting profil…
stigus Mar 26, 2025
9a2d785
- Fixed profil-api name error that led to timeout when getting profil…
stigus Mar 26, 2025
9563f05
- Mindre refaktor
stigus Mar 26, 2025
6f1b33d
- Validerer om melding er gyldig xml dersom kønavn inneholder xml
stigus Mar 26, 2025
933dedf
- Gitt tilgang til gruppen tps-messaging-frontend-access
stigus Mar 26, 2025
4f5cc8b
- Håndterer loading og error state for innsending mot tps-messaging-s…
stigus Mar 26, 2025
cbdfa13
- Bruker wonderwall sidecar for auth
stigus Mar 26, 2025
9f0afec
- Fix for AlertWithCloseButton Error
stigus Mar 26, 2025
83438b7
- Endret workflow filer for testing
stigus Mar 26, 2025
2910785
- Endret workflow filer for testing
stigus Mar 26, 2025
66455fc
- Endret workflow filer for testing
stigus Mar 26, 2025
93793a2
- Lagt til client igjen for oauth2
stigus Mar 26, 2025
e3f4b8b
- Fix vitest workflow
stigus Mar 26, 2025
9053d40
- Fix vitest workflow
stigus Mar 26, 2025
e2c18b0
- Endringer for vitest workflow
stigus Mar 26, 2025
847025d
- Endringer for vitest workflow
stigus Mar 26, 2025
e85c692
Add external ingress URL for messaging service in config #deploy-tps-…
krharum Mar 27, 2025
6084762
Merge branch 'refs/heads/master' into feature/sende-xml-til-tps
stigus Mar 27, 2025
588e161
- Endret config for claims og replyURL for ekstern.dev
stigus Mar 27, 2025
aba8af0
- Endret oppsett for wonderwall og ekstern.dev ingress
stigus Mar 27, 2025
33ee1d4
- Endret oppsett for wonderwall og ekstern.dev ingress
stigus Mar 27, 2025
cbe52cd
- Endret oppsett for wonderwall og ekstern.dev ingress
stigus Mar 27, 2025
7b95dc3
- Endret oppsett for wonderwall og ekstern.dev ingress
stigus Mar 27, 2025
56a29c4
- Diverse bugfix
stigus Mar 27, 2025
fbe1192
- Diverse bugfix
stigus Mar 27, 2025
bf0c4cd
- Diverse bugfix
stigus Mar 27, 2025
3a02b6d
- Diverse Forbedringer og bugfix
stigus Mar 27, 2025
8f07a40
- Diverse Forbedringer og bugfix
stigus Mar 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions .github/workflows/app.dolly-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,22 @@ on:
- "libs/security-core/**"
- "apps/dolly-frontend/**"
- ".github/workflows/app.dolly-frontend.yml"
- ".github/workflows/common.playwright-vitest.yml"
- ".github/workflows/common.playwright.yml"
- ".github/workflows/common.vitest.yml"

jobs:
playwright:
uses: ./.github/workflows/common.playwright-vitest.yml
uses: ./.github/workflows/common.playwright.yml
permissions:
packages: write
id-token: write
contents: read
with:
working-directory: "apps/dolly-frontend"
secrets:
READER_TOKEN: ${{ secrets.READER_TOKEN }}
vitest:
uses: ./.github/workflows/common.vitest.yml
permissions:
packages: write
id-token: write
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/app.tps-messaging-frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: tps-messaging-frontend

on:
push:
paths:
- "plugins/**"
- "libs/reactive-core/**"
- "libs/reactive-frontend/**"
- "libs/reactive-session-security/**"
- "libs/security-core/**"
- "apps/tps-messaging-frontend/**"
- ".github/workflows/app.tps-messaging-frontend.yml"
- ".github/workflows/common.vitest.yml"

jobs:
vitest:
uses: ./.github/workflows/common.vitest.yml
permissions:
packages: write
id-token: write
contents: read
with:
working-directory: "apps/tps-messaging-frontend"
secrets:
READER_TOKEN: ${{ secrets.READER_TOKEN }}
workflow:
uses: ./.github/workflows/common.workflow.frontend.yml
with:
working-directory: "apps/tps-messaging-frontend"
deploy-tag: "#deploy-tps-messaging-frontend"
permissions:
contents: read
id-token: write
secrets: inherit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Playwright/Vitest Tests
name: Playwright Tests
on:
workflow_call:
inputs:
Expand Down Expand Up @@ -44,11 +44,6 @@ jobs:
name: blob-report-${{ matrix.shardIndex }}
path: ${{ inputs.working-directory }}/src/main/js/blob-report
retention-days: 1

- name: Run Vitest/RTL tests
if: ${{ matrix.shardIndex == 1 }}
working-directory: ${{ inputs.working-directory }}/src/main/js
run: npm run test:vitest-run

merge-reports:
if: ${{ !cancelled() }}
Expand Down Expand Up @@ -85,7 +80,6 @@ jobs:
source: ${{ inputs.working-directory }}/src/main/js/playwright-report
destination: /${{ github.repository }}/${{ github.run_number }}
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
# project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}

- name: Merge to json report
working-directory: ${{ inputs.working-directory }}/src/main/js
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/common.vitest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Vitest Tests
on:
workflow_call:
inputs:
working-directory:
type: string
description: "The working directory for the job, e.g. apps/dolly-frontend (without leading/trailing slash)."
required: true
secrets:
READER_TOKEN:
required: true

jobs:
vitest:
runs-on: ubuntu-latest
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
registry-url: https://npm.pkg.github.com/
scope: "@navikt"
- name: Install dependencies
working-directory: ${{ inputs.working-directory }}/src/main/js
run: npm ci
- name: Install Playwright Browsers
working-directory: ${{ inputs.working-directory }}/src/main/js
run: npx playwright install --with-deps
- name: Run Vitest/RTL tests
working-directory: ${{ inputs.working-directory }}/src/main/js
run: npm run test:vitest-run
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# testing
*vitest-result.json

# dependencies
*node_modules/

Expand Down
1 change: 1 addition & 0 deletions apps/bruker-service/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ spec:
- application: dolly-backend
- application: dolly-frontend
- application: dolly-idporten
- application: testnav-tps-messaging-frontend
- application: testnav-oversikt-frontend
outbound:
rules:
Expand Down
1 change: 0 additions & 1 deletion apps/dolly-frontend/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ includeBuild "../../libs/reactive-proxy"
includeBuild "../../libs/reactive-security"
includeBuild "../../libs/reactive-session-security"
includeBuild "../../libs/security-core"
includeBuild "../../libs/security-core"
includeBuild "../../libs/testing"
includeBuild '../../.github/workflows'

Expand Down
2 changes: 1 addition & 1 deletion apps/dolly-frontend/src/main/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
"@navikt/ds-css": "^7.4.0",
"@navikt/ds-icons": "^3.4.3",
"@navikt/ds-react": "^7.4.0",
"@playwright/test": "^1.48.2",
"@react-router/dev": "^7.0.2",
"@reduxjs/toolkit": "^2.3.0",
"@testing-library/dom": "^10.4.0",
Expand Down Expand Up @@ -96,6 +95,7 @@
"less": "^4.2.0",
"msw": "^2.6.0",
"playwright": "^1.51.0",
"@playwright/test": "^1.48.2",
"prettier": "^3.3.3",
"react-dropzone": "^14.2.10",
"react-pdf": "^9.1.1",
Expand Down
2 changes: 1 addition & 1 deletion apps/dolly-frontend/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spring:
resourceserver:
aad:
issuer-uri: ${AZURE_OPENID_CONFIG_ISSUER}
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}
accepted-audience: ${TOKEN_X_CLIENT_ID}
Expand Down
1 change: 1 addition & 0 deletions apps/profil-api/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ spec:
- application: testnav-faste-data-frontend
- application: testnav-oversikt-frontend
- application: testnorge-tilbakemelding-api
- application: testnav-tps-messaging-frontend
outbound:
rules:
- application: testnav-altinn3-tilgang-proxy
Expand Down
12 changes: 12 additions & 0 deletions apps/tps-messaging-frontend/.run/build.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="build" type="js.build_tools.npm" nameIsGenerated="true">
<package-json value="$PROJECT_DIR$/src/main/js/package.json" />
<command value="run" />
<scripts>
<script value="build" />
</scripts>
<node-interpreter value="project" />
<envs />
<method v="2" />
</configuration>
</component>
9 changes: 9 additions & 0 deletions apps/tps-messaging-frontend/.run/install.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="install" type="js.build_tools.npm" nameIsGenerated="true">
<package-json value="$PROJECT_DIR$/src/main/js/package.json" />
<command value="install" />
<node-interpreter value="project" />
<envs />
<method v="2" />
</configuration>
</component>
12 changes: 12 additions & 0 deletions apps/tps-messaging-frontend/.run/start.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="start" type="js.build_tools.npm" nameIsGenerated="true">
<package-json value="$PROJECT_DIR$/src/main/js/package.json" />
<command value="run" />
<scripts>
<script value="start" />
</scripts>
<node-interpreter value="project" />
<envs />
<method v="2" />
</configuration>
</component>
8 changes: 8 additions & 0 deletions apps/tps-messaging-frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM ghcr.io/navikt/baseimages/temurin:21
LABEL maintainer="Team Dolly"

COPY /build/libs/app.jar /app/app.jar

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

EXPOSE 8080
10 changes: 10 additions & 0 deletions apps/tps-messaging-frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Tps-Messaging-frontend

Frontend for kunne sende meldinger til TPS. For å benytte denne appen må brukeren være logget inn med en bruker registrert på
azure-applikasjonen `dev-gcp:dolly:tps-messaging-frontend`.

https://testnav-tps-messaging.intern.dev.nav.no

## Lokal kjøring
* [Generelt.](../../docs/local_general.md)
* [Secret Manager.](../../docs/local_secretmanager.md)
35 changes: 35 additions & 0 deletions apps/tps-messaging-frontend/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
plugins {
id "dolly-apps"
}

sonarqube {
properties {
property "sonar.projectKey", "testnav-tps-messaging-frontend"
property "sonar.projectName", "testnav-tps-messaging-frontend"
property "sonar.sources", "src/main/java,src/main/js"
property "sonar.tests", "src/test/java"
}
}

dependencies {
implementation "io.grpc:grpc-netty:$versions.grpc"

implementation "no.nav.testnav.libs:reactive-core"
implementation "no.nav.testnav.libs:reactive-frontend"
implementation "no.nav.testnav.libs:reactive-security"
implementation("no.nav.testnav.libs:reactive-session-security") {
exclude group: "org.springframework.session", module: "spring-session-data-redis"
exclude group: "org.springframework.boot", module: "spring-boot-starter-data-redis"
}
implementation("no.nav.testnav.libs:security-core") {
exclude group: "org.springframework.session", module: "spring-session-data-redis"
}

implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server"
implementation "org.springframework.boot:spring-boot-starter-oauth2-client"
implementation "org.springframework.boot:spring-boot-starter-security"

implementation "org.springframework.cloud:spring-cloud-starter-gateway"

testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock"
}
60 changes: 60 additions & 0 deletions apps/tps-messaging-frontend/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
apiVersion: "nais.io/v1alpha1"
kind: "Application"
metadata:
name: testnav-tps-messaging-frontend
namespace: dolly
labels:
team: dolly
spec:
port: 8080
azure:
sidecar:
enabled: true
autoLogin: true
application:
enabled: true
tenant: nav.no
replyURLs:
- "https://testnav-tps-messaging.ekstern.dev.nav.no/login/oauth2/code/aad"
- "http://localhost:8080/login/oauth2/code/aad"
claims:
groups:
- id: 9c7efec1-1599-4216-a67e-6fd53a6a951c # Dolly team
- id: 21c9abee-4bc7-4077-9aba-6049c760d094 # Tps messaging frontend access
liveness:
path: /internal/health/liveness
initialDelay: 20
periodSeconds: 2
failureThreshold: 140
observability:
logging:
destinations:
- id: elastic
autoInstrumentation:
enabled: true
runtime: java
readiness:
path: /internal/health/readiness
initialDelay: 20
periodSeconds: 2
failureThreshold: 140
prometheus:
enabled: true
path: /internal/metrics
replicas:
min: 1
max: 1
accessPolicy:
outbound:
rules:
- application: testnav-tps-messaging-service
- application: testnorge-profil-api
resources:
requests:
cpu: 50m
memory: 600Mi
limits:
memory: 2048Mi
image: "{{image}}"
ingresses:
- "https://testnav-tps-messaging.ekstern.dev.nav.no"
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading