diff options
Diffstat (limited to 'sparkybe-onap-application/src/main/java')
-rw-r--r-- | sparkybe-onap-application/src/main/java/org/onap/aai/sparky/portal/PortalBean.java | 33 |
1 files changed, 26 insertions, 7 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; } |