Commit f7d4cf9639007848472a1e3de64072659fd270cf

Authored by Dmytro Landiak
1 parent 5274de80

rest api https support

@@ -34,7 +34,7 @@ public class RestApiCallPlugin extends AbstractPlugin<RestApiCallPluginConfigura @@ -34,7 +34,7 @@ public class RestApiCallPlugin extends AbstractPlugin<RestApiCallPluginConfigura
34 private static final String AUTHORIZATION_HEADER_NAME = "Authorization"; 34 private static final String AUTHORIZATION_HEADER_NAME = "Authorization";
35 private static final String AUTHORIZATION_HEADER_FORMAT = "Basic %s"; 35 private static final String AUTHORIZATION_HEADER_FORMAT = "Basic %s";
36 private static final String CREDENTIALS_TEMPLATE = "%s:%s"; 36 private static final String CREDENTIALS_TEMPLATE = "%s:%s";
37 - private static final String BASE_URL_TEMPLATE = "http://%s:%d%s"; 37 + private static final String BASE_URL_TEMPLATE = "%s%s:%d%s";
38 private RestApiCallMsgHandler handler; 38 private RestApiCallMsgHandler handler;
39 private String baseUrl; 39 private String baseUrl;
40 private HttpHeaders headers = new HttpHeaders(); 40 private HttpHeaders headers = new HttpHeaders();
@@ -43,6 +43,7 @@ public class RestApiCallPlugin extends AbstractPlugin<RestApiCallPluginConfigura @@ -43,6 +43,7 @@ public class RestApiCallPlugin extends AbstractPlugin<RestApiCallPluginConfigura
43 public void init(RestApiCallPluginConfiguration configuration) { 43 public void init(RestApiCallPluginConfiguration configuration) {
44 this.baseUrl = String.format( 44 this.baseUrl = String.format(
45 BASE_URL_TEMPLATE, 45 BASE_URL_TEMPLATE,
  46 + configuration.getProtocol(),
46 configuration.getHost(), 47 configuration.getHost(),
47 configuration.getPort(), 48 configuration.getPort(),
48 configuration.getBasePath()); 49 configuration.getBasePath());
@@ -22,6 +22,8 @@ import java.util.List; @@ -22,6 +22,8 @@ import java.util.List;
22 22
23 @Data 23 @Data
24 public class RestApiCallPluginConfiguration { 24 public class RestApiCallPluginConfiguration {
  25 +
  26 + private String protocol;
25 private String host; 27 private String host;
26 private int port; 28 private int port;
27 private String basePath; 29 private String basePath;
@@ -3,6 +3,10 @@ @@ -3,6 +3,10 @@
3 "title": "REST API Call Plugin Configuration", 3 "title": "REST API Call Plugin Configuration",
4 "type": "object", 4 "type": "object",
5 "properties": { 5 "properties": {
  6 + "protocol": {
  7 + "title": "URI Scheme name",
  8 + "type": "string"
  9 + },
6 "host": { 10 "host": {
7 "title": "Host", 11 "title": "Host",
8 "type": "string" 12 "type": "string"
@@ -51,6 +55,7 @@ @@ -51,6 +55,7 @@
51 } 55 }
52 }, 56 },
53 "required": [ 57 "required": [
  58 + "protocol",
54 "host", 59 "host",
55 "port", 60 "port",
56 "basePath", 61 "basePath",
@@ -58,6 +63,21 @@ @@ -58,6 +63,21 @@
58 ] 63 ]
59 }, 64 },
60 "form": [ 65 "form": [
  66 + {
  67 + "key": "protocol",
  68 + "type": "rc-select",
  69 + "multiple": false,
  70 + "items": [
  71 + {
  72 + "value": "http://",
  73 + "label": "HTTP"
  74 + },
  75 + {
  76 + "value": "https://",
  77 + "label": "HTTPS"
  78 + }
  79 + ]
  80 + },
61 "host", 81 "host",
62 "port", 82 "port",
63 "basePath", 83 "basePath",