From d0558c1f496029f1ae8fcbd3d428c5761453ceb1 Mon Sep 17 00:00:00 2001 From: kristenhaerum Date: Wed, 2 Oct 2024 09:51:39 +0200 Subject: [PATCH] Add support for Trygdeetaten Azure AD integration #deploy-proxy-yrkesskade Updated configuration to include a new Azure AD application for Trygdeetaten and modified the application starter to use TrygdeetatenAzureAdTokenService for authentication. These changes facilitate seamless integration of Testnav Yrkesskade Proxy with Trygdeetaten's Azure AD instance. --- proxies/yrkesskade-proxy/config.yml | 17 ++++++++++++++++- .../YrkesskadeProxyApplicationStarter.java | 4 ++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/proxies/yrkesskade-proxy/config.yml b/proxies/yrkesskade-proxy/config.yml index 6e73d1188c..546484eeca 100644 --- a/proxies/yrkesskade-proxy/config.yml +++ b/proxies/yrkesskade-proxy/config.yml @@ -1,4 +1,17 @@ -apiVersion: "nais.io/v1alpha1" +--- +apiVersion: nais.io/v1 +kind: AzureAdApplication +metadata: + name: testnav-yrkesskade-proxy-trygdeetaten + namespace: dolly + labels: + team: dolly +spec: + secretName: azure-trygdeetaten-testnav-yrkesskade-proxy-trygdeetaten + secretKeyPrefix: "AZURE_TRYGDEETATEN" + tenant: trygdeetaten.no +--- +apiVersion: "nais.io/v1alpha1" kind: "Application" metadata: name: testnav-yrkesskade-proxy @@ -59,5 +72,7 @@ spec: memory: 1025Mi limits: memory: 2048Mi + envFrom: + - secret: azure-trygdeetaten-testnav-yrkesskade-proxy-trygdeetaten ingresses: - "https://testnav-yrkesskade-proxy.intern.dev.nav.no" diff --git a/proxies/yrkesskade-proxy/src/main/java/no/nav/testnav/proxies/yrkesskadeproxy/YrkesskadeProxyApplicationStarter.java b/proxies/yrkesskade-proxy/src/main/java/no/nav/testnav/proxies/yrkesskadeproxy/YrkesskadeProxyApplicationStarter.java index 6e87a94270..29f60ccba9 100644 --- a/proxies/yrkesskade-proxy/src/main/java/no/nav/testnav/proxies/yrkesskadeproxy/YrkesskadeProxyApplicationStarter.java +++ b/proxies/yrkesskade-proxy/src/main/java/no/nav/testnav/proxies/yrkesskadeproxy/YrkesskadeProxyApplicationStarter.java @@ -4,7 +4,7 @@ import no.nav.testnav.libs.reactiveproxy.config.SecurityConfig; import no.nav.testnav.libs.reactiveproxy.filter.AddAuthenticationRequestGatewayFilterFactory; import no.nav.testnav.libs.reactivesecurity.config.SecureOAuth2ServerToServerConfiguration; -import no.nav.testnav.libs.reactivesecurity.exchange.azuread.AzureAdTokenService; +import no.nav.testnav.libs.reactivesecurity.exchange.azuread.TrygdeetatenAzureAdTokenService; import no.nav.testnav.libs.securitycore.domain.AccessToken; import no.nav.testnav.proxies.yrkesskadeproxy.config.Consumers; import org.springframework.boot.SpringApplication; @@ -43,7 +43,7 @@ public RouteLocator customRouteLocator(RouteLocatorBuilder builder, @Bean GatewayFilter getAuthenticationFilter( - AzureAdTokenService tokenService, + TrygdeetatenAzureAdTokenService tokenService, Consumers consumers) { return AddAuthenticationRequestGatewayFilterFactory