summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-BE-common/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-portal-BE-common/src/main')
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/CommonWidgetController.java6
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/MicroserviceProxyServiceImpl.java2
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/MicroserviceServiceImpl.java8
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/UserRolesCommonServiceImpl.java2
4 files changed, 14 insertions, 4 deletions
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/CommonWidgetController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/CommonWidgetController.java
index 68e32a16..7faea5d9 100644
--- a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/CommonWidgetController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/CommonWidgetController.java
@@ -20,6 +20,8 @@
package org.openecomp.portalapp.portal.controller;
import javax.servlet.http.HttpServletRequest;
+
+import org.openecomp.portalapp.controller.EPRestrictedBaseController;
import org.openecomp.portalapp.portal.controller.DashboardController.WidgetCategory;
import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
@@ -33,7 +35,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
-public class CommonWidgetController implements BasicAuthenticationController{
+public class CommonWidgetController extends EPRestrictedBaseController implements BasicAuthenticationController{
private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(CommonWidgetController.class);
@@ -63,7 +65,7 @@ public class CommonWidgetController implements BasicAuthenticationController{
* Request parameter.
* @return Rest response wrapped around a CommonWidgetMeta object.
*/
- @RequestMapping(value = "/widgetData", method = RequestMethod.GET, produces = "application/json")
+ @RequestMapping(value = "/commonWidgets", method = RequestMethod.GET, produces = "application/json")
public PortalRestResponse<CommonWidgetMeta> getWidgetData(HttpServletRequest request,
@RequestParam String resourceType) {
if (!isValidResourceType(resourceType)){
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/MicroserviceProxyServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/MicroserviceProxyServiceImpl.java
index 6b9a4416..ff8ee424 100644
--- a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/MicroserviceProxyServiceImpl.java
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/MicroserviceProxyServiceImpl.java
@@ -108,6 +108,8 @@ public class MicroserviceProxyServiceImpl implements MicroserviceProxyService {
HttpHeaders headers = new HttpHeaders();
headers.add("Authorization", "Basic " + base64Creds);
headers.setContentType(MediaType.APPLICATION_JSON);
+ String rawCookie = request.getHeader("Cookie");
+ headers.add("Cookie", rawCookie);
HttpEntity<String> entity = new HttpEntity<String>(headers);
String url = microserviceUrlConverter(data, params);
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/MicroserviceServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/MicroserviceServiceImpl.java
index aaadfa18..520bef98 100644
--- a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/MicroserviceServiceImpl.java
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/MicroserviceServiceImpl.java
@@ -24,6 +24,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import javax.crypto.BadPaddingException;
+
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Restrictions;
import org.openecomp.portalapp.portal.domain.MicroserviceData;
@@ -82,7 +84,11 @@ public class MicroserviceServiceImpl implements MicroserviceService {
List<MicroserviceData> list = (List<MicroserviceData>) dataAccessService.getList(MicroserviceData.class, null);
for (int i = 0; i < list.size(); i++) {
if (list.get(i).getPassword() != null)
- list.get(i).setPassword(decryptedPassword(list.get(i).getPassword()));
+ try{
+ list.get(i).setPassword(decryptedPassword(list.get(i).getPassword()));
+ } catch(BadPaddingException bpe){
+ logger.error(EELFLoggerDelegate.errorLogger, "Couldn't decrypt - Check decryption key in system.properties - looks wrong. Still going ahead with list population though", bpe);
+ }
list.get(i).setParameterList(getServiceParameters(list.get(i).getId()));
}
return list;
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/UserRolesCommonServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/UserRolesCommonServiceImpl.java
index 80408954..58809210 100644
--- a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/UserRolesCommonServiceImpl.java
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/UserRolesCommonServiceImpl.java
@@ -1242,7 +1242,7 @@ public class UserRolesCommonServiceImpl {
protected EPUser getUser(String userId, EPApp app, ApplicationsRestClientService applicationsRestClientService)
throws HTTPException {
- return applicationsRestClientService.get(EPUser.class, app.getId(), String.format("/user/%s", userId), true);
+ return applicationsRestClientService.get(EPUser.class, app.getId(), String.format("/user/%s", userId));
}