Commit f7d4cf9639007848472a1e3de64072659fd270cf

Authored by Dmytro Landiak
1 parent 5274de80

rest api https support

... ... @@ -34,7 +34,7 @@ public class RestApiCallPlugin extends AbstractPlugin<RestApiCallPluginConfigura
34 34 private static final String AUTHORIZATION_HEADER_NAME = "Authorization";
35 35 private static final String AUTHORIZATION_HEADER_FORMAT = "Basic %s";
36 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 38 private RestApiCallMsgHandler handler;
39 39 private String baseUrl;
40 40 private HttpHeaders headers = new HttpHeaders();
... ... @@ -43,6 +43,7 @@ public class RestApiCallPlugin extends AbstractPlugin<RestApiCallPluginConfigura
43 43 public void init(RestApiCallPluginConfiguration configuration) {
44 44 this.baseUrl = String.format(
45 45 BASE_URL_TEMPLATE,
  46 + configuration.getProtocol(),
46 47 configuration.getHost(),
47 48 configuration.getPort(),
48 49 configuration.getBasePath());
... ...
... ... @@ -22,6 +22,8 @@ import java.util.List;
22 22
23 23 @Data
24 24 public class RestApiCallPluginConfiguration {
  25 +
  26 + private String protocol;
25 27 private String host;
26 28 private int port;
27 29 private String basePath;
... ...
... ... @@ -3,6 +3,10 @@
3 3 "title": "REST API Call Plugin Configuration",
4 4 "type": "object",
5 5 "properties": {
  6 + "protocol": {
  7 + "title": "URI Scheme name",
  8 + "type": "string"
  9 + },
6 10 "host": {
7 11 "title": "Host",
8 12 "type": "string"
... ... @@ -51,6 +55,7 @@
51 55 }
52 56 },
53 57 "required": [
  58 + "protocol",
54 59 "host",
55 60 "port",
56 61 "basePath",
... ... @@ -58,6 +63,21 @@
58 63 ]
59 64 },
60 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 81 "host",
62 82 "port",
63 83 "basePath",
... ...