summaryrefslogtreecommitdiffstats
path: root/sparkybe-onap-application/src
diff options
context:
space:
mode:
Diffstat (limited to 'sparkybe-onap-application/src')
-rw-r--r--sparkybe-onap-application/src/main/java/org/onap/aai/sparky/portal/PortalBean.java33
-rw-r--r--sparkybe-onap-application/src/main/scripts/start.sh5
2 files changed, 28 insertions, 10 deletions
diff --git a/sparkybe-onap-application/src/main/java/org/onap/aai/sparky/portal/PortalBean.java b/sparkybe-onap-application/src/main/java/org/onap/aai/sparky/portal/PortalBean.java
index 86f019e..4443443 100644
--- a/sparkybe-onap-application/src/main/java/org/onap/aai/sparky/portal/PortalBean.java
+++ b/sparkybe-onap-application/src/main/java/org/onap/aai/sparky/portal/PortalBean.java
@@ -3,7 +3,8 @@ package org.onap.aai.sparky.portal;
import javax.servlet.Filter;
import org.onap.aai.sparky.security.filter.LoginFilter;
-import org.openecomp.portalsdk.core.onboarding.crossapi.PortalRestAPIProxy;
+import org.onap.portalsdk.core.onboarding.crossapi.CadiAuthFilter;
+import org.onap.portalsdk.core.onboarding.crossapi.PortalRestAPIProxy;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
@@ -13,27 +14,45 @@ import org.springframework.stereotype.Component;
@Component
@Profile("portal")
public class PortalBean {
-
+
private Filter loginFilter = new LoginFilter();
-
+ private Filter cadiAuthFilter = new CadiAuthFilter();
+
/**
* bind LoginFilter
*/
@Bean
public FilterRegistrationBean loginFilterRegistrationBean() {
FilterRegistrationBean registration = new FilterRegistrationBean();
-
registration.setFilter(loginFilter);
registration.addUrlPatterns("/*");
-
+ registration.setOrder(1);
+
return registration;
}
+ /**
+ * bind CadiAuthFilter
+ */
+ @Bean
+ public FilterRegistrationBean cadiFilterRegistrationBean() {
+ FilterRegistrationBean registration = new FilterRegistrationBean();
+
+ registration.setFilter(cadiAuthFilter);
+ registration.addUrlPatterns("/*");
+ registration.setOrder(0);
+ registration.addInitParameter("cadi_prop_files","/opt/app/sparky/resources/portal/cadi.properties");
+ registration.addInitParameter("inlclude_url_endpoints","/api/v3/*");
+ registration.addInitParameter("exclude_url_endpoints","/api/v2/*");
+
+ return registration;
+ }
+
@Bean
public ServletRegistrationBean portalApiProxy() {
-
+
final ServletRegistrationBean servlet =
- new ServletRegistrationBean(new PortalRestAPIProxy(), "/api/v2/*");
+ new ServletRegistrationBean(new PortalRestAPIProxy(), "/api/v3/*");
servlet.setName("PortalRestApiProxy");
return servlet;
}
diff --git a/sparkybe-onap-application/src/main/scripts/start.sh b/sparkybe-onap-application/src/main/scripts/start.sh
index c16c9b2..8369d6c 100644
--- a/sparkybe-onap-application/src/main/scripts/start.sh
+++ b/sparkybe-onap-application/src/main/scripts/start.sh
@@ -6,12 +6,11 @@ CONFIG_HOME=${APP_HOME}/config
PROPS="-DAPP_HOME=${APP_HOME} -DCONFIG_HOME=${CONFIG_HOME} -Dlogging.config=${CONFIG_HOME}/logging/logback.xml"
set -x
-jar ufv ${APP_HOME}/lib/sparkybe-onap-application*.jar -C ${CONFIG_HOME}/portal/ BOOT-INF/classes/portal.properties
+jar ufv ${APP_HOME}/lib/sparkybe-onap-application*.jar -C ${CONFIG_HOME}/portal/ BOOT-INF/classes/portal.properties -C ${CONFIG_HOME}/portal/ BOOT-INF/classes/key.properties
#
# change the working directory so that Spring-Boot will pick up the config folder from the right path
#
cd $APP_HOME
-java -Xms1024m -Xmx4096m $PROPS -jar ${APP_HOME}/lib/sparkybe-onap-application*.jar
-
+java -Xms1024m -Xmx4096m $PROPS -jar ${APP_HOME}/lib/sparkybe-onap-application*.jar \ No newline at end of file