Add asserts to silence Sonar warnings re tests
[portal/ric-dashboard.git] / webapp-backend / src / main / java / org / oransc / ric / portal / dashboard / config / WebSecurityConfiguration.java
index f4819d3..f1438d7 100644 (file)
@@ -23,6 +23,7 @@ import java.lang.invoke.MethodHandles;
 import java.lang.reflect.InvocationTargetException;
 
 import org.onap.portalsdk.core.onboarding.util.PortalApiConstants;
+import org.oransc.ric.portal.dashboard.DashboardConstants;
 import org.oransc.ric.portal.dashboard.DashboardUserManager;
 import org.oransc.ric.portal.dashboard.controller.A1MediatorController;
 import org.oransc.ric.portal.dashboard.controller.AdminController;
@@ -74,7 +75,7 @@ public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter {
 
        @Override
        protected void configure(HttpSecurity http) throws Exception {
-               logger.debug("configure: portalapi.username {}", userName);
+               logger.debug("configure: portalapi.appName {}", appName);
                // A chain of ".and()" always baffles me
                http.authorizeRequests().anyRequest().authenticated();
                http.headers().frameOptions().disable();
@@ -83,7 +84,7 @@ public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter {
        }
 
        /**
-        * Resource paths that do not require authentication, especially including
+        * Resource paths that do not require authentication, including
         * Swagger-generated documentation.
         */
        protected static final String[] OPEN_PATHS = { //
@@ -92,14 +93,17 @@ public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter {
                        "/swagger-ui.html", //
                        "/webjars/**", //
                        PortalApiConstants.API_PREFIX + "/**", //
-                       A1MediatorController.CONTROLLER_PATH + "/" + A1MediatorController.VERSION_METHOD, //
+                       A1MediatorController.CONTROLLER_PATH + "/" + DashboardConstants.VERSION_METHOD, //
                        AdminController.CONTROLLER_PATH + "/" + AdminController.HEALTH_METHOD, //
                        AdminController.CONTROLLER_PATH + "/" + AdminController.VERSION_METHOD, //
-                       AppManagerController.CONTROLLER_PATH + "/" + AppManagerController.HEALTH_ALIVE_METHOD, //
-                       AppManagerController.CONTROLLER_PATH + "/" + AppManagerController.HEALTH_READY_METHOD, //
-                       AppManagerController.CONTROLLER_PATH + "/" + AppManagerController.VERSION_METHOD, //
-                       E2ManagerController.CONTROLLER_PATH + "/" + E2ManagerController.HEALTH_METHOD, //
-                       E2ManagerController.CONTROLLER_PATH + "/" + E2ManagerController.VERSION_METHOD, //
+                       AppManagerController.CONTROLLER_PATH + "/" + DashboardConstants.RIC_INSTANCE_KEY + "/*/"
+                                       + AppManagerController.HEALTH_ALIVE_METHOD, //
+                       AppManagerController.CONTROLLER_PATH + "/" + DashboardConstants.RIC_INSTANCE_KEY + "/*/"
+                                       + AppManagerController.HEALTH_READY_METHOD, //
+                       AppManagerController.CONTROLLER_PATH + "/" + DashboardConstants.VERSION_METHOD, //
+                       E2ManagerController.CONTROLLER_PATH + "/" + DashboardConstants.RIC_INSTANCE_KEY + "/*/"
+                                       + E2ManagerController.HEALTH_METHOD, //
+                       E2ManagerController.CONTROLLER_PATH + "/" + DashboardConstants.VERSION_METHOD, //
                        SimpleErrorController.ERROR_PATH };
 
        @Override
@@ -111,6 +115,7 @@ public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter {
        @Bean
        public PortalAuthManager portalAuthManagerBean() throws ClassNotFoundException, IllegalAccessException,
                        InstantiationException, InvocationTargetException, NoSuchMethodException {
+               logger.debug("portalAuthManagerBean");
                return new PortalAuthManager(appName, userName, password, decryptor, userCookie);
        }
 
@@ -125,6 +130,7 @@ public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter {
         */
        public PortalAuthenticationFilter portalAuthenticationFilterBean() throws ClassNotFoundException,
                        IllegalAccessException, InstantiationException, InvocationTargetException, NoSuchMethodException {
+               logger.debug("portalAuthenticationFilterBean");
                return new PortalAuthenticationFilter(portalapiSecurity, portalAuthManagerBean(), this.userManager);
        }