From 40e9ab6b7ed32e3d5c3811731ed38bfb647c5624 Mon Sep 17 00:00:00 2001 From: kristenhaerum Date: Mon, 9 Sep 2024 15:03:07 +0200 Subject: [PATCH] Oppdatert timere og forberedt for logging #deploy-modapp-ereg-proxy Deleted LocalSecurityConfig.java and LocalVaultConfig.java files. Adjusted DevConfig to use correct VaultPropertySource and updated application.yml settings for better configuration management. --- .../libs/reactiveproxy/config/DevConfig.java | 2 +- proxies/modapp-ereg-proxy/build.gradle | 3 -- .../modapperegproxy/LocalSecurityConfig.java | 20 ------------ .../modapperegproxy/LocalVaultConfig.java | 32 ------------------- .../src/main/resources/application-dev.yml | 7 ++++ .../src/main/resources/application.yml | 14 +++++++- 6 files changed, 21 insertions(+), 57 deletions(-) delete mode 100644 proxies/modapp-ereg-proxy/src/main/java/no/nav/testnav/proxies/modapperegproxy/LocalSecurityConfig.java delete mode 100644 proxies/modapp-ereg-proxy/src/main/java/no/nav/testnav/proxies/modapperegproxy/LocalVaultConfig.java create mode 100644 proxies/modapp-ereg-proxy/src/main/resources/application-dev.yml diff --git a/libs/reactive-proxy/src/main/java/no/nav/testnav/libs/reactiveproxy/config/DevConfig.java b/libs/reactive-proxy/src/main/java/no/nav/testnav/libs/reactiveproxy/config/DevConfig.java index d6b9e8fce29..4a34d70612d 100644 --- a/libs/reactive-proxy/src/main/java/no/nav/testnav/libs/reactiveproxy/config/DevConfig.java +++ b/libs/reactive-proxy/src/main/java/no/nav/testnav/libs/reactiveproxy/config/DevConfig.java @@ -12,7 +12,7 @@ @Configuration @Profile("dev") -@VaultPropertySource(value = "azuread/prod/creds/team-dolly-lokal-app", ignoreSecretNotFound = false) +@VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) public class DevConfig extends AbstractVaultConfiguration { private static final String VAULT_TOKEN = "spring.cloud.vault.token"; diff --git a/proxies/modapp-ereg-proxy/build.gradle b/proxies/modapp-ereg-proxy/build.gradle index 9201affb0f5..329955971cd 100644 --- a/proxies/modapp-ereg-proxy/build.gradle +++ b/proxies/modapp-ereg-proxy/build.gradle @@ -12,7 +12,4 @@ sonarqube { dependencies { implementation 'no.nav.testnav.libs:security-core' implementation 'no.nav.testnav.libs:reactive-security' - - implementation "org.springframework.boot:spring-boot-starter-webflux" - implementation "org.springframework.cloud:spring-cloud-starter-vault-config" } diff --git a/proxies/modapp-ereg-proxy/src/main/java/no/nav/testnav/proxies/modapperegproxy/LocalSecurityConfig.java b/proxies/modapp-ereg-proxy/src/main/java/no/nav/testnav/proxies/modapperegproxy/LocalSecurityConfig.java deleted file mode 100644 index 69cc8d9f53d..00000000000 --- a/proxies/modapp-ereg-proxy/src/main/java/no/nav/testnav/proxies/modapperegproxy/LocalSecurityConfig.java +++ /dev/null @@ -1,20 +0,0 @@ -package no.nav.testnav.proxies.modapperegproxy; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.security.config.web.server.ServerHttpSecurity; -import org.springframework.security.web.server.SecurityWebFilterChain; - -@Configuration -@Profile("dev") -public class LocalSecurityConfig { - - @Bean - public SecurityWebFilterChain securityWebFilterChain(ServerHttpSecurity http) { - return http - .csrf(ServerHttpSecurity.CsrfSpec::disable) - .authorizeExchange(authorizeExchangeSpec -> authorizeExchangeSpec.anyExchange().permitAll()) - .build(); - } -} \ No newline at end of file diff --git a/proxies/modapp-ereg-proxy/src/main/java/no/nav/testnav/proxies/modapperegproxy/LocalVaultConfig.java b/proxies/modapp-ereg-proxy/src/main/java/no/nav/testnav/proxies/modapperegproxy/LocalVaultConfig.java deleted file mode 100644 index 94d268eed82..00000000000 --- a/proxies/modapp-ereg-proxy/src/main/java/no/nav/testnav/proxies/modapperegproxy/LocalVaultConfig.java +++ /dev/null @@ -1,32 +0,0 @@ -package no.nav.testnav.proxies.modapperegproxy; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.lang.NonNull; -import org.springframework.vault.annotation.VaultPropertySource; -import org.springframework.vault.authentication.ClientAuthentication; -import org.springframework.vault.authentication.TokenAuthentication; -import org.springframework.vault.client.VaultEndpoint; -import org.springframework.vault.config.AbstractVaultConfiguration; - -@Configuration -@Profile("dev") -@VaultPropertySource( - value = "secret/dolly/lokal", - ignoreSecretNotFound = false -) -public class LocalVaultConfig extends AbstractVaultConfiguration { - - @Override - @NonNull - public VaultEndpoint vaultEndpoint() { - return VaultEndpoint.create("vault.adeo.no", 443); - } - - @Override - @NonNull - public ClientAuthentication clientAuthentication() { - return new TokenAuthentication(System.getProperty("spring.cloud.vault.token")); - } - -} diff --git a/proxies/modapp-ereg-proxy/src/main/resources/application-dev.yml b/proxies/modapp-ereg-proxy/src/main/resources/application-dev.yml new file mode 100644 index 00000000000..eb7746295e2 --- /dev/null +++ b/proxies/modapp-ereg-proxy/src/main/resources/application-dev.yml @@ -0,0 +1,7 @@ + +logging: + level: + org: + springframework: + cloud: + gateway: TRACE \ No newline at end of file diff --git a/proxies/modapp-ereg-proxy/src/main/resources/application.yml b/proxies/modapp-ereg-proxy/src/main/resources/application.yml index 3c2b7a2dbc8..14b73c872df 100644 --- a/proxies/modapp-ereg-proxy/src/main/resources/application.yml +++ b/proxies/modapp-ereg-proxy/src/main/resources/application.yml @@ -14,10 +14,22 @@ spring: cloud: gateway: httpclient: - response-timeout: 1200s + response-timeout: 10s + wiretap: true + httpserver: + wiretap: true vault: enabled: false +logging: + level: + reactor: + netty: INFO + org: + springframework: + cloud: + gateway: INFO + consumers: ereg-aura: name: ereg-aura