Skip to content

Commit

Permalink
Korrekt url ved bruk av FPApplication fra gcp til fss. (#1278)
Browse files Browse the repository at this point in the history
* Korrekt url ved bruk av FPApplication fra gcp til fss.

* Bare bruk proxy for FSS
  • Loading branch information
espenwaaga committed Apr 25, 2023
1 parent 95e9caa commit c5869e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,13 @@ private static OpenIDConfiguration createStsConfiguration(String wellKnownUrl) {

@SuppressWarnings("unused")
private static OpenIDConfiguration createAzureAppConfiguration(String wellKnownUrl) {
var useProxy = ENV.isLocal() ? null : URI.create(ENV.getProperty(AZURE_HTTP_PROXY, getDefaultProxy()));
var proxyUrl = ENV.isFss() ? URI.create(ENV.getProperty(AZURE_HTTP_PROXY, getDefaultProxy())) : null;
return createConfiguration(OpenIDProvider.AZUREAD, Optional.ofNullable(getAzureProperty(AzureProperty.AZURE_OPENID_CONFIG_ISSUER))
.orElseGet(() -> getIssuerFra(wellKnownUrl, useProxy).orElse(null)),
.orElseGet(() -> getIssuerFra(wellKnownUrl, proxyUrl).orElse(null)),
Optional.ofNullable(getAzureProperty(AzureProperty.AZURE_OPENID_CONFIG_JWKS_URI))
.orElseGet(() -> getJwksFra(wellKnownUrl, useProxy).orElse(null)),
.orElseGet(() -> getJwksFra(wellKnownUrl, proxyUrl).orElse(null)),
Optional.ofNullable(getAzureProperty(AzureProperty.AZURE_OPENID_CONFIG_TOKEN_ENDPOINT))
.orElseGet(() -> getTokenEndpointFra(wellKnownUrl, useProxy).orElse(null)), !ENV.isLocal(), useProxy,
.orElseGet(() -> getTokenEndpointFra(wellKnownUrl, proxyUrl).orElse(null)), ENV.isFss(), proxyUrl,
getAzureProperty(AzureProperty.AZURE_APP_CLIENT_ID), getAzureProperty(AzureProperty.AZURE_APP_CLIENT_SECRET), ENV.isLocal());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ public static String contextPathFor(FpApplication application) {
if (ENV.isFss()) { // Kaller fra FSS til GCP
return prefix + ".intern" + (ENV.isProd() ? "" : ".dev") + ".nav.no/" + appname;
} else if (ENV.isGcp()) { // Kaller fra GCP til FSS
return prefix + clusterForApplication.clusterName() + "-pub.nais.io/" + appname;
if (FPSAK.equals(application)) {
return prefix + "-api." + clusterForApplication.clusterName() + "-pub.nais.io/" + appname;
}
return prefix + "." + clusterForApplication.clusterName() + "-pub.nais.io/" + appname;
} else {
throw new IllegalStateException("Utviklerfeil: Skal ikke komme hit");
}
Expand Down

0 comments on commit c5869e4

Please sign in to comment.