aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTal Gitelman <tg851x@intl.att.com>2018-10-10 14:52:54 +0300
committerMichael Lando <michael.lando@intl.att.com>2018-10-12 08:07:35 +0000
commit7d05e16f0ab24ba8918bd4466d50a9fb77571552 (patch)
treed1da92387eaa9d29780d56650e51dc5ccd439107
parent502b7b7839374680a494c1606798a8b4588daa2b (diff)
update sdc portal integration
Change-Id: I6e17434f753c2eaa562da80c1eade8688601f510 Issue-ID: SDC-1749 Signed-off-by: Tal Gitelman <tg851x@intl.att.com>
-rw-r--r--.gitignore3
-rw-r--r--asdctool/pom.xml2
-rw-r--r--catalog-be/pom.xml2
-rw-r--r--catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/attributes/default.rb7
-rw-r--r--catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_6_setup_portal_and_key_properties.rb24
-rw-r--r--catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_6_setup_portal_properties.rb17
-rw-r--r--catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-key.properties.erb41
-rw-r--r--catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-portal.properties.erb81
-rw-r--r--catalog-be/sdc-backend/chef-solo/roles/catalog-be.json2
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/ecomp/EcompIntImpl.java39
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/ecomp/converters/EcompRoleConverter.java2
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/ecomp/converters/EcompUserConverter.java5
-rw-r--r--catalog-be/src/main/resources/key.properties41
-rw-r--r--catalog-be/src/main/resources/portal.properties97
-rw-r--r--catalog-be/src/main/resources/portal.properties.old25
-rw-r--r--catalog-be/src/main/webapp/WEB-INF/web.xml2
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/ecomp/EcompIntImplTest.java10
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/ecomp/converters/EcompRoleConverterTest.java2
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/ecomp/converters/EcompUserConverterTest.java6
-rw-r--r--catalog-fe/pom.xml2
-rw-r--r--catalog-fe/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/files/default/key.properties41
-rw-r--r--catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/PortalServlet.java12
-rw-r--r--catalog-fe/src/main/resources/key.properties41
-rw-r--r--common-app-api/src/main/java/org/openecomp/sdc/common/util/ZipUtil.java5
-rw-r--r--pom.xml2
-rw-r--r--sdc-os-chef/environments/Template.json9
-rw-r--r--test-apis-ci/pom.xml2
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/EcompUserRestUtils.java4
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/UserAPIs.java4
29 files changed, 417 insertions, 113 deletions
diff --git a/.gitignore b/.gitignore
index 4d30906ad9..7c7a6aeb00 100644
--- a/.gitignore
+++ b/.gitignore
@@ -278,3 +278,6 @@ utils/DmaapPublisher/logs/*
asdctool/*.csv
asdctool/test-output/*
+
+asdctool/report_delete_1538046694389.json
+asdctool/report_test_1538046722484.json
diff --git a/asdctool/pom.xml b/asdctool/pom.xml
index acaf482ad0..18557b620c 100644
--- a/asdctool/pom.xml
+++ b/asdctool/pom.xml
@@ -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>
diff --git a/catalog-be/pom.xml b/catalog-be/pom.xml
index a90f5f2abb..5248f48d8c 100644
--- a/catalog-be/pom.xml
+++ b/catalog-be/pom.xml
@@ -430,7 +430,7 @@
<!-- 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-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/attributes/default.rb b/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/attributes/default.rb
index 49ac86aaec..d1d6f642fd 100644
--- a/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/attributes/default.rb
+++ b/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/attributes/default.rb
@@ -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
index 0000000000..bf724ded5f
--- /dev/null
+++ b/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_6_setup_portal_and_key_properties.rb
@@ -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
index 912ddf7dc0..0000000000
--- a/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_6_setup_portal_properties.rb
+++ /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
index 0000000000..007a36e350
--- /dev/null
+++ b/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-key.properties.erb
@@ -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
diff --git a/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-portal.properties.erb b/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-portal.properties.erb
index 4f23cb827f..bf58f77d9f 100644
--- a/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-portal.properties.erb
+++ b/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-portal.properties.erb
@@ -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 %>
diff --git a/catalog-be/sdc-backend/chef-solo/roles/catalog-be.json b/catalog-be/sdc-backend/chef-solo/roles/catalog-be.json
index b8fe325e64..b3171ad3f2 100644
--- a/catalog-be/sdc-backend/chef-solo/roles/catalog-be.json
+++ b/catalog-be/sdc-backend/chef-solo/roles/catalog-be.json
@@ -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]"
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/ecomp/EcompIntImpl.java b/catalog-be/src/main/java/org/openecomp/sdc/be/ecomp/EcompIntImpl.java
index 757c3a48d4..50d48d4ca7 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/ecomp/EcompIntImpl.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/ecomp/EcompIntImpl.java
@@ -21,10 +21,16 @@
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;
+ }
}
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/ecomp/converters/EcompRoleConverter.java b/catalog-be/src/main/java/org/openecomp/sdc/be/ecomp/converters/EcompRoleConverter.java
index aebc9170f1..df20351fd8 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/ecomp/converters/EcompRoleConverter.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/ecomp/converters/EcompRoleConverter.java
@@ -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;
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/ecomp/converters/EcompUserConverter.java b/catalog-be/src/main/java/org/openecomp/sdc/be/ecomp/converters/EcompUserConverter.java
index 0297abeacb..61b29a3986 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/ecomp/converters/EcompUserConverter.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/ecomp/converters/EcompUserConverter.java
@@ -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
index 0000000000..0315075e53
--- /dev/null
+++ b/catalog-be/src/main/resources/key.properties
@@ -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
diff --git a/catalog-be/src/main/resources/portal.properties b/catalog-be/src/main/resources/portal.properties
index c67261f962..fbedd05028 100644
--- a/catalog-be/src/main/resources/portal.properties
+++ b/catalog-be/src/main/resources/portal.properties
@@ -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
index 0000000000..df59ba392d
--- /dev/null
+++ b/catalog-be/src/main/resources/portal.properties.old
@@ -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
diff --git a/catalog-be/src/main/webapp/WEB-INF/web.xml b/catalog-be/src/main/webapp/WEB-INF/web.xml
index 74092fe9cb..93c5194c0c 100644
--- a/catalog-be/src/main/webapp/WEB-INF/web.xml
+++ b/catalog-be/src/main/webapp/WEB-INF/web.xml
@@ -151,7 +151,7 @@
<!-- 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>
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/ecomp/EcompIntImplTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/ecomp/EcompIntImplTest.java
index e4e13d6477..fd5bbdb74a 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/ecomp/EcompIntImplTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/ecomp/EcompIntImplTest.java
@@ -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 = "";
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/ecomp/converters/EcompRoleConverterTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/ecomp/converters/EcompRoleConverterTest.java
index 528b9b6b69..53d8d5f7c6 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/ecomp/converters/EcompRoleConverterTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/ecomp/converters/EcompRoleConverterTest.java
@@ -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 {
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/ecomp/converters/EcompUserConverterTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/ecomp/converters/EcompUserConverterTest.java
index 91cf1417dd..301de32f6f 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/ecomp/converters/EcompUserConverterTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/ecomp/converters/EcompUserConverterTest.java
@@ -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;
diff --git a/catalog-fe/pom.xml b/catalog-fe/pom.xml
index d0ede07f22..eab116c02b 100644
--- a/catalog-fe/pom.xml
+++ b/catalog-fe/pom.xml
@@ -235,7 +235,7 @@
<!-- 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
index 0000000000..0315075e53
--- /dev/null
+++ b/catalog-fe/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/files/default/key.properties
@@ -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
diff --git a/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/PortalServlet.java b/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/PortalServlet.java
index 408529f710..56a41988a1 100644
--- a/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/PortalServlet.java
+++ b/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/PortalServlet.java
@@ -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
index 0000000000..0315075e53
--- /dev/null
+++ b/catalog-fe/src/main/resources/key.properties
@@ -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
diff --git a/common-app-api/src/main/java/org/openecomp/sdc/common/util/ZipUtil.java b/common-app-api/src/main/java/org/openecomp/sdc/common/util/ZipUtil.java
index 2036e2332d..13ad92e8a5 100644
--- a/common-app-api/src/main/java/org/openecomp/sdc/common/util/ZipUtil.java
+++ b/common-app-api/src/main/java/org/openecomp/sdc/common/util/ZipUtil.java
@@ -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 fa27ae4519..cff2505efc 100644
--- 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). -->
diff --git a/sdc-os-chef/environments/Template.json b/sdc-os-chef/environments/Template.json
index 34392a4187..5c7e83575d 100644
--- a/sdc-os-chef/environments/Template.json
+++ b/sdc-os-chef/environments/Template.json
@@ -23,13 +23,10 @@
},
"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",
diff --git a/test-apis-ci/pom.xml b/test-apis-ci/pom.xml
index 0df71ab241..2402cb5f4e 100644
--- a/test-apis-ci/pom.xml
+++ b/test-apis-ci/pom.xml
@@ -281,7 +281,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>
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/EcompUserRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/EcompUserRestUtils.java
index 949ab68961..b3a25fd3a0 100644
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/EcompUserRestUtils.java
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/EcompUserRestUtils.java
@@ -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;
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/UserAPIs.java b/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/UserAPIs.java
index 67c7fb0424..149593de60 100644
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/UserAPIs.java
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/UserAPIs.java
@@ -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;