diff --git a/proxies/pdl-proxy/config.yml b/proxies/pdl-proxy/config.yml index a044b13b15d..6221000a281 100644 --- a/proxies/pdl-proxy/config.yml +++ b/proxies/pdl-proxy/config.yml @@ -98,5 +98,6 @@ spec: memory: 2048Mi envFrom: - secret: azure-trygdeetaten-testnav-pdl-proxy-trygdeetaten + - secret: testnav-pdl-proxy ingresses: - "https://testnav-pdl-proxy.dev-fss-pub.nais.io" diff --git a/proxies/pdl-proxy/src/main/java/no/nav/testnav/proxies/pdlproxy/config/CredentialsConfig.java b/proxies/pdl-proxy/src/main/java/no/nav/testnav/proxies/pdlproxy/config/CredentialsConfig.java index 76b88499fd5..a4048e36182 100644 --- a/proxies/pdl-proxy/src/main/java/no/nav/testnav/proxies/pdlproxy/config/CredentialsConfig.java +++ b/proxies/pdl-proxy/src/main/java/no/nav/testnav/proxies/pdlproxy/config/CredentialsConfig.java @@ -1,27 +1,45 @@ package no.nav.testnav.proxies.pdlproxy.config; +import lombok.extern.slf4j.Slf4j; import no.nav.testnav.proxies.pdlproxy.CredentialsHolder; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration +@Slf4j public class CredentialsConfig { - @Value("${hendelse.lager.api.key}") + @Value("${app.hendelse.lager.api.key}") private String hendelselagerApiKey; - @Value("${person.aktor.admin.api}") + @Value("${app.person.aktor.admin.api}") private String aktoerAdminApiKey; - @Value("${elastic.username}") + @Value("${app.elastic.username}") private String elasticUsername; - @Value("${elastic.password}") + @Value("${app.elastic.password}") private String elasticPassword; + @Value("${hendelse.lager.api.key}") + private String oldHendelselagerApiKey; + + @Value("${person.aktor.admin.api}") + private String oldAktoerAdminApiKey; + + @Value("${elastic.username}") + private String oldElasticUsername; + + @Value("${elastic.password}") + private String oldElasticPassword; + @Bean CredentialsHolder credentialsHolder() { + log.info("Checking aktoerAdminApiKey: {}", (aktoerAdminApiKey.equals(oldAktoerAdminApiKey))); + log.info("Checking hendelselagerApiKey: {}", (hendelselagerApiKey.equals(oldHendelselagerApiKey))); + log.info("Checking elasticUsername: {}", (elasticUsername.equals(oldElasticUsername))); + log.info("Checking elasticPassword: {}", (elasticPassword.equals(oldElasticPassword))); return new CredentialsHolder(hendelselagerApiKey, aktoerAdminApiKey, elasticUsername, elasticPassword); } diff --git a/proxies/pdl-proxy/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/proxies/pdl-proxy/src/main/resources/META-INF/additional-spring-configuration-metadata.json new file mode 100644 index 00000000000..822e874f5ef --- /dev/null +++ b/proxies/pdl-proxy/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -0,0 +1,23 @@ +{ + "properties": [ + { + "name": "app.hendelse.lager.api.key", + "type": "java.lang.String", + "description": "API key for hendelse-lager-api? Assigned by ?." + }, + { + "name": "app.person.aktor.api.key", + "type": "java.lang.String", + "description": "API key for person-aktor-api? Assigned by ?." + }, + { + "name": "app.elastic.username", + "type": "java.lang.String", + "description": "Elastic username." + }, + { + "name": "app.elastic.password", + "type": "java.lang.String", + "description": "Elastic password." + } + ] } \ No newline at end of file diff --git a/proxies/pdl-proxy/src/main/resources/application.yml b/proxies/pdl-proxy/src/main/resources/application.yml index f832549c1de..3dc38463c53 100644 --- a/proxies/pdl-proxy/src/main/resources/application.yml +++ b/proxies/pdl-proxy/src/main/resources/application.yml @@ -25,6 +25,13 @@ spring: vault: enabled: false +app: + elastic: + username: ${ELASTIC_PASSWORD} + password: ${ELASTIC_USERNAME} + hendelse.lager.api.key: ${HENDELSE_LAGER_API_KEY} + person.aktor.api.key: ${PERSON_AKTOR_API_KEY} + sts: token: provider: