summaryrefslogtreecommitdiffstats
path: root/sparkybe-onap-application/src/main
diff options
context:
space:
mode:
authorrv871f <richard.vondadelszen@amdocs.com>2018-03-29 11:38:04 -0400
committerrv871f <richard.vondadelszen@amdocs.com>2018-03-29 11:38:30 -0400
commit439e16586f6a1b05a892cada09e7b48cb322878c (patch)
tree7a2caa507265c1471e2d1241e7591f177a8f8233 /sparkybe-onap-application/src/main
parentb505658d523507b2aa8eec564b599ce1e2b1956a (diff)
Portal Login Filter reintegration
Issue-ID: AAI-599 Change-Id: I119608a418a07546cd58d4fcbdf93f033c8fbd88 Signed-off-by: rv871f <richard.vondadelszen@amdocs.com>
Diffstat (limited to 'sparkybe-onap-application/src/main')
-rw-r--r--sparkybe-onap-application/src/main/java/org/onap/aai/sparky/Application.java44
-rw-r--r--sparkybe-onap-application/src/main/scripts/start.sh3
2 files changed, 26 insertions, 21 deletions
diff --git a/sparkybe-onap-application/src/main/java/org/onap/aai/sparky/Application.java b/sparkybe-onap-application/src/main/java/org/onap/aai/sparky/Application.java
index 693617b..1077642 100644
--- a/sparkybe-onap-application/src/main/java/org/onap/aai/sparky/Application.java
+++ b/sparkybe-onap-application/src/main/java/org/onap/aai/sparky/Application.java
@@ -20,25 +20,30 @@
*/
package org.onap.aai.sparky;
+import javax.servlet.Filter;
+
+import org.onap.aai.sparky.security.filter.LoginFilter;
+
import org.apache.camel.component.servlet.CamelHttpTransportServlet;
import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
+import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
@SpringBootApplication
public class Application {
-
- public static void main(String[] args) {
- SpringApplication.run(Application.class, args);
+ private Filter loginFilter = new LoginFilter();
+ public static void main(String[] args) {
+ SpringApplication.run(Application.class, args);
}
-
+
/*
* This initialization code enabled access to aai-ui-proxy-processor
*/
-
@Bean
ServletRegistrationBean servletRegistrationBean() {
final ServletRegistrationBean servlet =
@@ -48,20 +53,19 @@ public class Application {
}
/**
- * bind LoginFilter
+ * bind LoginFilter
*/
-
- /*@Bean
- public FilterRegistrationBean myFilter() {
- FilterRegistrationBean registration = new FilterRegistrationBean();
- Filter myFilter = new LoginFilter();
- beanFactory.autowireBean(myFilter);
- registration.setFilter(myFilter);
- registration.addUrlPatterns("/*");
- return registration;
- }*/
-
-
-
-
+ @Bean
+ @ConditionalOnProperty(value = "sparky.portal.enabled", havingValue = "true")
+ public FilterRegistrationBean loginFilterRegistrationBean() {
+ FilterRegistrationBean registration = new FilterRegistrationBean();
+
+ registration.setFilter(loginFilter);
+ registration.addUrlPatterns("/*");
+
+ return registration;
+ }
+
+
+
}
diff --git a/sparkybe-onap-application/src/main/scripts/start.sh b/sparkybe-onap-application/src/main/scripts/start.sh
index 0db0d37..f2f6f31 100644
--- a/sparkybe-onap-application/src/main/scripts/start.sh
+++ b/sparkybe-onap-application/src/main/scripts/start.sh
@@ -6,5 +6,6 @@ CONFIG_HOME=${APP_HOME}/appconfig
PROPS="-DAPP_HOME=${APP_HOME} -DCONFIG_HOME=${CONFIG_HOME}"
set -x
-java -Xms1024m -Xmx4096m $PROPS -jar ${APP_HOME}/lib/sparkybe-onap-application*.jar --sparky.ssl.enabled=${UI_SSL_ENABLED}
+jar ufv ${APP_HOME}/lib/sparkybe-onap-application*.jar -C ${CONFIG_HOME}/portal/ BOOT-INF/classes/portal.properties
+java -Xms1024m -Xmx4096m $PROPS -jar ${APP_HOME}/lib/sparkybe-onap-application*.jar --sparky.ssl.enabled=${UI_SSL_ENABLED} --sparky.portal.enabled=${UI_PORTAL_ENABLED}