summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-app-os
diff options
context:
space:
mode:
authorLo, WEI-TING(wl849v) <wl849v@att.com>2018-03-19 17:37:22 -0400
committerLo, WEI-TING(wl849v) <wl849v@att.com>2018-03-19 17:37:22 -0400
commita932df953215fa4fe25d0dee962291eaa64d1846 (patch)
tree5106087e4723b93d6d3690ad37f560f6a7257e31 /ecomp-sdk/epsdk-app-os
parentdcdf1bb1838de59e16c63ab37b29fb913efe2f69 (diff)
Effort to make portal resilient
Issue-ID: PORTAL-210 Includes music library that contatins session management Change-Id: Icacab904e1f948068348fcc19cd77965cb5b446e Signed-off-by: Lo, WEI-TING(wl849v) <wl849v@att.com>
Diffstat (limited to 'ecomp-sdk/epsdk-app-os')
-rw-r--r--ecomp-sdk/epsdk-app-os/pom.xml13
-rw-r--r--ecomp-sdk/epsdk-app-os/src/main/java/org/onap/portalapp/conf/ExternalAppConfig.java2
-rw-r--r--ecomp-sdk/epsdk-app-os/src/main/java/org/onap/portalapp/filter/SecurityXssFilter.java20
-rw-r--r--ecomp-sdk/epsdk-app-os/src/main/resources/music.properties24
-rw-r--r--ecomp-sdk/epsdk-app-os/src/main/webapp/WEB-INF/web.xml10
5 files changed, 66 insertions, 3 deletions
diff --git a/ecomp-sdk/epsdk-app-os/pom.xml b/ecomp-sdk/epsdk-app-os/pom.xml
index 49298d6a..496f3e3e 100644
--- a/ecomp-sdk/epsdk-app-os/pom.xml
+++ b/ecomp-sdk/epsdk-app-os/pom.xml
@@ -243,6 +243,12 @@
<artifactId>epsdk-workflow</artifactId>
<version>${epsdk.version}</version>
</dependency>
+ <!-- Music -->
+ <dependency>
+ <groupId>org.onap.portal.sdk</groupId>
+ <artifactId>epsdk-music</artifactId>
+ <version>${epsdk.version}</version>
+ </dependency>
<dependency>
<groupId>com.att.eelf</groupId>
<artifactId>eelf-core</artifactId>
@@ -252,17 +258,17 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
- <version>2.9.2</version>
+ <version>2.8.10</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
- <version>2.9.2</version>
+ <version>2.8.10</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
- <version>2.9.2</version>
+ <version>2.8.10</version>
</dependency>
<dependency>
<groupId>com.mchange</groupId>
@@ -362,5 +368,6 @@
<version>${jacoco.version}</version>
<classifier>runtime</classifier>
</dependency>
+
</dependencies>
</project>
diff --git a/ecomp-sdk/epsdk-app-os/src/main/java/org/onap/portalapp/conf/ExternalAppConfig.java b/ecomp-sdk/epsdk-app-os/src/main/java/org/onap/portalapp/conf/ExternalAppConfig.java
index 6f3e8f28..9c777b9e 100644
--- a/ecomp-sdk/epsdk-app-os/src/main/java/org/onap/portalapp/conf/ExternalAppConfig.java
+++ b/ecomp-sdk/epsdk-app-os/src/main/java/org/onap/portalapp/conf/ExternalAppConfig.java
@@ -41,6 +41,7 @@ import java.util.ArrayList;
import java.util.List;
import org.onap.portalapp.login.LoginStrategyImpl;
+import org.onap.portalapp.music.conf.MusicSessionConfig;
import org.onap.portalapp.scheduler.RegistryAdapter;
import org.onap.portalsdk.core.auth.LoginStrategy;
import org.onap.portalsdk.core.conf.AppConfig;
@@ -75,6 +76,7 @@ import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
@Profile("src")
@EnableAsync
@EnableScheduling
+@Import({ MusicSessionConfig.class })
public class ExternalAppConfig extends AppConfig implements Configurable {
private RegistryAdapter schedulerRegistryAdapter;
diff --git a/ecomp-sdk/epsdk-app-os/src/main/java/org/onap/portalapp/filter/SecurityXssFilter.java b/ecomp-sdk/epsdk-app-os/src/main/java/org/onap/portalapp/filter/SecurityXssFilter.java
index aad01286..0a1f340d 100644
--- a/ecomp-sdk/epsdk-app-os/src/main/java/org/onap/portalapp/filter/SecurityXssFilter.java
+++ b/ecomp-sdk/epsdk-app-os/src/main/java/org/onap/portalapp/filter/SecurityXssFilter.java
@@ -44,6 +44,9 @@ import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
import javax.servlet.FilterChain;
import javax.servlet.ReadListener;
@@ -74,8 +77,25 @@ public class SecurityXssFilter extends OncePerRequestFilter {
private ByteArrayOutputStream cachedBytes;
+ private Map parameter = new HashMap();
+
+ @SuppressWarnings("unchecked")
public RequestWrapper(HttpServletRequest request) {
super(request);
+ Enumeration<String> parameterNames = request.getParameterNames();
+ while (parameterNames.hasMoreElements()) {
+ String paramName = parameterNames.nextElement();
+ String paramValue = request.getParameter(paramName);
+ parameter.put(paramName,paramValue);
+ }
+ }
+
+ @Override
+ public String getParameter(String name) {
+ if (parameter != null) {
+ return (String) parameter.get(name);
+ }
+ return null;
}
@Override
diff --git a/ecomp-sdk/epsdk-app-os/src/main/resources/music.properties b/ecomp-sdk/epsdk-app-os/src/main/resources/music.properties
new file mode 100644
index 00000000..635ccb50
--- /dev/null
+++ b/ecomp-sdk/epsdk-app-os/src/main/resources/music.properties
@@ -0,0 +1,24 @@
+music.endpoint = http://vm-ep-dev4.research.att.com/MUSIC/rest/
+music.version = v2
+music.keyspace = keyspaces
+music.session.keyspace = test_session
+music.session.attr.tables = spring_session_attributes
+music.session.meta.tables = spring_session
+music.x.minor.version = 3
+music.x.patch.version = 0
+music.ns = com.att.ecomp.portal.demeter
+music.user.id = m00468@portal.ecomp.att.com
+music.password = friedG33nS-
+music.consistency.info = type
+music.consistency.info.value = eventual
+music.cache = false
+music.serialize.compress = true
+music.session.max.inactive.interval.seconds = 1800
+#By default it's eventual
+music.atomic.get = false
+music.atomic.put = false
+
+cassandra.host=135.197.226.103
+zookeeper.host=135.197.226.103, 135.197.226.108, 135.197.226.119
+cassandra.user=cassandra
+cassandra.password=cassandra \ No newline at end of file
diff --git a/ecomp-sdk/epsdk-app-os/src/main/webapp/WEB-INF/web.xml b/ecomp-sdk/epsdk-app-os/src/main/webapp/WEB-INF/web.xml
index 76a372be..f621d5c2 100644
--- a/ecomp-sdk/epsdk-app-os/src/main/webapp/WEB-INF/web.xml
+++ b/ecomp-sdk/epsdk-app-os/src/main/webapp/WEB-INF/web.xml
@@ -21,6 +21,16 @@
<filter-name>SecurityXssFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
+ <!-- <filter>
+ <filter-name>springSessionRepositoryFilter</filter-name>
+ <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>springSessionRepositoryFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>ERROR</dispatcher>
+ </filter-mapping> -->
<error-page>
<location>/WEB-INF/jsp/error.jsp</location>
</error-page>