diff options
7 files changed, 30 insertions, 37 deletions
diff --git a/deliveries/.env b/deliveries/.env index babd90e8..c5961d33 100644 --- a/deliveries/.env +++ b/deliveries/.env @@ -38,11 +38,11 @@ CLI_IMG_NAME=onap/cli # This is the first portion of the Docker image tag # that is published to the ONAP registry. -PORTAL_VERSION=2.5.0 +PORTAL_VERSION=2.6.0 # This is used during builds and in docker-compose; # it is never published to the ONAP registry. -PORTAL_TAG=casablanca +PORTAL_TAG=elalto # Name of directory in apps container (NOT host) WEBAPPS_DIR=/opt/apache-tomcat-8.0.37/webapps diff --git a/deliveries/build_portalapps_dockers.sh b/deliveries/build_portalapps_dockers.sh index 2a09997c..fdaf9a15 100755 --- a/deliveries/build_portalapps_dockers.sh +++ b/deliveries/build_portalapps_dockers.sh @@ -19,7 +19,6 @@ fi # Check for Jenkins build number if [ -n "$BUILD_NUMBER" ]; then - export PORTAL_TAG=$BUILD_NUMBER echo "Using Jenkins build number $BUILD_NUMBER; Docker Tag $PORTAL_TAG" else # This indicates a non-Jenkins build diff --git a/docs/release-notes.rst b/docs/release-notes.rst index a1b6e09c..b1b0266b 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -19,8 +19,11 @@ We worked on SDK upgrade to integrate with AAF. We partially implemented multi-l * Use of CADI * 68% JUnit Test Coverage * Addressing security issues - * Internationalization language support - partially implemented + * Angular 6 upgrade delivered foundation code with sample screen + * Documentation on the Angular 6 upgrade can be found `here <https://docs.onap.org/en/latest/submodules/portal.git/docs/tutorials/portal-sdk/your-angular-app.html>`_ + * Internationalization language support - partially implemented. * Reporting feature enhancement in portal/sdk - design and partial code changes + * There is more information about new features at `DEMOS - R4 Dublin Demos <https://wiki.onap.org/display/DW/DEMOS+-+R4+Dublin+Demos>`_ **Bug Fixes** * Fixed Sonar reported critical issues. @@ -29,6 +32,7 @@ We worked on SDK upgrade to integrate with AAF. We partially implemented multi-l * Mismatch while displaying active online user in Portal. * Internationalization Language component partially completed. * Functional Menu change requires manual refresh. + * Modifying Onboarded App configurations from the onboarding page malfunctions but changes to the App configuration can be done through accessing the database (portal:fn_app table) directly. **Security Notes** @@ -39,9 +43,9 @@ We worked on SDK upgrade to integrate with AAF. We partially implemented multi-l * CVE-2019-12317 - Number of XSS vulnerabilities in Portal [`OJSI-15 <https://jira.onap.org/browse/OJSI-15>`_] * CVE-2019-12122 - ONAP Portal allows to retrieve password of currently active user [`OJSI-65 <https://jira.onap.org/browse/OJSI-65>`_] * CVE-2019-12121 - ONAP Portal is vulnerable for Padding Oracle attack [`OJSI-92 <https://jira.onap.org/browse/OJSI-92>`_] - * In defult deployment PORTAL (portal-app) exposes HTTP port 8989 outside of cluster. [`OJSI-97 <https://jira.onap.org/browse/OJSI-97>`_] - * In defult deployment PORTAL (portal-app) exposes HTTP port 30215 outside of cluster. [`OJSI-105 <https://jira.onap.org/browse/OJSI-105>`_] - * In defult deployment PORTAL (portal-sdk) exposes HTTP port 30212 outside of cluster. [`OJSI-106 <https://jira.onap.org/browse/OJSI-106>`_] + * In default deployment PORTAL (portal-app) exposes HTTP port 8989 outside of cluster. [`OJSI-97 <https://jira.onap.org/browse/OJSI-97>`_] + * In default deployment PORTAL (portal-app) exposes HTTP port 30215 outside of cluster. [`OJSI-105 <https://jira.onap.org/browse/OJSI-105>`_] + * In default deployment PORTAL (portal-sdk) exposes HTTP port 30212 outside of cluster. [`OJSI-106 <https://jira.onap.org/browse/OJSI-106>`_] * CVE-2019-12318 - Number of SQL Injections in Portal [`OJSI-174 <https://jira.onap.org/browse/OJSI-174>`_] * Portal stores users passwords encrypted instead of hashed [`OJSI-190 <https://jira.onap.org/browse/OJSI-190>`_] diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/LanguageController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/LanguageController.java index 383e4720..508b1be2 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/LanguageController.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/LanguageController.java @@ -15,15 +15,16 @@ */ package org.onap.portalapp.portal.controller; -import com.alibaba.fastjson.JSONObject; -import org.onap.portalapp.portal.domain.Language; -import org.onap.portalapp.portal.service.LanguageService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.util.List; +import org.onap.portalapp.portal.service.LanguageService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; +import com.alibaba.fastjson.JSONObject; @RestController @RequestMapping("/auxapi") diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/RoleManageController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/RoleManageController.java index b50d1cf4..9a525b51 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/RoleManageController.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/RoleManageController.java @@ -523,7 +523,7 @@ public class RoleManageController extends EPRestrictedBaseController { EPApp requestedApp = appService.getApp(appId); if (isAuthorizedUser(user, requestedApp)) { fieldsValidation(requestedApp); - if (requestedApp.getCentralAuth()) { + if (requestedApp.getCentralAuth() && roleFunc!=null) { String code = roleFunc.getType() + PIPE + roleFunc.getCode() + PIPE + roleFunc.getAction(); CentralV2RoleFunction domainRoleFunction = externalAccessRolesService.getRoleFunction(code, requestedApp.getUebKey()); @@ -679,7 +679,7 @@ public class RoleManageController extends EPRestrictedBaseController { } @RequestMapping(value = { "/portalApi/centralizedApps" }, method = RequestMethod.GET) - public List<CentralizedApp> getCentralizedAppRoles(HttpServletRequest request, HttpServletResponse response, String userId) throws IOException { + public List<CentralizedApp> getCentralizedAppRoles(HttpServletRequest request, HttpServletResponse response, String userId) { if(userId!=null) { SecureString secureString = new SecureString(userId); @@ -817,7 +817,7 @@ public class RoleManageController extends EPRestrictedBaseController { private boolean isAuthorizedUser(EPUser user, EPApp requestedApp) { if (user != null && (adminRolesService.isAccountAdminOfApplication(user, requestedApp) - || (adminRolesService.isSuperAdmin(user) && requestedApp.getId() == PortalConstants.PORTAL_APP_ID))) + || (adminRolesService.isSuperAdmin(user) && requestedApp.getId().equals(PortalConstants.PORTAL_APP_ID)))) return true; return false; } diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/AdminRolesServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/AdminRolesServiceImpl.java index 18aac6f4..6950bdda 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/AdminRolesServiceImpl.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/AdminRolesServiceImpl.java @@ -40,25 +40,19 @@ package org.onap.portalapp.portal.service; import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; -import java.util.SortedSet; -import java.util.TreeSet; import java.util.stream.Collectors; - import javax.annotation.PostConstruct; - import org.apache.cxf.common.util.StringUtils; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.Transaction; import org.json.JSONArray; import org.json.JSONObject; -import org.onap.portalapp.portal.domain.CentralV2RoleFunction; import org.onap.portalapp.portal.domain.EPApp; import org.onap.portalapp.portal.domain.EPRole; import org.onap.portalapp.portal.domain.EPUser; @@ -71,16 +65,12 @@ import org.onap.portalapp.portal.logging.format.EPAppMessagesEnum; import org.onap.portalapp.portal.logging.logic.EPLogUtil; import org.onap.portalapp.portal.transport.AppNameIdIsAdmin; import org.onap.portalapp.portal.transport.AppsListWithAdminRole; -import org.onap.portalapp.portal.transport.EPUserAppCurrentRoles; import org.onap.portalapp.portal.transport.ExternalAccessUser; import org.onap.portalapp.portal.utils.EPCommonSystemProperties; import org.onap.portalapp.portal.utils.EcompPortalUtils; import org.onap.portalapp.portal.utils.PortalConstants; import org.onap.portalapp.util.EPUserUtils; -import org.onap.portalsdk.core.domain.RoleFunction; -import org.onap.portalsdk.core.domain.User; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; -import org.onap.portalsdk.core.restful.domain.EcompRole; import org.onap.portalsdk.core.service.DataAccessService; import org.onap.portalsdk.core.util.SystemProperties; import org.springframework.beans.factory.annotation.Autowired; @@ -92,7 +82,6 @@ import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.client.RestTemplate; - import com.fasterxml.jackson.databind.ObjectMapper; @Service("adminRolesService") @@ -106,6 +95,7 @@ public class AdminRolesServiceImpl implements AdminRolesService { private Long ACCOUNT_ADMIN_ROLE_ID = 999L; private Long ECOMP_APP_ID = 1L; public static final String TYPE_APPROVER = "approver"; + private static final String ADMIN_ACCOUNT= "Is account admin for user {}"; private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AdminRolesServiceImpl.class); @@ -458,7 +448,7 @@ public class AdminRolesServiceImpl implements AdminRolesService { final Map<String, Long> userParams = new HashMap<>(); userParams.put("userId", user.getId()); - logger.debug(EELFLoggerDelegate.debugLogger, "Is account admin for user {}", user.getId()); + logger.debug(EELFLoggerDelegate.debugLogger, ADMIN_ACCOUNT, user.getId()); List<Integer> userAdminApps = new ArrayList<>(); userAdminApps =dataAccessService.executeNamedQuery("getAdminAppsForTheUser", userParams, null); @@ -498,7 +488,7 @@ public class AdminRolesServiceImpl implements AdminRolesService { Set<String> getRoleFuncListOfPortalSet1=new HashSet<>(); Set<String> roleFunSet = new HashSet<>(); roleFunSet = getRoleFuncListOfPortalSet.stream().filter(x -> x.contains("|")).collect(Collectors.toSet()); - if (roleFunSet.size() > 0) + if (!roleFunSet.isEmpty()) for (String roleFunction : roleFunSet) { String type = externalAccessRolesService.getFunctionCodeType(roleFunction); getRoleFuncListOfPortalSet1.add(type); @@ -561,10 +551,10 @@ public class AdminRolesServiceImpl implements AdminRolesService { try { final Map<String, Long> userParams = new HashMap<>(); userParams.put("userId", user.getId()); - logger.debug(EELFLoggerDelegate.debugLogger, "Is account admin for user {}", user.getId()); + logger.debug(EELFLoggerDelegate.debugLogger, ADMIN_ACCOUNT, user.getId()); List<Integer> userAdminApps = new ArrayList<>(); userAdminApps =dataAccessService.executeNamedQuery("getAdminAppsForTheUser", userParams, null); - if(userAdminApps.size()>=1){ + if(!userAdminApps.isEmpty()){ isApplicationAccountAdmin=userAdminApps.contains((int) (long) app.getId()); logger.debug(EELFLoggerDelegate.debugLogger, "Is account admin for user is true{} ,appId {}", user.getId(),app.getId()); } @@ -586,7 +576,7 @@ public class AdminRolesServiceImpl implements AdminRolesService { Set<String> getRoleFuncListOfPortalSet = new HashSet<>(getRoleFuncListOfPortal); Set<String> roleFunSet = new HashSet<>(); roleFunSet = getRoleFuncListOfPortalSet.stream().filter(x -> x.contains("|")).collect(Collectors.toSet()); - if (roleFunSet.size() > 0) + if (!roleFunSet.isEmpty()) for (String roleFunction : roleFunSet) { String roleFun = EcompPortalUtils.getFunctionCode(roleFunction); getRoleFuncListOfPortalSet.remove(roleFunction); @@ -598,7 +588,6 @@ public class AdminRolesServiceImpl implements AdminRolesService { finalRoleFunctionSet.add(EPUserUtils.decodeFunctionCode(roleFn)); } -// List<String> functionsOfUser = new ArrayList<>(getRoleFuncListOfPortal); return finalRoleFunctionSet; } @@ -609,10 +598,10 @@ public class AdminRolesServiceImpl implements AdminRolesService { try { final Map<String, Long> userParams = new HashMap<>(); userParams.put("userId", user.getId()); - logger.debug(EELFLoggerDelegate.debugLogger, "Is account admin for user {}", user.getId()); + logger.debug(EELFLoggerDelegate.debugLogger, ADMIN_ACCOUNT, user.getId()); List<Integer> userAdminApps = new ArrayList<>(); userAdminApps =dataAccessService.executeNamedQuery("getAllAdminAppsofTheUser", userParams, null); - if(userAdminApps.size()>=1){ + if(!userAdminApps.isEmpty()){ isApplicationAccountAdmin=userAdminApps.contains((int) (long) app.getId()); logger.debug(EELFLoggerDelegate.debugLogger, "Is account admin for user is true{} ,appId {}", user.getId(),app.getId()); } @@ -36,7 +36,7 @@ <jacocoVersion>0.7.6.201602180812</jacocoVersion> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <encoding>UTF-8</encoding> - <sonar.exclusions>**/scripts/**/*,**.js</sonar.exclusions> + <!-- <sonar.exclusions>**/scripts/**/*,**.js</sonar.exclusions> --> <sonar.test.exclusions>**/test/**/*,**/tests/**/*</sonar.test.exclusions> <enforcer.skip>false</enforcer.skip> </properties> |