summaryrefslogtreecommitdiffstats
path: root/ONAP-SDK-APP/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'ONAP-SDK-APP/src/main')
-rw-r--r--ONAP-SDK-APP/src/main/java/org/openecomp/portalapp/login/LoginStrategyImpl.java36
-rw-r--r--ONAP-SDK-APP/src/main/resources/portal.properties11
-rw-r--r--ONAP-SDK-APP/src/main/webapp/WEB-INF/conf/system.properties6
-rw-r--r--ONAP-SDK-APP/src/main/webapp/app/fusion/scripts/DS2-view-models/ds2Header.html68
4 files changed, 91 insertions, 30 deletions
diff --git a/ONAP-SDK-APP/src/main/java/org/openecomp/portalapp/login/LoginStrategyImpl.java b/ONAP-SDK-APP/src/main/java/org/openecomp/portalapp/login/LoginStrategyImpl.java
index 567fbb7cf..3b38f1d8e 100644
--- a/ONAP-SDK-APP/src/main/java/org/openecomp/portalapp/login/LoginStrategyImpl.java
+++ b/ONAP-SDK-APP/src/main/java/org/openecomp/portalapp/login/LoginStrategyImpl.java
@@ -26,10 +26,10 @@ import javax.servlet.http.HttpServletResponse;
import org.onap.policy.common.logging.flexlogger.FlexLogger;
import org.onap.policy.common.logging.flexlogger.Logger;
import org.openecomp.portalsdk.core.auth.LoginStrategy;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.openecomp.portalsdk.core.onboarding.exception.PortalAPIException;
import org.openecomp.portalsdk.core.onboarding.util.CipherUtil;
-import org.openecomp.portalsdk.core.onboarding.util.PortalApiConstants;
-import org.openecomp.portalsdk.core.onboarding.util.PortalApiProperties;
+import org.openecomp.portalsdk.core.util.SystemProperties;
import org.springframework.web.servlet.ModelAndView;
public class LoginStrategyImpl extends LoginStrategy {
@@ -58,23 +58,21 @@ public class LoginStrategyImpl extends LoginStrategy {
}
private static String getUserIdFromCookie(HttpServletRequest request) throws PortalAPIException {
- String userId = "";
- Cookie[] cookies = request.getCookies();
- Cookie userIdcookie = null;
- if (cookies != null)
- for (Cookie cookie : cookies)
- if (cookie.getName().equals(USER_ID))
- userIdcookie = cookie;
- if (userIdcookie != null) {
- try {
- userId = CipherUtil.decrypt(userIdcookie.getValue(),
- PortalApiProperties.getProperty(PortalApiConstants.Decryption_Key));
- } catch (Exception e) {
- throw new PortalAPIException(e);
- }
- }
- return userId;
-
+ String userId = "";
+ Cookie userIdCookie = getCookie(request, USER_ID);
+ if (userIdCookie != null) {
+ final String cookieValue = userIdCookie.getValue();
+ if (!SystemProperties.containsProperty(SystemProperties.Decryption_Key))
+ throw new IllegalStateException("Failed to find property " + SystemProperties.Decryption_Key);
+ final String decryptionKey = SystemProperties.getProperty(SystemProperties.Decryption_Key);
+ try {
+ userId = CipherUtil.decrypt(cookieValue, decryptionKey);
+ LOGGER.debug("getUserIdFromCookie: decrypted as {}" +userId);
+ } catch (Exception e) {
+ LOGGER.error("Exception Occured in getUserIdFromCookie" + e);
+ }
+ }
+ return userId;
}
private static boolean isLoginCookieExist(HttpServletRequest request) {
diff --git a/ONAP-SDK-APP/src/main/resources/portal.properties b/ONAP-SDK-APP/src/main/resources/portal.properties
index 2ab096f1a..1f2336d7b 100644
--- a/ONAP-SDK-APP/src/main/resources/portal.properties
+++ b/ONAP-SDK-APP/src/main/resources/portal.properties
@@ -27,11 +27,6 @@ portal.api.prefix = /api
max.idle.time = 5
user.attribute.name = user_attribute
-# CSP settings
-csp_cookie_name = attESSec
-csp_gate_keeper_prod_key = PROD
-testing=testing
-
#Use REST API instead of UEB to fetch the functional menu data
use_rest_for_functional_menu=true
@@ -43,10 +38,10 @@ use_rest_for_functional_menu=true
portal.api.impl.class = org.openecomp.portalapp.service.OnBoardingApiServiceImpl
# CSP Global Log On for single sign on
-onap_redirect_url = todo_csp_global_logon
+ecomp_redirect_url = todo_csp_global_logon
# URL of the ONAP Portal REST API
-onap_rest_url = todo_Onap_rest_url
+ecomp_rest_url = todo_Onap_rest_url
# Applications do not need to run a UEB listener in 1610.
ueb_listeners_enable = false
@@ -58,7 +53,7 @@ ueb_listeners_enable = false
# UEB servers
ueb_url_list = todo_ueb_list
# ONAP Portal listens on this UEB topic
-onap_portal_inbox_name = ONAP-PORTAL-INBOX-TEST-DEMETER
+ecomp_portal_inbox_name = ONAP-PORTAL-INBOX-TEST-DEMETER
# Replace these 3 default values with the ones for your specific App,
# as shown on the on-boarding page on the ONAP Portal web application.
ueb_app_key = ZOicEniw7BWDL1pM
diff --git a/ONAP-SDK-APP/src/main/webapp/WEB-INF/conf/system.properties b/ONAP-SDK-APP/src/main/webapp/WEB-INF/conf/system.properties
index 304bcbd90..aa8ee1476 100644
--- a/ONAP-SDK-APP/src/main/webapp/WEB-INF/conf/system.properties
+++ b/ONAP-SDK-APP/src/main/webapp/WEB-INF/conf/system.properties
@@ -23,8 +23,8 @@ decryption_key = AGLDdG4D04BKm2IxIWEr8o==
# The following properties MAY require changes by partner applications.
##########################################################################
#Mysql
-db.driver = com.mysql.jdbc.Driver
-db.connectionURL = jdbc:mysql://localhost:3306/onap_sdk
+db.driver = org.mariadb.jdbc.Driver
+db.connectionURL = jdbc:mariadb://localhost:3306/onap_sdk
db.userName = policy_user
db.password = policy_user
db.hib.dialect = org.hibernate.dialect.MySQLDialect
@@ -50,7 +50,7 @@ mylogins_feed_cron = 0 0/60 * * * ?;
my_login_feed_output_dir = /tmp/MyLogins
# ONAP Portal Shared Context REST API URL
-onap_shared_context_rest_url= todo_shared_context_url
+ecomp_shared_context_rest_url= todo_shared_context_url
# Link shown in Help menu
contact_us_link = todo_Contact_link
diff --git a/ONAP-SDK-APP/src/main/webapp/app/fusion/scripts/DS2-view-models/ds2Header.html b/ONAP-SDK-APP/src/main/webapp/app/fusion/scripts/DS2-view-models/ds2Header.html
new file mode 100644
index 000000000..444514939
--- /dev/null
+++ b/ONAP-SDK-APP/src/main/webapp/app/fusion/scripts/DS2-view-models/ds2Header.html
@@ -0,0 +1,68 @@
+<div class="header-main-div" >
+ <header class="b2b-header-tabs" b2b-header-responsive ng-show="{{showHeader}}">
+ <ul class="header__items" role="navigation">
+ <li class="header__item icon__item" tabindex="0" ng-click="returnToPortal()">
+ <span class="globe-text">ONAP Portal</span>
+ </li>
+ <li b2b-header-menu class="header__item b2b-headermenu" ng-repeat="item in menuItems" role="presentation">
+ <a href="javascript:void(0);" class="menu__item" role="menuitem" ng-bind="item.text"></a>
+ <div class="header-secondary-wrapper">
+ <ul class="header-secondary" role="menu">
+ <li class="header-subitem" b2b-header-submenu
+ ng-repeat="secondLevMenu in item.children" role="presentation">
+ <a href="{{secondLevMenu.action}}" ng-if="secondLevMenu.childMenus.length==0" class="menu__item" role="menuitem" ng-bind="secondLevMenu.label"></a>
+ <a href="javascript:void(0);" ng-if="secondLevMenu.childMenus.length!=0" class="menu__item" role="menuitem" ng-bind="secondLevMenu.label" ></a>
+ <div class="header-tertiary-wrapper">
+ <ul class="header-tertiary" role="menu">
+ <li b2b-header-tertiarymenu ng-repeat="thirdLevMenu in secondLevMenu.childMenus"role="presentation">
+ <a href="{{thirdLevMenu.action}}"role="menuitem" aria-haspopup="true" ng-bind="thirdLevMenu.label"></a>
+ </li>
+ </ul>
+ </div>
+ </li>
+ </ul>
+ </div></li>
+ <li class="header__item profile">
+ <b2b-flyout>
+ <div b2b-flyout-toggler class="header-profile" >
+ <div class="icon-people-oneperson" id="header-user-icon" tabindex="0" b2b-accessibility-click="13,32" aria-label="notifications" aria-haspopup="true" aria-expanded="{{flyoutOpened}}" role="button"></div>
+ <div id="login-snippet-text" class="login-snippet-text">{{userFirstName}}</div>
+ </div>
+ <b2b-flyout-content horizontal-placement="center" vertical-placement="below">
+ <div>
+ <div id="reg-header-snippet">
+ <div tabindex="0" class="reg-profileDetails" id="reg-profiledetails-id">
+ <ul class="reg-Details-table">
+ <li>
+ <div class="reg-userName-table">
+ <div id="reg-userName-table-row">
+ <div id="reg-userName-table-cell">
+ <h3 ng-bind="userName">&nbsp;</h3>
+ <span>&nbsp;</span>
+ </div>
+ </div>
+ </div>
+ </li>
+ <li><div class="reg-userEmail-label"><span class="reg-userEmail-label-spn" style=font-weight:bold>Email<span class="visuallyhidden">:
+ </span></span></div></li>
+ <li><div class="reg-userEmail-value"><span class="reg-userEmail-value-spn">
+ {{userEmail}}</span></div></li>
+ <li>&nbsp;</li>
+ <li><div class="reg-userRole-label"><span class="reg-userRole-label-spn" style=font-weight:bold>
+ User Id<span class="visuallyhidden">:</span></span></div></li>
+ <li><div class="reg-userRole-value"><span class="reg-userRole-value-spn">
+ {{userId}}<span class="visuallyhidden"></span></span></div></li>
+ </ul>
+ <div id="reg-logout-div" style="padding-top: 8px">
+ <a href="logout.htm" id="allLogout" class="btn btn-alt btn-small">
+ Log out
+ </a>
+ </div>
+ </div>
+ </div>
+ </div>
+ </b2b-flyout-content>
+ </b2b-flyout>
+ </ul>
+ </header>
+</div>