update sdc portal integration 07/69807/8
authorTal Gitelman <tg851x@intl.att.com>
Wed, 10 Oct 2018 11:52:54 +0000 (14:52 +0300)
committerMichael Lando <michael.lando@intl.att.com>
Fri, 12 Oct 2018 08:07:35 +0000 (08:07 +0000)
Change-Id: I6e17434f753c2eaa562da80c1eade8688601f510
Issue-ID: SDC-1749
Signed-off-by: Tal Gitelman <tg851x@intl.att.com>
29 files changed:
.gitignore
asdctool/pom.xml
catalog-be/pom.xml
catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/attributes/default.rb
catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_6_setup_portal_and_key_properties.rb [new file with mode: 0644]
catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_6_setup_portal_properties.rb [deleted file]
catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-key.properties.erb [new file with mode: 0644]
catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-portal.properties.erb
catalog-be/sdc-backend/chef-solo/roles/catalog-be.json
catalog-be/src/main/java/org/openecomp/sdc/be/ecomp/EcompIntImpl.java
catalog-be/src/main/java/org/openecomp/sdc/be/ecomp/converters/EcompRoleConverter.java
catalog-be/src/main/java/org/openecomp/sdc/be/ecomp/converters/EcompUserConverter.java
catalog-be/src/main/resources/key.properties [new file with mode: 0644]
catalog-be/src/main/resources/portal.properties
catalog-be/src/main/resources/portal.properties.old [new file with mode: 0644]
catalog-be/src/main/webapp/WEB-INF/web.xml
catalog-be/src/test/java/org/openecomp/sdc/be/ecomp/EcompIntImplTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/ecomp/converters/EcompRoleConverterTest.java
catalog-be/src/test/java/org/openecomp/sdc/be/ecomp/converters/EcompUserConverterTest.java
catalog-fe/pom.xml
catalog-fe/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/files/default/key.properties [new file with mode: 0644]
catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/PortalServlet.java
catalog-fe/src/main/resources/key.properties [new file with mode: 0644]
common-app-api/src/main/java/org/openecomp/sdc/common/util/ZipUtil.java
pom.xml
sdc-os-chef/environments/Template.json
test-apis-ci/pom.xml
test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/EcompUserRestUtils.java
test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/UserAPIs.java

index 4d30906..7c7a6ae 100644 (file)
@@ -278,3 +278,6 @@ utils/DmaapPublisher/logs/*
 
 asdctool/*.csv
 asdctool/test-output/*
+
+asdctool/report_delete_1538046694389.json
+asdctool/report_test_1538046722484.json
index acaf482..18557b6 100644 (file)
@@ -97,7 +97,7 @@
                </dependency>
 
                <dependency>
-                       <groupId>org.openecomp.ecompsdkos</groupId>
+                       <groupId>org.onap.portal.sdk</groupId>
                        <artifactId>epsdk-fw</artifactId>
                        <version>${ecomp.version}</version>
                        <scope>compile</scope>
index a90f5f2..5248f48 100644 (file)
 
         <!-- Inserted for ECOMP Portal Integration -->
         <dependency>
-            <groupId>org.openecomp.ecompsdkos</groupId>
+            <groupId>org.onap.portal.sdk</groupId>
             <artifactId>epsdk-fw</artifactId>
             <version>${ecomp.version}</version>
             <scope>compile</scope>
index 49ac86a..d1d6f64 100644 (file)
@@ -35,4 +35,9 @@ default['UEB']['SecretKey'] = "4ZRPzNJfEUK0sSNBvccd2m7X"
 default['Pair_EnvName'] = ""
 
 #DmaapConsumer
-default['DMAAP']['active'] = false
\ No newline at end of file
+default['DMAAP']['active'] = false
+
+#Portal
+default['ECompP']['cipher_key'] = "AGLDdG4D04BKm2IxIWEr8o=="
+default['ECompP']['portal_user'] = "Ipwxi2oLvDxctMA1royaRw1W0jhucLx+grHzci3ePIA="
+default['ECompP']['portal_pass'] = "j85yNhyIs7zKYbR1VlwEfNhS6b7Om4l0Gx5O8931sCI="
\ No newline at end of file
diff --git a/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_6_setup_portal_and_key_properties.rb b/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_6_setup_portal_and_key_properties.rb
new file mode 100644 (file)
index 0000000..bf724de
--- /dev/null
@@ -0,0 +1,24 @@
+template "template portal.properties" do
+    path "#{ENV['JETTY_BASE']}/resources/portal.properties"
+    source "BE-portal.properties.erb"
+    owner "jetty"
+    group "jetty"
+    mode "0755"
+    variables ({
+        :ecomp_rest_url      => node['ECompP']['ecomp_rest_url'],
+        :ecomp_redirect_url  => node['ECompP']['ecomp_redirect_url'],
+        :ecomp_portal_user  => node['ECompP']['portal_user'],
+        :ecomp_portal_pass  => node['ECompP']['portal_pass']
+    })
+end
+
+template "template key.properties" do
+    path "#{ENV['JETTY_BASE']}/resources/key.properties"
+    source "BE-key.properties.erb"
+    owner "jetty"
+    group "jetty"
+    mode "0755"
+    variables ({
+        :cipher_key      => node['ECompP']['cipher_key']
+    })
+end
\ No newline at end of file
diff --git a/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_6_setup_portal_properties.rb b/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_6_setup_portal_properties.rb
deleted file mode 100644 (file)
index 912ddf7..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-template "template portal.properties" do
-    path "#{ENV['JETTY_BASE']}/resources/portal.properties"
-    source "BE-portal.properties.erb"
-    owner "jetty"
-    group "jetty"
-    mode "0755"
-    variables ({
-        :ecomp_rest_url      => node['ECompP']['ecomp_rest_url'],
-        :ecomp_redirect_url  => node['ECompP']['ecomp_redirect_url'],
-        :ueb_url_list        => node['ECompP']['ueb_url_list'],
-        :inbox_name          => node['ECompP']['inbox_name'],
-        :app_key             => node['ECompP']['app_key'],
-        :app_secret          => node['ECompP']['app_secret'],
-        :app_topic_name      => node['ECompP']['app_topic_name'],
-               :decrypt_key         => node['ECompP']['decryption_key']
-    })
-end
diff --git a/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-key.properties.erb b/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-key.properties.erb
new file mode 100644 (file)
index 0000000..007a36e
--- /dev/null
@@ -0,0 +1,41 @@
+###
+# ============LICENSE_START==========================================
+# ONAP Portal SDK
+# ===================================================================
+# 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============================================
+#
+# 
+###
+
+# Properties read by the ECOMP Framework library (epsdk-fw)
+
+cipher.enc.key = <%= @cipher_key %>
\ No newline at end of file
index 4f23cb8..bf58f77 100644 (file)
@@ -1,32 +1,67 @@
-# Portal REST URL, ends "/auxapi"
-ecomp_rest_url = <%= @ecomp_rest_url %>
-
-# Java implementation of interface
-portal.api.impl.class = org.openecomp.sdc.be.ecomp.EcompIntImpl
+###
+# ============LICENSE_START==========================================
+# ONAP Portal SDK
+# ===================================================================
+# 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============================================
+#
+#
+###
+# Properties read by ECOMP Framework library, ecompFW.jar
 
-# CSP-SSO URL
-
-ecomp_redirect_url = <%= @ecomp_redirect_url %>
+##########################################################################
+# The following properties should NOT be changed by partner applications.
+##########################################################################
 
-# Comma-separated list of UEB server names
+portal.api.prefix = /api
+max.idle.time = 5
+user.attribute.name = user_attribute
 
-ueb_url_list = <%= @ueb_url_list %>
+#Use REST API instead of UEB to fetch the functional menu data
+use_rest_for_functional_menu=true
 
-# UEB topic where Portal listens
-ecomp_portal_inbox_name = <%= @inbox_name %>
 
-# UEB key generated while on-boarding
-ueb_app_key = <%= @app_key %>
+##########################################################################
+# The following properties MUST be changed by partner applications.
+##########################################################################
 
-# UEB secret generated while on-boarding
-ueb_app_secret = <%= @app_secret %>
-
-# UEB topic where App listens
-ueb_app_mailbox_name = <%= @app_topic_name %>
+# Name of java class that implements the OnBoardingApiService interface.
+portal.api.impl.class = org.openecomp.sdc.be.ecomp.EcompIntImpl
 
-# Consumer group name; most Apps should use {UUID}
-ueb_app_consumer_group_name = {UUID}
+# URL of the Portal where this app is onboarded
+ecomp_redirect_url = <%= @ecomp_redirect_url %>
 
-ueb_listeners_enable = true
+# URL of the ECOMP Portal REST API
+ecomp_rest_url = <%= @ecomp_rest_url %>
+#Portal user & key
+portal_user = <%= @ecomp_portal_user %>
+portal_pass = <%= @ecomp_portal_pass %>
 
-decryption_key = <%= @decrypt_key %>
index b8fe325..b3171ad 100644 (file)
@@ -15,7 +15,7 @@
     "recipe[sdc-catalog-be::BE_3_locate_keystore]",
     "recipe[sdc-catalog-be::BE_4_jetty_Modules]",
     "recipe[sdc-catalog-be::BE_5_setup_elasticsearch]",
-    "recipe[sdc-catalog-be::BE_6_setup_portal_properties]",
+    "recipe[sdc-catalog-be::BE_6_setup_portal_and_key_properties]",
     "recipe[sdc-catalog-be::BE_7_logback]",
     "recipe[sdc-catalog-be::BE_8_errors_config]",
     "recipe[sdc-catalog-be::BE_9_prepareProbeFile]"
index 757c3a4..50d48d4 100644 (file)
 package org.openecomp.sdc.be.ecomp;
 
 import fj.data.Either;
-import org.openecomp.portalsdk.core.onboarding.crossapi.IPortalRestAPIService;
-import org.openecomp.portalsdk.core.onboarding.exception.PortalAPIException;
-import org.openecomp.portalsdk.core.restful.domain.EcompRole;
-import org.openecomp.portalsdk.core.restful.domain.EcompUser;
+import org.onap.portalsdk.core.onboarding.crossapi.IPortalRestAPIService;
+import org.onap.portalsdk.core.onboarding.crossapi.IPortalRestCentralService;
+import org.onap.portalsdk.core.onboarding.exception.CipherUtilException;
+import org.onap.portalsdk.core.onboarding.exception.PortalAPIException;
+import org.onap.portalsdk.core.onboarding.util.CipherUtil;
+import org.onap.portalsdk.core.onboarding.util.KeyConstants;
+import org.onap.portalsdk.core.onboarding.util.KeyProperties;
+import org.onap.portalsdk.core.onboarding.util.PortalApiProperties;
+import org.onap.portalsdk.core.restful.domain.EcompRole;
+import org.onap.portalsdk.core.restful.domain.EcompUser;
 import org.openecomp.sdc.be.config.BeEcompErrorManager;
 import org.openecomp.sdc.be.config.BeEcompErrorManager.ErrorSeverity;
 import org.openecomp.sdc.be.dao.api.ActionStatus;
@@ -40,8 +46,10 @@ import org.springframework.context.ApplicationContext;
 import org.springframework.web.context.ContextLoader;
 
 import javax.servlet.http.HttpServletRequest;
+import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Map;
 
 
 public class EcompIntImpl implements IPortalRestAPIService {
@@ -265,7 +273,7 @@ public class EcompIntImpl implements IPortalRestAPIService {
     }
 
     @Override
-    public List<EcompRole> getAvailableRoles() throws PortalAPIException {
+    public List<EcompRole> getAvailableRoles(String requestedLoginId) throws PortalAPIException {
         log.debug("Start handle request of ECOMP getAvailableRoles");
         try {
             List<EcompRole> ecompRolesList = new LinkedList<>();
@@ -372,14 +380,21 @@ public class EcompIntImpl implements IPortalRestAPIService {
 
     @Override
     public boolean isAppAuthenticated(HttpServletRequest request) throws PortalAPIException {
-        // TODO Validation should be changed completely
+        final String portal_key = PortalApiProperties.getProperty("portal_pass");
+        final String portal_user = PortalApiProperties.getProperty("portal_user");
         final String USERNAME = request.getHeader("username");
         final String PASSWORD = request.getHeader("password");
 
         if (USERNAME != null && PASSWORD != null) {
-            if (!USERNAME.equals("") && !PASSWORD.equals("")) {
-                log.debug("User authenticated - Username: ,Password: {}", USERNAME, PASSWORD);
-                return true;
+            try {
+                if (CipherUtil.decryptPKC(USERNAME).equals(CipherUtil.decryptPKC(portal_user)) &&
+                        CipherUtil.decryptPKC(PASSWORD).equals(CipherUtil.decryptPKC(portal_key))) {
+                    log.debug("User authenticated - Username: {}", USERNAME);
+                    return true;
+                }
+            } catch (CipherUtilException e) {
+                log.debug("User authentication failed - Decryption failed", e);
+                return false;
             }
         }
 
@@ -415,4 +430,10 @@ public class EcompIntImpl implements IPortalRestAPIService {
     public String getUserId(HttpServletRequest request) throws PortalAPIException {
         return request.getHeader(Constants.USER_ID_HEADER);
     }
+
+    //TODO for what the following method stands for
+    @Override
+    public Map<String, String> getCredentials() throws PortalAPIException {
+        return null;
+    }
 }
index aebc917..df20351 100644 (file)
@@ -20,7 +20,7 @@
 
 package org.openecomp.sdc.be.ecomp.converters;
 
-import org.openecomp.portalsdk.core.restful.domain.EcompRole;
+import org.onap.portalsdk.core.restful.domain.EcompRole;
 import org.openecomp.sdc.be.user.Role;
 import org.openecomp.sdc.common.log.wrappers.Logger;
 
index 0297abe..61b29a3 100644 (file)
@@ -21,8 +21,9 @@
 package org.openecomp.sdc.be.ecomp.converters;
 
 import fj.data.Either;
-import org.openecomp.portalsdk.core.restful.domain.EcompRole;
-import org.openecomp.portalsdk.core.restful.domain.EcompUser;
+
+import org.onap.portalsdk.core.restful.domain.EcompRole;
+import org.onap.portalsdk.core.restful.domain.EcompUser;
 import org.openecomp.sdc.be.dao.utils.UserStatusEnum;
 import org.openecomp.sdc.be.model.User;
 import org.openecomp.sdc.be.user.Role;
diff --git a/catalog-be/src/main/resources/key.properties b/catalog-be/src/main/resources/key.properties
new file mode 100644 (file)
index 0000000..0315075
--- /dev/null
@@ -0,0 +1,41 @@
+###
+# ============LICENSE_START==========================================
+# ONAP Portal SDK
+# ===================================================================
+# 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============================================
+#
+# 
+###
+
+# Properties read by the ECOMP Framework library (epsdk-fw)
+
+cipher.enc.key = AGLDdG4D04BKm2IxIWEr8o==
\ No newline at end of file
index c67261f..fbedd05 100644 (file)
@@ -1,25 +1,76 @@
-# Portal REST URL, ends "/auxapi"
-ecomp_rest_url = https://ecomp.homer.att.com/ecompportal/auxapi
-# Java implementation of interface
+###
+# ============LICENSE_START==========================================
+# ONAP Portal SDK
+# ===================================================================
+# 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============================================
+#
+# 
+###
+# Properties read by ECOMP Framework library, ecompFW.jar
+
+##########################################################################
+# The following properties should NOT be changed by partner applications.
+##########################################################################
+
+portal.api.prefix = /api
+max.idle.time = 5
+user.attribute.name = user_attribute
+
+#Use REST API instead of UEB to fetch the functional menu data
+use_rest_for_functional_menu=true
+
+##########################################################################
+# The following properties MUST be changed by partner applications.
+##########################################################################
+
+# Name of java class that implements the OnBoardingApiService interface.
 portal.api.impl.class = org.openecomp.sdc.be.ecomp.EcompIntImpl
 
-# CSP-SSO URL
-ecomp_redirect_url = https://www.e-access.att.com/ecomp_portal_ist/ecompportal/process_csp 
-# Cookie set by CSP-SSO
-csp_cookie_name = attESSec
-# CSP setting, most use PROD; DEV also recognized
-csp_gate_keeper_prod_key = PROD
-
-# Comma-separated list of UEB server names
-ueb_url_list = uebsb91kcdc.it.att.com,uebsb92kcdc.it.att.com,uebsb93kcdc.it.att.com
-# UEB topic where Portal listens
-ecomp_portal_inbox_name = ECOMP-PORTAL-INBOX-TEST
-# UEB key generated while on-boarding
-ueb_app_key = app_key_here
-# UEB secret generated while on-boarding
-ueb_app_secret = app_secret_here
-# UEB topic where App listens
-ueb_app_mailbox_name = app_topic_name_here
-# Consumer group name; most Apps should use {UUID}
-ueb_app_consumer_group_name = {UUID}
\ No newline at end of file
+# URL of the Portal where this app is onboarded
+ecomp_redirect_url = http://portal.api.simpledemo.onap.org:8989/ONAPPORTAL/login.htm
+
+# URL of the ECOMP Portal REST API
+ecomp_rest_url = http://portal.api.simpledemo.onap.org:8989/ecompportal/auxapi
+
+# Applications do not need to run a UEB listener after 1607.
+ueb_listeners_enable = false
+
+#Portal user & key
+portal_user = Ipwxi2oLvDxctMA1royaRw1W0jhucLx+grHzci3ePIA=
+portal_pass = j85yNhyIs7zKYbR1VlwEfNhS6b7Om4l0Gx5O8931sCI=
+
+# UEB Configuration
+# If key ueb_listeners_enable is set to false,
+# then only the ueb_app_key is required.
+ueb_app_key = REPLACE-ME-UEB-APP-KEY-EPSDK-APP-OS
+
+
diff --git a/catalog-be/src/main/resources/portal.properties.old b/catalog-be/src/main/resources/portal.properties.old
new file mode 100644 (file)
index 0000000..df59ba3
--- /dev/null
@@ -0,0 +1,25 @@
+# Portal REST URL, ends "/auxapi"
+ecomp_rest_url = https://ecomp.homer.att.com/ecompportal/auxapi
+# Java implementation of interface
+portal.api.impl.class = org.openecomp.sdc.be.ecomp.EcompIntImpl
+
+# CSP-SSO URL
+ecomp_redirect_url = https://www.e-access.att.com/ecomp_portal_ist/ecompportal/process_csp
+# Cookie set by CSP-SSO
+csp_cookie_name = attESSec
+# CSP setting, most use PROD; DEV also recognized
+csp_gate_keeper_prod_key = PROD
+
+# Comma-separated list of UEB server names
+ueb_url_list = uebsb91kcdc.it.att.com,uebsb92kcdc.it.att.com,uebsb93kcdc.it.att.com
+# UEB topic where Portal listens
+ecomp_portal_inbox_name = ECOMP-PORTAL-INBOX-TEST
+# UEB key generated while on-boarding
+ueb_app_key = app_key_here
+# UEB secret generated while on-boarding
+ueb_app_secret = app_secret_here
+# UEB topic where App listens
+ueb_app_mailbox_name = app_topic_name_here
+# Consumer group name; most Apps should use {UUID}
+ueb_app_consumer_group_name = {UUID}
\ No newline at end of file
index 74092fe..93c5194 100644 (file)
        <!-- ECOMP Portal -->
        <servlet>
                <servlet-name>ECOMPServlet</servlet-name>
-               <servlet-class>org.openecomp.portalsdk.core.onboarding.crossapi.PortalRestAPIProxy</servlet-class>
+               <servlet-class>org.onap.portalsdk.core.onboarding.crossapi.PortalRestAPIProxy</servlet-class>
                <load-on-startup>3</load-on-startup>
                <async-supported>true</async-supported>
        </servlet>
index e4e13d6..fd5bbdb 100644 (file)
@@ -2,9 +2,9 @@ package org.openecomp.sdc.be.ecomp;
 
 import org.junit.Test;
 import org.mockito.Mockito;
-import org.openecomp.portalsdk.core.onboarding.exception.PortalAPIException;
-import org.openecomp.portalsdk.core.restful.domain.EcompRole;
-import org.openecomp.portalsdk.core.restful.domain.EcompUser;
+import org.onap.portalsdk.core.onboarding.exception.PortalAPIException;
+import org.onap.portalsdk.core.restful.domain.EcompRole;
+import org.onap.portalsdk.core.restful.domain.EcompUser;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.List;
@@ -64,10 +64,10 @@ public class EcompIntImplTest {
 
         // default test
         testSubject = createTestSubject();
-        result = testSubject.getAvailableRoles();
+        result = testSubject.getAvailableRoles("Mock");
     }
 
-    @Test(expected=PortalAPIException.class)
+    @Test(expected= PortalAPIException.class)
     public void testGetUserRoles() throws Exception {
         EcompIntImpl testSubject;
         String loginId = "";
index 528b9b6..53d8d5f 100644 (file)
@@ -1,7 +1,7 @@
 package org.openecomp.sdc.be.ecomp.converters;
 
 import org.junit.Test;
-import org.openecomp.portalsdk.core.restful.domain.EcompRole;
+import org.onap.portalsdk.core.restful.domain.EcompRole;
 import org.openecomp.sdc.be.user.Role;
 
 public class EcompRoleConverterTest {
index 91cf141..301de32 100644 (file)
@@ -1,13 +1,11 @@
 package org.openecomp.sdc.be.ecomp.converters;
 
-import fj.data.Either;
 import fj.data.Either;
 import org.junit.Test;
-import org.openecomp.portalsdk.core.restful.domain.EcompRole;
-import org.openecomp.portalsdk.core.restful.domain.EcompUser;
+import org.onap.portalsdk.core.restful.domain.EcompRole;
+import org.onap.portalsdk.core.restful.domain.EcompUser;
 import org.openecomp.sdc.be.model.User;
 
-
 import java.util.Collections;
 
 import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
index d0ede07..eab116c 100644 (file)
 
                <!-- Inserted for ECOMP Portal Integration -->
                <dependency>
-                       <groupId>org.openecomp.ecompsdkos</groupId>
+                       <groupId>org.onap.portal.sdk</groupId>
                        <artifactId>epsdk-fw</artifactId>
                        <version>${ecomp.version}</version>
                        <scope>compile</scope>
diff --git a/catalog-fe/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/files/default/key.properties b/catalog-fe/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/files/default/key.properties
new file mode 100644 (file)
index 0000000..0315075
--- /dev/null
@@ -0,0 +1,41 @@
+###
+# ============LICENSE_START==========================================
+# ONAP Portal SDK
+# ===================================================================
+# 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============================================
+#
+# 
+###
+
+# Properties read by the ECOMP Framework library (epsdk-fw)
+
+cipher.enc.key = AGLDdG4D04BKm2IxIWEr8o==
\ No newline at end of file
index 408529f..56a4198 100644 (file)
@@ -20,9 +20,9 @@
 
 package org.openecomp.sdc.fe.servlets;
 
-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.onap.portalsdk.core.onboarding.util.CipherUtil;
+import org.onap.portalsdk.core.onboarding.util.PortalApiConstants;
+import org.onap.portalsdk.core.onboarding.util.PortalApiProperties;
 import org.openecomp.sdc.common.impl.MutableHttpServletRequest;
 import org.openecomp.sdc.fe.Constants;
 import org.openecomp.sdc.fe.config.Configuration;
@@ -283,8 +283,10 @@ public class PortalServlet extends HttpServlet {
                                if (cookie.getName().equals(Constants.ECOMP_PORTAL_COOKIE))
                                        userIdcookie = cookie;
                if (userIdcookie != null) {
-                       userId = CipherUtil.decrypt(userIdcookie.getValue(),
-                                       PortalApiProperties.getProperty(PortalApiConstants.Decryption_Key));
+                       CipherUtil.decryptPKC(userIdcookie.getValue());
+                       //Todo Remove after smoke test & review
+                       /*userId = CipherUtil.decrypt(userIdcookie.getValue(),
+                                       PortalApiProperties.getProperty(PortalApiConstants.CSP_GATE_KEEPER_PROD_KEY));*/
                }
                return userId;
 
diff --git a/catalog-fe/src/main/resources/key.properties b/catalog-fe/src/main/resources/key.properties
new file mode 100644 (file)
index 0000000..0315075
--- /dev/null
@@ -0,0 +1,41 @@
+###
+# ============LICENSE_START==========================================
+# ONAP Portal SDK
+# ===================================================================
+# 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============================================
+#
+# 
+###
+
+# Properties read by the ECOMP Framework library (epsdk-fw)
+
+cipher.enc.key = AGLDdG4D04BKm2IxIWEr8o==
\ No newline at end of file
index 2036e23..13ad92e 100644 (file)
@@ -86,11 +86,8 @@ public class ZipUtil {
        }
 
        public static void main(String[] args) {
-
                String zipFileName = "/src/test/resources/config/config.zip";
-
                zipFileName = "C:\\Git_work\\D2-SDnC\\catalog-be\\src\\test\\resources\\config\\config.zip";
-
                Path path = Paths.get(zipFileName);
 
                try {
@@ -102,7 +99,6 @@ public class ZipUtil {
                } catch (IOException e) {
                        log.info("close Byte stream failed" , e);
                }
-
        }
 
        public static byte[] zipBytes(byte[] input) throws IOException {
@@ -131,5 +127,4 @@ public class ZipUtil {
                        throw new IllegalStateException("Can't unzip input stream", e);
                }
        }
-
 }
diff --git a/pom.xml b/pom.xml
index fa27ae4..cff2505 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -42,7 +42,7 @@ Modifications copyright (c) 2018 Nokia
         <jersey-bom.version>2.27</jersey-bom.version>
         <servlet-api.version>3.1.0</servlet-api.version>
         <wire-mock.version>2.18.0</wire-mock.version>
-        <ecomp.version>1.1.0</ecomp.version>
+        <ecomp.version>2.4.0</ecomp.version>
         <cassandra.unit.version>3.5.0.1</cassandra.unit.version>
 
         <!-- Elastic Search mapper (reference the elastic search version actually). -->
index 34392a4..5c7e835 100644 (file)
         },
                "ECompP": {
                    "ecomp_rest_url": "http://portal.api.simpledemo.onap.org:8989/ONAPPORTAL/auxapi",
-            "ueb_url_list": "10.0.11.1,10.0.11.1",
-            "app_secret": "XftIATw9Jr3VzAcPqt3NnJOu",
-            "app_key": "x9UfO7JsDn8BESVX",
-            "inbox_name": "ECOMP-PORTAL-INBOX",
             "ecomp_redirect_url": "http://portal.api.simpledemo.openecomp.org:8989/ECOMPPORTAL/login.htm",
-            "app_topic_name": "ECOMP-PORTAL-OUTBOX-SDC1",
-                       "decryption_key": "AGLDdG4D04BKm2IxIWEr8o=="
+            "cipher_key": "AGLDdG4D04BKm2IxIWEr8o==",
+            "portal_user": "Ipwxi2oLvDxctMA1royaRw1W0jhucLx+grHzci3ePIA=",
+            "portal_pass": "j85yNhyIs7zKYbR1VlwEfNhS6b7Om4l0Gx5O8931sCI="
         },
         "UEB": {
             "PublicKey": "iPIxkpAMI8qTcQj8",
index 0df71ab..2402cb5 100644 (file)
         </dependency>
 
         <dependency>
-            <groupId>org.openecomp.ecompsdkos</groupId>
+            <groupId>org.onap.portal.sdk</groupId>
             <artifactId>epsdk-fw</artifactId>
             <version>${ecomp.version}</version>
             <scope>compile</scope>
index 949ab68..b3a25fd 100644 (file)
@@ -21,8 +21,8 @@
 package org.openecomp.sdc.ci.tests.utils.rest;
 
 import com.google.gson.Gson;
-import org.openecomp.portalsdk.core.restful.domain.EcompRole;
-import org.openecomp.portalsdk.core.restful.domain.EcompUser;
+import org.onap.portalsdk.core.restful.domain.EcompRole;
+import org.onap.portalsdk.core.restful.domain.EcompUser;
 import org.openecomp.sdc.ci.tests.api.Urls;
 import org.openecomp.sdc.ci.tests.config.Config;
 import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
index 67c7fb0..149593d 100644 (file)
@@ -24,8 +24,8 @@ import com.google.gson.Gson;
 import com.google.gson.reflect.TypeToken;
 import org.junit.Rule;
 import org.junit.rules.TestName;
-import org.openecomp.portalsdk.core.restful.domain.EcompRole;
-import org.openecomp.portalsdk.core.restful.domain.EcompUser;
+import org.onap.portalsdk.core.restful.domain.EcompRole;
+import org.onap.portalsdk.core.restful.domain.EcompUser;
 import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
 import org.openecomp.sdc.be.model.Resource;
 import org.openecomp.sdc.be.model.User;