summaryrefslogtreecommitdiffstats
path: root/prh-app-server/src/main
diff options
context:
space:
mode:
authorMaciej Wejs <maciej.wejs@nokia.com>2018-11-06 16:38:46 +0100
committerMaciej Wejs <maciej.wejs@nokia.com>2018-11-06 16:38:46 +0100
commitf4f1318b19c90016c70a0af457020361733b69f3 (patch)
tree679399be0e90df7f2e24fd054a6a6d2918f62d75 /prh-app-server/src/main
parent8a762124d24555d50ce7455398ca3ac02fde1076 (diff)
Names change of SSL config params
Change-Id: I719b38b76fec976c459bfca6ffdc6dd9c1d7b00c Issue-ID: DCAEGEN2-953 Signed-off-by: Maciej Wejs <maciej.wejs@nokia.com>
Diffstat (limited to 'prh-app-server/src/main')
-rw-r--r--prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/AppConfig.java100
-rw-r--r--prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/CloudConfigParser.java36
-rw-r--r--prh-app-server/src/main/resources/prh_endpoints.json9
3 files changed, 64 insertions, 81 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 191294fd..9d199a14 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
@@ -119,20 +119,17 @@ public class AppConfig extends PrhAppConfig {
@Value("${aai.aaiClientConfiguration.aaiPnfPath:}")
public String aaiPnfPath;
- @Value("${security.keyFile:}")
- public String keyFile;
+ @Value("${security.trustStorePath:}")
+ public String trustStorePath;
- @Value("${security.trustStore:}")
- public String trustStore;
+ @Value("${security.trustStorePasswordPath:}")
+ public String trustStorePasswordPath;
- @Value("${security.trustStorePassword:}")
- public String trustStorePassword;
+ @Value("${security.keyStorePath:}")
+ public String keyStorePath;
- @Value("${security.keyStore:}")
- public String keyStore;
-
- @Value("${security.keyStorePassword:}")
- public String keyStorePassword;
+ @Value("${security.keyStorePasswordPath:}")
+ public String keyStorePasswordPath;
@Value("${security.enableAaiCertAuth:}")
public Boolean enableAaiCertAuth;
@@ -173,21 +170,18 @@ public class AppConfig extends PrhAppConfig {
.orElse(dmaapConsumerConfiguration.consumerGroup()))
.consumerId(Optional.ofNullable(consumerId).filter(isEmpty.negate())
.orElse(dmaapConsumerConfiguration.consumerId()))
- .keyFile(
- Optional.ofNullable(keyFile).filter(isEmpty.negate())
- .orElse(dmaapConsumerConfiguration.keyFile()))
- .trustStore(
- Optional.ofNullable(trustStore).filter(isEmpty.negate())
- .orElse(dmaapConsumerConfiguration.trustStore()))
- .trustStorePassword(
- Optional.ofNullable(trustStorePassword).filter(isEmpty.negate())
- .orElse(dmaapConsumerConfiguration.trustStorePassword()))
- .keyStore(
- Optional.ofNullable(keyStore).filter(isEmpty.negate())
- .orElse(dmaapConsumerConfiguration.keyStore()))
- .keyStorePassword(
- Optional.ofNullable(keyStorePassword).filter(isEmpty.negate())
- .orElse(dmaapConsumerConfiguration.keyStorePassword()))
+ .trustStorePath(
+ Optional.ofNullable(trustStorePath).filter(isEmpty.negate())
+ .orElse(dmaapConsumerConfiguration.trustStorePath()))
+ .trustStorePasswordPath(
+ Optional.ofNullable(trustStorePasswordPath).filter(isEmpty.negate())
+ .orElse(dmaapConsumerConfiguration.trustStorePasswordPath()))
+ .keyStorePath(
+ Optional.ofNullable(keyStorePath).filter(isEmpty.negate())
+ .orElse(dmaapConsumerConfiguration.keyStorePath()))
+ .keyStorePasswordPath(
+ Optional.ofNullable(keyStorePasswordPath).filter(isEmpty.negate())
+ .orElse(dmaapConsumerConfiguration.keyStorePasswordPath()))
.enableDmaapCertAuth(
Optional.ofNullable(enableDmaapCertAuth).filter(p -> !p.toString().isEmpty())
.orElse(dmaapConsumerConfiguration.enableDmaapCertAuth()))
@@ -215,21 +209,18 @@ public class AppConfig extends PrhAppConfig {
.aaiPnfPath(
Optional.ofNullable(aaiPnfPath).filter(isEmpty.negate()).orElse(aaiClientConfiguration.aaiPnfPath()))
.aaiHeaders(aaiClientConfiguration.aaiHeaders())
- .keyFile(
- Optional.ofNullable(keyFile).filter(isEmpty.negate())
- .orElse(aaiClientConfiguration.keyFile()))
- .trustStore(
- Optional.ofNullable(trustStore).filter(isEmpty.negate())
- .orElse(aaiClientConfiguration.trustStore()))
- .trustStorePassword(
- Optional.ofNullable(trustStorePassword).filter(isEmpty.negate())
- .orElse(aaiClientConfiguration.trustStorePassword()))
- .keyStore(
- Optional.ofNullable(keyStore).filter(isEmpty.negate())
- .orElse(aaiClientConfiguration.keyStore()))
- .keyStorePassword(
- Optional.ofNullable(keyStorePassword).filter(isEmpty.negate())
- .orElse(aaiClientConfiguration.keyStorePassword()))
+ .trustStorePath(
+ Optional.ofNullable(trustStorePath).filter(isEmpty.negate())
+ .orElse(aaiClientConfiguration.trustStorePath()))
+ .trustStorePasswordPath(
+ Optional.ofNullable(trustStorePasswordPath).filter(isEmpty.negate())
+ .orElse(aaiClientConfiguration.trustStorePasswordPath()))
+ .keyStorePath(
+ Optional.ofNullable(keyStorePath).filter(isEmpty.negate())
+ .orElse(aaiClientConfiguration.keyStorePath()))
+ .keyStorePasswordPath(
+ Optional.ofNullable(keyStorePasswordPath).filter(isEmpty.negate())
+ .orElse(aaiClientConfiguration.keyStorePasswordPath()))
.enableAaiCertAuth(
Optional.ofNullable(enableAaiCertAuth).filter(p -> !p.toString().isEmpty())
.orElse(aaiClientConfiguration.enableAaiCertAuth()))
@@ -260,21 +251,18 @@ public class AppConfig extends PrhAppConfig {
.dmaapUserPassword(
Optional.ofNullable(producerDmaapUserPassword).filter(isEmpty.negate())
.orElse(dmaapPublisherConfiguration.dmaapUserPassword()))
- .keyFile(
- Optional.ofNullable(keyFile).filter(isEmpty.negate())
- .orElse(dmaapPublisherConfiguration.keyFile()))
- .trustStore(
- Optional.ofNullable(trustStore).filter(isEmpty.negate())
- .orElse(dmaapPublisherConfiguration.trustStore()))
- .trustStorePassword(
- Optional.ofNullable(trustStorePassword).filter(isEmpty.negate())
- .orElse(dmaapPublisherConfiguration.trustStorePassword()))
- .keyStore(
- Optional.ofNullable(keyStore).filter(isEmpty.negate())
- .orElse(dmaapPublisherConfiguration.keyStore()))
- .keyStorePassword(
- Optional.ofNullable(keyStorePassword).filter(isEmpty.negate())
- .orElse(dmaapPublisherConfiguration.keyStorePassword()))
+ .trustStorePath(
+ Optional.ofNullable(trustStorePath).filter(isEmpty.negate())
+ .orElse(dmaapPublisherConfiguration.trustStorePath()))
+ .trustStorePasswordPath(
+ Optional.ofNullable(trustStorePasswordPath).filter(isEmpty.negate())
+ .orElse(dmaapPublisherConfiguration.trustStorePasswordPath()))
+ .keyStorePath(
+ Optional.ofNullable(keyStorePath).filter(isEmpty.negate())
+ .orElse(dmaapPublisherConfiguration.keyStorePath()))
+ .keyStorePasswordPath(
+ Optional.ofNullable(keyStorePasswordPath).filter(isEmpty.negate())
+ .orElse(dmaapPublisherConfiguration.keyStorePasswordPath()))
.enableDmaapCertAuth(
Optional.ofNullable(enableDmaapCertAuth).filter(p -> !p.toString().isEmpty())
.orElse(dmaapPublisherConfiguration.enableDmaapCertAuth()))
diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/CloudConfigParser.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/CloudConfigParser.java
index 2e57256e..660cdebb 100644
--- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/CloudConfigParser.java
+++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/CloudConfigParser.java
@@ -33,11 +33,10 @@ import org.onap.dcaegen2.services.prh.config.ImmutableDmaapPublisherConfiguratio
*/
class CloudConfigParser {
- private static final String SECURITY_KEY_FILE = "security.keyFile";
- private static final String SECURITY_TRUST_STORE = "security.trustStore";
- private static final String SECURITY_KEY_STORE = "security.keyStore";
- private static final String KEY_STORE_PASS = "security.keyStorePassword";
- private static final String TRUST_STORE_PASS = "security.trustStorePassword";
+ private static final String SECURITY_TRUST_STORE_PATH = "security.trustStorePath";
+ private static final String SECURITY_TRUST_STORE_PASS_PATH = "security.trustStorePasswordPath";
+ private static final String SECURITY_KEY_STORE_PATH = "security.keyStorePath";
+ private static final String SECURITY_KEY_STORE_PASS_PATH = "security.keyStorePasswordPath";
private final JsonObject jsonObject;
CloudConfigParser(JsonObject jsonObject) {
@@ -53,11 +52,10 @@ class CloudConfigParser {
.dmaapContentType(jsonObject.get("dmaap.dmaapProducerConfiguration.dmaapContentType").getAsString())
.dmaapHostName(jsonObject.get("dmaap.dmaapProducerConfiguration.dmaapHostName").getAsString())
.dmaapUserName(jsonObject.get("dmaap.dmaapProducerConfiguration.dmaapUserName").getAsString())
- .keyFile(jsonObject.get(SECURITY_KEY_FILE).getAsString())
- .trustStore(jsonObject.get(SECURITY_TRUST_STORE).getAsString())
- .trustStorePassword(jsonObject.get(TRUST_STORE_PASS).getAsString())
- .keyStore(jsonObject.get(SECURITY_KEY_STORE).getAsString())
- .keyStorePassword(jsonObject.get(KEY_STORE_PASS).getAsString())
+ .trustStorePath(jsonObject.get(SECURITY_TRUST_STORE_PATH).getAsString())
+ .trustStorePasswordPath(jsonObject.get(SECURITY_TRUST_STORE_PASS_PATH).getAsString())
+ .keyStorePath(jsonObject.get(SECURITY_KEY_STORE_PATH).getAsString())
+ .keyStorePasswordPath(jsonObject.get(SECURITY_KEY_STORE_PASS_PATH).getAsString())
.enableDmaapCertAuth(jsonObject.get("security.enableDmaapCertAuth").getAsBoolean())
.build();
}
@@ -73,11 +71,10 @@ class CloudConfigParser {
.aaiUserPassword(jsonObject.get("aai.aaiClientConfiguration.aaiUserPassword").getAsString())
.aaiProtocol(jsonObject.get("aai.aaiClientConfiguration.aaiProtocol").getAsString())
.aaiBasePath(jsonObject.get("aai.aaiClientConfiguration.aaiBasePath").getAsString())
- .keyFile(jsonObject.get(SECURITY_KEY_FILE).getAsString())
- .trustStore(jsonObject.get(SECURITY_TRUST_STORE).getAsString())
- .trustStorePassword(jsonObject.get(TRUST_STORE_PASS).getAsString())
- .keyStore(jsonObject.get(SECURITY_KEY_STORE).getAsString())
- .keyStorePassword(jsonObject.get(KEY_STORE_PASS).getAsString())
+ .trustStorePath(jsonObject.get(SECURITY_TRUST_STORE_PATH).getAsString())
+ .trustStorePasswordPath(jsonObject.get(SECURITY_TRUST_STORE_PASS_PATH).getAsString())
+ .keyStorePath(jsonObject.get(SECURITY_KEY_STORE_PATH).getAsString())
+ .keyStorePasswordPath(jsonObject.get(SECURITY_KEY_STORE_PASS_PATH).getAsString())
.enableAaiCertAuth(jsonObject.get("security.enableAaiCertAuth").getAsBoolean())
.build();
}
@@ -95,11 +92,10 @@ class CloudConfigParser {
.dmaapProtocol(jsonObject.get("dmaap.dmaapConsumerConfiguration.dmaapProtocol").getAsString())
.consumerId(jsonObject.get("dmaap.dmaapConsumerConfiguration.consumerId").getAsString())
.consumerGroup(jsonObject.get("dmaap.dmaapConsumerConfiguration.consumerGroup").getAsString())
- .keyFile(jsonObject.get(SECURITY_KEY_FILE).getAsString())
- .trustStore(jsonObject.get(SECURITY_TRUST_STORE).getAsString())
- .trustStorePassword(jsonObject.get(TRUST_STORE_PASS).getAsString())
- .keyStore(jsonObject.get(SECURITY_KEY_STORE).getAsString())
- .keyStorePassword(jsonObject.get(KEY_STORE_PASS).getAsString())
+ .trustStorePath(jsonObject.get(SECURITY_TRUST_STORE_PATH).getAsString())
+ .trustStorePasswordPath(jsonObject.get(SECURITY_TRUST_STORE_PASS_PATH).getAsString())
+ .keyStorePath(jsonObject.get(SECURITY_KEY_STORE_PATH).getAsString())
+ .keyStorePasswordPath(jsonObject.get(SECURITY_KEY_STORE_PASS_PATH).getAsString())
.enableDmaapCertAuth(jsonObject.get("security.enableDmaapCertAuth").getAsBoolean())
.build();
}
diff --git a/prh-app-server/src/main/resources/prh_endpoints.json b/prh-app-server/src/main/resources/prh_endpoints.json
index 75917f12..2e224833 100644
--- a/prh-app-server/src/main/resources/prh_endpoints.json
+++ b/prh-app-server/src/main/resources/prh_endpoints.json
@@ -44,11 +44,10 @@
}
},
"security": {
- "keyFile" : "/opt/app/prh/local/org.onap.prh.keyfile",
- "trustStore" : "change it",
- "trustStorePassword" : "change it",
- "keyStore" : "change it",
- "keyStorePassword" : "change it",
+ "trustStorePath" : "change it",
+ "trustStorePasswordPath" : "change it",
+ "keyStorePath" : "change it",
+ "keyStorePasswordPath" : "change it",
"enableAaiCertAuth" : "false",
"enableDmaapCertAuth" : "false"
}