Skip to content

Commit 289e19f

Browse files
authored
Minor changes in system variables set when starting applications in local profile.
- Adds Secret Manager provided value AZURE_TRYGDEETATEN_OPENID_CONFIG_TOKEN_ENDPOINT in local profile. - Moves ALTINN_URL handling to altinn3-tilgang-service config (only used here). - Moves CRYPTOGRAPHY_SECRET handling to bruker-service config (only used here). - Moves SLACK_CHANNEL/SLACK_TOKEN handling to tilbakemelding-api config (only used here). - Moves IDPORTEN_CLIENT_ID/IDPORTEN_CLIENT_JWK handling to dolly-frontend config (only used here).
1 parent b523f33 commit 289e19f

File tree

8 files changed

+17
-15
lines changed

8 files changed

+17
-15
lines changed

apps/altinn3-tilgang-service/src/main/resources/application-local.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
ALTINN_URL: ${sm\://altinn-url}
12
MASKINPORTEN_CLIENT_ID: ef2960de-7fa6-4396-80a5-2eca00e4af28
23
MASKINPORTEN_SCOPES: altinn:resourceregistry/accesslist.read altinn:resourceregistry/accesslist.write altinn:accessmanagement/authorizedparties.resourceowner
34

Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTINN_URL: dummy

apps/bruker-service/src/main/resources/application-local.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
CRYPTOGRAPHY_SECRET: dummy
12
TOKEN_X_CLIENT_ID: dev-gcp:dolly:testnav-bruker-service-dev
23

34
spring:

apps/bruker-service/src/test/resources/application-test.yml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
CRYPTOGRAPHY_SECRET: dummy
2+
13
spring:
24
flyway:
35
url: jdbc:h2:mem:testdb
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
IDPORTEN_CLIENT_ID: dummy
2+
IDPORTEN_CLIENT_JWK: dummy
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
SLACK_CHANNEL: dummy
2+
SLACK_TOKEN: dummy
3+
14
consumers:
25
profil-api:
36
url: https://testnorge-profil-api.intern.dev.nav.no
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
SLACK_TOKEN: dummy
2-
SLACK_CHANNEL: dummy
1+
SLACK_CHANNEL: dummy
2+
SLACK_TOKEN: dummy

libs/testing/src/main/java/no/nav/dolly/libs/nais/NaisEnvironmentApplicationContextInitializer.java

+5-13
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,21 @@ private static void configureForLocalProfile(Map<String, Object> properties) {
3434
log.info("Configuring environment for local profile using Secret Manager");
3535

3636
// Emulating NAIS provided environment variables.
37-
properties.putIfAbsent("ALTINN_URL", "${sm\\://altinn-url}"); // Used by altinn3-tilgang-service only.
3837
properties.putIfAbsent("AZURE_APP_CLIENT_ID", "${sm\\://azure-app-client-id}");
3938
properties.putIfAbsent("AZURE_APP_CLIENT_SECRET", "${sm\\://azure-app-client-secret}");
4039
properties.putIfAbsent("AZURE_NAV_APP_CLIENT_ID", DUMMY); // Value found in pod, if needed.
4140
properties.putIfAbsent("AZURE_NAV_APP_CLIENT_SECRET", DUMMY); // Value found in pod, if needed.
4241
properties.putIfAbsent("AZURE_NAV_OPENID_CONFIG_TOKEN_ENDPOINT", "${sm\\://azure-nav-openid-config-token-endpoint}");
4342
properties.putIfAbsent("AZURE_OPENID_CONFIG_ISSUER", "${sm\\://azure-openid-config-issuer}");
4443
properties.putIfAbsent("AZURE_OPENID_CONFIG_TOKEN_ENDPOINT", "${sm\\://azure-openid-config-token-endpoint}");
45-
properties.putIfAbsent("AZURE_TRYGDEETATEN_APP_CLIENT_ID", DUMMY);
46-
properties.putIfAbsent("AZURE_TRYGDEETATEN_APP_CLIENT_SECRET", DUMMY);
47-
properties.putIfAbsent("AZURE_TRYGDEETATEN_OPENID_CONFIG_TOKEN_ENDPOINT", DUMMY);
48-
properties.putIfAbsent("CRYPTOGRAPHY_SECRET", DUMMY); // Used by bruker-service only.
49-
properties.putIfAbsent("JWT_SECRET", DUMMY); // Used by bruker-service only.
44+
properties.putIfAbsent("AZURE_TRYGDEETATEN_APP_CLIENT_ID", DUMMY); // Value found in pod, if needed.
45+
properties.putIfAbsent("AZURE_TRYGDEETATEN_APP_CLIENT_SECRET", DUMMY); // Value found in pod, if needed.
46+
properties.putIfAbsent("AZURE_TRYGDEETATEN_OPENID_CONFIG_TOKEN_ENDPOINT", "${sm\\://azure-trygdeetaten-openid-config-token-endpoint}");
47+
properties.putIfAbsent("JWT_SECRET", DUMMY);
5048
properties.putIfAbsent("MASKINPORTEN_CLIENT_ID", DUMMY); // Used by tenor-search-service and altinn3-tilgang-service only.
5149
properties.putIfAbsent("MASKINPORTEN_CLIENT_JWK", DUMMY); // Used by tenor-search-service and altinn3-tilgang-service only.
5250
properties.putIfAbsent("MASKINPORTEN_SCOPES", DUMMY); // Used by tenor-search-service and altinn3-tilgang-service only.
5351
properties.putIfAbsent("MASKINPORTEN_WELL_KNOWN_URL", "${sm\\://maskinporten-well-known-url}"); // Used by tenor-search-service and altinn3-tilgang-service only.
54-
properties.putIfAbsent("SLACK_CHANNEL", DUMMY); // Used by tilbakemelding-api only.
55-
properties.putIfAbsent("SLACK_TOKEN", DUMMY); // Used by tilbakemelding-api only.
5652
properties.putIfAbsent("TOKEN_X_ISSUER", "${sm\\://token-x-issuer}");
5753

5854
}
@@ -70,13 +66,9 @@ private static void configureForTestProfile(Map<String, Object> properties) {
7066
"spring.cloud.vault.token", // For apps using no.nav.testnav.libs:vault.
7167

7268
"ALTINN_API_KEY",
73-
"ALTINN_URL",
7469
"AZURE_OPENID_CONFIG_ISSUER",
7570
"AZURE_OPENID_CONFIG_TOKEN_ENDPOINT",
76-
"CRYPTOGRAPHY_SECRET", // Used by bruker-service only.
77-
"IDPORTEN_CLIENT_ID", // Used by dolly-frontend only.
78-
"IDPORTEN_CLIENT_JWK", // Used by dolly-frontend only.
79-
"JWT_SECRET", // Used by bruker-service only.
71+
"JWT_SECRET",
8072
"MASKINPORTEN_CLIENT_ID",
8173
"MASKINPORTEN_CLIENT_JWK",
8274
"MASKINPORTEN_SCOPES",

0 commit comments

Comments
 (0)