X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=webapp-backend%2Fsrc%2Fmain%2Fjava%2Forg%2Foransc%2Fric%2Fportal%2Fdashboard%2Fconfig%2FWebSecurityConfiguration.java;h=f4819d307d79863b0173685d054217c0b14d57d6;hb=6dd828008e1c553b5b4ac6e45af0ccf73c2ed92e;hp=33458badaf3d2d1eefd034586c6c0f6460d61911;hpb=50fb3b40ec45a65ba7c687e290a3d7f491484b49;p=portal%2Fric-dashboard.git diff --git a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/WebSecurityConfiguration.java b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/WebSecurityConfiguration.java index 33458bad..f4819d30 100644 --- a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/WebSecurityConfiguration.java +++ b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/WebSecurityConfiguration.java @@ -19,7 +19,6 @@ */ package org.oransc.ric.portal.dashboard.config; -import java.io.IOException; import java.lang.invoke.MethodHandles; import java.lang.reflect.InvocationTargetException; @@ -27,7 +26,6 @@ import org.onap.portalsdk.core.onboarding.util.PortalApiConstants; import org.oransc.ric.portal.dashboard.DashboardUserManager; import org.oransc.ric.portal.dashboard.controller.A1MediatorController; import org.oransc.ric.portal.dashboard.controller.AdminController; -import org.oransc.ric.portal.dashboard.controller.AnrXappController; import org.oransc.ric.portal.dashboard.controller.AppManagerController; import org.oransc.ric.portal.dashboard.controller.E2ManagerController; import org.oransc.ric.portal.dashboard.controller.SimpleErrorController; @@ -74,6 +72,7 @@ public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter { @Autowired DashboardUserManager userManager; + @Override protected void configure(HttpSecurity http) throws Exception { logger.debug("configure: portalapi.username {}", userName); // A chain of ".and()" always baffles me @@ -87,7 +86,7 @@ public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter { * Resource paths that do not require authentication, especially including * Swagger-generated documentation. */ - public static final String[] OPEN_PATHS = { // + protected static final String[] OPEN_PATHS = { // "/v2/api-docs", // "/swagger-resources/**", // "/swagger-ui.html", // @@ -96,9 +95,6 @@ public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter { A1MediatorController.CONTROLLER_PATH + "/" + A1MediatorController.VERSION_METHOD, // AdminController.CONTROLLER_PATH + "/" + AdminController.HEALTH_METHOD, // AdminController.CONTROLLER_PATH + "/" + AdminController.VERSION_METHOD, // - AnrXappController.CONTROLLER_PATH + "/" + AnrXappController.HEALTH_ALIVE_METHOD, // - AnrXappController.CONTROLLER_PATH + "/" + AnrXappController.HEALTH_READY_METHOD, // - AnrXappController.CONTROLLER_PATH + "/" + AnrXappController.VERSION_METHOD, // AppManagerController.CONTROLLER_PATH + "/" + AppManagerController.HEALTH_ALIVE_METHOD, // AppManagerController.CONTROLLER_PATH + "/" + AppManagerController.HEALTH_READY_METHOD, // AppManagerController.CONTROLLER_PATH + "/" + AppManagerController.VERSION_METHOD, // @@ -113,9 +109,8 @@ public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter { } @Bean - public PortalAuthManager portalAuthManagerBean() - throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException, - IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException { + public PortalAuthManager portalAuthManagerBean() throws ClassNotFoundException, IllegalAccessException, + InstantiationException, InvocationTargetException, NoSuchMethodException { return new PortalAuthManager(appName, userName, password, decryptor, userCookie); } @@ -128,12 +123,9 @@ public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter { * bypass this filter, which seems to me means the filter participates * correctly. */ - public PortalAuthenticationFilter portalAuthenticationFilterBean() - throws ClassNotFoundException, InstantiationException, IllegalAccessException, IOException, - IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException { - PortalAuthenticationFilter portalAuthenticationFilter = new PortalAuthenticationFilter(portalapiSecurity, - portalAuthManagerBean(), this.userManager); - return portalAuthenticationFilter; + public PortalAuthenticationFilter portalAuthenticationFilterBean() throws ClassNotFoundException, + IllegalAccessException, InstantiationException, InvocationTargetException, NoSuchMethodException { + return new PortalAuthenticationFilter(portalapiSecurity, portalAuthManagerBean(), this.userManager); } }