aboutsummaryrefslogtreecommitdiffstats
path: root/prh-app-server/src/main/java/org
diff options
context:
space:
mode:
authorMaciej Wejs <maciej.wejs@nokia.com>2018-11-06 12:07:12 +0100
committerMaciej Wejs <maciej.wejs@nokia.com>2018-11-06 12:07:12 +0100
commit8330d0e6c2cf1d9d8215e13b928530c2277fa974 (patch)
treeb475506131e3aac411721da0c166609f054db02d /prh-app-server/src/main/java/org
parente8a80102a45458b3f1d15e07dc0a63e1370c44a7 (diff)
SSL implementation for PRH to AAI calls
Change-Id: Ic9777760346258afb40610fa9c9bc261964752cf Issue-ID: DCAEGEN2-950 Signed-off-by: Maciej Wejs <maciej.wejs@nokia.com>
Diffstat (limited to 'prh-app-server/src/main/java/org')
-rw-r--r--prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/AppConfig.java18
-rw-r--r--prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/PrhAppConfig.java7
-rw-r--r--prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/AaiProducerTask.java3
3 files changed, 14 insertions, 14 deletions
diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/AppConfig.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/AppConfig.java
index 643462f1..191294fd 100644
--- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/AppConfig.java
+++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/AppConfig.java
@@ -174,16 +174,16 @@ public class AppConfig extends PrhAppConfig {
.consumerId(Optional.ofNullable(consumerId).filter(isEmpty.negate())
.orElse(dmaapConsumerConfiguration.consumerId()))
.keyFile(
- Optional.ofNullable(keyFile).filter(p -> !p.isEmpty())
+ Optional.ofNullable(keyFile).filter(isEmpty.negate())
.orElse(dmaapConsumerConfiguration.keyFile()))
.trustStore(
- Optional.ofNullable(trustStore).filter(p -> !p.isEmpty())
+ Optional.ofNullable(trustStore).filter(isEmpty.negate())
.orElse(dmaapConsumerConfiguration.trustStore()))
.trustStorePassword(
Optional.ofNullable(trustStorePassword).filter(isEmpty.negate())
.orElse(dmaapConsumerConfiguration.trustStorePassword()))
.keyStore(
- Optional.ofNullable(keyStore).filter(p -> !p.isEmpty())
+ Optional.ofNullable(keyStore).filter(isEmpty.negate())
.orElse(dmaapConsumerConfiguration.keyStore()))
.keyStorePassword(
Optional.ofNullable(keyStorePassword).filter(isEmpty.negate())
@@ -216,16 +216,16 @@ public class AppConfig extends PrhAppConfig {
Optional.ofNullable(aaiPnfPath).filter(isEmpty.negate()).orElse(aaiClientConfiguration.aaiPnfPath()))
.aaiHeaders(aaiClientConfiguration.aaiHeaders())
.keyFile(
- Optional.ofNullable(keyFile).filter(p -> !p.isEmpty())
+ Optional.ofNullable(keyFile).filter(isEmpty.negate())
.orElse(aaiClientConfiguration.keyFile()))
.trustStore(
- Optional.ofNullable(trustStore).filter(p -> !p.isEmpty())
+ Optional.ofNullable(trustStore).filter(isEmpty.negate())
.orElse(aaiClientConfiguration.trustStore()))
.trustStorePassword(
Optional.ofNullable(trustStorePassword).filter(isEmpty.negate())
.orElse(aaiClientConfiguration.trustStorePassword()))
.keyStore(
- Optional.ofNullable(keyStore).filter(p -> !p.isEmpty())
+ Optional.ofNullable(keyStore).filter(isEmpty.negate())
.orElse(aaiClientConfiguration.keyStore()))
.keyStorePassword(
Optional.ofNullable(keyStorePassword).filter(isEmpty.negate())
@@ -261,16 +261,16 @@ public class AppConfig extends PrhAppConfig {
Optional.ofNullable(producerDmaapUserPassword).filter(isEmpty.negate())
.orElse(dmaapPublisherConfiguration.dmaapUserPassword()))
.keyFile(
- Optional.ofNullable(keyFile).filter(p -> !p.isEmpty())
+ Optional.ofNullable(keyFile).filter(isEmpty.negate())
.orElse(dmaapPublisherConfiguration.keyFile()))
.trustStore(
- Optional.ofNullable(trustStore).filter(p -> !p.isEmpty())
+ Optional.ofNullable(trustStore).filter(isEmpty.negate())
.orElse(dmaapPublisherConfiguration.trustStore()))
.trustStorePassword(
Optional.ofNullable(trustStorePassword).filter(isEmpty.negate())
.orElse(dmaapPublisherConfiguration.trustStorePassword()))
.keyStore(
- Optional.ofNullable(keyStore).filter(p -> !p.isEmpty())
+ Optional.ofNullable(keyStore).filter(isEmpty.negate())
.orElse(dmaapPublisherConfiguration.keyStore()))
.keyStorePassword(
Optional.ofNullable(keyStorePassword).filter(isEmpty.negate())
diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/PrhAppConfig.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/PrhAppConfig.java
index 54c63532..2b4b201a 100644
--- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/PrhAppConfig.java
+++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/PrhAppConfig.java
@@ -95,11 +95,10 @@ public abstract class PrhAppConfig implements Config {
try (InputStream inputStream = resourceFile.getInputStream()) {
JsonElement rootElement = getJsonElement(parser, inputStream);
if (rootElement.isJsonObject()) {
- JsonObject jsonObject = concatenateJsonObjects(
- rootElement.getAsJsonObject().getAsJsonObject(CONFIG).getAsJsonObject(AAI).getAsJsonObject(AAI_CONFIG),
- rootElement.getAsJsonObject().getAsJsonObject(CONFIG).getAsJsonObject(SECURITY));
aaiClientConfiguration = deserializeType(gsonBuilder,
- jsonObject,
+ concatenateJsonObjects(
+ rootElement.getAsJsonObject().getAsJsonObject(CONFIG).getAsJsonObject(AAI).getAsJsonObject(AAI_CONFIG),
+ rootElement.getAsJsonObject().getAsJsonObject(CONFIG).getAsJsonObject(SECURITY)),
AaiClientConfiguration.class);
dmaapConsumerConfiguration = deserializeType(gsonBuilder,
concatenateJsonObjects(
diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/AaiProducerTask.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/AaiProducerTask.java
index efa4f66f..54a8ad89 100644
--- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/AaiProducerTask.java
+++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/AaiProducerTask.java
@@ -27,6 +27,7 @@ import org.onap.dcaegen2.services.prh.exceptions.PrhTaskException;
import org.onap.dcaegen2.services.prh.model.ConsumerDmaapModel;
import org.onap.dcaegen2.services.prh.service.AaiReactiveWebClient;
import org.onap.dcaegen2.services.prh.service.producer.AaiProducerReactiveHttpClient;
+import org.onap.dcaegen2.services.prh.ssl.SslFactory;
import org.springframework.web.reactive.function.client.WebClient;
import reactor.core.publisher.Mono;
@@ -46,6 +47,6 @@ public abstract class AaiProducerTask {
throws PrhTaskException, SSLException;
WebClient buildWebClient() throws SSLException {
- return new AaiReactiveWebClient().fromConfiguration(resolveConfiguration()).build();
+ return new AaiReactiveWebClient(new SslFactory(), resolveConfiguration()).build();
}
}