diff options
author | Shiwei Tian <tian.shiwei@zte.com.cn> | 2018-03-06 10:01:38 +0800 |
---|---|---|
committer | Shiwei Tian <tian.shiwei@zte.com.cn> | 2018-03-06 10:01:38 +0800 |
commit | 5b3f8b279725c337de6988e703cca418b3e53826 (patch) | |
tree | 42fe75020eb407a6cc20c7b04447506345687184 | |
parent | 3b822dd0c43d656cf4cb9b3f37633300b963e120 (diff) |
Change HTTP Requests into HTTPS Ones
Issue-ID: HOLMES-104
Change-Id: I535050f7dcacc2caa75d9a8941d93000fd91c361
Signed-off-by: Shiwei Tian <tian.shiwei@zte.com.cn>
10 files changed, 20 insertions, 15 deletions
diff --git a/engine-d-standalone/src/main/assembly/bin/run.sh b/engine-d-standalone/src/main/assembly/bin/run.sh index dab4cbc..d3d5348 100644 --- a/engine-d-standalone/src/main/assembly/bin/run.sh +++ b/engine-d-standalone/src/main/assembly/bin/run.sh @@ -70,6 +70,13 @@ fi #ActiveMQ IP Configurations sed -i "s|brokerIp:.*|brokerIp: $SERVICE_IP|" "$main_path/conf/engine-d.yml" +KEY_PATH="$main_path/conf/holmes.keystore" +KEY_PASSWORD="holmes" + +#HTTPS Configurations +sed -i "s|keyStorePath:.*|keyStorePath: $KEY_PATH|" "$main_path/conf/engine-d.yml" +sed -i "s|keyStorePassword:.*|keyStorePassword: $KEY_PASSWORD|" "$main_path/conf/engine-d.yml" + cat "$main_path/conf/engine-d.yml" diff --git a/engine-d-standalone/src/main/assembly/conf/engine-d.yml b/engine-d-standalone/src/main/assembly/conf/engine-d.yml index ff3201b..c5a750a 100644 --- a/engine-d-standalone/src/main/assembly/conf/engine-d.yml +++ b/engine-d-standalone/src/main/assembly/conf/engine-d.yml @@ -19,8 +19,12 @@ server: applicationContextPath: /
adminContextPath: /admin
connector:
- type: http
+ type: https
port: 9102
+ keyStorePath: /home/holmes/conf/holmes.keystore
+ keyStorePassword: holmes
+ validateCerts: false
+ validatePeers: false
# Logging settings.
diff --git a/engine-d-standalone/src/main/assembly/conf/holmes.keystore b/engine-d-standalone/src/main/assembly/conf/holmes.keystore Binary files differnew file mode 100644 index 0000000..a6266bb --- /dev/null +++ b/engine-d-standalone/src/main/assembly/conf/holmes.keystore diff --git a/engine-d/src/main/java/org/onap/holmes/engine/EngineDActiveApp.java b/engine-d/src/main/java/org/onap/holmes/engine/EngineDActiveApp.java index 4f5593c..0e7acac 100644 --- a/engine-d/src/main/java/org/onap/holmes/engine/EngineDActiveApp.java +++ b/engine-d/src/main/java/org/onap/holmes/engine/EngineDActiveApp.java @@ -62,6 +62,7 @@ public class EngineDActiveApp extends IOCApplication<EngineDAppConfig> { msinfo.setUrl("/api/holmes-engine-mgmt/v1"); msinfo.setProtocol("REST"); msinfo.setVisualRange("0|1"); + msinfo.setEnable_ssl(true); Set<Node> nodes = new HashSet<>(); Node node = new Node(); node.setIp(serviceAddrInfo[0]); diff --git a/engine-d/src/main/java/org/onap/holmes/engine/request/CompileRuleRequest.java b/engine-d/src/main/java/org/onap/holmes/engine/request/CompileRuleRequest.java index 6e0da48..8af9778 100644 --- a/engine-d/src/main/java/org/onap/holmes/engine/request/CompileRuleRequest.java +++ b/engine-d/src/main/java/org/onap/holmes/engine/request/CompileRuleRequest.java @@ -24,7 +24,6 @@ import lombok.Setter; @Setter public class CompileRuleRequest { - @JsonProperty(value = "content") @NotNull private String content; }
\ No newline at end of file diff --git a/engine-d/src/main/java/org/onap/holmes/engine/request/DeployRuleRequest.java b/engine-d/src/main/java/org/onap/holmes/engine/request/DeployRuleRequest.java index 74ddf67..f2ef369 100644 --- a/engine-d/src/main/java/org/onap/holmes/engine/request/DeployRuleRequest.java +++ b/engine-d/src/main/java/org/onap/holmes/engine/request/DeployRuleRequest.java @@ -15,7 +15,6 @@ */ package org.onap.holmes.engine.request; -import com.fasterxml.jackson.annotation.JsonProperty; import javax.validation.constraints.NotNull; import lombok.Getter; import lombok.Setter; @@ -24,14 +23,11 @@ import lombok.Setter; @Setter public class DeployRuleRequest { - @JsonProperty(value = "content") @NotNull private String content; - @JsonProperty(value = "engineid") private String engineId; - @JsonProperty(value = "loopcontrolname") @NotNull private String loopControlName; } diff --git a/engine-d/src/main/java/org/onap/holmes/engine/resources/DmaapConfigurationService.java b/engine-d/src/main/java/org/onap/holmes/engine/resources/DmaapConfigurationService.java index 99567b8..548b9b2 100644 --- a/engine-d/src/main/java/org/onap/holmes/engine/resources/DmaapConfigurationService.java +++ b/engine-d/src/main/java/org/onap/holmes/engine/resources/DmaapConfigurationService.java @@ -50,7 +50,7 @@ public class DmaapConfigurationService { + " and <b>url</b>. Both fields are required.") DmaapConfigRequest config, @Context HttpServletRequest request){ String url = config.getUrl(); - if (url.startsWith("http://")) { + if (url.startsWith("http://") || url.startsWith("https://")) { Subscriber subscriber = new Subscriber(); subscriber.setTopic(config.getName()); subscriber.setUrl(url); @@ -64,7 +64,7 @@ public class DmaapConfigurationService { return "{\"message\": \"Succeeded!\", \"topic\": \"" + config.getName() + "\"}"; } - return "{\"message\": \"Only the HTTP protocol is supported!\"}"; + return "{\"message\": \"Only the HTTP or HTTPS protocol is supported!\"}"; } @DELETE @@ -92,7 +92,7 @@ public class DmaapConfigurationService { + " and <b>url</b>. Both fields are required.") DmaapConfigRequest config, @Context HttpServletRequest request){ String url = config.getUrl(); - if (url.startsWith("http://")) { + if (url.startsWith("http://") || url.startsWith("https://")) { SecurityInfo securityInfo = new SecurityInfo(); SecurityInfo.DmaapInfo dmaapInfo = new SecurityInfo().new DmaapInfo(); dmaapInfo.setTopicUrl(config.getUrl()); @@ -100,6 +100,6 @@ public class DmaapConfigurationService { DcaeConfigurationsCache.addPubSecInfo(config.getName(), securityInfo); return "{\"message\": \"Succeeded!\", \"topic\": \"" + config.getName() + "\"}"; } - return "{\"message\": \"Only the HTTP protocol is supported!\"}"; + return "{\"message\": \"Only the HTTP or HTTPS protocol is supported!\"}"; } } diff --git a/engine-d/src/main/java/org/onap/holmes/engine/resources/EngineResources.java b/engine-d/src/main/java/org/onap/holmes/engine/resources/EngineResources.java index b4cb0b1..b9875da 100644 --- a/engine-d/src/main/java/org/onap/holmes/engine/resources/EngineResources.java +++ b/engine-d/src/main/java/org/onap/holmes/engine/resources/EngineResources.java @@ -61,8 +61,8 @@ public class EngineResources { @Timed public CorrelationRuleResponse deployRule( @ApiParam(value = "The request entity of the HTTP call, which comprises three " - + "fields: \"content\" , \"loopcontrolname\" and \"engineid\". " - + "The \"content\" should be a valid Drools rule string and the \"engineid\" " + + "fields: \"content\" , \"loopControlName\" and \"engineId\". " + + "The \"content\" should be a valid Drools rule string and the \"engineId\" " + "has to be \"engine-d\" in the Amsterdam release.", required = true) DeployRuleRequest deployRuleRequest, @Context HttpServletRequest httpRequest) { diff --git a/engine-d/src/main/java/org/onap/holmes/engine/response/CorrelationRuleResponse.java b/engine-d/src/main/java/org/onap/holmes/engine/response/CorrelationRuleResponse.java index b234f91..306bd7f 100644 --- a/engine-d/src/main/java/org/onap/holmes/engine/response/CorrelationRuleResponse.java +++ b/engine-d/src/main/java/org/onap/holmes/engine/response/CorrelationRuleResponse.java @@ -15,7 +15,6 @@ */ package org.onap.holmes.engine.response; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Getter; import lombok.Setter; @@ -23,6 +22,5 @@ import lombok.Setter; @Setter public class CorrelationRuleResponse { - @JsonProperty(value = "package") private String packageName; } @@ -75,7 +75,7 @@ <dependency> <groupId>org.onap.msb.java-sdk</groupId> <artifactId>msb-java-sdk</artifactId> - <version>1.0.0</version> + <version>1.1.0-SNAPSHOT</version> </dependency> <dependency> <groupId>org.reflections</groupId> |