X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=webapp-backend%2Fsrc%2Fmain%2Fjava%2Forg%2Foransc%2Fric%2Fportal%2Fdashboard%2Fconfig%2FCaasIngressConfiguration.java;h=dd9449dc89e568570e6fca5b42b5efd4d7e61ca3;hb=6dd828008e1c553b5b4ac6e45af0ccf73c2ed92e;hp=55398ded403a12a4f1838fcfec785971c1832fd0;hpb=44203c43bb16a87eb54cc97431a026e111842c97;p=portal%2Fric-dashboard.git diff --git a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/CaasIngressConfiguration.java b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/CaasIngressConfiguration.java index 55398ded..dd9449dc 100644 --- a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/CaasIngressConfiguration.java +++ b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/CaasIngressConfiguration.java @@ -19,7 +19,6 @@ */ package org.oransc.ric.portal.dashboard.config; -import java.io.IOException; import java.lang.invoke.MethodHandles; import java.security.KeyManagementException; import java.security.NoSuchAlgorithmException; @@ -31,38 +30,34 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import org.springframework.web.util.DefaultUriBuilderFactory; /** * Creates instances of CAAS-Ingres clients. */ -@org.springframework.context.annotation.Configuration +@Configuration @Profile("!test") public class CaasIngressConfiguration { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); // Populated by the autowired constructor - private final String caasIngressAuxUrl; private final String caasIngressPltUrl; @Autowired public CaasIngressConfiguration( // - @Value("${caasingress.insecure}") final Boolean insecureFlag, // - @Value("${caasingress.aux.url.prefix}") final String auxUrlPrefix, // - @Value("${caasingress.aux.url.suffix}") final String auxUrlSuffix, // @Value("${caasingress.plt.url.prefix}") final String pltUrlPrefix, - @Value("${caasingress.plt.url.suffix}") final String pltUrlSuffix) + @Value("${caasingress.plt.url.suffix}") final String pltUrlSuffix, + @Value("${caasingress.insecure}") final Boolean insecureFlag) // throws KeyManagementException, NoSuchAlgorithmException { - logger.debug("ctor caasingress aux prefix '{}' suffix '{}'", auxUrlPrefix, auxUrlSuffix); logger.debug("ctor caasingress plt prefix '{}' suffix '{}'", pltUrlPrefix, pltUrlSuffix); - caasIngressAuxUrl = new DefaultUriBuilderFactory(auxUrlPrefix.trim()).builder().path(auxUrlSuffix.trim()) - .build().normalize().toString(); + logger.debug("ctor caasingress insecure flag {}", insecureFlag); caasIngressPltUrl = new DefaultUriBuilderFactory(pltUrlPrefix.trim()).builder().path(pltUrlSuffix.trim()) .build().normalize().toString(); - logger.info("Configuring CAAS-Ingress URLs: aux {}, plt {}", caasIngressAuxUrl, caasIngressPltUrl); - if (insecureFlag) { + logger.info("Configuring CAAS-Ingress URL: plt {}", caasIngressPltUrl); + if (insecureFlag != null && insecureFlag) { logger.warn("ctor: insecure flag set, disabling SSL checks"); HttpsURLConnectionUtils.turnOffSslChecking(); } @@ -70,13 +65,7 @@ public class CaasIngressConfiguration { @Bean // The bean (method) name must be globally unique - public SimpleKubernetesClient ciAuxApi() throws IOException { - return new SimpleKubernetesClient(caasIngressAuxUrl); - } - - @Bean - // The bean (method) name must be globally unique - public SimpleKubernetesClient ciPltApi() throws IOException { + public SimpleKubernetesClient ciPltApi() { return new SimpleKubernetesClient(caasIngressPltUrl); }