Skip to content

Commit

Permalink
Service discovery mot etterlatte-api
Browse files Browse the repository at this point in the history
  • Loading branch information
sebassonav committed Dec 5, 2024
1 parent dee021c commit bd377b9
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion apps/innsendt-soeknad/.nais/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ spec:
- name: NAV_CONSUMER_ID
value: "srvbarnepensjon"
- name: ETTERLATTE_API_URL
value: https://etterlatte-api.intern.dev.nav.no
value: http://etterlatte-api
- name: ETTERLATTE_API_AZURE_SCOPE
value: api://dev-gcp.etterlatte.etterlatte-api/.default
accessPolicy:
Expand Down
3 changes: 2 additions & 1 deletion apps/innsendt-soeknad/.nais/prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,13 @@ spec:
- name: NAV_CONSUMER_ID
value: "srvbarnepensjon"
- name: ETTERLATTE_API_URL
value: https://etterlatte-api.intern.nav.no
value: https://etterlatte-api
- name: ETTERLATTE_API_AZURE_SCOPE
value: api://prod-gcp.etterlatte.etterlatte-api/.default
accessPolicy:
outbound:
rules:
- application: etterlatte-api
- application: digdir-krr-proxy
namespace: team-rocket
- application: kodeverk-api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import io.ktor.client.plugins.auth.AuthProvider
import io.ktor.client.request.HttpRequestBuilder
import io.ktor.http.HttpHeaders
import io.ktor.http.auth.HttpAuthHeader
import no.nav.etterlatte.AzureDefaultEnvVariables
import no.nav.security.token.support.client.core.ClientAuthenticationProperties
import no.nav.security.token.support.client.core.ClientProperties
import no.nav.security.token.support.client.core.oauth2.ClientCredentialsTokenClient
Expand All @@ -21,15 +22,15 @@ class ClientCredentialAuthProvider(
private val clientPropertiesConfig =
ClientProperties(
tokenEndpointUrl = null,
wellKnownUrl = config["AZURE_APP_WELL_KNOWN_URL"]?.let { URI(it) },
wellKnownUrl = config[AzureDefaultEnvVariables.AZURE_APP_WELL_KNOWN_URL.name]?.let { URI(it) },
grantType = GrantType.CLIENT_CREDENTIALS,
scope = config["AZURE_APP_OUTBOUND_SCOPE"]?.split(",") ?: emptyList(),
scope = config[AzureDefaultEnvVariables.AZURE_APP_OUTBOUND_SCOPE.name]?.split(",") ?: emptyList(),
authentication =
ClientAuthenticationProperties
.builder(
clientId = config.getOrThrow("AZURE_APP_CLIENT_ID"),
clientId = config.getOrThrow(AzureDefaultEnvVariables.AZURE_APP_CLIENT_ID.name),
clientAuthMethod = ClientAuthenticationMethod.PRIVATE_KEY_JWT,
).clientJwk(config.getOrThrow("AZURE_APP_JWK"))
).clientJwk(config.getOrThrow(AzureDefaultEnvVariables.AZURE_APP_JWK.name))
.build(),
resourceUrl = null,
tokenExchange = null,
Expand Down
4 changes: 1 addition & 3 deletions apps/selvbetjening-backend/.nais/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ spec:
- name: PDL_AUDIENCE
value: "dev-fss:pdl:pdl-api"
- name: ETTERLATTE_API_URL
value: https://etterlatte-api.intern.dev.nav.no
value: http://etterlatte-api
- name: ETTERLATTE_API_AZURE_SCOPE
value: api://dev-gcp.etterlatte.etterlatte-api/.default
envFrom:
Expand All @@ -70,8 +70,6 @@ spec:
outbound:
rules:
- application: etterlatte-api
namespace: etterlatte
cluster: dev-gcp
external:
- host: pdl-api.dev-fss-pub.nais.io
- host: etterlatte-unleash-api.nav.cloud.nais.io
Expand Down
4 changes: 1 addition & 3 deletions apps/selvbetjening-backend/.nais/prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ spec:
- name: PDL_AUDIENCE
value: "prod-fss:pdl:pdl-api"
- name: ETTERLATTE_API_URL
value: https://etterlatte-api.intern.nav.no
value: https://etterlatte-api
- name: ETTERLATTE_API_AZURE_SCOPE
value: api://prod-gcp.etterlatte.etterlatte-api/.default
envFrom:
Expand All @@ -70,8 +70,6 @@ spec:
outbound:
rules:
- application: etterlatte-api
namespace: etterlatte
cluster: prod-gcp
external:
- host: pdl-api.prod-fss-pub.nais.io
- host: etterlatte-unleash-api.nav.cloud.nais.io
Expand Down

0 comments on commit bd377b9

Please sign in to comment.