diff options
author | st782s <statta@research.att.com> | 2018-01-30 17:29:36 -0500 |
---|---|---|
committer | st782s <statta@research.att.com> | 2018-02-01 15:10:02 -0500 |
commit | 21a8761f684745bb300e075c7e98ad897ace9eed (patch) | |
tree | 6d585c3fe39fbb42a314941dbc8646e6ccf188cf /ecomp-portal-BE-os | |
parent | 3af8af1310d5a27cb58be29505573f0bbdc1717c (diff) |
Security/ Package Name changes
Issue-ID: PORTAL-174, PORTAL-157, PORTAL-156, PORTAL-148, PORTAL-145,
PORTAL-140, PORTAL-133, PORTAL-121, PORTAL-111, PORTAL-88
Includes security fixes, Role Centralization, replace certain ECOMP
occurrences etc
Change-Id: I3c8b706709c6b92e646e3cbe50c2d660e8a46ef4
Signed-off-by: st782s <statta@research.att.com>
Diffstat (limited to 'ecomp-portal-BE-os')
-rw-r--r-- | ecomp-portal-BE-os/.gitignore | 1 | ||||
-rw-r--r-- | ecomp-portal-BE-os/README.md | 42 | ||||
-rw-r--r-- | ecomp-portal-BE-os/pom.xml | 31 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/authentication/LoginStrategy.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/authentication/LoginStrategy.java) | 8 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/authentication/OpenIdConnectLoginStrategy.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/authentication/OpenIdConnectLoginStrategy.java) | 28 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/authentication/SimpleLoginStrategy.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/authentication/SimpleLoginStrategy.java) | 30 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/conf/ExternalAppConfig.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/conf/ExternalAppConfig.java) | 185 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/conf/ExternalAppInitializer.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/conf/ExternalAppInitializer.java) | 10 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/conf/HibernateMappingLocations.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/conf/HibernateMappingLocations.java) | 12 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ECOMPLogoutController.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/ECOMPLogoutController.java) | 21 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/LoginController.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/LoginController.java) | 53 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/LoginService.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/LoginService.java) | 8 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ONAPLoginController.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/ONAPLoginController.java) | 20 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ONAPWelcomeController.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/ONAPWelcomeController.java) | 14 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/OpenCollaborationController.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/OpenCollaborationController.java) | 8 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/PeerBroadcastSocket.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/PeerBroadcastSocket.java) | 10 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/filter/SecurityXssFilter.java | 158 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/filter/SecurityXssValidator.java | 207 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/AppsOSController.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/controller/AppsOSController.java) | 29 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/DashboardSearchResultController.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/controller/DashboardSearchResultController.java) | 33 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/ExternalAppsRestfulController.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/controller/ExternalAppsRestfulController.java) | 35 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/PortalAdminController.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/controller/PortalAdminController.java) | 31 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/interceptor/SessionTimeoutInterceptor.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/interceptor/SessionTimeoutInterceptor.java) | 26 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/logging/aop/EPEELFLoggerAspect.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPEELFLoggerAspect.java) | 37 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/AppsCacheService.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/AppsCacheService.java) | 10 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/AppsCacheServiceImple.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/AppsCacheServiceImple.java) | 16 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/EPAppServiceImpl.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/EPAppServiceImpl.java) | 30 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/SearchService.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/SearchService.java) | 12 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/SearchServiceImpl.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/SearchServiceImpl.java) | 21 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/TicketEventServiceImpl.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/TicketEventServiceImpl.java) | 13 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/UserRolesServiceImpl.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/UserRolesServiceImpl.java) | 24 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/UserService.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/UserService.java) | 10 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/UserServiceImpl.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/UserServiceImpl.java) | 28 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/transport/OnboardingApp.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/transport/OnboardingApp.java) | 8 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/ueb/EPUebHelper.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/ueb/EPUebHelper.java) | 39 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/ueb/EPUebMsgTypes.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/ueb/EPUebMsgTypes.java) | 10 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/utils/EPSystemProperties.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/utils/EPSystemProperties.java) | 9 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/scheduler/LogJob.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/scheduler/LogJob.java) | 10 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/scheduler/LogRegistry.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/scheduler/LogRegistry.java) | 12 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/scheduler/Register.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/scheduler/Register.java) | 14 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/scheduler/RegistryAdapter.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/scheduler/RegistryAdapter.java) | 14 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/scheduler/SessionMgtRegistry.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/scheduler/SessionMgtRegistry.java) | 18 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/service/RemoteWebServiceCallServiceImpl.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/service/RemoteWebServiceCallServiceImpl.java) | 26 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/uebhandler/FunctionalMenuHandler.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/uebhandler/FunctionalMenuHandler.java) | 30 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/uebhandler/InitUebHandler.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/uebhandler/InitUebHandler.java) | 18 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/uebhandler/MainUebHandler.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/uebhandler/MainUebHandler.java) | 18 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/uebhandler/WidgetNotificationHandler.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/uebhandler/WidgetNotificationHandler.java) | 26 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/java/org/onap/portalapp/util/SessionCookieUtil.java (renamed from ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/util/SessionCookieUtil.java) | 26 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/resources/key.properties | 3 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/resources/logback.xml | 6 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/resources/openid-connect.properties | 6 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/resources/portal.properties | 10 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/quartz.properties | 6 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/raptor.properties | 6 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/raptor_app_fusion.properties | 6 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/raptor_db_fusion.properties | 6 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/raptor_pdf.properties | 6 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/scheduler.properties (renamed from ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/shared-context-test.properties) | 37 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/sql.properties | 6 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/system.properties | 44 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/webapp/WEB-INF/defs/definitions.xml | 6 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/webapp/WEB-INF/fusion/conf/fusion.properties | 6 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/error.jsp | 6 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/index.jsp | 6 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/login.jsp | 26 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/oid-admin.jsp | 6 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/oid-home.jsp | 6 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/oid-login.jsp | 6 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/oid-user.jsp | 6 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/webapp/WEB-INF/oid-context.xml | 20 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/webapp/WEB-INF/web.xml | 27 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/webapp/app/fusion/external/ds2/css/digital-ng-library/ecomp-ionicons.css | 3 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/main/webapp/index.jsp | 6 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/authentication/OpenIdConnectLoginStrategyTest.java (renamed from ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/authentication/OpenIdConnectLoginStrategyTest.java) | 32 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/authentication/SessionTimeoutInterceptorTest.java (renamed from ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/authentication/SessionTimeoutInterceptorTest.java) | 18 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/authentication/SimpleLoginStrategyTest.java (renamed from ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/authentication/SimpleLoginStrategyTest.java) | 32 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/AppsOSControllerTest.java (renamed from ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/AppsOSControllerTest.java) | 31 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/DashboardSearchResultControllerTest.java (renamed from ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/DashboardSearchResultControllerTest.java) | 29 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/ECOMPLogoutControllerTest.java (renamed from ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/ECOMPLogoutControllerTest.java) | 26 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/ExternalAppsRestfulControllerOSTest.java (renamed from ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/ExternalAppsRestfulControllerOSTest.java) | 31 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/LoginControllerTest.java (renamed from ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/LoginControllerTest.java) | 24 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/ONAPLoginControllerTest.java (renamed from ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/ONAPLoginControllerTest.java) | 22 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/ONAPWelcomeControllerTest.java (renamed from ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/ONAPWelcomeControllerTest.java) | 16 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/PortalAdminControllerOSTest.java (renamed from ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/PortalAdminControllerOSTest.java) | 37 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/framework/MockEPUser.java (renamed from ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/framework/MockEPUser.java) | 10 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/framework/MockitoTestSuite.java (renamed from ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/framework/MockitoTestSuite.java) | 8 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/listener/HealthMonitorTest.java (renamed from ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/listener/HealthMonitorTest.java) | 9 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/service/RemoteWebServiceCallServiceImplTest.java (renamed from ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/service/RemoteWebServiceCallServiceImplTest.java) | 31 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/service/SearchServiceImplTest.java (renamed from ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/service/SearchServiceImplTest.java) | 20 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/service/UserServiceImplTest.java | 101 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/utils/EcompPortalUtilsTest.java (renamed from ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/utils/EcompPortalUtilsTest.java) | 9 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextRestClient.java | 298 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextRestControllerTest.java | 143 | ||||
-rw-r--r-- | ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextTestProperties.java | 99 |
94 files changed, 1427 insertions, 1350 deletions
diff --git a/ecomp-portal-BE-os/.gitignore b/ecomp-portal-BE-os/.gitignore index f3fcea6a..8bb0dd67 100644 --- a/ecomp-portal-BE-os/.gitignore +++ b/ecomp-portal-BE-os/.gitignore @@ -1,5 +1,6 @@ /catalina.base_IS_UNDEFINED/ /target/ +jacoco.exec .classpath .project .settings/ diff --git a/ecomp-portal-BE-os/README.md b/ecomp-portal-BE-os/README.md index e3f273d9..0b091f51 100644 --- a/ecomp-portal-BE-os/README.md +++ b/ecomp-portal-BE-os/README.md @@ -14,38 +14,52 @@ https://www.eclipse.org/m2e-wtp/ ## Release Notes -Version 1.3.0 (Amsterdam), November 2017 +Version 2.1 +- [PORTAL-145] Harden code to address SQL injecton, XSS vulnerabilities +- [PORTAL-156] Left menu are showing web analytics items and missing plus icons on Account Details page +- [Portal-148] ONAP Portal Beijing does not accept logins; currently OIDC code is disabled; please check the web.xml + Long term solution is being worked on. +- [Portal-140] Portal role synch error with partner apps +- [Portal-111] To get Centralized apps on Roles and Role Functions page; + Create, Edit and Delete calls for Roles and Role Functions +- [Portal-121] GUI controls overlapping on app onboarding dialog +- [Portal-133] Replace ECOMP wording from contact us page with ONAP +- [Portal-88] Unable to deselect widget on Widget catalog page +- [Portal-111] Centralized Role Management Task(Integration to AAF) +- [PORTAL-157] OpenID connect conflicting with spring security +- [Portal-174] missing DB statement in DML script(Users, Roles Page fix) + +Version 1.1.0 (Amsterdam), November 2017 - [Portal-6] Updates to License and Trademark in the PORTAL Source Code - [Portal-7] Improvements added as part of the rebasing process - [Portal-17] Remove jfree related items -- [PORTAL-21] FE changes to OS for AAF centralization and name space field; DB script updates for EcompPortalDDLMySql_1710_Common.sql under ecomp-portal-DB-common, EcompPortalDMLMySql_1710_OS.sql under ecomp-portal-DB-os -- [Portal-30] Failed to communicate with the widget microservice -- [Portal-35] Replaced the portal logo with onap logo on the login screen +- [PORTAL-21] FE changes to OS for AAF centralization and name space field; DB script updates for EcompPortalDDLMySql_1710_Common.sql under ecomp-portal-DB-common, EcompPortalDMLMySql_1710_OS.sql under ecomp-portal-DB-os; +- [Portal-30] Failed to communicate with the widget microservice: Fixed +- [Portal-35] Replaced the portal logo with onap logo on the login screen. - [Portal-40] Fix to add user roles - [Portal-45] Fix to update an existing app on Application Onboarding - [Portal-47] Fix to eliminate duplicate roles on Users page - [Portal-48] Fix to save a new app on Application onboarding - [Portal-49] image icon is missing on Widget corner -- [Portal-50] Enabled the junit coverage in ONAP -- [Portal-50] Fix to get the Sonar coverage for ONAP -- [Portal-59] Fix to to display Portal users on User page -- [Portal-61] Fixed the routing problem, loaded data and changed the notification hyperlink - [Portal-63] remove att_abs_tpls*.js and greensock url - [Portal-69] unable to pick role in Functional Menu Update -- [Portal-72] Sonar scan - resolving severity Blocker issues - [Portal-73] unable to onboard new Application fix +- [Portal-50] Enabled the junit coverage in ONAP - [Portal-76] Edit functional menu modal doesn't show +- [Portal-61] Fixed the routing problem, loaded data and changed the notification hyperlink - [Portal-77] Changes to remove preview image and update the new image automatically on App onbarding page - [Portal-82] Unable to pick Role in Widget onboarding for assigned app -- [Portal-86] Remove internal att.com usages from tests and other files - [Portal-94] Unable to see the updates on Edit Functional Menu -- [Portal-102] Fixed the page refresh issue on App Account Management page -- [Portal-103] Fix to enhanced notification ticket source for ONAP - [Portal-104] Replaced mysql DB connector with mariaDB +- [Portal-72] Sonar scan - resolving severity Blocker issues +- [Portal-103] Fix to enhanced notification ticket source for ONAP +- [Portal-50] Fix to get the Sonar coverage for ONAP +- [Portal-86] Remove internal att.com usages from tests and other files (rework) +- [Portal-102] Fixed the page refresh issue on App Account Management page - [Portal-104] replace mysql DB connector with mariaDB connector -- [Portal-116] Empty Widgets on Home page - widget uploaded with a wrong format in db +- [Portal-116] Empty Widgets on Home page - widget onboarded with a wrong format in database +- [Portal-59] Fix to to display Portal users on User page - [Portal-125] Fixed the missing role assignment when adding a user in portal -- [Portal-127] Remove GreenSock license code from b2b library; upgrade to EPSDK 1.3.1 Version 1.0.0, February 2017 - Initial release diff --git a/ecomp-portal-BE-os/pom.xml b/ecomp-portal-BE-os/pom.xml index 473d0eeb..f2855b74 100644 --- a/ecomp-portal-BE-os/pom.xml +++ b/ecomp-portal-BE-os/pom.xml @@ -1,13 +1,14 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> + <parent> <groupId>org.onap.portal</groupId> <artifactId>onap-portal-parent</artifactId> - <version>1.3.0</version> + <version>2.2</version> </parent> - <artifactId>ecompportal-be-os</artifactId> + <artifactId>portal-be-os</artifactId> <packaging>war</packaging> <properties> @@ -79,7 +80,7 @@ <!-- specify the order in which these should be applied --> <overlay> <groupId>org.onap.portal</groupId> - <artifactId>ecompportal-be-common</artifactId> + <artifactId>portal-be-common</artifactId> </overlay> <overlay> <groupId>org.onap.portal.sdk</groupId> @@ -483,18 +484,26 @@ <!-- EcompPortal common overlay --> <dependency> <groupId>org.onap.portal</groupId> - <artifactId>ecompportal-be-common</artifactId> + <artifactId>portal-be-common</artifactId> <version>${project.version}</version> <type>war</type> </dependency> <dependency> <groupId>org.onap.portal</groupId> - <artifactId>ecompportal-be-common</artifactId> + <artifactId>portal-be-common</artifactId> <version>${project.version}</version> <type>jar</type> <classifier>classes</classifier> </dependency> <dependency> + <groupId>org.onap.portal</groupId> + <artifactId>portal-be-common</artifactId> + <version>${project.version}</version> + <type>jar</type> + <classifier>tests</classifier> + <scope>test</scope> + </dependency> + <dependency> <groupId>org.onap.portal.sdk</groupId> <artifactId>epsdk-fw</artifactId> <version>${epsdk.version}</version> @@ -534,6 +543,11 @@ <artifactId>epsdk-analytics</artifactId> <version>${epsdk.version}</version> </dependency> + <dependency> + <groupId>org.json</groupId> + <artifactId>json</artifactId> + <version>20171018</version> + </dependency> <!-- Referenced by some poms and needed for testing; do NOT use "test" scope here. --> <dependency> @@ -578,7 +592,7 @@ <dependency> <groupId>org.mitre</groupId> <artifactId>openid-connect-client</artifactId> - <version>1.2.2</version> + <version>1.3.1</version> <exclusions> <exclusion> <groupId>org.codehaus.jackson</groupId> @@ -586,7 +600,7 @@ </exclusion> </exclusions> </dependency> - <dependency> +<!-- <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-taglibs</artifactId> <version>3.2.8.RELEASE</version> @@ -596,7 +610,7 @@ <artifactId>*</artifactId> </exclusion> </exclusions> - </dependency> + </dependency> --> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjrt</artifactId> @@ -637,5 +651,4 @@ </plugins> </reporting> - </project> diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/authentication/LoginStrategy.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/authentication/LoginStrategy.java index 6cdcb6ba..767bd520 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/authentication/LoginStrategy.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/authentication/LoginStrategy.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,7 +35,7 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.authentication; +package org.onap.portalapp.authentication; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/authentication/OpenIdConnectLoginStrategy.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/authentication/OpenIdConnectLoginStrategy.java index 02cd340a..cbe4b352 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/authentication/OpenIdConnectLoginStrategy.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/authentication/OpenIdConnectLoginStrategy.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,7 +35,7 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.authentication; +package org.onap.portalapp.authentication; import java.util.HashSet; @@ -43,25 +43,25 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.mitre.openid.connect.model.UserInfo; -import org.openecomp.portalapp.command.EPLoginBean; -import org.openecomp.portalapp.portal.domain.EPUser; -import org.openecomp.portalapp.portal.utils.EPSystemProperties; -import org.openecomp.portalapp.util.EPUserUtils; -import org.openecomp.portalapp.util.SessionCookieUtil; -import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; -import org.openecomp.portalsdk.core.onboarding.exception.PortalAPIException; -import org.openecomp.portalsdk.core.util.SystemProperties; +import org.onap.portalapp.command.EPLoginBean; +import org.onap.portalapp.portal.domain.EPUser; +import org.onap.portalapp.portal.utils.EPSystemProperties; +import org.onap.portalapp.util.EPUserUtils; +import org.onap.portalapp.util.SessionCookieUtil; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalsdk.core.onboarding.exception.PortalAPIException; +import org.onap.portalsdk.core.util.SystemProperties; import org.springframework.util.StringUtils; import org.springframework.web.servlet.ModelAndView; -public class OpenIdConnectLoginStrategy extends org.openecomp.portalsdk.core.auth.LoginStrategy implements org.openecomp.portalapp.authentication.LoginStrategy { +public class OpenIdConnectLoginStrategy extends org.onap.portalsdk.core.auth.LoginStrategy implements org.onap.portalapp.authentication.LoginStrategy { private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(OpenIdConnectLoginStrategy.class); private static final String GLOBAL_LOCATION_KEY = "Location"; @SuppressWarnings("rawtypes") - public boolean login(HttpServletRequest request, HttpServletResponse response){ + public boolean login(HttpServletRequest request, HttpServletResponse response) throws Exception{ logger.info("Attempting Login"); diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/authentication/SimpleLoginStrategy.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/authentication/SimpleLoginStrategy.java index b7e16443..55a0f10a 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/authentication/SimpleLoginStrategy.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/authentication/SimpleLoginStrategy.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,26 +35,26 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.authentication; +package org.onap.portalapp.authentication; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.openecomp.portalapp.command.EPLoginBean; -import org.openecomp.portalapp.portal.service.EPLoginService; -import org.openecomp.portalapp.portal.service.EPRoleFunctionService; -import org.openecomp.portalapp.portal.utils.EPSystemProperties; -import org.openecomp.portalapp.util.EPUserUtils; -import org.openecomp.portalapp.util.SessionCookieUtil; -import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; -import org.openecomp.portalsdk.core.menu.MenuProperties; -import org.openecomp.portalsdk.core.onboarding.exception.PortalAPIException; -import org.openecomp.portalsdk.core.util.SystemProperties; +import org.onap.portalapp.command.EPLoginBean; +import org.onap.portalapp.portal.service.EPLoginService; +import org.onap.portalapp.portal.service.EPRoleFunctionService; +import org.onap.portalapp.portal.utils.EPSystemProperties; +import org.onap.portalapp.util.EPUserUtils; +import org.onap.portalapp.util.SessionCookieUtil; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalsdk.core.menu.MenuProperties; +import org.onap.portalsdk.core.onboarding.exception.PortalAPIException; +import org.onap.portalsdk.core.util.SystemProperties; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.StringUtils; import org.springframework.web.servlet.ModelAndView; -public class SimpleLoginStrategy extends org.openecomp.portalsdk.core.auth.LoginStrategy implements LoginStrategy{ +public class SimpleLoginStrategy extends org.onap.portalsdk.core.auth.LoginStrategy implements LoginStrategy{ @Autowired private EPLoginService loginService; diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/conf/ExternalAppConfig.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/conf/ExternalAppConfig.java index 7b44add9..b6d384d5 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/conf/ExternalAppConfig.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/conf/ExternalAppConfig.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,7 +35,7 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.conf; +package org.onap.portalapp.conf; import static com.att.eelf.configuration.Configuration.MDC_ALERT_SEVERITY; import static com.att.eelf.configuration.Configuration.MDC_INSTANCE_UUID; @@ -48,38 +48,51 @@ import java.net.InetAddress; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; +import java.util.HashMap; import java.util.List; +import java.util.Map; import javax.annotation.PostConstruct; -import org.openecomp.portalapp.authentication.LoginStrategy; -import org.openecomp.portalapp.authentication.OpenIdConnectLoginStrategy; -import org.openecomp.portalapp.authentication.SimpleLoginStrategy; -import org.openecomp.portalapp.controller.core.LogoutController; -import org.openecomp.portalapp.controller.core.SDKLoginController; -import org.openecomp.portalapp.portal.interceptor.PortalResourceInterceptor; -import org.openecomp.portalapp.portal.interceptor.SessionTimeoutInterceptor; -import org.openecomp.portalapp.portal.listener.HealthMonitor; -import org.openecomp.portalapp.portal.service.EPLoginService; -import org.openecomp.portalapp.portal.service.EPLoginServiceImpl; -import org.openecomp.portalapp.portal.ueb.EPUebHelper; -import org.openecomp.portalapp.portal.utils.EPSystemProperties; -import org.openecomp.portalapp.portal.utils.EcompPortalUtils; -import org.openecomp.portalapp.scheduler.RegistryAdapter; -import org.openecomp.portalapp.uebhandler.FunctionalMenuHandler; -import org.openecomp.portalapp.uebhandler.InitUebHandler; -import org.openecomp.portalapp.uebhandler.MainUebHandler; -import org.openecomp.portalapp.uebhandler.WidgetNotificationHandler; -import org.openecomp.portalsdk.core.conf.AppConfig; -import org.openecomp.portalsdk.core.conf.Configurable; -import org.openecomp.portalsdk.core.logging.format.AlarmSeverityEnum; -import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; -import org.openecomp.portalsdk.core.objectcache.AbstractCacheManager; -import org.openecomp.portalsdk.core.service.DataAccessService; -import org.openecomp.portalsdk.core.service.FnMenuService; -import org.openecomp.portalsdk.core.service.FnMenuServiceImpl; -import org.openecomp.portalsdk.core.util.CacheManager; -import org.openecomp.portalsdk.core.util.SystemProperties; +import org.json.JSONArray; +import org.json.JSONObject; +import org.onap.portalapp.authentication.LoginStrategy; +import org.onap.portalapp.authentication.OpenIdConnectLoginStrategy; +import org.onap.portalapp.authentication.SimpleLoginStrategy; +import org.onap.portalapp.controller.core.LogoutController; +import org.onap.portalapp.controller.core.SDKLoginController; +import org.onap.portalapp.portal.domain.EPApp; +import org.onap.portalapp.portal.domain.EPUser; +import org.onap.portalapp.portal.domain.EPUserApp; +import org.onap.portalapp.portal.interceptor.PortalResourceInterceptor; +import org.onap.portalapp.portal.interceptor.SessionTimeoutInterceptor; +import org.onap.portalapp.portal.listener.HealthMonitor; +import org.onap.portalapp.portal.service.EPLoginService; +import org.onap.portalapp.portal.service.EPLoginServiceImpl; +import org.onap.portalapp.portal.service.ExternalAccessRolesService; +import org.onap.portalapp.portal.service.UserRolesService; +import org.onap.portalapp.portal.transport.ExternalAuthUserRole; +import org.onap.portalapp.portal.transport.ExternalRoleDescription; +import org.onap.portalapp.portal.ueb.EPUebHelper; +import org.onap.portalapp.portal.utils.EPCommonSystemProperties; +import org.onap.portalapp.portal.utils.EPSystemProperties; +import org.onap.portalapp.scheduler.RegistryAdapter; +import org.onap.portalapp.uebhandler.FunctionalMenuHandler; +import org.onap.portalapp.uebhandler.InitUebHandler; +import org.onap.portalapp.uebhandler.MainUebHandler; +import org.onap.portalapp.uebhandler.WidgetNotificationHandler; +import org.onap.portalsdk.core.conf.AppConfig; +import org.onap.portalsdk.core.conf.Configurable; +import org.onap.portalsdk.core.logging.format.AlarmSeverityEnum; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalsdk.core.objectcache.AbstractCacheManager; +import org.onap.portalsdk.core.onboarding.util.PortalApiConstants; +import org.onap.portalsdk.core.onboarding.util.PortalApiProperties; +import org.onap.portalsdk.core.service.DataAccessService; +import org.onap.portalsdk.core.service.FnMenuService; +import org.onap.portalsdk.core.service.FnMenuServiceImpl; +import org.onap.portalsdk.core.util.CacheManager; +import org.onap.portalsdk.core.util.SystemProperties; import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; @@ -96,26 +109,41 @@ import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.google.gson.Gson; + @Configuration @EnableWebMvc -@ComponentScan(basePackages = { "org.openecomp" }, excludeFilters = { - @Filter(value = { LogoutController.class, SDKLoginController.class }, type = FilterType.ASSIGNABLE_TYPE) }) +@ComponentScan(basePackages = {"org.onap", "org.openecomp" }, excludeFilters = { + @Filter(value = { LogoutController.class, SDKLoginController.class}, type = FilterType.ASSIGNABLE_TYPE) }) @Profile("src") @EnableAsync @EnableScheduling + public class ExternalAppConfig extends AppConfig implements Configurable { - EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ExternalAppConfig.class); + private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ExternalAppConfig.class); + + @Autowired + private DataAccessService dataAccessService; + + @Autowired + private UserRolesService userRolesService; + + @Autowired + private ExternalAccessRolesService externalAccessRolesService; private RegistryAdapter schedulerRegistryAdapter; + String UEB_APP_KEY = PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_KEY); + public ViewResolver viewResolver() { return super.viewResolver(); } @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { - registry.addResourceHandler("/app/fusion/**").addResourceLocations("/app/fusion/"); + registry.addResourceHandler("/app/fusion/**").addResourceLocations("/app/fusion/"); registry.addResourceHandler("/static/**").addResourceLocations("/static/"); registry.addResourceHandler("/images/**").addResourceLocations("/images/"); registry.addResourceHandler("/**").addResourceLocations("/public/"); @@ -123,34 +151,83 @@ public class ExternalAppConfig extends AppConfig implements Configurable { @PostConstruct private void init() { + String remotecentralizedsystemaccess = SystemProperties.getProperty(EPCommonSystemProperties.REMOTE_CENTRALIZED_SYSTEM_ACCESS); try { // Loading defaults MDC.put(MDC_SERVICE_NAME, EPSystemProperties.ECOMP_PORTAL_BE); MDC.put(MDC_SERVER_FQDN, InetAddress.getLocalHost().getHostName()); MDC.put(MDC_SERVER_IP_ADDRESS, InetAddress.getLocalHost().getHostAddress()); MDC.put(MDC_SERVICE_INSTANCE_ID, ""); - MDC.put(MDC_ALERT_SEVERITY, AlarmSeverityEnum.INFORMATIONAL.toString()); + MDC.put(MDC_ALERT_SEVERITY, AlarmSeverityEnum.INFORMATIONAL.severity()); MDC.put(MDC_INSTANCE_UUID, SystemProperties.getProperty(SystemProperties.INSTANCE_UUID)); + if(remotecentralizedsystemaccess.equalsIgnoreCase("true")){ + importFromExternalAuth(); + } } catch (Exception e) { logger.error(EELFLoggerDelegate.errorLogger, "init failed", e); } } - - /* - * / + + /** + * Does a sync on functions, roles and role functions based on namespace + * for all the centralized applications between AAF and ONAP, updates + * fn_user and fn_user_role with user information from AAF. * - * @PostConstruct // file://${catalina.home}/conf/log4j.properties public - * void initLog4j() throws FileNotFoundException { try { URL[] classpathurls - * = ((URLClassLoader) - * (Thread.currentThread().getContextClassLoader())).getURLs(); for (URL url - * : classpathurls) { System.out.println(url.getFile().toString()); } - * Log4jConfigurer.initLogging( - * "file://${catalina.home}/conf/log4j.properties"); } catch - * (FileNotFoundException e) { ((URLClassLoader) - * (Thread.currentThread().getContextClassLoader())).getURLs(); - * Log4jConfigurer.initLogging("classpath:../conf/log4j.properties"); } } / - **/ - + */ + private void importFromExternalAuth() throws Exception { + JSONArray aafAppRoles = new JSONArray(); + JSONArray aafUserList = new JSONArray(); + List<EPApp> appList; + //to get all centralized apps + List<EPApp> centralizedAppList = dataAccessService.executeNamedQuery("getCentralizedApps", null, null); + if(centralizedAppList != null && centralizedAppList.size() > 0){ + for(int i = 0; i < centralizedAppList.size(); i++){ + //syncRoles(does a sync on functions, roles and role functions) + externalAccessRolesService.syncApplicationRolesWithEcompDB(centralizedAppList.get(i)); + //retrieve roles based on NS + aafAppRoles = externalAccessRolesService.getAppRolesJSONFromExtAuthSystem(centralizedAppList.get(i)); + if(aafAppRoles != null && aafAppRoles.length() > 0){ + for(int j = 0; j < aafAppRoles.length(); j++){ + ObjectMapper mapper = new ObjectMapper(); + String name = aafAppRoles.getJSONObject(j).getString("name"); + String desc = aafAppRoles.getJSONObject(j).getString("description"); + ExternalRoleDescription externalRoleDescription = mapper.readValue(desc, ExternalRoleDescription.class); + aafUserList = externalAccessRolesService.getAllUsersByRole(name); + if(aafUserList != null && aafUserList.length() > 0){ + for(int k = 0; k < aafUserList.length(); k++){ + EPUser user = null; + List<EPUser> usersList = null; + List<EPUserApp> userRolesList = new ArrayList<EPUserApp>(); + JSONObject userRole = (JSONObject) aafUserList.get(k); + Gson gson = new Gson(); + ExternalAuthUserRole userRoleObj = gson.fromJson(userRole.toString(), ExternalAuthUserRole.class); + if(userRoleObj.getUser() != null){ + userRoleObj.setUser(userRoleObj.getUser().substring(0, userRoleObj.getUser().indexOf("@"))); + } + //for each role and user in that role, check if user exists in fn_user. If not, add + Map<String, String> orgUserId = new HashMap<>(); + orgUserId.put("orgUserIdValue", userRoleObj.getUser()); + usersList = dataAccessService.executeNamedQuery("epUserAppId", orgUserId, null); + if(usersList != null && usersList.size() > 0){ + user = usersList.get(0); + } + if(user == null){ + // add user to fn_user(needs to be revisited after getting user info from AAF PORTAL-172) + } + //for each role and user in that role, check if user exists in fn_user_role. If not, add + /*userRolesList = userRolesService.getUserRolesList(centralizedAppList.get(0).getId(), user.getId(), Long.valueOf(externalRoleDescription.getId())); + if(userRolesList == null || userRolesList.isEmpty()){ + // add userRole to fn_user_role(needs to be revisited after getting user info from AAF PORTAL-172) + }*/ + } + } + + } + } + } + } + } + public DataAccessService dataAccessService() { return super.dataAccessService(); } @@ -186,7 +263,7 @@ public class ExternalAppConfig extends AppConfig implements Configurable { } @Bean - public org.openecomp.portalsdk.core.auth.LoginStrategy coreLoginStrategy() { + public org.onap.portalsdk.core.auth.LoginStrategy coreLoginStrategy() { if (SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM).trim().equalsIgnoreCase("OIDC")) return new OpenIdConnectLoginStrategy(); else @@ -218,7 +295,7 @@ public class ExternalAppConfig extends AppConfig implements Configurable { registry.addInterceptor(sessionTimeoutInterceptor()).excludePathPatterns("/oid-login", "/portalApi/healthCheck", "/portalApi/healthCheck/", "/portalApi/healthCheckSuspend", "/portalApi/healthCheckSuspend/", "/portalApi/healthCheckResume", "/portalApi/healthCheckResume/", "/login_external", - "/login_external.htm*", "login", "/login.htm*","/auxapi/*","/context/*", "/api*", + "/login_external.htm*", "login", "/login.htm*", "/auxapi/*", "/context/*", "/api*", "/single_signon.htm", "/single_signon", "/dashboard", "/OpenSourceLogin.htm"); registry.addInterceptor(portalResourceInterceptor()); diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/conf/ExternalAppInitializer.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/conf/ExternalAppInitializer.java index 121c4beb..62051b1d 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/conf/ExternalAppInitializer.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/conf/ExternalAppInitializer.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,11 +35,11 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.conf; +package org.onap.portalapp.conf; import java.util.Arrays; -import org.openecomp.portalsdk.core.conf.AppInitializer; +import org.onap.portalsdk.core.conf.AppInitializer; public class ExternalAppInitializer extends AppInitializer{ diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/conf/HibernateMappingLocations.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/conf/HibernateMappingLocations.java index 7f0e9569..f340ec35 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/conf/HibernateMappingLocations.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/conf/HibernateMappingLocations.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,9 +35,9 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.conf; +package org.onap.portalapp.conf; -import org.openecomp.portalsdk.core.conf.HibernateMappingLocatable; +import org.onap.portalsdk.core.conf.HibernateMappingLocatable; import org.springframework.context.annotation.Profile; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; @@ -55,7 +55,7 @@ public class HibernateMappingLocations implements HibernateMappingLocatable { @Override public String[] getPackagesToScan() { - return new String[] { "org.openecomp" }; + return new String[] { "org.onap","org.openecomp" }; } } diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/ECOMPLogoutController.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ECOMPLogoutController.java index 10ae7b9d..0f0cf270 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/ECOMPLogoutController.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ECOMPLogoutController.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,18 +35,19 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.controller; +package org.onap.portalapp.controller; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.openecomp.portalapp.portal.domain.EPUser; -import org.openecomp.portalapp.portal.logging.aop.EPAuditLog; -import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog; -import org.openecomp.portalapp.portal.utils.EPSystemProperties; -import org.openecomp.portalapp.util.EPUserUtils; -import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalapp.controller.EPUnRestrictedBaseController; +import org.onap.portalapp.portal.domain.EPUser; +import org.onap.portalapp.portal.logging.aop.EPAuditLog; +import org.onap.portalapp.portal.logging.aop.EPMetricsLog; +import org.onap.portalapp.portal.utils.EPSystemProperties; +import org.onap.portalapp.util.EPUserUtils; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.springframework.context.annotation.EnableAspectJAutoProxy; import org.springframework.context.annotation.Profile; import org.springframework.stereotype.Controller; diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/LoginController.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/LoginController.java index ce6cc530..273a0b1e 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/LoginController.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/LoginController.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,10 +35,12 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.controller; +package org.onap.portalapp.controller; import static com.att.eelf.configuration.Configuration.MDC_KEY_REQUEST_ID; +import java.net.MalformedURLException; +import java.net.URL; import java.net.URLDecoder; import java.util.Enumeration; import java.util.HashMap; @@ -50,19 +52,22 @@ import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.apache.commons.lang.StringUtils; import org.json.JSONObject; -import org.openecomp.portalapp.command.EPLoginBean; -import org.openecomp.portalapp.portal.domain.SharedContext; -import org.openecomp.portalapp.portal.service.EPLoginService; -import org.openecomp.portalapp.portal.service.EPRoleFunctionService; -import org.openecomp.portalapp.portal.service.SharedContextService; -import org.openecomp.portalapp.portal.utils.EPSystemProperties; -import org.openecomp.portalapp.util.EPUserUtils; -import org.openecomp.portalapp.util.SessionCookieUtil; -import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; -import org.openecomp.portalsdk.core.menu.MenuProperties; -import org.openecomp.portalsdk.core.onboarding.util.CipherUtil; -import org.openecomp.portalsdk.core.util.SystemProperties; +import org.onap.portalapp.command.EPLoginBean; +import org.onap.portalapp.controller.EPUnRestrictedBaseController; +import org.onap.portalapp.portal.domain.SharedContext; +import org.onap.portalapp.portal.service.EPLoginService; +import org.onap.portalapp.portal.service.EPRoleFunctionService; +import org.onap.portalapp.portal.service.SharedContextService; +import org.onap.portalapp.portal.utils.EPCommonSystemProperties; +import org.onap.portalapp.portal.utils.EPSystemProperties; +import org.onap.portalapp.util.EPUserUtils; +import org.onap.portalapp.util.SessionCookieUtil; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalsdk.core.menu.MenuProperties; +import org.onap.portalsdk.core.onboarding.util.CipherUtil; +import org.onap.portalsdk.core.util.SystemProperties; import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -200,6 +205,7 @@ public class LoginController extends EPUnRestrictedBaseController implements Log logger.info(EELFLoggerDelegate.debugLogger, "processSingleSignOn: begins with orgUserId {}", orgUserId); StringBuilder sbAdditionalInfo = new StringBuilder(); + validateDomain(request); if (orgUserId == null || orgUserId.length() == 0) { model.put(ERROR_MESSAGE_KEY, SystemProperties.MESSAGE_KEY_LOGIN_ERROR_COOKIE_EMPTY); if (request.getParameter(REDIRECT_URL) != null && request.getParameter(REDIRECT_URL).length() != 0) { @@ -242,6 +248,7 @@ public class LoginController extends EPUnRestrictedBaseController implements Log sbAdditionalInfo.append(String.format( "But the Login-Id: %s doesn't exist in the Database. Created a Guest Session. Request-URL: %s", orgUserId, fullURL)); + validateDomain(request); if (request.getParameter(REDIRECT_URL) != null && request.getParameter(REDIRECT_URL).length() != 0) { return new ModelAndView(REDIRECT_COLON + DEFAULT_FAILURE_VIEW + ".htm" + "?redirectUrl=" + request.getParameter(REDIRECT_URL)); @@ -292,6 +299,7 @@ public class LoginController extends EPUnRestrictedBaseController implements Log commandBean.getUser().getOrgUserId() + " exists in the the system."); // get redirectUrl from URL parameter + validateDomain(request); if (request.getParameter(REDIRECT_URL) != null && request.getParameter(REDIRECT_URL).length() != 0) { String forwardUrl = URLDecoder.decode(request.getParameter(REDIRECT_URL), "UTF-8"); // clean cookie @@ -327,6 +335,19 @@ public class LoginController extends EPUnRestrictedBaseController implements Log return new ModelAndView(REDIRECT_COLON + SystemProperties.getProperty(EPSystemProperties.FE_URL)); } + private void validateDomain(HttpServletRequest request) throws MalformedURLException { + final String returnToAppUrl = request.getParameter(REDIRECT_URL); + if (StringUtils.isNotBlank(returnToAppUrl)) { + String hostName = new URL(returnToAppUrl).getHost(); + if (StringUtils.isNotBlank(hostName) + && !hostName.endsWith(EPSystemProperties.getProperty(EPCommonSystemProperties.COOKIE_DOMAIN))) { + logger.debug(EELFLoggerDelegate.debugLogger, + "processSingleSignOn () accessing Unauthorized url :" + hostName); + throw new SecurityException("accessing Unauthorized url : " + hostName); + } + } + } + private String getFullURL(HttpServletRequest request) { if (request != null) { String requestURL = request.getRequestURL().toString(); diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/LoginService.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/LoginService.java index 4b5a8d96..41e07a8e 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/LoginService.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/LoginService.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,7 +35,7 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.controller; +package org.onap.portalapp.controller; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/ONAPLoginController.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ONAPLoginController.java index 64f38c18..d20a4608 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/ONAPLoginController.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ONAPLoginController.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,7 +35,7 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.controller; +package org.onap.portalapp.controller; import java.util.HashMap; import java.util.Map; @@ -43,12 +43,12 @@ import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.openecomp.portalsdk.core.auth.LoginStrategy; -import org.openecomp.portalsdk.core.controller.UnRestrictedBaseController; -import org.openecomp.portalsdk.core.onboarding.listener.PortalTimeoutHandler; -import org.openecomp.portalsdk.core.service.LoginService; -import org.openecomp.portalsdk.core.service.ProfileService; -import org.openecomp.portalsdk.core.web.support.AppUtils; +import org.onap.portalsdk.core.auth.LoginStrategy; +import org.onap.portalsdk.core.controller.UnRestrictedBaseController; +import org.onap.portalsdk.core.onboarding.listener.PortalTimeoutHandler; +import org.onap.portalsdk.core.service.LoginService; +import org.onap.portalsdk.core.service.ProfileService; +import org.onap.portalsdk.core.web.support.AppUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/ONAPWelcomeController.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ONAPWelcomeController.java index 917d7713..0435dbaf 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/ONAPWelcomeController.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ONAPWelcomeController.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,7 +35,7 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.controller; +package org.onap.portalapp.controller; import java.security.Principal; import java.util.Set; @@ -45,7 +45,8 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.mitre.openid.connect.client.SubjectIssuerGrantedAuthority; -import org.openecomp.portalapp.portal.logging.aop.EPAuditLog; +import org.onap.portalapp.controller.EPRestrictedBaseController; +import org.onap.portalapp.portal.logging.aop.EPAuditLog; import org.springframework.context.annotation.EnableAspectJAutoProxy; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; @@ -79,8 +80,7 @@ public class ONAPWelcomeController extends EPRestrictedBaseController{ this.viewName = viewName; } - - @Resource(name = "namedAdmins") + //@Resource(name = "namedAdmins") private Set<SubjectIssuerGrantedAuthority> admins; @RequestMapping("/user") diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/OpenCollaborationController.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/OpenCollaborationController.java index 9e87ae2e..5348f237 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/OpenCollaborationController.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/OpenCollaborationController.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,7 +35,7 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.controller; +package org.onap.portalapp.controller; import java.util.HashMap; import java.util.Map; diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/PeerBroadcastSocket.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/PeerBroadcastSocket.java index 9366b1e7..170c3ce1 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/PeerBroadcastSocket.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/PeerBroadcastSocket.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,7 +35,7 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.controller; +package org.onap.portalapp.controller; import java.io.IOException; import java.util.Hashtable; @@ -47,7 +47,7 @@ import javax.websocket.OnOpen; import javax.websocket.Session; import javax.websocket.server.ServerEndpoint; -import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import com.fasterxml.jackson.databind.ObjectMapper; @ServerEndpoint("/opencontact") diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/filter/SecurityXssFilter.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/filter/SecurityXssFilter.java new file mode 100644 index 00000000..11d1a449 --- /dev/null +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/filter/SecurityXssFilter.java @@ -0,0 +1,158 @@ + +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalapp.filter; + +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; + +import javax.servlet.FilterChain; +import javax.servlet.ReadListener; +import javax.servlet.ServletException; +import javax.servlet.ServletInputStream; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletRequestWrapper; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.http.HttpStatus; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.springframework.web.filter.OncePerRequestFilter; + +public class SecurityXssFilter extends OncePerRequestFilter { + + private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SecurityXssFilter.class); + + private static final String APPLICATION_JSON = "application/json"; + + private static final String ERROR_BAD_REQUEST = "{\"error\":\"BAD_REQUEST\"}"; + + private SecurityXssValidator validator = SecurityXssValidator.getInstance(); + + public class RequestWrapper extends HttpServletRequestWrapper { + + private ByteArrayOutputStream cachedBytes; + + public RequestWrapper(HttpServletRequest request) { + super(request); + } + + @Override + public ServletInputStream getInputStream() throws IOException { + if (cachedBytes == null) + cacheInputStream(); + + return new CachedServletInputStream(); + } + + @Override + public BufferedReader getReader() throws IOException { + return new BufferedReader(new InputStreamReader(getInputStream())); + } + + private void cacheInputStream() throws IOException { + cachedBytes = new ByteArrayOutputStream(); + IOUtils.copy(super.getInputStream(), cachedBytes); + } + + public class CachedServletInputStream extends ServletInputStream { + private ByteArrayInputStream input; + + public CachedServletInputStream() { + input = new ByteArrayInputStream(cachedBytes.toByteArray()); + } + + @Override + public int read() throws IOException { + return input.read(); + } + + @Override + public boolean isFinished() { + return false; + } + + @Override + public boolean isReady() { + return false; + } + + @Override + public void setReadListener(ReadListener readListener) { + + } + + } + } + + @Override + protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) + throws ServletException, IOException { + if (validateRequestType(request)) { + request = new RequestWrapper(request); + String requestData = IOUtils.toString(request.getInputStream(), StandardCharsets.UTF_8.toString()); + try { + if (StringUtils.isNotBlank(requestData) && validator.denyXSS(requestData)) { + response.setContentType(APPLICATION_JSON); + response.setStatus(HttpStatus.SC_BAD_REQUEST); + response.getWriter().write(ERROR_BAD_REQUEST); + throw new SecurityException(ERROR_BAD_REQUEST); + } + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "doFilterInternal() failed due to BAD_REQUEST", e); + response.getWriter().close(); + return; + } + filterChain.doFilter(request, response); + + } else { + filterChain.doFilter(request, response); + } + + } + + private boolean validateRequestType(HttpServletRequest request) { + return (request.getMethod().equalsIgnoreCase("POST") || request.getMethod().equalsIgnoreCase("PUT") + || request.getMethod().equalsIgnoreCase("DELETE")); + } +}
\ No newline at end of file diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/filter/SecurityXssValidator.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/filter/SecurityXssValidator.java new file mode 100644 index 00000000..4d6a9fe2 --- /dev/null +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/filter/SecurityXssValidator.java @@ -0,0 +1,207 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalapp.filter; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; +import java.util.regex.Pattern; + +import org.apache.commons.lang.NotImplementedException; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringEscapeUtils; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalsdk.core.util.SystemProperties; +import org.owasp.esapi.ESAPI; +import org.owasp.esapi.codecs.Codec; +import org.owasp.esapi.codecs.MySQLCodec; +import org.owasp.esapi.codecs.MySQLCodec.Mode; +import org.owasp.esapi.codecs.OracleCodec; + +public class SecurityXssValidator { + + private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SecurityXssValidator.class); + + private static final String MYSQL_DB = "mysql"; + private static final String ORACLE_DB = "oracle"; + private static final String MARIA_DB = "mariadb"; + private static final int FLAGS = Pattern.CASE_INSENSITIVE | Pattern.MULTILINE | Pattern.DOTALL; + static SecurityXssValidator validator = null; + private static Codec instance; + private static final Lock lock = new ReentrantLock(); + + public static SecurityXssValidator getInstance() { + + if (validator == null) { + lock.lock(); + try { + if (validator == null) + validator = new SecurityXssValidator(); + } finally { + lock.unlock(); + } + } + + return validator; + } + + private SecurityXssValidator() { + // Avoid anything between script tags + XSS_INPUT_PATTERNS.add(Pattern.compile("<script>(.*?)</script>", FLAGS)); + + // avoid iframes + XSS_INPUT_PATTERNS.add(Pattern.compile("<iframe(.*?)>(.*?)</iframe>", FLAGS)); + + // Avoid anything in a src='...' type of expression + XSS_INPUT_PATTERNS.add(Pattern.compile("src[\r\n]*=[\r\n]*\\\'(.*?)\\\'", FLAGS)); + + XSS_INPUT_PATTERNS.add(Pattern.compile("src[\r\n]*=[\r\n]*\\\"(.*?)\\\"", FLAGS)); + + XSS_INPUT_PATTERNS.add(Pattern.compile("src[\r\n]*=[\r\n]*([^>]+)", FLAGS)); + + // Remove any lonesome </script> tag + XSS_INPUT_PATTERNS.add(Pattern.compile("</script>", FLAGS)); + + XSS_INPUT_PATTERNS.add(Pattern.compile(".*(<script>|</script>).*", FLAGS)); + + XSS_INPUT_PATTERNS.add(Pattern.compile(".*(<iframe>|</iframe>).*", FLAGS)); + + // Remove any lonesome <script ...> tag + XSS_INPUT_PATTERNS.add(Pattern.compile("<script(.*?)>", FLAGS)); + + // Avoid eval(...) expressions + XSS_INPUT_PATTERNS.add(Pattern.compile("eval\\((.*?)\\)", FLAGS)); + + // Avoid expression(...) expressions + XSS_INPUT_PATTERNS.add(Pattern.compile("expression\\((.*?)\\)", FLAGS)); + + // Avoid javascript:... expressions + XSS_INPUT_PATTERNS.add(Pattern.compile(".*(javascript:|vbscript:).*", FLAGS)); + + // Avoid onload= expressions + XSS_INPUT_PATTERNS.add(Pattern.compile(".*(onload(.*?)=).*", FLAGS)); + } + + private List<Pattern> XSS_INPUT_PATTERNS = new ArrayList<Pattern>(); + + /** + * * This method takes a string and strips out any potential script injections. + * + * @param value + * @return String - the new "sanitized" string. + */ + public String stripXSS(String value) { + + try { + + if (StringUtils.isNotBlank(value)) { + + value = StringEscapeUtils.escapeHtml4(value); + + value = ESAPI.encoder().canonicalize(value); + + // Avoid null characters + value = value.replaceAll("\0", ""); + + for (Pattern xssInputPattern : XSS_INPUT_PATTERNS) { + value = xssInputPattern.matcher(value).replaceAll(""); + } + } + + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "stripXSS() failed", e); + } + + return value; + } + + public Boolean denyXSS(String value) { + Boolean flag = Boolean.FALSE; + try { + if (StringUtils.isNotBlank(value)) { + value = ESAPI.encoder().canonicalize(value); + for (Pattern xssInputPattern : XSS_INPUT_PATTERNS) { + if (xssInputPattern.matcher(value).matches()) { + flag = Boolean.TRUE; + break; + } + + } + } + + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "denyXSS() failed", e); + } + + return flag; + } + + public Codec getCodec() { + try { + if (null == instance) { + if (StringUtils.containsIgnoreCase(SystemProperties.getProperty(SystemProperties.DB_DRIVER), MYSQL_DB) + || StringUtils.containsIgnoreCase(SystemProperties.getProperty(SystemProperties.DB_DRIVER), + MARIA_DB)) { + instance = new MySQLCodec(Mode.STANDARD); + + } else if (StringUtils.containsIgnoreCase(SystemProperties.getProperty(SystemProperties.DB_DRIVER), + ORACLE_DB)) { + instance = new OracleCodec(); + } else { + throw new NotImplementedException("Handling for data base \"" + + SystemProperties.getProperty(SystemProperties.DB_DRIVER) + "\" not yet implemented."); + } + } + + } catch (Exception ex) { + logger.error(EELFLoggerDelegate.errorLogger, "getCodec() failed", ex); + } + return instance; + + } + + public List<Pattern> getXSS_INPUT_PATTERNS() { + return XSS_INPUT_PATTERNS; + } + + public void setXSS_INPUT_PATTERNS(List<Pattern> xSS_INPUT_PATTERNS) { + XSS_INPUT_PATTERNS = xSS_INPUT_PATTERNS; + } + +}
\ No newline at end of file diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/controller/AppsOSController.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/AppsOSController.java index 5cffe8cd..364899da 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/controller/AppsOSController.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/AppsOSController.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,7 +35,7 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.controller; +package org.onap.portalapp.portal.controller; import java.util.HashMap; import java.util.Map; @@ -43,16 +43,17 @@ import java.util.Map; import javax.servlet.http.HttpServletRequest; import org.json.JSONObject; -import org.openecomp.portalapp.portal.domain.EPUser; -import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse; -import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum; -import org.openecomp.portalapp.portal.logging.aop.EPAuditLog; -import org.openecomp.portalapp.portal.service.AdminRolesService; -import org.openecomp.portalapp.portal.service.EPAppService; -import org.openecomp.portalapp.portal.service.PersUserAppService; -import org.openecomp.portalapp.portal.service.UserService; -import org.openecomp.portalapp.util.EPUserUtils; -import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalapp.portal.controller.AppsController; +import org.onap.portalapp.portal.domain.EPUser; +import org.onap.portalapp.portal.ecomp.model.PortalRestResponse; +import org.onap.portalapp.portal.ecomp.model.PortalRestStatusEnum; +import org.onap.portalapp.portal.logging.aop.EPAuditLog; +import org.onap.portalapp.portal.service.AdminRolesService; +import org.onap.portalapp.portal.service.EPAppService; +import org.onap.portalapp.portal.service.PersUserAppService; +import org.onap.portalapp.portal.service.UserService; +import org.onap.portalapp.util.EPUserUtils; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.EnableAspectJAutoProxy; import org.springframework.web.bind.annotation.PathVariable; diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/controller/DashboardSearchResultController.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/DashboardSearchResultController.java index 313ae683..7670f883 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/controller/DashboardSearchResultController.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/DashboardSearchResultController.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,7 +35,7 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.controller; +package org.onap.portalapp.portal.controller; import java.text.ParseException; import java.text.SimpleDateFormat; @@ -47,17 +47,18 @@ import java.util.Map; import javax.servlet.http.HttpServletRequest; -import org.openecomp.portalapp.controller.EPRestrictedBaseController; -import org.openecomp.portalapp.portal.domain.EPUser; -import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse; -import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum; -import org.openecomp.portalapp.portal.ecomp.model.SearchResultItem; -import org.openecomp.portalapp.portal.service.DashboardSearchService; -import org.openecomp.portalapp.portal.transport.CommonWidget; -import org.openecomp.portalapp.portal.transport.CommonWidgetMeta; -import org.openecomp.portalapp.util.EPUserUtils; -import org.openecomp.portalsdk.core.domain.support.CollaborateList; -import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalapp.controller.EPRestrictedBaseController; +import org.onap.portalapp.portal.controller.DashboardSearchResultController; +import org.onap.portalapp.portal.domain.EPUser; +import org.onap.portalapp.portal.ecomp.model.PortalRestResponse; +import org.onap.portalapp.portal.ecomp.model.PortalRestStatusEnum; +import org.onap.portalapp.portal.ecomp.model.SearchResultItem; +import org.onap.portalapp.portal.service.DashboardSearchService; +import org.onap.portalapp.portal.transport.CommonWidget; +import org.onap.portalapp.portal.transport.CommonWidgetMeta; +import org.onap.portalapp.util.EPUserUtils; +import org.onap.portalsdk.core.domain.support.CollaborateList; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -220,7 +221,7 @@ public class DashboardSearchResultController extends EPRestrictedBaseController String userId = user.getOrgUserId(); activeUsers = searchService.getRelatedUsers(userId); - HashSet<String> usersSet = CollaborateList.getInstance().getAllUserName(); + HashSet<String> usersSet = (HashSet<String>) CollaborateList.getInstance().getAllUserName(); for (String users : activeUsers) { if (usersSet.contains(users)) { onlineUsers.add(users); diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/controller/ExternalAppsRestfulController.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/ExternalAppsRestfulController.java index 95623661..f877587e 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/controller/ExternalAppsRestfulController.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/ExternalAppsRestfulController.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,7 +35,7 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.controller; +package org.onap.portalapp.portal.controller; import java.io.IOException; import java.util.List; @@ -43,19 +43,20 @@ import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.openecomp.portalapp.controller.EPRestrictedRESTfulBaseController; -import org.openecomp.portalapp.portal.domain.EPUser; -import org.openecomp.portalapp.portal.logging.aop.EPAuditLog; -import org.openecomp.portalapp.portal.service.AdminRolesService; -import org.openecomp.portalapp.portal.service.EPLoginService; -import org.openecomp.portalapp.portal.service.FunctionalMenuService; -import org.openecomp.portalapp.portal.transport.FavoritesFunctionalMenuItemJson; -import org.openecomp.portalapp.portal.transport.FieldsValidator; -import org.openecomp.portalapp.portal.transport.FunctionalMenuItem; -import org.openecomp.portalapp.portal.utils.EPSystemProperties; -import org.openecomp.portalapp.portal.utils.EcompPortalUtils; -import org.openecomp.portalapp.portal.utils.PortalConstants; -import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalapp.controller.EPRestrictedRESTfulBaseController; +import org.onap.portalapp.portal.controller.ExternalAppsRestfulController; +import org.onap.portalapp.portal.domain.EPUser; +import org.onap.portalapp.portal.logging.aop.EPAuditLog; +import org.onap.portalapp.portal.service.AdminRolesService; +import org.onap.portalapp.portal.service.EPLoginService; +import org.onap.portalapp.portal.service.FunctionalMenuService; +import org.onap.portalapp.portal.transport.FavoritesFunctionalMenuItemJson; +import org.onap.portalapp.portal.transport.FieldsValidator; +import org.onap.portalapp.portal.transport.FunctionalMenuItem; +import org.onap.portalapp.portal.utils.EPSystemProperties; +import org.onap.portalapp.portal.utils.EcompPortalUtils; +import org.onap.portalapp.portal.utils.PortalConstants; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.EnableAspectJAutoProxy; diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/controller/PortalAdminController.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/PortalAdminController.java index d2585ab4..45fb2f4c 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/controller/PortalAdminController.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/PortalAdminController.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,24 +35,25 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.controller; +package org.onap.portalapp.portal.controller; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.openecomp.portalapp.controller.EPRestrictedBaseController; -import org.openecomp.portalapp.portal.domain.EPRole; -import org.openecomp.portalapp.portal.domain.EPUser; -import org.openecomp.portalapp.portal.logging.aop.EPAuditLog; -import org.openecomp.portalapp.portal.service.AdminRolesService; -import org.openecomp.portalapp.portal.service.PortalAdminService; -import org.openecomp.portalapp.portal.transport.FieldsValidator; -import org.openecomp.portalapp.portal.transport.PortalAdmin; -import org.openecomp.portalapp.portal.utils.EcompPortalUtils; -import org.openecomp.portalapp.util.EPUserUtils; -import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalapp.controller.EPRestrictedBaseController; +import org.onap.portalapp.portal.controller.PortalAdminController; +import org.onap.portalapp.portal.domain.EPRole; +import org.onap.portalapp.portal.domain.EPUser; +import org.onap.portalapp.portal.logging.aop.EPAuditLog; +import org.onap.portalapp.portal.service.AdminRolesService; +import org.onap.portalapp.portal.service.PortalAdminService; +import org.onap.portalapp.portal.transport.FieldsValidator; +import org.onap.portalapp.portal.transport.PortalAdmin; +import org.onap.portalapp.portal.utils.EcompPortalUtils; +import org.onap.portalapp.util.EPUserUtils; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.EnableAspectJAutoProxy; import org.springframework.web.bind.annotation.PathVariable; diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/interceptor/SessionTimeoutInterceptor.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/interceptor/SessionTimeoutInterceptor.java index 61b98e4f..e05e25c5 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/interceptor/SessionTimeoutInterceptor.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/interceptor/SessionTimeoutInterceptor.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,20 +35,20 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.interceptor; +package org.onap.portalapp.portal.interceptor; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.openecomp.portalapp.authentication.LoginStrategy; -import org.openecomp.portalapp.portal.domain.EPUser; -import org.openecomp.portalapp.portal.utils.EcompPortalUtils; -import org.openecomp.portalapp.util.EPUserUtils; -import org.openecomp.portalapp.util.SessionCookieUtil; -import org.openecomp.portalsdk.core.controller.FusionBaseController; -import org.openecomp.portalsdk.core.domain.support.CollaborateList; -import org.openecomp.portalsdk.core.exception.SessionExpiredException; -import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalapp.authentication.LoginStrategy; +import org.onap.portalapp.portal.domain.EPUser; +import org.onap.portalapp.portal.utils.EcompPortalUtils; +import org.onap.portalapp.util.EPUserUtils; +import org.onap.portalapp.util.SessionCookieUtil; +import org.onap.portalsdk.core.controller.FusionBaseController; +import org.onap.portalsdk.core.domain.support.CollaborateList; +import org.onap.portalsdk.core.exception.SessionExpiredException; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPEELFLoggerAspect.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/logging/aop/EPEELFLoggerAspect.java index 0970ec45..ab235ca6 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPEELFLoggerAspect.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/logging/aop/EPEELFLoggerAspect.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,16 +35,19 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.logging.aop; +package org.onap.portalapp.portal.logging.aop; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Pointcut; -import org.openecomp.portalapp.portal.transport.FieldsValidator; -import org.openecomp.portalapp.portal.utils.EcompPortalUtils; -import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; -import org.openecomp.portalsdk.core.util.SystemProperties.SecurityEventTypeEnum; +import org.onap.portalapp.portal.logging.aop.EPAuditLog; +import org.onap.portalapp.portal.logging.aop.EPEELFLoggerAdvice; +import org.onap.portalapp.portal.logging.aop.EPMetricsLog; +import org.onap.portalapp.portal.transport.FieldsValidator; +import org.onap.portalapp.portal.utils.EcompPortalUtils; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalsdk.core.util.SystemProperties.SecurityEventTypeEnum; import org.springframework.beans.factory.annotation.Autowired; @Aspect @@ -59,56 +62,56 @@ public class EPEELFLoggerAspect { /* * Point-cut expression to handle all INCOMING_REST_MESSAGES */ - @Pointcut("execution(public * org.openecomp.portalapp.portal.controller.*.*(..))") + @Pointcut("execution(public * org.onap.portalapp.portal.controller.*.*(..))") public void incomingAuditMessages() {} /* * Handles all INCOMING_REST_MESSAGES from kpiDashboard */ - @Pointcut("execution(public * org.openecomp.portalapp.kpidash.controller.*.*(..))") + @Pointcut("execution(public * org.onap.portalapp.kpidash.controller.*.*(..))") public void kpiDashboardAuditMessages() {} /* * Point-cut expression to handle all session management INCOMING_REST_MESSAGES */ - @Pointcut("execution(public * org.openecomp.portalapp.controller.sessionmgt.*.*(..))") + @Pointcut("execution(public * org.onap.portalapp.controller.sessionmgt.*.*(..))") public void sessionMgtIncomingAuditMessages() {} /* * Point-cut expression to handle UserProfileController INCOMING_REST_MESSAGES */ - @Pointcut("execution(public * org.openecomp.portalapp.controller.core.UserProfileController.*(..))") + @Pointcut("execution(public * org.onap.portalapp.controller.core.UserProfileController.*(..))") public void userProfileIncomingAuditMessages() {} /* * Point-cut expression to handle UserProfileController INCOMING_REST_MESSAGES */ - @Pointcut("execution(public * org.openecomp.portalapp.controller.ONAPWelcomeController.*(..))") + @Pointcut("execution(public * org.onap.portalapp.controller.ONAPWelcomeController.*(..))") public void welcomeIncomingAuditMessages() {} /* * Point-cut expression to handle INCOMING Logout Rest Messages */ - @Pointcut("execution(public * org.openecomp.portalapp.controller.ECOMPLogoutController.*(..))") + @Pointcut("execution(public * org.onap.portalapp.controller.ECOMPLogoutController.*(..))") public void logoutAuditMessages() {} /* * Point-cut expression which handles all the OUTGOING_REST_MESSAGES. */ - @Pointcut("execution(public * org.openecomp.portalapp.portal.service.ApplicationsRestClientServiceImpl.*(..))") + @Pointcut("execution(public * org.onap.portalapp.portal.service.ApplicationsRestClientServiceImpl.*(..))") public void outgoingAuditMessages() {} /* * Point-cut expression to handle all the session management OUTGOING_REST_MESSAGES. */ - @Pointcut("execution(public * org.openecomp.portalapp.service.sessionmgt.SessionCommunication.*(..))") + @Pointcut("execution(public * org.onap.portalapp.service.sessionmgt.SessionCommunication.*(..))") public void sessionMgtOutgoingAuditMessages() {} /* * Point-cut expression which handles all the LDAP_PHONEBOOK_USER_SEARCH calls. */ - @Pointcut("execution(public * org.openecomp.portalapp.portal.service.EPLdapServiceImpl.*(..))") + @Pointcut("execution(public * org.onap.portalapp.portal.service.EPLdapServiceImpl.*(..))") public void phoneBookSearchAuditMessages() {} /* diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/AppsCacheService.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/AppsCacheService.java index 20f4d59f..0ffe246c 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/AppsCacheService.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/AppsCacheService.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -36,9 +36,9 @@ * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.service; +package org.onap.portalapp.portal.service; -import org.openecomp.portalapp.portal.domain.EPApp; +import org.onap.portalapp.portal.domain.EPApp; public interface AppsCacheService { diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/AppsCacheServiceImple.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/AppsCacheServiceImple.java index 09a78e85..f884d4e7 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/AppsCacheServiceImple.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/AppsCacheServiceImple.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,7 +35,7 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.service; +package org.onap.portalapp.portal.service; import java.util.HashMap; import java.util.List; @@ -43,9 +43,11 @@ import java.util.Map; import javax.annotation.PostConstruct; -import org.openecomp.portalapp.portal.domain.EPApp; -import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog; -import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalapp.portal.domain.EPApp; +import org.onap.portalapp.portal.logging.aop.EPMetricsLog; +import org.onap.portalapp.portal.service.AppsCacheService; +import org.onap.portalapp.portal.service.EPAppService; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.EnableAspectJAutoProxy; import org.springframework.stereotype.Service; diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/EPAppServiceImpl.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/EPAppServiceImpl.java index ea92ca51..ca321044 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/EPAppServiceImpl.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/EPAppServiceImpl.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,7 +35,7 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.service; +package org.onap.portalapp.portal.service; import java.net.MalformedURLException; import java.security.GeneralSecurityException; @@ -49,16 +49,18 @@ import javax.servlet.http.HttpServletResponse; import org.hibernate.Session; import org.hibernate.Transaction; -import org.openecomp.portalapp.portal.domain.EPApp; -import org.openecomp.portalapp.portal.domain.EPUser; -import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog; -import org.openecomp.portalapp.portal.logging.format.EPAppMessagesEnum; -import org.openecomp.portalapp.portal.logging.logic.EPLogUtil; -import org.openecomp.portalapp.portal.transport.FieldsValidator; -import org.openecomp.portalapp.portal.transport.OnboardingApp; -import org.openecomp.portalapp.portal.utils.EcompPortalUtils; -import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; -import org.openecomp.portalsdk.core.service.DataAccessService; +import org.onap.portalapp.portal.domain.EPApp; +import org.onap.portalapp.portal.domain.EPUser; +import org.onap.portalapp.portal.logging.aop.EPMetricsLog; +import org.onap.portalapp.portal.logging.format.EPAppMessagesEnum; +import org.onap.portalapp.portal.logging.logic.EPLogUtil; +import org.onap.portalapp.portal.service.EPAppCommonServiceImpl; +import org.onap.portalapp.portal.service.EPAppService; +import org.onap.portalapp.portal.transport.FieldsValidator; +import org.onap.portalapp.portal.transport.OnboardingApp; +import org.onap.portalapp.portal.utils.EcompPortalUtils; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalsdk.core.service.DataAccessService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.EnableAspectJAutoProxy; import org.springframework.stereotype.Service; diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/SearchService.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/SearchService.java index 07dc8cca..44fd7ca2 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/SearchService.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/SearchService.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,12 +35,12 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.service; +package org.onap.portalapp.portal.service; import java.util.List; -import org.openecomp.portalapp.portal.domain.EPUser; -import org.openecomp.portalapp.portal.transport.UserWithNameSurnameTitle; +import org.onap.portalapp.portal.domain.EPUser; +import org.onap.portalapp.portal.transport.UserWithNameSurnameTitle; public interface SearchService { diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/SearchServiceImpl.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/SearchServiceImpl.java index 0929c480..8a2f7269 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/SearchServiceImpl.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/SearchServiceImpl.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,16 +35,19 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.service; +package org.onap.portalapp.portal.service; import java.util.ArrayList; import java.util.List; -import org.openecomp.portalapp.portal.domain.EPUser; -import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog; -import org.openecomp.portalapp.portal.transport.UserWithNameSurnameTitle; -import org.openecomp.portalapp.portal.utils.EcompPortalUtils; -import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalapp.portal.domain.EPUser; +import org.onap.portalapp.portal.logging.aop.EPMetricsLog; +import org.onap.portalapp.portal.service.SearchService; +import org.onap.portalapp.portal.service.SearchServiceImpl; +import org.onap.portalapp.portal.service.UserService; +import org.onap.portalapp.portal.transport.UserWithNameSurnameTitle; +import org.onap.portalapp.portal.utils.EcompPortalUtils; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.EnableAspectJAutoProxy; import org.springframework.stereotype.Service; diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/TicketEventServiceImpl.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/TicketEventServiceImpl.java index 446bb60e..bf71bc06 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/TicketEventServiceImpl.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/TicketEventServiceImpl.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,10 +35,11 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.service; +package org.onap.portalapp.portal.service; -import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties; -import org.openecomp.portalsdk.core.util.SystemProperties; +import org.onap.portalapp.portal.service.TicketEventService; +import org.onap.portalapp.portal.utils.EPCommonSystemProperties; +import org.onap.portalsdk.core.util.SystemProperties; import org.springframework.stereotype.Service; import com.fasterxml.jackson.databind.JsonNode; diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/UserRolesServiceImpl.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/UserRolesServiceImpl.java index 41b320c2..c0d14f60 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/UserRolesServiceImpl.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/UserRolesServiceImpl.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,18 +35,18 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.service; +package org.onap.portalapp.portal.service; import java.util.List; import org.apache.cxf.transport.http.HTTPException; -import org.openecomp.portalapp.portal.domain.EPApp; -import org.openecomp.portalapp.portal.domain.EPRole; -import org.openecomp.portalapp.portal.domain.EPUser; -import org.openecomp.portalapp.portal.domain.EPUserApp; -import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog; -import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; -import org.openecomp.portalsdk.core.service.DataAccessService; +import org.onap.portalapp.portal.domain.EPApp; +import org.onap.portalapp.portal.domain.EPRole; +import org.onap.portalapp.portal.domain.EPUser; +import org.onap.portalapp.portal.domain.EPUserApp; +import org.onap.portalapp.portal.logging.aop.EPMetricsLog; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalsdk.core.service.DataAccessService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.EnableAspectJAutoProxy; import org.springframework.stereotype.Service; @@ -118,4 +118,6 @@ public class UserRolesServiceImpl extends UserRolesCommonServiceImpl implements return roleList; } + + } diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/UserService.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/UserService.java index 69ea652c..2d149428 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/UserService.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/UserService.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,11 +35,11 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.service; +package org.onap.portalapp.portal.service; import java.util.List; -import org.openecomp.portalapp.portal.domain.EPUser; +import org.onap.portalapp.portal.domain.EPUser; public interface UserService { diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/UserServiceImpl.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/UserServiceImpl.java index 9cc97460..eeb0193d 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/UserServiceImpl.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/UserServiceImpl.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,7 +35,7 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.service; +package org.onap.portalapp.portal.service; import java.io.BufferedReader; import java.io.IOException; @@ -47,13 +47,15 @@ import java.util.List; import org.json.JSONArray; import org.json.JSONObject; -import org.openecomp.portalapp.portal.domain.EPUser; -import org.openecomp.portalapp.portal.utils.EPSystemProperties; -import org.openecomp.portalsdk.core.FusionObject.Utilities; -import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; -import org.openecomp.portalsdk.core.onboarding.util.CipherUtil; -import org.openecomp.portalsdk.core.service.DataAccessService; -import org.openecomp.portalsdk.core.util.SystemProperties; +import org.onap.portalapp.portal.domain.EPUser; +import org.onap.portalapp.portal.service.UserService; +import org.onap.portalapp.portal.service.UserServiceImpl; +import org.onap.portalapp.portal.utils.EPSystemProperties; +import org.onap.portalsdk.core.FusionObject.Utilities; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalsdk.core.onboarding.util.CipherUtil; +import org.onap.portalsdk.core.service.DataAccessService; +import org.onap.portalsdk.core.util.SystemProperties; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -241,7 +243,7 @@ public class UserServiceImpl implements UserService { if (list == null || list.size() == 0) { newUser.setActive(true); newUser.setOrgUserId(newUser.getLoginId()); - newUser.setLoginPwd(CipherUtil.encrypt(newUser.getLoginPwd())); + newUser.setLoginPwd(CipherUtil.encryptPKC(newUser.getLoginPwd())); getDataAccessService().saveDomainObject(newUser, null); } else { if (checkDuplicate.equals("Yes")) { @@ -254,7 +256,7 @@ public class UserServiceImpl implements UserService { oldUser.setLastName(newUser.getLastName()); oldUser.setMiddleInitial(newUser.getMiddleInitial()); if (!oldUser.getLoginPwd().equals(newUser.getLoginPwd())) - oldUser.setLoginPwd(CipherUtil.encrypt(newUser.getLoginPwd())); + oldUser.setLoginPwd(CipherUtil.encryptPKC(newUser.getLoginPwd())); else oldUser.setLoginPwd(newUser.getLoginPwd()); getDataAccessService().saveDomainObject(oldUser, null); diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/transport/OnboardingApp.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/transport/OnboardingApp.java index 4a156a1a..f37c4b1f 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/transport/OnboardingApp.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/transport/OnboardingApp.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,7 +35,7 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.transport; +package org.onap.portalapp.portal.transport; public class OnboardingApp { diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/ueb/EPUebHelper.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/ueb/EPUebHelper.java index 81b1c495..5c92b5dd 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/ueb/EPUebHelper.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/ueb/EPUebHelper.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,7 +35,7 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.ueb; +package org.onap.portalapp.portal.ueb; import java.net.HttpURLConnection; import java.net.URL; @@ -44,21 +44,20 @@ import java.util.List; import org.hibernate.Session; import org.hibernate.SessionFactory; -import org.openecomp.portalapp.portal.domain.EPApp; -import org.openecomp.portalapp.portal.domain.EcompApp; -import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog; -import org.openecomp.portalapp.portal.logging.format.EPAppMessagesEnum; -import org.openecomp.portalapp.portal.logging.logic.EPLogUtil; -import org.openecomp.portalapp.portal.service.EPAppService; -import org.openecomp.portalapp.portal.utils.EcompPortalUtils; -import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; -import org.openecomp.portalsdk.core.onboarding.ueb.Helper; -import org.openecomp.portalsdk.core.onboarding.ueb.Publisher; -import org.openecomp.portalsdk.core.onboarding.ueb.UebException; -import org.openecomp.portalsdk.core.onboarding.ueb.UebManager; -import org.openecomp.portalsdk.core.onboarding.ueb.UebMsg; -import org.openecomp.portalsdk.core.onboarding.util.PortalApiConstants; -import org.openecomp.portalsdk.core.onboarding.util.PortalApiProperties; +import org.onap.portalapp.portal.domain.EPApp; +import org.onap.portalapp.portal.domain.EcompApp; +import org.onap.portalapp.portal.logging.aop.EPMetricsLog; +import org.onap.portalapp.portal.logging.format.EPAppMessagesEnum; +import org.onap.portalapp.portal.logging.logic.EPLogUtil; +import org.onap.portalapp.portal.service.EPAppService; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalsdk.core.onboarding.ueb.Helper; +import org.onap.portalsdk.core.onboarding.ueb.Publisher; +import org.onap.portalsdk.core.onboarding.ueb.UebException; +import org.onap.portalsdk.core.onboarding.ueb.UebManager; +import org.onap.portalsdk.core.onboarding.ueb.UebMsg; +import org.onap.portalsdk.core.onboarding.util.PortalApiConstants; +import org.onap.portalsdk.core.onboarding.util.PortalApiProperties; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.EnableAspectJAutoProxy; import org.springframework.stereotype.Component; @@ -165,7 +164,7 @@ public class EPUebHelper { // // boolean available = true; - LinkedList<String> urlList = Helper.uebUrlList(); + LinkedList<String> urlList = (LinkedList<String>) Helper.uebUrlList(); if (!urlList.isEmpty()) { String url = "http://" + urlList.getFirst() + ":3904/topics/" + PortalApiProperties.getProperty(PortalApiConstants.ECOMP_PORTAL_INBOX_NAME); diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/ueb/EPUebMsgTypes.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/ueb/EPUebMsgTypes.java index 720e0615..7e49f8f2 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/ueb/EPUebMsgTypes.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/ueb/EPUebMsgTypes.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,9 +35,9 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.ueb; +package org.onap.portalapp.portal.ueb; -import org.openecomp.portalsdk.core.onboarding.ueb.UebMsgTypes; +import org.onap.portalsdk.core.onboarding.ueb.UebMsgTypes; public interface EPUebMsgTypes extends UebMsgTypes { diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/utils/EPSystemProperties.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/utils/EPSystemProperties.java index e8772677..f9b69e92 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/utils/EPSystemProperties.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/utils/EPSystemProperties.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,8 +35,9 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.utils; +package org.onap.portalapp.portal.utils; +import org.onap.portalapp.portal.utils.EPCommonSystemProperties; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; import org.springframework.context.annotation.PropertySources; diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/scheduler/LogJob.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/scheduler/LogJob.java index 63b44027..b553ff37 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/scheduler/LogJob.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/scheduler/LogJob.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,9 +35,9 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.scheduler; +package org.onap.portalapp.scheduler; -import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.quartz.DisallowConcurrentExecution; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/scheduler/LogRegistry.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/scheduler/LogRegistry.java index f502a564..c54a26b0 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/scheduler/LogRegistry.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/scheduler/LogRegistry.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,14 +35,14 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.scheduler; +package org.onap.portalapp.scheduler; import java.text.ParseException; import java.util.HashMap; import java.util.Map; -import org.openecomp.portalsdk.core.scheduler.CronRegistry; -import org.openecomp.portalsdk.core.util.SystemProperties; +import org.onap.portalsdk.core.scheduler.CronRegistry; +import org.onap.portalsdk.core.util.SystemProperties; import org.springframework.context.annotation.DependsOn; import org.springframework.scheduling.quartz.CronTriggerFactoryBean; import org.springframework.scheduling.quartz.JobDetailFactoryBean; diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/scheduler/Register.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/scheduler/Register.java index 00eb7b69..aa3dfe62 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/scheduler/Register.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/scheduler/Register.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,14 +35,14 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.scheduler; +package org.onap.portalapp.scheduler; import java.util.ArrayList; import java.util.List; -import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; -import org.openecomp.portalsdk.core.scheduler.Registerable; -import org.openecomp.portalsdk.core.util.SystemProperties; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalsdk.core.scheduler.Registerable; +import org.onap.portalsdk.core.util.SystemProperties; import org.quartz.Trigger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.DependsOn; diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/scheduler/RegistryAdapter.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/scheduler/RegistryAdapter.java index 542b0d88..82120e1c 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/scheduler/RegistryAdapter.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/scheduler/RegistryAdapter.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,21 +35,21 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.scheduler; +package org.onap.portalapp.scheduler; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.openecomp.portalsdk.core.scheduler.Registerable; -import org.openecomp.portalsdk.workflow.services.WorkflowScheduleService; +import org.onap.portalsdk.core.scheduler.Registerable; +import org.onap.portalsdk.workflow.services.WorkflowScheduleService; import org.quartz.Trigger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.quartz.SchedulerFactoryBean; import org.springframework.stereotype.Component; /** - * TODO REFACTOR moved from org.openecomp.portalsdk.core.scheduler to + * TODO REFACTOR moved from org.onap.portalsdk.core.scheduler to * org.openecomp.portalapp.scheduler * */ diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/scheduler/SessionMgtRegistry.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/scheduler/SessionMgtRegistry.java index c18b4b35..e263d7ec 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/scheduler/SessionMgtRegistry.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/scheduler/SessionMgtRegistry.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,17 +35,17 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.scheduler; +package org.onap.portalapp.scheduler; import java.text.ParseException; import java.util.HashMap; import java.util.Map; -import org.openecomp.portalapp.portal.listener.UserSessionListener; -import org.openecomp.portalapp.service.sessionmgt.TimeoutHandler; -import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; -import org.openecomp.portalsdk.core.scheduler.CronRegistry; -import org.openecomp.portalsdk.core.util.SystemProperties; +import org.onap.portalapp.portal.listener.UserSessionListener; +import org.onap.portalapp.service.sessionmgt.TimeoutHandler; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalsdk.core.scheduler.CronRegistry; +import org.onap.portalsdk.core.util.SystemProperties; import org.springframework.beans.BeansException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/service/RemoteWebServiceCallServiceImpl.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/service/RemoteWebServiceCallServiceImpl.java index 0b10caf6..f3377055 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/service/RemoteWebServiceCallServiceImpl.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/service/RemoteWebServiceCallServiceImpl.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,15 +35,16 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.service; +package org.onap.portalapp.service; import java.util.List; -import org.openecomp.portalapp.portal.domain.EPApp; -import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; -import org.openecomp.portalsdk.core.onboarding.util.CipherUtil; -import org.openecomp.portalsdk.core.service.WebServiceCallServiceImpl; -import org.openecomp.portalsdk.core.util.SystemProperties; +import org.onap.portalapp.portal.domain.EPApp; +import org.onap.portalapp.service.RemoteWebServiceCallService; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalsdk.core.onboarding.util.CipherUtil; +import org.onap.portalsdk.core.service.WebServiceCallServiceImpl; +import org.onap.portalsdk.core.util.SystemProperties; import org.springframework.context.annotation.EnableAspectJAutoProxy; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -70,7 +71,7 @@ public class RemoteWebServiceCallServiceImpl extends WebServiceCallServiceImpl i String encryptedPwdDB = appRecord.getAppPassword(); String appUserName = appRecord.getUsername(); - String decryptedPwd = CipherUtil.decrypt(encryptedPwdDB, + String decryptedPwd = CipherUtil.decryptPKC(encryptedPwdDB, secretKey == null ? SystemProperties.getProperty(SystemProperties.Decryption_Key) : secretKey); if (decryptedPwd.equals(requestPassword) && appUserName.equals(requestAppName)) return true; @@ -110,9 +111,4 @@ public class RemoteWebServiceCallServiceImpl extends WebServiceCallServiceImpl i return (list == null || list.size() == 0) ? null : (EPApp) list.get(0); } - public static void main(String args[]) throws Exception { - String decryptedPwd = CipherUtil.decrypt("okYTaDrhzibcbGVq5mjkVQ==", "AGLDdG4D04BKm2IxIWEr8o=="); - System.out.print(decryptedPwd); - } - } diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/uebhandler/FunctionalMenuHandler.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/uebhandler/FunctionalMenuHandler.java index 8fd70a2b..6127da60 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/uebhandler/FunctionalMenuHandler.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/uebhandler/FunctionalMenuHandler.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,21 +35,21 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.uebhandler; +package org.onap.portalapp.uebhandler; import java.util.List; -import org.openecomp.portalapp.portal.domain.EPUser; -import org.openecomp.portalapp.portal.logging.aop.EPAuditLog; -import org.openecomp.portalapp.portal.service.AdminRolesService; -import org.openecomp.portalapp.portal.service.FunctionalMenuService; -import org.openecomp.portalapp.portal.service.SearchService; -import org.openecomp.portalapp.portal.transport.FunctionalMenuItem; -import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; -import org.openecomp.portalsdk.core.onboarding.ueb.UebException; -import org.openecomp.portalsdk.core.onboarding.ueb.UebManager; -import org.openecomp.portalsdk.core.onboarding.ueb.UebMsg; -import org.openecomp.portalsdk.core.service.DataAccessService; +import org.onap.portalapp.portal.domain.EPUser; +import org.onap.portalapp.portal.logging.aop.EPAuditLog; +import org.onap.portalapp.portal.service.AdminRolesService; +import org.onap.portalapp.portal.service.FunctionalMenuService; +import org.onap.portalapp.portal.service.SearchService; +import org.onap.portalapp.portal.transport.FunctionalMenuItem; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalsdk.core.onboarding.ueb.UebException; +import org.onap.portalsdk.core.onboarding.ueb.UebManager; +import org.onap.portalsdk.core.onboarding.ueb.UebMsg; +import org.onap.portalsdk.core.service.DataAccessService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.EnableAspectJAutoProxy; import org.springframework.scheduling.annotation.Async; diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/uebhandler/InitUebHandler.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/uebhandler/InitUebHandler.java index db60c89f..1d3d192c 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/uebhandler/InitUebHandler.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/uebhandler/InitUebHandler.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,15 +35,15 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.uebhandler; +package org.onap.portalapp.uebhandler; import java.util.concurrent.ConcurrentLinkedQueue; -import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; -import org.openecomp.portalsdk.core.onboarding.ueb.UebManager; -import org.openecomp.portalsdk.core.onboarding.ueb.UebMsg; -import org.openecomp.portalsdk.core.onboarding.util.PortalApiConstants; -import org.openecomp.portalsdk.core.onboarding.util.PortalApiProperties; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalsdk.core.onboarding.ueb.UebManager; +import org.onap.portalsdk.core.onboarding.ueb.UebMsg; +import org.onap.portalsdk.core.onboarding.util.PortalApiConstants; +import org.onap.portalsdk.core.onboarding.util.PortalApiProperties; // // Adding this class for the sole purpose of insuring that the MainUebHandler really diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/uebhandler/MainUebHandler.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/uebhandler/MainUebHandler.java index 9e2bfff7..d522277b 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/uebhandler/MainUebHandler.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/uebhandler/MainUebHandler.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,18 +35,18 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.uebhandler; +package org.onap.portalapp.uebhandler; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.concurrent.ConcurrentLinkedQueue; -import org.openecomp.portalapp.portal.ueb.EPUebMsgTypes; -import org.openecomp.portalapp.portal.utils.EPSystemProperties; -import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; -import org.openecomp.portalsdk.core.onboarding.ueb.UebMsg; -import org.openecomp.portalsdk.core.onboarding.ueb.UebMsgTypes; +import org.onap.portalapp.portal.ueb.EPUebMsgTypes; +import org.onap.portalapp.portal.utils.EPSystemProperties; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalsdk.core.onboarding.ueb.UebMsg; +import org.onap.portalsdk.core.onboarding.ueb.UebMsgTypes; import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Async; diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/uebhandler/WidgetNotificationHandler.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/uebhandler/WidgetNotificationHandler.java index 1f964437..d8dd98f6 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/uebhandler/WidgetNotificationHandler.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/uebhandler/WidgetNotificationHandler.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,22 +35,22 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.uebhandler; +package org.onap.portalapp.uebhandler; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; -import org.openecomp.portalapp.portal.domain.EPApp; -import org.openecomp.portalapp.portal.domain.EPUser; -import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog; -import org.openecomp.portalapp.portal.service.EPAppService; -import org.openecomp.portalapp.portal.service.SearchService; -import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; -import org.openecomp.portalsdk.core.onboarding.ueb.UebException; -import org.openecomp.portalsdk.core.onboarding.ueb.UebManager; -import org.openecomp.portalsdk.core.onboarding.ueb.UebMsg; +import org.onap.portalapp.portal.domain.EPApp; +import org.onap.portalapp.portal.domain.EPUser; +import org.onap.portalapp.portal.logging.aop.EPMetricsLog; +import org.onap.portalapp.portal.service.EPAppService; +import org.onap.portalapp.portal.service.SearchService; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalsdk.core.onboarding.ueb.UebException; +import org.onap.portalsdk.core.onboarding.ueb.UebManager; +import org.onap.portalsdk.core.onboarding.ueb.UebMsg; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.EnableAspectJAutoProxy; import org.springframework.scheduling.annotation.Async; diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/util/SessionCookieUtil.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/util/SessionCookieUtil.java index 7ae34aed..edb5ebb6 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/util/SessionCookieUtil.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/util/SessionCookieUtil.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,20 +35,20 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.util; +package org.onap.portalapp.util; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; -import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties; -import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; -import org.openecomp.portalsdk.core.onboarding.listener.PortalTimeoutHandler; -import org.openecomp.portalsdk.core.onboarding.util.CipherUtil; -import org.openecomp.portalsdk.core.onboarding.util.PortalApiConstants; -import org.openecomp.portalsdk.core.util.SystemProperties; -import org.openecomp.portalsdk.core.web.support.AppUtils; +import org.onap.portalapp.portal.utils.EPCommonSystemProperties; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalsdk.core.onboarding.listener.PortalTimeoutHandler; +import org.onap.portalsdk.core.onboarding.util.CipherUtil; +import org.onap.portalsdk.core.onboarding.util.PortalApiConstants; +import org.onap.portalsdk.core.util.SystemProperties; +import org.onap.portalsdk.core.web.support.AppUtils; public class SessionCookieUtil { @@ -78,7 +78,7 @@ public class SessionCookieUtil { public static void setUpUserIdCookie(HttpServletRequest request, HttpServletResponse response,String userId) throws Exception { logger.info("************** session cookie util set up UserId cookie begins"); - userId = CipherUtil.encrypt(userId, + userId = CipherUtil.encryptPKC(userId, SystemProperties.getProperty(SystemProperties.Decryption_Key)); Cookie cookie1 = new Cookie(USER_ID, userId); cookie1.setMaxAge(cookieMaxAge); @@ -98,7 +98,7 @@ public class SessionCookieUtil { if (cookie.getName().equals(USER_ID)) userIdcookie = cookie; if(userIdcookie!=null){ - userId = CipherUtil.decrypt(userIdcookie.getValue(), + userId = CipherUtil.decryptPKC(userIdcookie.getValue(), SystemProperties.getProperty(SystemProperties.Decryption_Key)); } diff --git a/ecomp-portal-BE-os/src/main/resources/key.properties b/ecomp-portal-BE-os/src/main/resources/key.properties new file mode 100644 index 00000000..b9dad852 --- /dev/null +++ b/ecomp-portal-BE-os/src/main/resources/key.properties @@ -0,0 +1,3 @@ +# Encrypted Properties + +cipher.enc.key = AGLDdG4D04BKm2IxIWEr8o==!
\ No newline at end of file diff --git a/ecomp-portal-BE-os/src/main/resources/logback.xml b/ecomp-portal-BE-os/src/main/resources/logback.xml index 8afa5af9..d1efbe28 100644 --- a/ecomp-portal-BE-os/src/main/resources/logback.xml +++ b/ecomp-portal-BE-os/src/main/resources/logback.xml @@ -3,11 +3,11 @@ ============LICENSE_START========================================== ONAP Portal =================================================================== - Copyright © 2017 AT&T Intellectual Property. All rights reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. =================================================================== Unless otherwise specified, all software contained herein is licensed - under the Apache License, Version 2.0 (the “License”); + under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License. You may obtain a copy of the License at @@ -20,7 +20,7 @@ limitations under the License. Unless otherwise specified, all documentation contained herein is licensed - under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + under the Creative Commons License, Attribution 4.0 Intl. (the "License"); you may not use this documentation except in compliance with the License. You may obtain a copy of the License at diff --git a/ecomp-portal-BE-os/src/main/resources/openid-connect.properties b/ecomp-portal-BE-os/src/main/resources/openid-connect.properties index cafd0fda..3c771490 100644 --- a/ecomp-portal-BE-os/src/main/resources/openid-connect.properties +++ b/ecomp-portal-BE-os/src/main/resources/openid-connect.properties @@ -2,11 +2,11 @@ # ============LICENSE_START========================================== # ONAP Portal # =================================================================== -# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. # =================================================================== # # Unless otherwise specified, all software contained herein is licensed -# under the Apache License, Version 2.0 (the “License”); +# under the Apache License, Version 2.0 (the "License"); # you may not use this software except in compliance with the License. # You may obtain a copy of the License at # @@ -19,7 +19,7 @@ # limitations under the License. # # Unless otherwise specified, all documentation contained herein is licensed -# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# under the Creative Commons License, Attribution 4.0 Intl. (the "License"); # you may not use this documentation except in compliance with the License. # You may obtain a copy of the License at # diff --git a/ecomp-portal-BE-os/src/main/resources/portal.properties b/ecomp-portal-BE-os/src/main/resources/portal.properties index 37e24840..c858480b 100644 --- a/ecomp-portal-BE-os/src/main/resources/portal.properties +++ b/ecomp-portal-BE-os/src/main/resources/portal.properties @@ -2,11 +2,11 @@ # ============LICENSE_START========================================== # ONAP Portal # =================================================================== -# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. # =================================================================== # # Unless otherwise specified, all software contained herein is licensed -# under the Apache License, Version 2.0 (the “License”); +# under the Apache License, Version 2.0 (the "License"); # you may not use this software except in compliance with the License. # You may obtain a copy of the License at # @@ -19,7 +19,7 @@ # limitations under the License. # # Unless otherwise specified, all documentation contained herein is licensed -# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# under the Creative Commons License, Attribution 4.0 Intl. (the "License"); # you may not use this documentation except in compliance with the License. # You may obtain a copy of the License at # @@ -35,7 +35,7 @@ # # ECOMP is a trademark and service mark of AT&T Intellectual Property. ### -portal.api.impl.class = org.openecomp.portalsdk.core.onboarding.client.OnBoardingApiServiceImpl +portal.api.impl.class = org.onap.portalsdk.core.onboarding.client.OnBoardingApiServiceImpl portal.api.prefix = /api max.idle.time = 5 user.attribute.name = user_attribute @@ -45,7 +45,7 @@ ecomp_redirect_url = https://localhost:8080/ecompportal/login.htm testing=testing -# URL of the ECOMP Portal REST API +# URL of the ONAP Portal REST API ecomp_rest_url = http://localhost:8080/ecompportal/auxapi ueb_listeners_enable = true diff --git a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/quartz.properties b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/quartz.properties index 10b51126..8728af65 100644 --- a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/quartz.properties +++ b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/quartz.properties @@ -2,11 +2,11 @@ # ============LICENSE_START========================================== # ONAP Portal # =================================================================== -# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. # =================================================================== # # Unless otherwise specified, all software contained herein is licensed -# under the Apache License, Version 2.0 (the “License”); +# under the Apache License, Version 2.0 (the "License"); # you may not use this software except in compliance with the License. # You may obtain a copy of the License at # @@ -19,7 +19,7 @@ # limitations under the License. # # Unless otherwise specified, all documentation contained herein is licensed -# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# under the Creative Commons License, Attribution 4.0 Intl. (the "License"); # you may not use this documentation except in compliance with the License. # You may obtain a copy of the License at # diff --git a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/raptor.properties b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/raptor.properties index 3335db1b..27d8c555 100644 --- a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/raptor.properties +++ b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/raptor.properties @@ -2,11 +2,11 @@ # ============LICENSE_START========================================== # ONAP Portal # =================================================================== -# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. # =================================================================== # # Unless otherwise specified, all software contained herein is licensed -# under the Apache License, Version 2.0 (the “License”); +# under the Apache License, Version 2.0 (the "License"); # you may not use this software except in compliance with the License. # You may obtain a copy of the License at # @@ -19,7 +19,7 @@ # limitations under the License. # # Unless otherwise specified, all documentation contained herein is licensed -# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# under the Creative Commons License, Attribution 4.0 Intl. (the "License"); # you may not use this documentation except in compliance with the License. # You may obtain a copy of the License at # diff --git a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/raptor_app_fusion.properties b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/raptor_app_fusion.properties index 26a05015..688e807f 100644 --- a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/raptor_app_fusion.properties +++ b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/raptor_app_fusion.properties @@ -2,11 +2,11 @@ # ============LICENSE_START========================================== # ONAP Portal # =================================================================== -# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. # =================================================================== # # Unless otherwise specified, all software contained herein is licensed -# under the Apache License, Version 2.0 (the “License”); +# under the Apache License, Version 2.0 (the "License"); # you may not use this software except in compliance with the License. # You may obtain a copy of the License at # @@ -19,7 +19,7 @@ # limitations under the License. # # Unless otherwise specified, all documentation contained herein is licensed -# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# under the Creative Commons License, Attribution 4.0 Intl. (the "License"); # you may not use this documentation except in compliance with the License. # You may obtain a copy of the License at # diff --git a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/raptor_db_fusion.properties b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/raptor_db_fusion.properties index 03dbcaba..ceb8849d 100644 --- a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/raptor_db_fusion.properties +++ b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/raptor_db_fusion.properties @@ -2,11 +2,11 @@ # ============LICENSE_START========================================== # ONAP Portal # =================================================================== -# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. # =================================================================== # # Unless otherwise specified, all software contained herein is licensed -# under the Apache License, Version 2.0 (the “License”); +# under the Apache License, Version 2.0 (the "License"); # you may not use this software except in compliance with the License. # You may obtain a copy of the License at # @@ -19,7 +19,7 @@ # limitations under the License. # # Unless otherwise specified, all documentation contained herein is licensed -# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# under the Creative Commons License, Attribution 4.0 Intl. (the "License"); # you may not use this documentation except in compliance with the License. # You may obtain a copy of the License at # diff --git a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/raptor_pdf.properties b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/raptor_pdf.properties index 484f205c..247042c6 100644 --- a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/raptor_pdf.properties +++ b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/raptor_pdf.properties @@ -2,11 +2,11 @@ # ============LICENSE_START========================================== # ONAP Portal # =================================================================== -# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. # =================================================================== # # Unless otherwise specified, all software contained herein is licensed -# under the Apache License, Version 2.0 (the “License”); +# under the Apache License, Version 2.0 (the "License"); # you may not use this software except in compliance with the License. # You may obtain a copy of the License at # @@ -19,7 +19,7 @@ # limitations under the License. # # Unless otherwise specified, all documentation contained herein is licensed -# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# under the Creative Commons License, Attribution 4.0 Intl. (the "License"); # you may not use this documentation except in compliance with the License. # You may obtain a copy of the License at # diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/shared-context-test.properties b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/scheduler.properties index 75e6f836..65e845e2 100644 --- a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/shared-context-test.properties +++ b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/scheduler.properties @@ -2,11 +2,11 @@ # ============LICENSE_START========================================== # ONAP Portal # =================================================================== -# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. # =================================================================== # # Unless otherwise specified, all software contained herein is licensed -# under the Apache License, Version 2.0 (the “License”); +# under the Apache License, Version 2.0 (the "License"); # you may not use this software except in compliance with the License. # You may obtain a copy of the License at # @@ -19,7 +19,7 @@ # limitations under the License. # # Unless otherwise specified, all documentation contained herein is licensed -# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# under the Creative Commons License, Attribution 4.0 Intl. (the "License"); # you may not use this documentation except in compliance with the License. # You may obtain a copy of the License at # @@ -36,11 +36,26 @@ # ECOMP is a trademark and service mark of AT&T Intellectual Property. ### -hostname= localhost -# port = 80 -secure = true -appname = ecompportal -restpath = context -uebkey = xgnLrmNmkfCRnIwa -username = Default -password = AppPassword!1 + +##scheduler authentication credentials +scheduler.user.name=test1 +scheduler.password=test2 +#scheduler properties +scheduler.server.url=http://mtanjv9sdlg10.aic.cip.onap.com:8989/scheduler +scheduler.create.new.vnf.change.instance=/v1/ChangeManagement/schedules/ +scheduler.get.time.slots=/v1/ChangeManagement/schedules/ +scheduler.submit.new.vnf.change=/v1/ChangeManagement/schedules/{scheduleId}/approvals +vid.truststore.filename=C:\\Temp\\vid_keystore.jks +vid.truststore.passwd.x=OBF:1wgg1wfq1uus1uui1x131x0r1x1v1x1j1uvo1uve1wg81wfi + +#scheduler-policy properties +policy.server.url=https://policypdp-conexus-e2e.ecomp.cci.onap.com:8081/pdp +policy.get.config=/api/getConfig +policy.ClientAuth=UHlQRFBTZXJ2ZXI6dGVzdA== +policy.client.mechId=m06814@controller.dcae.ecomp.onap.com +policy.client.password=OBF:1ffu1qvu1t2z1l161fuk1i801nz91ro41xf71xfv1rqi1nx51i7y1fuq1kxw1t371qxw1fh0 +policy.username=testpdp +policy.password=OBF:1igd1kft1l1a1sw61svs1kxs1kcl1idt +policy.Authorization=dGVzdHBkcDphbHBoYTEyMw== +policy.environment=TEST + diff --git a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/sql.properties b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/sql.properties index 0c2cfdaf..a2911fb9 100644 --- a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/sql.properties +++ b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/sql.properties @@ -2,11 +2,11 @@ # ============LICENSE_START========================================== # ONAP Portal # =================================================================== -# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. # =================================================================== # # Unless otherwise specified, all software contained herein is licensed -# under the Apache License, Version 2.0 (the “License”); +# under the Apache License, Version 2.0 (the "License"); # you may not use this software except in compliance with the License. # You may obtain a copy of the License at # @@ -19,7 +19,7 @@ # limitations under the License. # # Unless otherwise specified, all documentation contained herein is licensed -# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# under the Creative Commons License, Attribution 4.0 Intl. (the "License"); # you may not use this documentation except in compliance with the License. # You may obtain a copy of the License at # diff --git a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/system.properties b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/system.properties index fe2d7db5..5e8aa1a3 100644 --- a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/system.properties +++ b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/system.properties @@ -2,11 +2,11 @@ # ============LICENSE_START========================================== # ONAP Portal # =================================================================== -# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. # =================================================================== # # Unless otherwise specified, all software contained herein is licensed -# under the Apache License, Version 2.0 (the “License”); +# under the Apache License, Version 2.0 (the "License"); # you may not use this software except in compliance with the License. # You may obtain a copy of the License at # @@ -19,7 +19,7 @@ # limitations under the License. # # Unless otherwise specified, all documentation contained herein is licensed -# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# under the Creative Commons License, Attribution 4.0 Intl. (the "License"); # you may not use this documentation except in compliance with the License. # You may obtain a copy of the License at # @@ -37,12 +37,16 @@ ### db.driver = org.mariadb.jdbc.Driver -db.connectionURL = jdbc:mariadb:failover://localhost:3306/ecomp_portal -db.userName = XXXX -db.password = XXXX +#db.connectionURL = jdbc:mariadb:failover://localhost:3306/ecomp_portal +#db.userName = XXXX +#db.password = XXXX +db.connectionURL = jdbc:mariadb:failover://demeter.homer.att.com:3306/ecomp_portal_1710_os +db.userName = portal +db.password = P0rt@l # is the db.password property encrypted? db.encrypt_flag = false + db.hib.dialect = org.hibernate.dialect.MySQLDialect db.min_pool_size = 5 db.max_pool_size = 10 @@ -76,7 +80,7 @@ cache_switch = 1 cache_load_on_startup = false user_name = fullName -decryption_key = AGLDdG4D04BKm2lxlWEr8o== +decryption_key = AGLDdG4D04BKm2IxIWEr8o== #Cron Schedules @@ -138,22 +142,12 @@ window_width_threshold_right_menu = 1350 #External system notification URL external_system_notification_url= https://jira.onap.org/browse/ -#scheduler properties -scheduler.server.url=http://mtanjv9sdlg10.aic.cip.onap.com:8989/scheduler -scheduler.create.new.vnf.change.instance=/v1/ChangeManagement/schedules/ -scheduler.get.time.slots=/v1/ChangeManagement/schedules/ -scheduler.submit.new.vnf.change=/v1/ChangeManagement/schedules/{scheduleId}/approvals -vid.truststore.filename=C:\\Temp\\vid_keystore.jks -vid.truststore.passwd.x=OBF:1wgg1wfq1uus1uui1x131x0r1x1v1x1j1uvo1uve1wg81wfi - -#scheduler-policy properties -policy.server.url=https://policypdp-conexus-e2e.ecomp.cci.onap.com:8081/pdp -policy.get.config=/api/getConfig -policy.ClientAuth=UHlQRFBTZXJ2ZXI6dGVzdA== -policy.client.mechId=m06814@controller.dcae.ecomp.onap.com -policy.client.password=OBF:1ffu1qvu1t2z1l161fuk1i801nz91ro41xf71xfv1rqi1nx51i7y1fuq1kxw1t371qxw1fh0 -policy.username=testpdp -policy.password=OBF:1igd1kft1l1a1sw61svs1kxs1kcl1idt -policy.Authorization=dGVzdHBkcDphbHBoYTEyMw== -policy.environment=TEST +# External Access System Basic Auth Credentials & Rest endpoint(These credentials doesn't work as these are place holders for now) +ext_central_access_user_name = m00468@portal.onap.org +ext_central_access_password = dR2NABMkxPaFbIbym87ZwQ== +ext_central_access_url = https://aaftest.test.onap.org:8095/proxy/authz/ +ext_central_access_user_domain = @csp.onap.org + +# External Central Auth system access +remote_centralized_system_access = false diff --git a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/defs/definitions.xml b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/defs/definitions.xml index f8207a1f..34995ae2 100644 --- a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/defs/definitions.xml +++ b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/defs/definitions.xml @@ -3,11 +3,11 @@ ============LICENSE_START========================================== ONAP Portal =================================================================== - Copyright © 2017 AT&T Intellectual Property. All rights reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. =================================================================== Unless otherwise specified, all software contained herein is licensed - under the Apache License, Version 2.0 (the “License”); + under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License. You may obtain a copy of the License at @@ -20,7 +20,7 @@ limitations under the License. Unless otherwise specified, all documentation contained herein is licensed - under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + under the Creative Commons License, Attribution 4.0 Intl. (the "License"); you may not use this documentation except in compliance with the License. You may obtain a copy of the License at diff --git a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/fusion/conf/fusion.properties b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/fusion/conf/fusion.properties index c609ffa0..c986cbf9 100644 --- a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/fusion/conf/fusion.properties +++ b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/fusion/conf/fusion.properties @@ -3,11 +3,11 @@ # ============LICENSE_START========================================== # ONAP Portal # =================================================================== -# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. # =================================================================== # # Unless otherwise specified, all software contained herein is licensed -# under the Apache License, Version 2.0 (the “License”); +# under the Apache License, Version 2.0 (the "License"); # you may not use this software except in compliance with the License. # You may obtain a copy of the License at # @@ -20,7 +20,7 @@ # limitations under the License. # # Unless otherwise specified, all documentation contained herein is licensed -# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# under the Creative Commons License, Attribution 4.0 Intl. (the "License"); # you may not use this documentation except in compliance with the License. # You may obtain a copy of the License at # diff --git a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/error.jsp b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/error.jsp index ed3f0b9b..ec932022 100644 --- a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/error.jsp +++ b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/error.jsp @@ -2,11 +2,11 @@ ============LICENSE_START========================================== ONAP Portal =================================================================== - Copyright © 2017 AT&T Intellectual Property. All rights reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. =================================================================== Unless otherwise specified, all software contained herein is licensed - under the Apache License, Version 2.0 (the “License”); + under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License. You may obtain a copy of the License at @@ -19,7 +19,7 @@ limitations under the License. Unless otherwise specified, all documentation contained herein is licensed - under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + under the Creative Commons License, Attribution 4.0 Intl. (the "License"); you may not use this documentation except in compliance with the License. You may obtain a copy of the License at diff --git a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/index.jsp b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/index.jsp index 318ce4e3..5cd8060b 100644 --- a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/index.jsp +++ b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/index.jsp @@ -2,11 +2,11 @@ ============LICENSE_START========================================== ONAP Portal =================================================================== - Copyright © 2017 AT&T Intellectual Property. All rights reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. =================================================================== Unless otherwise specified, all software contained herein is licensed - under the Apache License, Version 2.0 (the “License”); + under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License. You may obtain a copy of the License at @@ -19,7 +19,7 @@ limitations under the License. Unless otherwise specified, all documentation contained herein is licensed - under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + under the Creative Commons License, Attribution 4.0 Intl. (the "License"); you may not use this documentation except in compliance with the License. You may obtain a copy of the License at diff --git a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/login.jsp b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/login.jsp index e6370be5..c0ca1514 100644 --- a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/login.jsp +++ b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/login.jsp @@ -2,11 +2,11 @@ ============LICENSE_START========================================== ONAP Portal =================================================================== - Copyright © 2017 AT&T Intellectual Property. All rights reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. =================================================================== Unless otherwise specified, all software contained herein is licensed - under the Apache License, Version 2.0 (the “License”); + under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License. You may obtain a copy of the License at @@ -19,7 +19,7 @@ limitations under the License. Unless otherwise specified, all documentation contained herein is licensed - under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + under the Creative Commons License, Attribution 4.0 Intl. (the "License"); you may not use this documentation except in compliance with the License. You may obtain a copy of the License at @@ -38,8 +38,8 @@ <%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> -<%@ page import="org.openecomp.portalsdk.core.util.SystemProperties" %> -<%@ page import="org.openecomp.portalapp.portal.utils.EPSystemProperties" %> +<%@ page import="org.onap.portalsdk.core.util.SystemProperties" %> +<%@ page import="org.onap.portalapp.portal.utils.EPSystemProperties" %> <c:set var="title" value="Login" /> <c:set var="isMobileEnabled" value="<%=(SystemProperties.getProperty(SystemProperties.MOBILE_ENABLE)!= null && SystemProperties.getProperty(SystemProperties.MOBILE_ENABLE).trim().equals(\"true\"))%>" /> @@ -188,22 +188,6 @@ app.controller("externalLoginController", function ($scope) { }); }; - /** - $scope.loginExternal = function() { - - - var redirectUrl = "login_external/login"; - var form = $('<form action="' + redirectUrl + '" method="post">' + - '<input type="hidden" name="loginId" value='+$scope.loginId+' />' + - '<input type="hidden" name="password" value='+$scope.password+' />' + - '</form>'); - - $('body').append(form); - $(form).submit(); - - - }; - */ }); </script> diff --git a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/oid-admin.jsp b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/oid-admin.jsp index 03d04b81..2bd21813 100644 --- a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/oid-admin.jsp +++ b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/oid-admin.jsp @@ -2,11 +2,11 @@ ============LICENSE_START========================================== ONAP Portal =================================================================== - Copyright © 2017 AT&T Intellectual Property. All rights reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. =================================================================== Unless otherwise specified, all software contained herein is licensed - under the Apache License, Version 2.0 (the “License”); + under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License. You may obtain a copy of the License at @@ -19,7 +19,7 @@ limitations under the License. Unless otherwise specified, all documentation contained herein is licensed - under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + under the Creative Commons License, Attribution 4.0 Intl. (the "License"); you may not use this documentation except in compliance with the License. You may obtain a copy of the License at diff --git a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/oid-home.jsp b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/oid-home.jsp index 9d143592..92c88b15 100644 --- a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/oid-home.jsp +++ b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/oid-home.jsp @@ -2,11 +2,11 @@ ============LICENSE_START========================================== ONAP Portal =================================================================== - Copyright © 2017 AT&T Intellectual Property. All rights reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. =================================================================== Unless otherwise specified, all software contained herein is licensed - under the Apache License, Version 2.0 (the “License”); + under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License. You may obtain a copy of the License at @@ -19,7 +19,7 @@ limitations under the License. Unless otherwise specified, all documentation contained herein is licensed - under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + under the Creative Commons License, Attribution 4.0 Intl. (the "License"); you may not use this documentation except in compliance with the License. You may obtain a copy of the License at diff --git a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/oid-login.jsp b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/oid-login.jsp index 47ef2491..9989f33e 100644 --- a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/oid-login.jsp +++ b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/oid-login.jsp @@ -2,11 +2,11 @@ ============LICENSE_START========================================== ONAP Portal =================================================================== - Copyright © 2017 AT&T Intellectual Property. All rights reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. =================================================================== Unless otherwise specified, all software contained herein is licensed - under the Apache License, Version 2.0 (the “License”); + under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License. You may obtain a copy of the License at @@ -19,7 +19,7 @@ limitations under the License. Unless otherwise specified, all documentation contained herein is licensed - under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + under the Creative Commons License, Attribution 4.0 Intl. (the "License"); you may not use this documentation except in compliance with the License. You may obtain a copy of the License at diff --git a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/oid-user.jsp b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/oid-user.jsp index e2440327..38262ae3 100644 --- a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/oid-user.jsp +++ b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/oid-user.jsp @@ -2,11 +2,11 @@ ============LICENSE_START========================================== ONAP Portal =================================================================== - Copyright © 2017 AT&T Intellectual Property. All rights reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. =================================================================== Unless otherwise specified, all software contained herein is licensed - under the Apache License, Version 2.0 (the “License”); + under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License. You may obtain a copy of the License at @@ -19,7 +19,7 @@ limitations under the License. Unless otherwise specified, all documentation contained herein is licensed - under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + under the Creative Commons License, Attribution 4.0 Intl. (the "License"); you may not use this documentation except in compliance with the License. You may obtain a copy of the License at diff --git a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/oid-context.xml b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/oid-context.xml index 3eed49a0..119f9e54 100644 --- a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/oid-context.xml +++ b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/oid-context.xml @@ -3,11 +3,11 @@ ============LICENSE_START========================================== ONAP Portal =================================================================== - Copyright © 2017 AT&T Intellectual Property. All rights reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. =================================================================== Unless otherwise specified, all software contained herein is licensed - under the Apache License, Version 2.0 (the “License”); + under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License. You may obtain a copy of the License at @@ -20,7 +20,7 @@ limitations under the License. Unless otherwise specified, all documentation contained herein is licensed - under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + under the Creative Commons License, Attribution 4.0 Intl. (the "License"); you may not use this documentation except in compliance with the License. You may obtain a copy of the License at @@ -46,12 +46,12 @@ xmlns:oauth="http://www.springframework.org/schema/security/oauth2" xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation="http://www.springframework.org/schema/security/oauth2 http://www.springframework.org/schema/security/spring-security-oauth2-2.0.xsd - http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd - http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.2.xsd - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd - http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.1.xsd - http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.1.xsd - http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd"> + http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd + http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-4.2.xsd + http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd + http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.2.xsd + http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.2.xsd + http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd"> <!-- DispatcherServlet Context: defines this servlet's request-processing infrastructure --> @@ -95,7 +95,7 @@ </security:http> <bean id="authenticationEntryPoint" class="org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint"> - <property name="loginFormUrl" value="/openid_connect_login" /> + <constructor-arg name="loginFormUrl" value="/openid_connect_login" /> </bean> <security:authentication-manager alias="authenticationManager"> diff --git a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/web.xml b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/web.xml index 1480a517..ee60d326 100644 --- a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/web.xml +++ b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/web.xml @@ -3,11 +3,11 @@ ============LICENSE_START========================================== ONAP Portal =================================================================== - Copyright © 2017 AT&T Intellectual Property. All rights reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. =================================================================== Unless otherwise specified, all software contained herein is licensed - under the Apache License, Version 2.0 (the “License”); + under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License. You may obtain a copy of the License at @@ -20,7 +20,7 @@ limitations under the License. Unless otherwise specified, all documentation contained herein is licensed - under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + under the Creative Commons License, Attribution 4.0 Intl. (the "License"); you may not use this documentation except in compliance with the License. You may obtain a copy of the License at @@ -54,7 +54,7 @@ <!-- The Portal app can function on a HA cluster --> <distributable/> - <context-param> + <!-- <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/oid-context.xml</param-value> </context-param> @@ -63,11 +63,11 @@ <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> - </listener> + </listener> --> <listener> - <listener-class>org.openecomp.portalapp.portal.listener.UserSessionListener</listener-class> + <listener-class>org.onap.portalapp.portal.listener.UserSessionListener</listener-class> </listener> <filter> @@ -88,18 +88,13 @@ <url-pattern>/*</url-pattern> </filter-mapping> - <filter> - <filter-name>springSecurityFilterChain</filter-name> - <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> - <!-- <init-param> - <param-name>contextAttribute</param-name> - <param-value>org.springframework.web.servlet.FrameworkServlet.CONTEXT.appServlet</param-value> - </init-param> --> + <filter> + <filter-name>SecurityXssFilter</filter-name> + <filter-class>org.onap.portalapp.filter.SecurityXssFilter</filter-class> </filter> - + <filter-mapping> - <filter-name>springSecurityFilterChain</filter-name> + <filter-name>SecurityXssFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> - </web-app> diff --git a/ecomp-portal-BE-os/src/main/webapp/app/fusion/external/ds2/css/digital-ng-library/ecomp-ionicons.css b/ecomp-portal-BE-os/src/main/webapp/app/fusion/external/ds2/css/digital-ng-library/ecomp-ionicons.css index 0bbd8a3f..150124b2 100644 --- a/ecomp-portal-BE-os/src/main/webapp/app/fusion/external/ds2/css/digital-ng-library/ecomp-ionicons.css +++ b/ecomp-portal-BE-os/src/main/webapp/app/fusion/external/ds2/css/digital-ng-library/ecomp-ionicons.css @@ -37,6 +37,7 @@ .icon-people-oneperson-stalker:before, .icon-controls-pointer:before, .icon-arrows-replay-restart:before, .icon-content-star:before, .icon-misc-trash:before, .icon-arrows-upload:before, +.icon-controls-moreapplications:before, .icon-controls-upPRIMARY, .ion-navicon { display: inline-block; @@ -154,3 +155,5 @@ .icon-controls-upPRIMARY:before { content: "\f3d8"; } .ion-navicon:before { content: "\f20e"; } + +.icon-controls-moreapplications:before { content: "\f20b"; } diff --git a/ecomp-portal-BE-os/src/main/webapp/index.jsp b/ecomp-portal-BE-os/src/main/webapp/index.jsp index f63bfa11..8b543da4 100644 --- a/ecomp-portal-BE-os/src/main/webapp/index.jsp +++ b/ecomp-portal-BE-os/src/main/webapp/index.jsp @@ -2,11 +2,11 @@ ============LICENSE_START========================================== ONAP Portal =================================================================== - Copyright © 2017 AT&T Intellectual Property. All rights reserved. + Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. =================================================================== Unless otherwise specified, all software contained herein is licensed - under the Apache License, Version 2.0 (the “License”); + under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License. You may obtain a copy of the License at @@ -19,7 +19,7 @@ limitations under the License. Unless otherwise specified, all documentation contained herein is licensed - under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + under the Creative Commons License, Attribution 4.0 Intl. (the "License"); you may not use this documentation except in compliance with the License. You may obtain a copy of the License at diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/authentication/OpenIdConnectLoginStrategyTest.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/authentication/OpenIdConnectLoginStrategyTest.java index 2d0f795a..58e596ae 100644 --- a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/authentication/OpenIdConnectLoginStrategyTest.java +++ b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/authentication/OpenIdConnectLoginStrategyTest.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,15 +35,20 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.authentication; +package org.onap.portalapp.portal.authentication; import static org.junit.Assert.*; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.openecomp.portalsdk.core.onboarding.exception.PortalAPIException; -import org.openecomp.portalsdk.core.util.SystemProperties; +import org.onap.portalapp.authentication.OpenIdConnectLoginStrategy; +import org.onap.portalapp.portal.framework.MockitoTestSuite; +import org.onap.portalapp.portal.utils.EPSystemProperties; +import org.onap.portalapp.util.EPUserUtils; +import org.onap.portalapp.util.SessionCookieUtil; +import org.onap.portalsdk.core.onboarding.exception.PortalAPIException; +import org.onap.portalsdk.core.util.SystemProperties; import org.junit.Before; import org.junit.Test; @@ -53,11 +58,6 @@ import org.mitre.openid.connect.model.UserInfo; import org.mockito.InjectMocks; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; -import org.openecomp.portalapp.authentication.OpenIdConnectLoginStrategy; -import org.openecomp.portalapp.portal.framework.MockitoTestSuite; -import org.openecomp.portalapp.portal.utils.EPSystemProperties; -import org.openecomp.portalapp.util.EPUserUtils; -import org.openecomp.portalapp.util.SessionCookieUtil; import org.powermock.api.mockito.PowerMockito; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; @@ -83,7 +83,7 @@ public class OpenIdConnectLoginStrategyTest { NullPointerException nullPointerException = new NullPointerException(); @Test - public void loginTest() + public void loginTest() throws Exception { PowerMockito.mockStatic(StringUtils.class); PowerMockito.mockStatic(EPUserUtils.class); @@ -99,7 +99,7 @@ public class OpenIdConnectLoginStrategyTest { } @Test - public void loginIfUserNullTest() + public void loginIfUserNullTest() throws Exception { PowerMockito.mockStatic(SystemProperties.class); UserInfo userInfo = null; @@ -109,7 +109,7 @@ public class OpenIdConnectLoginStrategyTest { } @Test - public void loginIfUserIfAuthIsOIDCTest() + public void loginIfUserIfAuthIsOIDCTest() throws Exception { PowerMockito.mockStatic(SystemProperties.class); UserInfo userInfo = null; @@ -120,7 +120,7 @@ public class OpenIdConnectLoginStrategyTest { } @Test - public void loginIfUserIfAuthNotNullTest() + public void loginIfUserIfAuthNotNullTest() throws Exception { PowerMockito.mockStatic(SystemProperties.class); UserInfo userInfo = null; @@ -131,7 +131,7 @@ public class OpenIdConnectLoginStrategyTest { } @Test - public void loginIfUserExceptionest() + public void loginIfUserExceptionest() throws Exception { PowerMockito.mockStatic(SystemProperties.class); UserInfo userInfo = null; diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/authentication/SessionTimeoutInterceptorTest.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/authentication/SessionTimeoutInterceptorTest.java index c4946c68..11b54bf7 100644 --- a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/authentication/SessionTimeoutInterceptorTest.java +++ b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/authentication/SessionTimeoutInterceptorTest.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,7 +35,7 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.authentication; +package org.onap.portalapp.portal.authentication; import static org.junit.Assert.assertFalse; @@ -47,11 +47,11 @@ import org.junit.Test; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import org.openecomp.portalapp.authentication.LoginStrategy; -import org.openecomp.portalapp.authentication.SimpleLoginStrategy; -import org.openecomp.portalapp.controller.EPFusionBaseController; -import org.openecomp.portalapp.portal.framework.MockitoTestSuite; -import org.openecomp.portalapp.portal.interceptor.SessionTimeoutInterceptor; +import org.onap.portalapp.authentication.LoginStrategy; +import org.onap.portalapp.authentication.SimpleLoginStrategy; +import org.onap.portalapp.controller.EPFusionBaseController; +import org.onap.portalapp.portal.framework.MockitoTestSuite; +import org.onap.portalapp.portal.interceptor.SessionTimeoutInterceptor; import org.springframework.web.method.HandlerMethod; public class SessionTimeoutInterceptorTest { diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/authentication/SimpleLoginStrategyTest.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/authentication/SimpleLoginStrategyTest.java index 588bd89c..1a3972f6 100644 --- a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/authentication/SimpleLoginStrategyTest.java +++ b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/authentication/SimpleLoginStrategyTest.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,7 +35,7 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.authentication; +package org.onap.portalapp.portal.authentication; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -50,18 +50,18 @@ import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; -import org.openecomp.portalapp.authentication.SimpleLoginStrategy; -import org.openecomp.portalapp.command.EPLoginBean; -import org.openecomp.portalapp.portal.domain.EPUser; -import org.openecomp.portalapp.portal.framework.MockitoTestSuite; -import org.openecomp.portalapp.portal.service.EPLoginService; -import org.openecomp.portalapp.portal.service.EPRoleFunctionService; -import org.openecomp.portalapp.portal.service.EPRoleService; -import org.openecomp.portalapp.util.EPUserUtils; -import org.openecomp.portalapp.util.SessionCookieUtil; -import org.openecomp.portalsdk.core.menu.MenuProperties; -import org.openecomp.portalsdk.core.onboarding.exception.PortalAPIException; -import org.openecomp.portalsdk.core.util.SystemProperties; +import org.onap.portalapp.authentication.SimpleLoginStrategy; +import org.onap.portalapp.command.EPLoginBean; +import org.onap.portalapp.portal.domain.EPUser; +import org.onap.portalapp.portal.framework.MockitoTestSuite; +import org.onap.portalapp.portal.service.EPLoginService; +import org.onap.portalapp.portal.service.EPRoleFunctionService; +import org.onap.portalapp.portal.service.EPRoleService; +import org.onap.portalapp.util.EPUserUtils; +import org.onap.portalapp.util.SessionCookieUtil; +import org.onap.portalsdk.core.menu.MenuProperties; +import org.onap.portalsdk.core.onboarding.exception.PortalAPIException; +import org.onap.portalsdk.core.util.SystemProperties; import org.powermock.api.mockito.PowerMockito; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/AppsOSControllerTest.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/AppsOSControllerTest.java index eb2ea32e..565bfdbf 100644 --- a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/AppsOSControllerTest.java +++ b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/AppsOSControllerTest.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,7 +35,7 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.controller; +package org.onap.portalapp.portal.controller; import static org.junit.Assert.assertEquals; @@ -46,21 +46,23 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; -import org.openecomp.portalapp.portal.domain.EPUser; -import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse; -import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum; -import org.openecomp.portalapp.portal.framework.MockEPUser; -import org.openecomp.portalapp.portal.framework.MockitoTestSuite; -import org.openecomp.portalapp.portal.service.AdminRolesService; -import org.openecomp.portalapp.portal.service.EPAppService; -import org.openecomp.portalapp.portal.service.PersUserAppService; -import org.openecomp.portalapp.portal.service.UserService; -import org.openecomp.portalapp.util.EPUserUtils; +import org.onap.portalapp.portal.controller.AppsOSController; +import org.onap.portalapp.portal.domain.EPUser; +import org.onap.portalapp.portal.ecomp.model.PortalRestResponse; +import org.onap.portalapp.portal.ecomp.model.PortalRestStatusEnum; +import org.onap.portalapp.portal.framework.MockEPUser; +import org.onap.portalapp.portal.framework.MockitoTestSuite; +import org.onap.portalapp.portal.service.AdminRolesService; +import org.onap.portalapp.portal.service.EPAppService; +import org.onap.portalapp.portal.service.PersUserAppService; +import org.onap.portalapp.portal.service.UserService; +import org.onap.portalapp.util.EPUserUtils; public class AppsOSControllerTest { @@ -108,6 +110,7 @@ public class AppsOSControllerTest { } @Test + @Ignore public void saveNewUserIfUserNOtNullTest() { PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>(); expectedportalRestResponse.setMessage("failure"); diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/DashboardSearchResultControllerTest.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/DashboardSearchResultControllerTest.java index b2a6c431..d2a0c4ea 100644 --- a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/DashboardSearchResultControllerTest.java +++ b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/DashboardSearchResultControllerTest.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,7 +35,7 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.controller; +package org.onap.portalapp.portal.controller; import static org.junit.Assert.assertEquals; @@ -53,16 +53,17 @@ import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; -import org.openecomp.portalapp.portal.domain.EPUser; -import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse; -import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum; -import org.openecomp.portalapp.portal.ecomp.model.SearchResultItem; -import org.openecomp.portalapp.portal.framework.MockEPUser; -import org.openecomp.portalapp.portal.framework.MockitoTestSuite; -import org.openecomp.portalapp.portal.service.DashboardSearchService; -import org.openecomp.portalapp.portal.transport.CommonWidget; -import org.openecomp.portalapp.portal.transport.CommonWidgetMeta; -import org.openecomp.portalapp.util.EPUserUtils; +import org.onap.portalapp.portal.controller.DashboardSearchResultController; +import org.onap.portalapp.portal.domain.EPUser; +import org.onap.portalapp.portal.ecomp.model.PortalRestResponse; +import org.onap.portalapp.portal.ecomp.model.PortalRestStatusEnum; +import org.onap.portalapp.portal.ecomp.model.SearchResultItem; +import org.onap.portalapp.portal.framework.MockEPUser; +import org.onap.portalapp.portal.framework.MockitoTestSuite; +import org.onap.portalapp.portal.service.DashboardSearchService; +import org.onap.portalapp.portal.transport.CommonWidget; +import org.onap.portalapp.portal.transport.CommonWidgetMeta; +import org.onap.portalapp.util.EPUserUtils; public class DashboardSearchResultControllerTest { diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/ECOMPLogoutControllerTest.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/ECOMPLogoutControllerTest.java index 954ff0c4..20f3fe7e 100644 --- a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/ECOMPLogoutControllerTest.java +++ b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/ECOMPLogoutControllerTest.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,10 +35,11 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.controller; +package org.onap.portalapp.portal.controller; -import static org.junit.Assert.assertEquals; +import static org.junit.Assert.*; +import javax.servlet.ServletRequestWrapper; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -49,13 +50,14 @@ import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; -import org.openecomp.portalapp.controller.ECOMPLogoutController; -import org.openecomp.portalapp.portal.framework.MockEPUser; -import org.openecomp.portalapp.portal.framework.MockitoTestSuite; -import org.openecomp.portalapp.portal.service.DashboardSearchService; -import org.openecomp.portalapp.portal.service.DashboardSearchServiceImpl; -import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties; -import org.openecomp.portalapp.util.EPUserUtils; +import org.mockito.stubbing.OngoingStubbing; +import org.onap.portalapp.controller.ECOMPLogoutController; +import org.onap.portalapp.portal.framework.MockEPUser; +import org.onap.portalapp.portal.framework.MockitoTestSuite; +import org.onap.portalapp.portal.service.DashboardSearchService; +import org.onap.portalapp.portal.service.DashboardSearchServiceImpl; +import org.onap.portalapp.portal.utils.EPCommonSystemProperties; +import org.onap.portalapp.util.EPUserUtils; import org.powermock.api.mockito.PowerMockito; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/ExternalAppsRestfulControllerOSTest.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/ExternalAppsRestfulControllerOSTest.java index 0f92bb3e..e8811121 100644 --- a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/ExternalAppsRestfulControllerOSTest.java +++ b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/ExternalAppsRestfulControllerOSTest.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,7 +35,7 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.controller; +package org.onap.portalapp.portal.controller; import static org.junit.Assert.*; @@ -52,17 +52,18 @@ import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; -import org.openecomp.portalapp.portal.domain.EPUser; -import org.openecomp.portalapp.portal.framework.MockEPUser; -import org.openecomp.portalapp.portal.framework.MockitoTestSuite; -import org.openecomp.portalapp.portal.service.AdminRolesService; -import org.openecomp.portalapp.portal.service.EPLoginService; -import org.openecomp.portalapp.portal.service.FunctionalMenuService; -import org.openecomp.portalapp.portal.transport.FavoritesFunctionalMenuItemJson; -import org.openecomp.portalapp.portal.transport.FunctionalMenuItem; -import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties; -import org.openecomp.portalapp.portal.utils.EPSystemProperties; -import org.openecomp.portalapp.portal.utils.EcompPortalUtils; +import org.onap.portalapp.portal.controller.ExternalAppsRestfulController; +import org.onap.portalapp.portal.domain.EPUser; +import org.onap.portalapp.portal.framework.MockEPUser; +import org.onap.portalapp.portal.framework.MockitoTestSuite; +import org.onap.portalapp.portal.service.AdminRolesService; +import org.onap.portalapp.portal.service.EPLoginService; +import org.onap.portalapp.portal.service.FunctionalMenuService; +import org.onap.portalapp.portal.transport.FavoritesFunctionalMenuItemJson; +import org.onap.portalapp.portal.transport.FunctionalMenuItem; +import org.onap.portalapp.portal.utils.EPCommonSystemProperties; +import org.onap.portalapp.portal.utils.EPSystemProperties; +import org.onap.portalapp.portal.utils.EcompPortalUtils; import org.powermock.api.mockito.PowerMockito; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/LoginControllerTest.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/LoginControllerTest.java index a02e1b2f..983584e9 100644 --- a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/LoginControllerTest.java +++ b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/LoginControllerTest.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,7 +35,7 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.controller; +package org.onap.portalapp.portal.controller; import static org.junit.Assert.*; @@ -49,14 +49,14 @@ import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; -import org.openecomp.portalapp.controller.LoginController; -import org.openecomp.portalapp.portal.framework.MockitoTestSuite; -import org.openecomp.portalapp.portal.service.EPLoginService; -import org.openecomp.portalapp.portal.service.EPRoleFunctionService; -import org.openecomp.portalapp.portal.service.EPRoleService; -import org.openecomp.portalapp.portal.service.SharedContextService; -import org.openecomp.portalapp.service.EPProfileService; -import org.openecomp.portalsdk.core.util.SystemProperties; +import org.onap.portalapp.controller.LoginController; +import org.onap.portalapp.portal.framework.MockitoTestSuite; +import org.onap.portalapp.portal.service.EPLoginService; +import org.onap.portalapp.portal.service.EPRoleFunctionService; +import org.onap.portalapp.portal.service.EPRoleService; +import org.onap.portalapp.portal.service.SharedContextService; +import org.onap.portalapp.service.EPProfileService; +import org.onap.portalsdk.core.util.SystemProperties; import org.powermock.api.mockito.PowerMockito; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/ONAPLoginControllerTest.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/ONAPLoginControllerTest.java index 46218302..ab01a0ce 100644 --- a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/ONAPLoginControllerTest.java +++ b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/ONAPLoginControllerTest.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,7 +35,7 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.controller; +package org.onap.portalapp.portal.controller; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; @@ -49,13 +49,13 @@ import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; -import org.openecomp.portalapp.controller.ONAPLoginController; -import org.openecomp.portalapp.portal.framework.MockEPUser; -import org.openecomp.portalapp.portal.framework.MockitoTestSuite; -import org.openecomp.portalsdk.core.auth.LoginStrategy; -import org.openecomp.portalsdk.core.service.LoginService; -import org.openecomp.portalsdk.core.service.ProfileService; -import org.openecomp.portalsdk.core.service.ProfileServiceImpl; +import org.onap.portalapp.controller.ONAPLoginController; +import org.onap.portalapp.portal.framework.MockEPUser; +import org.onap.portalapp.portal.framework.MockitoTestSuite; +import org.onap.portalsdk.core.auth.LoginStrategy; +import org.onap.portalsdk.core.service.LoginService; +import org.onap.portalsdk.core.service.ProfileService; +import org.onap.portalsdk.core.service.ProfileServiceImpl; import org.springframework.web.servlet.ModelAndView; public class ONAPLoginControllerTest { diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/ONAPWelcomeControllerTest.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/ONAPWelcomeControllerTest.java index b7399fbe..c9c18b7a 100644 --- a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/ONAPWelcomeControllerTest.java +++ b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/ONAPWelcomeControllerTest.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,9 +35,9 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.controller; +package org.onap.portalapp.portal.controller; -import static org.junit.Assert.assertEquals; +import static org.junit.Assert.*; import java.security.Principal; @@ -48,9 +48,11 @@ import org.junit.Before; import org.junit.Test; import org.mockito.InjectMocks; import org.mockito.Mock; +import org.mockito.Mockito; import org.mockito.MockitoAnnotations; -import org.openecomp.portalapp.controller.ONAPWelcomeController; -import org.openecomp.portalapp.portal.framework.MockitoTestSuite; +import org.onap.portalapp.controller.ONAPWelcomeController; +import org.onap.portalapp.portal.framework.MockitoTestSuite; +import org.springframework.ui.Model; import org.springframework.web.servlet.ModelAndView; public class ONAPWelcomeControllerTest { diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/PortalAdminControllerOSTest.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/PortalAdminControllerOSTest.java index aa7cb46a..a8d8e498 100644 --- a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/PortalAdminControllerOSTest.java +++ b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/PortalAdminControllerOSTest.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,7 +35,7 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.controller; +package org.onap.portalapp.portal.controller; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; @@ -52,20 +52,21 @@ import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; -import org.openecomp.portalapp.portal.domain.EPRole; -import org.openecomp.portalapp.portal.domain.EPUser; -import org.openecomp.portalapp.portal.framework.MockEPUser; -import org.openecomp.portalapp.portal.framework.MockitoTestSuite; -import org.openecomp.portalapp.portal.service.AdminRolesService; -import org.openecomp.portalapp.portal.service.AdminRolesServiceImpl; -import org.openecomp.portalapp.portal.service.PortalAdminService; -import org.openecomp.portalapp.portal.service.PortalAdminServiceImpl; -import org.openecomp.portalapp.portal.transport.FieldsValidator; -import org.openecomp.portalapp.portal.transport.PortalAdmin; -import org.openecomp.portalapp.portal.utils.EcompPortalUtils; -import org.openecomp.portalapp.util.EPUserUtils; -import org.openecomp.portalsdk.core.service.AuditService; -import org.openecomp.portalsdk.core.service.AuditServiceImpl; +import org.onap.portalapp.portal.controller.PortalAdminController; +import org.onap.portalapp.portal.domain.EPRole; +import org.onap.portalapp.portal.domain.EPUser; +import org.onap.portalapp.portal.framework.MockEPUser; +import org.onap.portalapp.portal.framework.MockitoTestSuite; +import org.onap.portalapp.portal.service.AdminRolesService; +import org.onap.portalapp.portal.service.AdminRolesServiceImpl; +import org.onap.portalapp.portal.service.PortalAdminService; +import org.onap.portalapp.portal.service.PortalAdminServiceImpl; +import org.onap.portalapp.portal.transport.FieldsValidator; +import org.onap.portalapp.portal.transport.PortalAdmin; +import org.onap.portalapp.portal.utils.EcompPortalUtils; +import org.onap.portalapp.util.EPUserUtils; +import org.onap.portalsdk.core.service.AuditService; +import org.onap.portalsdk.core.service.AuditServiceImpl; public class PortalAdminControllerOSTest { diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/framework/MockEPUser.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/framework/MockEPUser.java index d38b21a0..99c96547 100644 --- a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/framework/MockEPUser.java +++ b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/framework/MockEPUser.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,11 +35,11 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.framework; +package org.onap.portalapp.portal.framework; import java.util.Date; -import org.openecomp.portalapp.portal.domain.EPUser; +import org.onap.portalapp.portal.domain.EPUser; public class MockEPUser { diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/framework/MockitoTestSuite.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/framework/MockitoTestSuite.java index 529dd5ae..219bc860 100644 --- a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/framework/MockitoTestSuite.java +++ b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/framework/MockitoTestSuite.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,7 +35,7 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.framework; +package org.onap.portalapp.portal.framework; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/listener/HealthMonitorTest.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/listener/HealthMonitorTest.java index 651f7f61..929c8e36 100644 --- a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/listener/HealthMonitorTest.java +++ b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/listener/HealthMonitorTest.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,11 +35,12 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.listener; +package org.onap.portalapp.portal.listener; import static org.junit.Assert.assertEquals; import org.junit.Test; +import org.onap.portalapp.portal.listener.HealthMonitor; public class HealthMonitorTest { diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/service/RemoteWebServiceCallServiceImplTest.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/service/RemoteWebServiceCallServiceImplTest.java index f3218a70..ad208f39 100644 --- a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/service/RemoteWebServiceCallServiceImplTest.java +++ b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/service/RemoteWebServiceCallServiceImplTest.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,10 +35,9 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.service; +package org.onap.portalapp.portal.service; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.Assert.*; import java.util.ArrayList; import java.util.List; @@ -46,6 +45,7 @@ import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.onap.portalsdk.core.util.SystemProperties; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -53,12 +53,13 @@ import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; -import org.openecomp.portalapp.portal.domain.EPApp; -import org.openecomp.portalapp.portal.framework.MockitoTestSuite; -import org.openecomp.portalapp.service.RemoteWebServiceCallServiceImpl; -import org.openecomp.portalsdk.core.onboarding.util.CipherUtil; -import org.openecomp.portalsdk.core.service.DataAccessService; -import org.openecomp.portalsdk.core.util.SystemProperties; +import org.onap.portalapp.portal.domain.EPApp; +import org.onap.portalapp.portal.framework.MockitoTestSuite; +import org.onap.portalapp.portal.service.AppsCacheService; +import org.onap.portalapp.portal.utils.EcompPortalUtils; +import org.onap.portalapp.service.RemoteWebServiceCallServiceImpl; +import org.onap.portalsdk.core.onboarding.util.CipherUtil; +import org.onap.portalsdk.core.service.DataAccessService; import org.powermock.api.mockito.PowerMockito; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; @@ -103,7 +104,7 @@ public class RemoteWebServiceCallServiceImplTest { Mockito.when(dataAccessService.getList(EPApp.class, criteria.toString(), null, null)).thenReturn(appList); String secretKey = null; Mockito.when(SystemProperties.getProperty(SystemProperties.Decryption_Key)).thenReturn(secretKey); - Mockito.when(CipherUtil.decrypt("password", + Mockito.when(CipherUtil.decryptPKC("password", secretKey == null ? null : secretKey)).thenReturn("pwd"); assertFalse(remoteWebServiceCallServiceImpl.verifyRESTCredential(secretKey,"requestUebKey","requestAppName","requestPassword")); } @@ -122,7 +123,7 @@ public class RemoteWebServiceCallServiceImplTest { Mockito.when(dataAccessService.getList(EPApp.class, criteria.toString(), null, null)).thenReturn(appList); String secretKey = null; Mockito.when(SystemProperties.getProperty(SystemProperties.Decryption_Key)).thenReturn(secretKey); - Mockito.when(CipherUtil.decrypt("password", + Mockito.when(CipherUtil.decryptPKC("password", secretKey == null ? null : secretKey)).thenReturn("pwd"); assertTrue(remoteWebServiceCallServiceImpl.verifyRESTCredential(secretKey,"requestUebKey","requestAppName","pwd")); } @@ -141,7 +142,7 @@ public class RemoteWebServiceCallServiceImplTest { Mockito.when(dataAccessService.getList(EPApp.class, criteria.toString(), null, null)).thenReturn(null); String secretKey = null; Mockito.when(SystemProperties.getProperty(SystemProperties.Decryption_Key)).thenReturn(secretKey); - Mockito.when(CipherUtil.decrypt("password", + Mockito.when(CipherUtil.decryptPKC("password", secretKey == null ? null : secretKey)).thenReturn("pwd"); assertFalse(remoteWebServiceCallServiceImpl.verifyRESTCredential(secretKey,"requestUebKey","requestAppName","pwd")); } diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/service/SearchServiceImplTest.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/service/SearchServiceImplTest.java index 71671da3..339f4ebb 100644 --- a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/service/SearchServiceImplTest.java +++ b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/service/SearchServiceImplTest.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,7 +35,7 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.service; +package org.onap.portalapp.portal.service; import static org.junit.Assert.*; @@ -52,11 +52,13 @@ import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; -import org.openecomp.portalapp.portal.domain.EPUser; -import org.openecomp.portalapp.portal.framework.MockEPUser; -import org.openecomp.portalapp.portal.framework.MockitoTestSuite; -import org.openecomp.portalapp.portal.transport.UserWithNameSurnameTitle; -import org.openecomp.portalapp.portal.utils.EcompPortalUtils; +import org.onap.portalapp.portal.domain.EPUser; +import org.onap.portalapp.portal.framework.MockEPUser; +import org.onap.portalapp.portal.framework.MockitoTestSuite; +import org.onap.portalapp.portal.service.SearchServiceImpl; +import org.onap.portalapp.portal.service.UserService; +import org.onap.portalapp.portal.transport.UserWithNameSurnameTitle; +import org.onap.portalapp.portal.utils.EcompPortalUtils; import org.powermock.api.mockito.PowerMockito; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; diff --git a/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/service/UserServiceImplTest.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/service/UserServiceImplTest.java new file mode 100644 index 00000000..f4afb0fe --- /dev/null +++ b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/service/UserServiceImplTest.java @@ -0,0 +1,101 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalapp.portal.service; +//package org.openecomp.portalapp.portal.service; +// +//import javax.servlet.http.HttpServletRequest; +//import javax.servlet.http.HttpServletResponse; +// +//import org.junit.Before; +//import org.junit.Test; +//import org.junit.runner.RunWith; +//import org.mockito.InjectMocks; +//import org.mockito.Mock; +//import org.mockito.Mockito; +//import org.mockito.MockitoAnnotations; +//import org.openecomp.portalapp.portal.framework.MockitoTestSuite; +//import org.openecomp.portalapp.portal.utils.EPSystemProperties; +//import org.openecomp.portalsdk.core.service.DataAccessService; +//import org.openecomp.portalsdk.core.util.SystemProperties; +//import org.powermock.api.mockito.PowerMockito; +// +//import java.io.BufferedReader; +//import java.io.IOException; +//import java.io.InputStreamReader; +//import java.io.UnsupportedEncodingException; +//import java.net.HttpURLConnection; +//import org.powermock.core.classloader.annotations.PrepareForTest; +//import org.powermock.modules.junit4.PowerMockRunner; +// +// +//@RunWith(PowerMockRunner.class) +//@PrepareForTest({ SystemProperties.class , EPSystemProperties.class , SystemProperties.class}) +//public class UserServiceImplTest { +// +// +// @InjectMocks +// UserServiceImpl userServiceImpl = new UserServiceImpl(); +// +// @Mock +// DataAccessService dataAccessService; +// +// @Mock +// HttpURLConnection con; +// +// @Before +// public void setup() { +// MockitoAnnotations.initMocks(this); +// } +// +// MockitoTestSuite mockitoTestSuite = new MockitoTestSuite(); +// +// HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest(); +// HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse(); +// +// @Test +// public void getUserByUserIdTest() throws UnsupportedEncodingException, IOException +// { +// BufferedReader reader = new BufferedReader(new InputStreamReader(con.getInputStream(), "UTF-8")); +// PowerMockito.mockStatic(SystemProperties.class); +// PowerMockito.mockStatic(EPSystemProperties.class); +// Mockito.when(SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM)).thenReturn("OIDC"); +// Mockito.when(EPSystemProperties.getProperty(EPSystemProperties.AUTH_USER_SERVER)).thenReturn("http://www.google.com"); +// Mockito.when(new BufferedReader(new InputStreamReader(con.getInputStream(), "UTF-8"))).thenReturn(reader).thenReturn(reader); +// userServiceImpl.getUserByUserId("guestT"); +// } +//} diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/utils/EcompPortalUtilsTest.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/utils/EcompPortalUtilsTest.java index d9a54360..532c7204 100644 --- a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/utils/EcompPortalUtilsTest.java +++ b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/utils/EcompPortalUtilsTest.java @@ -2,11 +2,11 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -35,11 +35,12 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalapp.portal.utils; +package org.onap.portalapp.portal.utils; import static org.junit.Assert.assertEquals; import org.junit.Test; +import org.onap.portalapp.portal.utils.EcompPortalUtils; public class EcompPortalUtilsTest { diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextRestClient.java b/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextRestClient.java deleted file mode 100644 index f4196db8..00000000 --- a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextRestClient.java +++ /dev/null @@ -1,298 +0,0 @@ -/*- - * ============LICENSE_START========================================== - * ONAP Portal - * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. - * =================================================================== - * - * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); - * you may not use this software except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); - * you may not use this documentation except in compliance with the License. - * You may obtain a copy of the License at - * - * https://creativecommons.org/licenses/by/4.0/ - * - * Unless required by applicable law or agreed to in writing, documentation - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============LICENSE_END============================================ - * - * ECOMP is a trademark and service mark of AT&T Intellectual Property. - */ -package org.openecomp.portalapp.portal.controller; - -import java.net.URI; -import java.security.cert.CertificateException; -import java.security.cert.X509Certificate; - -import javax.net.ssl.SSLContext; -import javax.servlet.http.HttpServletResponse; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.http.Consts; -import org.apache.http.HttpEntity; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.client.utils.URIBuilder; -import org.apache.http.conn.ssl.NoopHostnameVerifier; -import org.apache.http.conn.ssl.SSLConnectionSocketFactory; -import org.apache.http.entity.ContentType; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClientBuilder; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.ssl.SSLContexts; -import org.apache.http.ssl.TrustStrategy; -import org.apache.http.util.EntityUtils; -/** - * Provides reusable features for test cases to get or post from an REST - * endpoint, allowing use of HTTPS connections to servers that use self-signed - * certificates. - */ -public class SharedContextRestClient { - - private static final Log logger = LogFactory.getLog(SharedContextRestClient.class); - - /** - * Convenience method that builds and sends a GET request using properties - * to build the URI and populate header with credentials. - * - * @param task - * last component(s) of REST endpoint name; e.g., "get". - * @param contextId - * @param contextKey - * @return JSON string fetched - * @throws Exception - * if the HTTP response code is anything other than OK. - */ - public static String getJson(final SharedContextTestProperties properties, final String task, - final String contextId, final String contextKey) throws Exception { - String requestPath = '/' + properties.getProperty(SharedContextTestProperties.APPNAME) // - + '/' + properties.getProperty(SharedContextTestProperties.RESTPATH) // - + '/' + task; - return getJson(properties.getProperty(SharedContextTestProperties.HOSTNAME), // - properties.getProperty(SharedContextTestProperties.PORT, -1), // - properties.getProperty(SharedContextTestProperties.SECURE, true), // - properties.getProperty(SharedContextTestProperties.UEBKEY), // - properties.getProperty(SharedContextTestProperties.USERNAME), // - properties.getProperty(SharedContextTestProperties.PASSWORD), requestPath, // - contextId, // - contextKey); - } - - /** - * Constructs and sends a GET request using the specified values. - * - * @param hostname - * @param port - * ignored if negative - * @param secure - * If true, uses https; else http. - * @param headerUebkey - * @param headerUsername - * @param headerPassword - * @param requestPath - * full path of the REST endpoint - * @param contextId - * @param contextKey - * Ignored if null - * @return JSON result - */ - public static String getJson(final String hostname, final int port, boolean secure, final String headerUebkey, - final String headerUsername, final String headerPassword, final String requestPath, final String contextId, - final String contextKey) throws Exception { - - URIBuilder uriBuilder = new URIBuilder(); - if (secure) - uriBuilder.setScheme("https"); - else - uriBuilder.setScheme("http"); - uriBuilder.setHost(hostname); - if (port > 0) - uriBuilder.setPort(port); - uriBuilder.setPath(requestPath); - uriBuilder.addParameter("context_id", contextId); - if (contextKey != null) - uriBuilder.addParameter("ckey", contextKey); - final URI uri = uriBuilder.build(); - - CloseableHttpClient httpClient; - if (secure) { - // Tell HttpClient to accept any server certificate for HTTPS. - // http://stackoverflow.com/questions/24720013/apache-http-client-ssl-certificate-error - SSLContext sslContext = SSLContexts.custom().loadTrustMaterial(null, new TrustStrategy() { - @Override - public boolean isTrusted(final X509Certificate[] chain, final String authType) - throws CertificateException { - return true; - } - }).build(); - SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslContext, - NoopHostnameVerifier.INSTANCE); - httpClient = HttpClientBuilder.create().setSSLSocketFactory(sslsf).build(); - } else { - httpClient = HttpClients.createDefault(); - } - - HttpGet httpGet = new HttpGet(uri); - httpGet.setHeader("uebkey", headerUebkey); - httpGet.setHeader("username", headerUsername); - httpGet.setHeader("password", headerPassword); - - String json = null; - CloseableHttpResponse response = null; - try { - logger.debug("GET from " + uri); - response = httpClient.execute(httpGet); - logger.info("Status is " + response.getStatusLine()); - if (response.getStatusLine().getStatusCode() != HttpServletResponse.SC_OK) - throw new Exception("Status is " + response.getStatusLine().toString()); - HttpEntity entity = response.getEntity(); - if (entity == null) { - logger.warn("Entity is null!"); - } else { - // entity content length is never set. - // this naively tries to read everything. - json = EntityUtils.toString(entity); - EntityUtils.consume(entity); - } - } finally { - if (response != null) - response.close(); - } - return json; - } - - /** - * Convenience method that builds and sends a POST request using properties - * to build the URI and populate header with credentials. - * - * @param path - * last component(s) of REST endpoint name; e.g., "users" or - * "user/{userid}/roles". - * @return JSON string fetched - * @throws Exception - * if the HTTP response code is anything other than OK. - */ - public static String postJson(final SharedContextTestProperties properties, final String path, final String json) - throws Exception { - String requestPath = '/' + properties.getProperty(SharedContextTestProperties.APPNAME) // - + '/' + properties.getProperty(SharedContextTestProperties.RESTPATH) // - + '/' + path; - return postJson(properties.getProperty(SharedContextTestProperties.HOSTNAME), // - properties.getProperty(SharedContextTestProperties.PORT, -1), // - properties.getProperty(SharedContextTestProperties.SECURE, true), // - properties.getProperty(SharedContextTestProperties.UEBKEY), // - properties.getProperty(SharedContextTestProperties.USERNAME), // - properties.getProperty(SharedContextTestProperties.PASSWORD), // - requestPath, // - json); - } - - /** - * Constructs and sends a POST request using the specified values. - * - * @param hostname - * @param port - * @param secure - * If true, uses https; else http. - * @param requestPath - * full path of the REST endpoint - * @param headerUebkey - * @param headerUsername - * @param headerPassword - * @param json - * Content to post - * @return JSON result - * @throws Exception - */ - public static String postJson(final String hostname, final int port, boolean secure, final String headerUebkey, - final String headerUsername, final String headerPassword, final String requestPath, final String json) - throws Exception { - - URIBuilder builder = new URIBuilder(); - if (secure) - builder.setScheme("https"); - else - builder.setScheme("http"); - builder.setHost(hostname); - if (port > 0) - builder.setPort(port); - builder.setPath(requestPath); - final URI uri = builder.build(); - - CloseableHttpClient httpClient; - if (secure) { - // Tell HttpClient to accept any server certificate for HTTPS. - // http://stackoverflow.com/questions/24720013/apache-http-client-ssl-certificate-error - SSLContext sslContext = SSLContexts.custom().loadTrustMaterial(null, new TrustStrategy() { - @Override - public boolean isTrusted(final X509Certificate[] chain, final String authType) - throws CertificateException { - return true; - } - }).build(); - SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslContext, - NoopHostnameVerifier.INSTANCE); - httpClient = HttpClientBuilder.create().setSSLSocketFactory(sslsf).build(); - } else { - httpClient = HttpClients.createDefault(); - } - HttpPost httpPost = new HttpPost(uri); - httpPost.setHeader("uebkey", headerUebkey); - httpPost.setHeader("username", headerUsername); - httpPost.setHeader("password", headerPassword); - - StringEntity postEntity = new StringEntity(json, ContentType.create("application/json", Consts.UTF_8)); - httpPost.setEntity(postEntity); - - String responseJson = null; - CloseableHttpResponse response = null; - try { - logger.debug("POST to " + uri); - response = httpClient.execute(httpPost); - logger.info("Status is " + response.getStatusLine()); - if (response.getStatusLine().getStatusCode() != HttpServletResponse.SC_OK) - throw new Exception("Status is " + response.getStatusLine().toString()); - - HttpEntity entity = response.getEntity(); - if (entity == null) { - logger.warn("Entity is null!"); - } else { - long len = entity.getContentLength(); - if (len < 0) - logger.warn("Content length is -1"); - if (len < 2048) { - responseJson = EntityUtils.toString(entity); - logger.debug(responseJson); - } else { - logger.warn("Not implemented - stream content"); - } - EntityUtils.consume(entity); - } - } finally { - if (response != null) - response.close(); - } - return responseJson; - } - -} diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextRestControllerTest.java b/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextRestControllerTest.java deleted file mode 100644 index e4061785..00000000 --- a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextRestControllerTest.java +++ /dev/null @@ -1,143 +0,0 @@ -/*- - * ============LICENSE_START========================================== - * ONAP Portal - * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. - * =================================================================== - * - * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); - * you may not use this software except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); - * you may not use this documentation except in compliance with the License. - * You may obtain a copy of the License at - * - * https://creativecommons.org/licenses/by/4.0/ - * - * Unless required by applicable law or agreed to in writing, documentation - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============LICENSE_END============================================ - * - * ECOMP is a trademark and service mark of AT&T Intellectual Property. - */ -package org.openecomp.portalapp.portal.controller; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.junit.Assert; -import com.fasterxml.jackson.databind.ObjectMapper; - -/** - * Tests the endpoints exposed by the Shared Context REST controller in Portal - * Core. - * - * @author clott - */ -public class SharedContextRestControllerTest { - - private final Log logger = LogFactory.getLog(getClass()); - - private final SharedContextTestProperties properties; - - private final String ckey = "ckey"; - private final String cvalue = "cvalue"; - - // Supposed to be a Portal session ID - private final String cxid = UUID.randomUUID().toString(); - - private final String key = "key123"; - private final String value1 = "first value"; - private final String value2 = "second value"; - - public SharedContextRestControllerTest() throws IOException { - properties = new SharedContextTestProperties(); - } - - @SuppressWarnings("unchecked") - //@Test - public void test() throws Exception { - String response = null, val = null; - ObjectMapper mapper = new ObjectMapper(); - Map<String, Object> responseMap, jsonMap; - - logger.info("Get on empty context"); - response = SharedContextRestClient.getJson(properties, "get", cxid, key); - // Should not exist - just generated the UUID - Map<String, Object> responseMap1 = mapper.readValue(response, Map.class); - response = (String) responseMap1.get("response"); - Assert.assertNull(response); - - logger.info("Set a new context"); - response = setContext(cxid, key, value1); - Assert.assertNotNull(response); - responseMap = mapper.readValue(response, Map.class); - String responseValue = (String) responseMap.get("response"); - Assert.assertNotNull(responseValue); - Assert.assertEquals("added", responseValue); - - logger.info("Get existing context"); - response = SharedContextRestClient.getJson(properties, "get", cxid, key); - responseMap = mapper.readValue(response, Map.class); - jsonMap = (Map<String,Object>) responseMap.get("response"); - Assert.assertNotNull(jsonMap); - val = (String) jsonMap.get(cvalue); - Assert.assertEquals(val, value1); - - logger.info("Overwrite exiting context"); - response = setContext(cxid, key, value2); - Assert.assertNotNull(response); - responseMap = mapper.readValue(response, Map.class); - response = (String) responseMap.get("response"); - Assert.assertNotNull(responseValue); - // Assert.assertEquals("replaced", responseValue); - - logger.info("Get existing context to verify overwrite"); - response = SharedContextRestClient.getJson(properties, "get", cxid, key); - responseMap = mapper.readValue(response, Map.class); - jsonMap = (Map<String,Object>) responseMap.get("response"); - Assert.assertNotNull(jsonMap); - val = (String) jsonMap.get(cvalue); - Assert.assertEquals(val, value2); - - logger.info("Delete one context"); - response = SharedContextRestClient.getJson(properties, "remove", cxid, key); - responseMap = mapper.readValue(response, Map.class); - response = (String) responseMap.get("response"); - Assert.assertEquals(response, "removed"); - - logger.info("Clear the context"); - response = SharedContextRestClient.getJson(properties, "clear", cxid, null); - Assert.assertEquals("", response); - } - - private String setContext(String context, String id, String value) throws Exception { - ObjectMapper mapper = new ObjectMapper(); - HashMap<String,String> stringMap = new HashMap<String,String>(); - stringMap.put("context_id", cxid); - stringMap.put(ckey, key); - stringMap.put(cvalue, value2); - String json = mapper.writeValueAsString(stringMap); - String response = SharedContextRestClient.postJson(properties, "set", json); - return response; - } -} diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextTestProperties.java b/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextTestProperties.java deleted file mode 100644 index 1c849420..00000000 --- a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextTestProperties.java +++ /dev/null @@ -1,99 +0,0 @@ -/*- - * ============LICENSE_START========================================== - * ONAP Portal - * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. - * =================================================================== - * - * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); - * you may not use this software except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); - * you may not use this documentation except in compliance with the License. - * You may obtain a copy of the License at - * - * https://creativecommons.org/licenses/by/4.0/ - * - * Unless required by applicable law or agreed to in writing, documentation - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============LICENSE_END============================================ - * - * ECOMP is a trademark and service mark of AT&T Intellectual Property. - */ -package org.openecomp.portalapp.portal.controller; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Properties; - -/** - * Trivial extension of Properties that populates itself from a known source. - */ -public class SharedContextTestProperties extends Properties { - - private static final long serialVersionUID = -4064100267979036550L; - - // property names - public static final String HOSTNAME = "hostname"; - public static final String PORT = "port"; - public static final String SECURE = "secure"; - public static final String APPNAME = "appname"; - public static final String RESTPATH = "restpath"; - public static final String UEBKEY = "uebkey"; - public static final String USERNAME = "username"; - public static final String PASSWORD = "password"; - - /** - * Expected on the classpath - */ - private static final String propertiesFileName = "shared-context-test.properties"; - - /** - * Constructor populates itself from properties file found in same package. - * - * @throws Exception - */ - public SharedContextTestProperties() throws IOException { - InputStream inStream = getClass().getResourceAsStream(propertiesFileName); - if (inStream == null) - throw new IOException("Failed to find file on classpath: " + propertiesFileName); - super.load(inStream); - inStream.close(); - } - - public int getProperty(final String name, final int defVal) throws NumberFormatException { - String prop = getProperty(name); - if (prop == null) - return defVal; - return Integer.parseInt(prop); - } - - public boolean getProperty(final String name, final boolean defVal) { - String prop = getProperty(name); - if (prop == null) - return false; - return Boolean.parseBoolean(prop); - } - - // Test this class - public static void main(String[] args) throws Exception { - SharedContextTestProperties p = new SharedContextTestProperties(); - System.out.println("Property " + SharedContextTestProperties.HOSTNAME + " = " - + p.getProperty(SharedContextTestProperties.HOSTNAME)); - } -} |