From ed64b5edff15e702493df21aa3230b81593e6133 Mon Sep 17 00:00:00 2001 From: Michael Lando Date: Fri, 9 Jun 2017 03:19:04 +0300 Subject: [SDC-29] catalog 1707 rebase commit. Change-Id: I43c3dc5cf44abf5da817649bc738938a3e8388c1 Signed-off-by: Michael Lando --- .../main/java/org/openecomp/sdc/fe/Constants.java | 20 +++ .../org/openecomp/sdc/fe/client/BackendClient.java | 4 +- .../sdc/fe/servlets/ConfigMgrServlet.java | 8 +- .../openecomp/sdc/fe/servlets/ConfigServlet.java | 4 +- .../sdc/fe/servlets/FeHealthCheckServlet.java | 4 - .../openecomp/sdc/fe/servlets/FeProxyServlet.java | 3 +- .../sdc/fe/servlets/HealthCheckService.java | 2 +- .../src/main/resources/config/configuration.yaml | 12 +- catalog-fe/src/main/resources/portal.properties | 7 +- catalog-fe/src/main/webapp/WEB-INF/web.xml | 169 --------------------- .../lib/jasmine-2.0.0/boot.js | 20 --- .../lib/jasmine-2.0.0/console.js | 20 --- .../lib/jasmine-2.0.0/jasmine-html.js | 20 --- .../lib/jasmine-2.0.0/jasmine.js | 20 --- .../jasmine-standalone-2.0.0/spec/PlayerSpec.js | 20 --- .../jasmine-standalone-2.0.0/spec/SpecHelper.js | 20 --- .../test/jasmine-standalone-2.0.0/src/Player.js | 22 +-- .../src/test/jasmine-standalone-2.0.0/src/Song.js | 22 +-- .../sdc/ContentDisposiotionDelegator.java | 1 - .../openecomp/sdc/TestExternalConfiguration.java | 1 - .../resources/config/catalog-fe/configuration.yaml | 10 ++ catalog-fe/src/test/spec/codeSpec.js | 20 --- catalog-fe/src/test/testScripts/filesContents.js | 22 +-- catalog-fe/src/test/testScripts/jasmine-fixture.js | 20 --- 24 files changed, 54 insertions(+), 417 deletions(-) (limited to 'catalog-fe/src') diff --git a/catalog-fe/src/main/java/org/openecomp/sdc/fe/Constants.java b/catalog-fe/src/main/java/org/openecomp/sdc/fe/Constants.java index e157efcda9..a9f5c1294e 100644 --- a/catalog-fe/src/main/java/org/openecomp/sdc/fe/Constants.java +++ b/catalog-fe/src/main/java/org/openecomp/sdc/fe/Constants.java @@ -1,3 +1,23 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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. + * ============LICENSE_END========================================================= + */ + package org.openecomp.sdc.fe; public class Constants { diff --git a/catalog-fe/src/main/java/org/openecomp/sdc/fe/client/BackendClient.java b/catalog-fe/src/main/java/org/openecomp/sdc/fe/client/BackendClient.java index 93e17144c0..92e497d278 100644 --- a/catalog-fe/src/main/java/org/openecomp/sdc/fe/client/BackendClient.java +++ b/catalog-fe/src/main/java/org/openecomp/sdc/fe/client/BackendClient.java @@ -151,7 +151,7 @@ public class BackendClient { } backendHttpClient.close(); } catch (IOException e) { - log.error("failed to close httpClient: " + e.getMessage()); + log.error("failed to close httpClient: {}", e.getMessage()); } } @@ -168,7 +168,7 @@ public class BackendClient { if (headerValue != null) { httpPost.setHeader(headerName, headerValue); } else { - log.error("missing required header " + headerName); + log.error("missing required header {}", headerName); return allHeadersAreSet; } } diff --git a/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/ConfigMgrServlet.java b/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/ConfigMgrServlet.java index 7792225742..356f9261c6 100644 --- a/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/ConfigMgrServlet.java +++ b/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/ConfigMgrServlet.java @@ -61,9 +61,9 @@ public class ConfigMgrServlet extends BasicServlet { Configuration configuration = configurationManager.getConfiguration(); if (configuration == null) { - log.warn("Configuration of type " + Configuration.class + " was not found"); + log.warn("Configuration of type {} was not found", Configuration.class); } else { - log.info("The value returned from getConfig is " + configuration); + log.info("The value returned from getConfig is {}", configuration); result = gson.toJson(configuration); @@ -72,9 +72,9 @@ public class ConfigMgrServlet extends BasicServlet { RestConfigurationInfo configuration = configurationManager.getRestClientConfiguration(); if (configuration == null) { - log.warn("Configuration of type " + RestConfigurationInfo.class + " was not found"); + log.warn("Configuration of type {} was not found", RestConfigurationInfo.class); } else { - log.info("The value returned from getConfig is " + configuration); + log.info("The value returned from getConfig is {}", configuration); result = gson.toJson(configuration); diff --git a/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/ConfigServlet.java b/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/ConfigServlet.java index 92bb9e8743..b8d623b72e 100644 --- a/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/ConfigServlet.java +++ b/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/ConfigServlet.java @@ -64,13 +64,13 @@ public class ConfigServlet extends BasicServlet { Configuration configuration = configurationSource.getAndWatchConfiguration(Configuration.class, null); if (configuration == null) { - log.warn("Configuration of type " + Configuration.class + " was not found"); + log.warn("Configuration of type {} was not found", Configuration.class); } log.debug("{}", configuration); if (log.isInfoEnabled()) { log.info("Info level ENABLED..."); } - log.info("The value returned from getConfig is " + configuration); + log.info("The value returned from getConfig is {}", configuration); result = gson.toJson(configuration); diff --git a/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/FeHealthCheckServlet.java b/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/FeHealthCheckServlet.java index da5b321339..1ed6ac5c07 100644 --- a/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/FeHealthCheckServlet.java +++ b/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/FeHealthCheckServlet.java @@ -35,10 +35,6 @@ import com.jcabi.aspects.Loggable; @Loggable(prepend = true, value = Loggable.TRACE, trim = false) @Path("/healthCheck") public class FeHealthCheckServlet extends BasicServlet { - - // private static Logger log = - // LoggerFactory.getLogger(FeHealthCheckServlet.class.getName()); - @GET public Response getFEandBeHealthCheck(@Context final HttpServletRequest request) { ServletContext context = request.getSession().getServletContext(); diff --git a/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/FeProxyServlet.java b/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/FeProxyServlet.java index 1cd28deb7a..11d4abf4af 100644 --- a/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/FeProxyServlet.java +++ b/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/FeProxyServlet.java @@ -85,7 +85,7 @@ public class FeProxyServlet extends SSLProxyServlet { String serviceInstanceID = httpRequest.getHeader(Constants.X_ECOMP_SERVICE_ID_HEADER); if (uuid != null && uuid.length() > 0) { - // User Id for logging + // UserId for logging String userId = httpRequest.getHeader(Constants.USER_ID_HEADER); String remoteAddr = httpRequest.getRemoteAddr(); @@ -201,6 +201,7 @@ public class FeProxyServlet extends SSLProxyServlet { if (onboardingForwardContext == null || onboardingForwardContext.isEmpty()) { onboardingForwardContext = "/onboarding-api"; } + redirectedUrl = redirectedUrl.replace("/sdc1/feProxy/dcae-api", "/dcae"); redirectedUrl = redirectedUrl.replace("/sdc1/feProxy/onboarding-api", onboardingForwardContext); redirectedUrl = redirectedUrl.replace("/sdc1/feProxy", "/sdc2"); return redirectedUrl; diff --git a/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/HealthCheckService.java b/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/HealthCheckService.java index 338e8d4c01..b7fce8d912 100644 --- a/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/HealthCheckService.java +++ b/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/HealthCheckService.java @@ -40,9 +40,9 @@ import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.util.EntityUtils; import org.openecomp.sdc.common.api.Constants; import org.openecomp.sdc.common.api.HealthCheckInfo; +import org.openecomp.sdc.common.api.HealthCheckWrapper; import org.openecomp.sdc.common.api.HealthCheckInfo.HealthCheckComponent; import org.openecomp.sdc.common.api.HealthCheckInfo.HealthCheckStatus; -import org.openecomp.sdc.common.api.HealthCheckWrapper; import org.openecomp.sdc.common.config.EcompErrorName; import org.openecomp.sdc.common.impl.ExternalConfiguration; import org.openecomp.sdc.fe.config.Configuration; diff --git a/catalog-fe/src/main/resources/config/configuration.yaml b/catalog-fe/src/main/resources/config/configuration.yaml index 6be93b330d..cd123ca220 100644 --- a/catalog-fe/src/main/resources/config/configuration.yaml +++ b/catalog-fe/src/main/resources/config/configuration.yaml @@ -17,30 +17,30 @@ beProtocol: http beSslPort: 8443 # threadpool size for handling requests -threadpoolSize: 50 +threadpoolSize: 50 # request processing timeout (seconds) requestTimeout: 10 +# Determines the health check read timeout when invoking health check towards the LB (or BE whatever is configured): healthCheckSocketTimeoutInMs: 5000 - healthCheckIntervalInSeconds: 5 -identificationHeaderFields: +identificationHeaderFields: - - &HTTP_IV_USER HTTP_IV_USER - &iv-user iv-user - - &USER_ID USER_ID - - &user-id user-id + - &csp-userId csp-userId - - &HTTP_CSP_ATTUID HTTP_CSP_ATTUID - &csp-attuid csp-attuid - - - &HTTP_CSP_WSTYPE HTTP_CSP_WSTYPE + - &HTTP_CSP_WSTYPE HTTP_CSP_WSTYPE - &csp-wstype csp-wstype -optionalHeaderFields: +optionalHeaderFields: - - &HTTP_CSP_FIRSTNAME HTTP_CSP_FIRSTNAME - &csp-firstname csp-firstname diff --git a/catalog-fe/src/main/resources/portal.properties b/catalog-fe/src/main/resources/portal.properties index 880c4fe9e9..a146d6ef0c 100644 --- a/catalog-fe/src/main/resources/portal.properties +++ b/catalog-fe/src/main/resources/portal.properties @@ -1,11 +1,12 @@ # Portal REST URL, ends "/auxapi" -ecomp_rest_url = https://portal.api.simpledemo.openecomp.org/ecompportal/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 = http://portal.api.simpledemo.openecomp.org:8989/ECOMPPORTAL/login.htm +# ecomp_redirect_url = https://www.e-access.att.com/ecomp_portal_ist/ecompportal/process_csp +ecomp_redirect_url = http://127.0.0.1:8989/ECOMPPORTAL/login.htm # Cookie set by CSP-SSO csp_cookie_name = attESSec @@ -13,7 +14,7 @@ csp_cookie_name = attESSec csp_gate_keeper_prod_key = PROD # Comma-separated list of UEB server names -ueb_url_list = +ueb_url_list = localhost # UEB topic where Portal listens ecomp_portal_inbox_name = ECOMP-PORTAL-INBOX-TEST # UEB key generated while on-boarding diff --git a/catalog-fe/src/main/webapp/WEB-INF/web.xml b/catalog-fe/src/main/webapp/WEB-INF/web.xml index f6d709ef58..c2127dcdca 100644 --- a/catalog-fe/src/main/webapp/WEB-INF/web.xml +++ b/catalog-fe/src/main/webapp/WEB-INF/web.xml @@ -39,146 +39,6 @@ /lbClassicStatus - - - - - FeProxy @@ -219,35 +79,6 @@ /kibanaProxy/* - - - - cross-origin-att - org.eclipse.jetty.servlets.CrossOriginFilter - true - - allowedOrigins - * - - - allowedMethods - GET,POST,OPTIONS,DELETE,PUT,HEAD - - - allowedHeaders - HTTP_CSP_FIRSTNAME, HTTP_CSP_LASTNAME, USER_ID, - HTTP_CSP_EMAIL, X-ECOMP-RequestID, origin, content-type, accept, authorization, Content-MD5,X-ECOMP-ServiceID - - - allowCredential - true - - - - cross-origin-att - /* - -