From 2a4e427fe3eaeab82bc13c594c748af43548122a Mon Sep 17 00:00:00 2001 From: Cato Olsen Date: Fri, 12 Apr 2024 09:15:49 +0200 Subject: [PATCH 1/2] Fjerner referanser til Vault secret secret/.common/tokenx/dev/app-1. --- .../testnorge/batchbestillingservice/config/DevConfig.java | 1 - .../src/main/java/no/nav/dolly/web/config/LocalVaultConfig.java | 1 - .../nav/registre/testnorge/miljoerservice/config/DevConfig.java | 1 - .../no/nav/testnav/apps/oversiktfrontend/config/DevConfig.java | 1 - 4 files changed, 4 deletions(-) diff --git a/apps/batch-bestilling-service/src/main/java/no/nav/registre/testnorge/batchbestillingservice/config/DevConfig.java b/apps/batch-bestilling-service/src/main/java/no/nav/registre/testnorge/batchbestillingservice/config/DevConfig.java index d5795d77967..3e801f0130f 100644 --- a/apps/batch-bestilling-service/src/main/java/no/nav/registre/testnorge/batchbestillingservice/config/DevConfig.java +++ b/apps/batch-bestilling-service/src/main/java/no/nav/registre/testnorge/batchbestillingservice/config/DevConfig.java @@ -13,7 +13,6 @@ @Configuration @Profile("dev") @VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -@VaultPropertySource(value = "secret/.common/tokenx/dev/app-1", ignoreSecretNotFound = false) public class DevConfig extends AbstractVaultConfiguration { private static final String VAULT_TOKEN = "spring.cloud.vault.token"; diff --git a/apps/dolly-frontend/src/main/java/no/nav/dolly/web/config/LocalVaultConfig.java b/apps/dolly-frontend/src/main/java/no/nav/dolly/web/config/LocalVaultConfig.java index db8513cfdb5..a76b14ce691 100644 --- a/apps/dolly-frontend/src/main/java/no/nav/dolly/web/config/LocalVaultConfig.java +++ b/apps/dolly-frontend/src/main/java/no/nav/dolly/web/config/LocalVaultConfig.java @@ -12,7 +12,6 @@ @Configuration @Profile("local") -@VaultPropertySource(value = "secret/.common/tokenx/dev/app-1", ignoreSecretNotFound = false) @VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) public class LocalVaultConfig extends AbstractVaultConfiguration { diff --git a/apps/miljoer-service/src/main/java/no/nav/registre/testnorge/miljoerservice/config/DevConfig.java b/apps/miljoer-service/src/main/java/no/nav/registre/testnorge/miljoerservice/config/DevConfig.java index 69c2518b831..379b86d8f21 100644 --- a/apps/miljoer-service/src/main/java/no/nav/registre/testnorge/miljoerservice/config/DevConfig.java +++ b/apps/miljoer-service/src/main/java/no/nav/registre/testnorge/miljoerservice/config/DevConfig.java @@ -13,7 +13,6 @@ @Configuration @Profile("dev") @VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -@VaultPropertySource(value = "secret/.common/tokenx/dev/app-1", ignoreSecretNotFound = false) public class DevConfig extends AbstractVaultConfiguration { private static final String VAULT_TOKEN = "spring.cloud.vault.token"; diff --git a/apps/oversikt-frontend/src/main/java/no/nav/testnav/apps/oversiktfrontend/config/DevConfig.java b/apps/oversikt-frontend/src/main/java/no/nav/testnav/apps/oversiktfrontend/config/DevConfig.java index 0a1c47022a5..69d0ed9419f 100644 --- a/apps/oversikt-frontend/src/main/java/no/nav/testnav/apps/oversiktfrontend/config/DevConfig.java +++ b/apps/oversikt-frontend/src/main/java/no/nav/testnav/apps/oversiktfrontend/config/DevConfig.java @@ -13,7 +13,6 @@ @Configuration @Profile("dev") @VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) -@VaultPropertySource(value = "secret/.common/tokenx/dev/app-1", ignoreSecretNotFound = false) public class DevConfig extends AbstractVaultConfiguration { private static final String VAULT_TOKEN = "spring.cloud.vault.token"; From 29ace95f2b3fb21fef7b9d6cdb6a2dfff233ff34 Mon Sep 17 00:00:00 2001 From: Cato Olsen Date: Fri, 12 Apr 2024 09:20:32 +0200 Subject: [PATCH 2/2] Fjernet noen null-relaterte warnings. --- .../testnorge/batchbestillingservice/config/DevConfig.java | 5 ++++- .../main/java/no/nav/dolly/web/config/LocalVaultConfig.java | 3 +++ .../registre/testnorge/miljoerservice/config/DevConfig.java | 3 +++ .../nav/testnav/apps/oversiktfrontend/config/DevConfig.java | 3 +++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/apps/batch-bestilling-service/src/main/java/no/nav/registre/testnorge/batchbestillingservice/config/DevConfig.java b/apps/batch-bestilling-service/src/main/java/no/nav/registre/testnorge/batchbestillingservice/config/DevConfig.java index 3e801f0130f..7f2ce2bae18 100644 --- a/apps/batch-bestilling-service/src/main/java/no/nav/registre/testnorge/batchbestillingservice/config/DevConfig.java +++ b/apps/batch-bestilling-service/src/main/java/no/nav/registre/testnorge/batchbestillingservice/config/DevConfig.java @@ -2,6 +2,7 @@ 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; @@ -15,14 +16,16 @@ @VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) public class DevConfig extends AbstractVaultConfiguration { - private static final String VAULT_TOKEN = "spring.cloud.vault.token"; + private static final String VAULT_TOKEN = "spring.cloud.vault.token"; @Override + @NonNull public VaultEndpoint vaultEndpoint() { return VaultEndpoint.create("vault.adeo.no", 443); } @Override + @NonNull public ClientAuthentication clientAuthentication() { if (System.getenv().containsKey("VAULT_TOKEN")) { System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); diff --git a/apps/dolly-frontend/src/main/java/no/nav/dolly/web/config/LocalVaultConfig.java b/apps/dolly-frontend/src/main/java/no/nav/dolly/web/config/LocalVaultConfig.java index a76b14ce691..9d48992a2e6 100644 --- a/apps/dolly-frontend/src/main/java/no/nav/dolly/web/config/LocalVaultConfig.java +++ b/apps/dolly-frontend/src/main/java/no/nav/dolly/web/config/LocalVaultConfig.java @@ -2,6 +2,7 @@ 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; @@ -18,11 +19,13 @@ public class LocalVaultConfig extends AbstractVaultConfiguration { private static final String VAULT_TOKEN = "spring.cloud.vault.token"; @Override + @NonNull public VaultEndpoint vaultEndpoint() { return VaultEndpoint.create("vault.adeo.no", 443); } @Override + @NonNull public ClientAuthentication clientAuthentication() { if (System.getenv().containsKey("VAULT_TOKEN")) { System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); diff --git a/apps/miljoer-service/src/main/java/no/nav/registre/testnorge/miljoerservice/config/DevConfig.java b/apps/miljoer-service/src/main/java/no/nav/registre/testnorge/miljoerservice/config/DevConfig.java index 379b86d8f21..cffa79859bc 100644 --- a/apps/miljoer-service/src/main/java/no/nav/registre/testnorge/miljoerservice/config/DevConfig.java +++ b/apps/miljoer-service/src/main/java/no/nav/registre/testnorge/miljoerservice/config/DevConfig.java @@ -2,6 +2,7 @@ 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; @@ -18,11 +19,13 @@ public class DevConfig extends AbstractVaultConfiguration { private static final String VAULT_TOKEN = "spring.cloud.vault.token"; @Override + @NonNull public VaultEndpoint vaultEndpoint() { return VaultEndpoint.create("vault.adeo.no", 443); } @Override + @NonNull public ClientAuthentication clientAuthentication() { if (System.getenv().containsKey("VAULT_TOKEN")) { System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN")); diff --git a/apps/oversikt-frontend/src/main/java/no/nav/testnav/apps/oversiktfrontend/config/DevConfig.java b/apps/oversikt-frontend/src/main/java/no/nav/testnav/apps/oversiktfrontend/config/DevConfig.java index 69d0ed9419f..02e7974a2d0 100644 --- a/apps/oversikt-frontend/src/main/java/no/nav/testnav/apps/oversiktfrontend/config/DevConfig.java +++ b/apps/oversikt-frontend/src/main/java/no/nav/testnav/apps/oversiktfrontend/config/DevConfig.java @@ -2,6 +2,7 @@ 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; @@ -18,11 +19,13 @@ public class DevConfig extends AbstractVaultConfiguration { private static final String VAULT_TOKEN = "spring.cloud.vault.token"; @Override + @NonNull public VaultEndpoint vaultEndpoint() { return VaultEndpoint.create("vault.adeo.no", 443); } @Override + @NonNull public ClientAuthentication clientAuthentication() { if (System.getenv().containsKey("VAULT_TOKEN")) { System.setProperty(VAULT_TOKEN, System.getenv("VAULT_TOKEN"));