X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ecomp-portal-BE-os%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fportalapp%2Fconf%2FExternalAppConfig.java;h=2bf10e430eafc026b5eddb27a8067fbf2e69762e;hb=6d6508031238b16d153d76b0f68ad7f27d90012c;hp=0bdcaebdbc097e3bad6ed5000ffd082ddc1fb0e3;hpb=bff4c07121e2ab171870a2ba5eabc27e2f4876af;p=portal.git diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/conf/ExternalAppConfig.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/conf/ExternalAppConfig.java index 0bdcaebd..2bf10e43 100644 --- a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/conf/ExternalAppConfig.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/conf/ExternalAppConfig.java @@ -3,6 +3,8 @@ * ONAP Portal * =================================================================== * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * + * Modifications Copyright © 2018 IBM. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed @@ -33,7 +35,7 @@ * * ============LICENSE_END============================================ * - * ECOMP is a trademark and service mark of AT&T Intellectual Property. + * */ package org.onap.portalapp.conf; @@ -61,6 +63,7 @@ import org.onap.portalapp.authentication.OpenIdConnectLoginStrategy; import org.onap.portalapp.authentication.SimpleLoginStrategy; import org.onap.portalapp.controller.core.LogoutController; import org.onap.portalapp.controller.core.SDKLoginController; +import org.onap.portalapp.music.conf.MusicSessionConfig; import org.onap.portalapp.portal.domain.EPApp; import org.onap.portalapp.portal.domain.EPUser; import org.onap.portalapp.portal.domain.EPUserApp; @@ -73,7 +76,6 @@ import org.onap.portalapp.portal.service.ExternalAccessRolesService; import org.onap.portalapp.portal.service.UserRolesService; import org.onap.portalapp.portal.transport.ExternalAuthUserRole; import org.onap.portalapp.portal.transport.ExternalRoleDescription; -import org.onap.portalapp.portal.ueb.EPUebHelper; import org.onap.portalapp.portal.utils.EPCommonSystemProperties; import org.onap.portalapp.portal.utils.EPSystemProperties; import org.onap.portalapp.scheduler.RegistryAdapter; @@ -100,6 +102,7 @@ import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan.Filter; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.FilterType; +import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Profile; import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableScheduling; @@ -119,7 +122,7 @@ import com.google.gson.Gson; @Profile("src") @EnableAsync @EnableScheduling - +@Import({ MusicSessionConfig.class }) public class ExternalAppConfig extends AppConfig implements Configurable { private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ExternalAppConfig.class); @@ -160,20 +163,16 @@ public class ExternalAppConfig extends AppConfig implements Configurable { MDC.put(MDC_SERVICE_INSTANCE_ID, ""); MDC.put(MDC_ALERT_SEVERITY, AlarmSeverityEnum.INFORMATIONAL.severity()); MDC.put(MDC_INSTANCE_UUID, SystemProperties.getProperty(SystemProperties.INSTANCE_UUID)); - if("true".equalsIgnoreCase(remotecentralizedsystemaccess)){ - importFromExternalAuth(); - } + + if("true".equalsIgnoreCase(remotecentralizedsystemaccess)){ + importFromExternalAuth(); + } } catch (Exception e) { logger.error(EELFLoggerDelegate.errorLogger, "init failed", e); } } - /** - * Does a sync on functions, roles and role functions based on namespace - * for all the centralized applications between AAF and ONAP, updates - * fn_user and fn_user_role with user information from AAF. - * - */ + private void importFromExternalAuth() throws Exception { JSONArray aafAppRoles = new JSONArray(); JSONArray aafUserList = new JSONArray(); @@ -190,8 +189,8 @@ public class ExternalAppConfig extends AppConfig implements Configurable { for(int j = 0; j < aafAppRoles.length(); j++){ ObjectMapper mapper = new ObjectMapper(); String name = aafAppRoles.getJSONObject(j).getString("name"); - String desc = aafAppRoles.getJSONObject(j).getString("description"); - ExternalRoleDescription externalRoleDescription = mapper.readValue(desc, ExternalRoleDescription.class); +// String desc = aafAppRoles.getJSONObject(j).getString("description"); +// ExternalRoleDescription externalRoleDescription = mapper.readValue(desc, ExternalRoleDescription.class); aafUserList = externalAccessRolesService.getAllUsersByRole(name); if(aafUserList != null && aafUserList.length() > 0){ for(int k = 0; k < aafUserList.length(); k++){ @@ -284,7 +283,7 @@ public class ExternalAppConfig extends AppConfig implements Configurable { registry.addInterceptor(sessionTimeoutInterceptor()).excludePathPatterns("/oid-login", "/portalApi/healthCheck", "/portalApi/healthCheck/", "/portalApi/healthCheckSuspend", "/portalApi/healthCheckSuspend/", "/portalApi/healthCheckResume", "/portalApi/healthCheckResume/", "/login_external", - "/login_external.htm*", "login", "/login.htm*", "/auxapi/*", "/context/*", "/api*", + "/login_external.htm*", "login", "/login.htm*", "/auxapi/**/*", "/context/*", "/api*", "/single_signon.htm", "/single_signon", "/dashboard", "/OpenSourceLogin.htm"); registry.addInterceptor(portalResourceInterceptor()); @@ -298,7 +297,8 @@ public class ExternalAppConfig extends AppConfig implements Configurable { * @return New instance of {@link SchedulerFactoryBean} */ - @Bean + /* + @Bean public EPUebHelper epUebHelper() { return new EPUebHelper(); } @@ -307,6 +307,8 @@ public class ExternalAppConfig extends AppConfig implements Configurable { public HealthMonitor healthMonitor() { return new HealthMonitor(); } + */ + /** * Creates and returns a new instance of a {@link MainUebHandler}.