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 --- catalog-fe/pom.xml | 675 ++++++++++----------- .../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 - catalog-fe/tarball.xml | 32 - 26 files changed, 368 insertions(+), 810 deletions(-) delete mode 100644 catalog-fe/tarball.xml (limited to 'catalog-fe') diff --git a/catalog-fe/pom.xml b/catalog-fe/pom.xml index 3518779952..a3acabb41f 100644 --- a/catalog-fe/pom.xml +++ b/catalog-fe/pom.xml @@ -5,387 +5,306 @@ catalog-fe war - - org.openecomp.sdc sdc-main 1.1.0-SNAPSHOT + + + org.functionaljava + functionaljava + ${functionaljava.version} + compile + - + + org.openecomp.sdc + security-utils + ${project.version} + compile + - junit - junit - 4.12 - test + org.openecomp.sdc + common-app-api + ${project.version} + - org.testng - testng - 6.9.10 - test + org.slf4j + slf4j-api + ${slf4j-api.version} + compile - org.springframework - spring-core - ${spring.version} - provided + ch.qos.logback + logback-classic + ${logback.version} + compile - org.springframework - spring-beans - ${spring.version} - provided + ch.qos.logback + logback-core + ${logback.version} + compile - org.springframework - spring-context - ${spring.version} - provided + org.codehaus.groovy + groovy-all + ${groovy.version} + compile - org.springframework - spring-context-support - ${spring.version} - provided + org.codehaus.janino + janino + ${janino.version} + compile - org.springframework - spring-messaging - ${spring.version} - provided + org.yaml + snakeyaml + ${snakeyaml.version} + compile - org.springframework - spring-web - ${spring.version} - provided + org.apache.commons + commons-jci-core + ${commons-jci-core.version} + compile - org.springframework - spring-webmvc - ${spring.version} - provided + com.google.code.gson + gson + ${gson.version} + compile - org.springframework - spring-aop - ${spring.version} - provided + org.glassfish.jersey.containers + jersey-container-servlet + ${jersey-bom.version} + compile - org.springframework - spring-aspects - ${spring.version} - provided + org.glassfish.jersey.media + jersey-media-multipart + ${jersey-bom.version} + compile - org.springframework - spring-expression - ${spring.version} - test + org.glassfish.jersey.media + jersey-media-moxy + ${jersey-bom.version} + compile + + javax.mail + javax.mail-api + 1.5.2 + compile + - org.functionaljava - functionaljava + org.glassfish.jersey.media + jersey-media-json-jackson + ${jersey-bom.version} compile - + - org.openecomp.sdc - security-utils - ${security-utils.version} - compile - - - org.openecomp.sdc - common-app-api - ${common-app-api.version} - - - - - org.slf4j - slf4j-api - 1.7.10 - compile - - - - ch.qos.logback - logback-classic - ${logback.version} - compile - - - - ch.qos.logback - logback-core - ${logback.version} - compile - - - - org.codehaus.groovy - groovy-all - ${groovy.version} - compile - - - - org.codehaus.janino - janino - ${janino.version} - compile - - - - org.yaml - snakeyaml - 1.14 - compile - - - - org.apache.commons - commons-jci-core - compile - - - - com.google.code.gson - gson - 2.3.1 - compile - - - - org.glassfish.jersey.containers - jersey-container-servlet - 2.24 - compile - - - - org.glassfish.jersey.media - jersey-media-multipart - compile - - - - org.glassfish.jersey.media - jersey-media-moxy - compile - - - - javax.mail - javax.mail-api - 1.5.2 - compile - - - - org.glassfish.jersey.media - jersey-media-json-jackson - compile - - - - com.fasterxml.jackson.core - jackson-core - ${jackson.version} - compile - - - - com.fasterxml.jackson.core - jackson-databind - ${jackson.version} - compile - - - - com.fasterxml.jackson.core - jackson-annotations - ${jackson.version} - compile - - - - - org.apache.httpcomponents - httpclient - ${httpclient.version} - compile - - - - org.apache.httpcomponents - httpcore - ${httpcore.version} - compile - - - - org.apache.httpcomponents - httpmime - - ${httpclient.version} - compile - - - - commons-logging - commons-logging - 1.2.1-SNAPSHOT - compile - - - - commons-codec - commons-codec - 2.0-SNAPSHOT - compile - - - - - javax.servlet - servlet-api - provided - - - - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - ${jackson.version} - compile - - - - - org.eclipse.jetty - jetty-proxy - ${jetty.version} - compile - + com.fasterxml.jackson.core + jackson-core + ${jackson.version} + compile + - - org.eclipse.jetty - jetty-servlets - ${jetty.servlets.version} - compile - - - - - com.google.guava - guava - ${guava.version} - compile - - - - - com.jcabi - jcabi-aspects - compile - - - org.aspectj - aspectjrt - ${aspectjrt.version} - compile - - - org.apache.commons - commons-lang3 - ${lang3.version} - compile - - - - - org.openecomp.ecompsdkos - ecompFW - ${ecomp.version} - compile - - - com.att.nsa - cambriaClient - - - slf4j-log4j12 - org.slf4j - - - - - - - org.glassfish.jersey.test-framework.providers - jersey-test-framework-provider-bundle - pom - test - - - - org.eclipse.jetty - jetty-servlet - test - + + com.fasterxml.jackson.core + jackson-databind + ${jackson.version} + compile + - - org.eclipse.jetty - jetty-webapp - test - + + com.fasterxml.jackson.core + jackson-annotations + ${jackson.annotations.version} + compile + - - org.mockito - mockito-all - 1.10.19 - test - + + + org.apache.httpcomponents + httpclient + ${httpclient.version} + compile + - - org.springframework - spring-test - ${spring.version} - test - - + + org.apache.httpcomponents + httpcore + ${httpcore.version} + compile + + + org.apache.httpcomponents + httpmime + ${httpclient.version} + + compile + + + commons-logging + commons-logging + ${commons-logging} + compile + + + commons-codec + commons-codec + ${commons-codec} + compile + + + + javax.servlet + servlet-api + ${servlet-api.version} + provided + - + + + com.fasterxml.jackson.dataformat + jackson-dataformat-yaml + ${jackson.version} + compile + - ${project.artifactId}-${project.version} + + + org.eclipse.jetty + jetty-proxy + ${jetty.version} + compile + - - + + org.eclipse.jetty + jetty-servlets + ${jetty.version} + provided + + + + + com.google.guava + guava + ${guava.version} + compile + + + + + com.jcabi + jcabi-aspects + ${jcabi.version} + compile + + + org.aspectj + aspectjrt + ${aspectjrt.version} + compile + + + + org.apache.commons + commons-lang3 + ${lang3.version} + compile + + + + + org.openecomp.ecompsdkos + ecompFW + ${ecomp.version} + compile + + + com.att.nsa + cambriaClient + + + slf4j-log4j12 + org.slf4j + + + + + + org.fusesource + sigar + ${sigar.version} + compile + + + + + org.glassfish.jersey.test-framework.providers + jersey-test-framework-provider-bundle + ${jersey-bom.version} + pom + test + + + + org.eclipse.jetty + jetty-servlet + ${jetty.version} + test + + + + org.eclipse.jetty + jetty-webapp + ${jetty.version} + test + + + + org.mockito + mockito-all + ${mockito.version} + test + + + + + + + ${project.artifactId}-${project.version} + + org.apache.maven.plugins maven-war-plugin @@ -396,7 +315,7 @@ true - + src/main/resources @@ -405,8 +324,6 @@ - - org.apache.maven.plugins maven-dependency-plugin @@ -439,16 +356,14 @@ ${project.parent.basedir}/sdc-os-chef/sdc-frontend/ - - - org.eclipse.jetty jetty-maven-plugin - 9.0.6.v20130930 + ${jetty.version} + / @@ -463,6 +378,9 @@ org.apache.maven.plugins maven-deploy-plugin 2.7 + + true + @@ -477,36 +395,12 @@ - - - - - org.apache.maven.plugins - maven-assembly-plugin - 2.6 - - ${project.artifactId}-${full.release.version}${build.type} - false - ${project.basedir}/tarball.xml - - - - - assembly-tar-file - package - - single - - - - - + only. It has no influence on the Maven build itself. --> org.eclipse.m2e lifecycle-mapping @@ -514,7 +408,7 @@ - + com.jcabi @@ -528,22 +422,81 @@ - + - + - - - - - - + + + + catalog + + false + + + + + + ${project.artifactId}-${full.release.version} + + + + + + + + org.codehaus.mojo + properties-maven-plugin + 1.0-alpha-2 + + + + false + initialize + + read-project-properties + + + + ${project.parent.build.directory}/FullReleaseVersion.properties + + + + + + + + + + + + Fortify + + false + + + + + + com.fortify.ps.maven.plugin + sca-maven-plugin + 4.30 + + 1.8 + ${project.parent.artifactId} + ${project.parent.artifactId} + + + + + + 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 - /* - -