diff options
Diffstat (limited to 'ecomp-portal-BE-os')
7 files changed, 91 insertions, 48 deletions
diff --git a/ecomp-portal-BE-os/README.md b/ecomp-portal-BE-os/README.md index 6ca4b1ed..06f9ae3d 100644 --- a/ecomp-portal-BE-os/README.md +++ b/ecomp-portal-BE-os/README.md @@ -15,6 +15,7 @@ https://www.eclipse.org/m2e-wtp/ ## Release Notes Version 2.2 +- [PORTAL-179] wrong menu available to App Admin User - [PORTAL-207] Raise 4 % percentage (from 44 to 48) sonar code coverage for ONAP PORTAL - [PORTAL-136] Raise JUnit test coverage ONAP Portal to 50% for Beijing - [PORTAL-133] replace ECOMP to ONAP on Contact Us and Get Access page diff --git a/ecomp-portal-BE-os/pom.xml b/ecomp-portal-BE-os/pom.xml index 41722611..ed42c061 100644 --- a/ecomp-portal-BE-os/pom.xml +++ b/ecomp-portal-BE-os/pom.xml @@ -318,17 +318,17 @@ <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-annotations</artifactId> - <version>2.9.2</version> + <version>2.8.10</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> - <version>2.9.2</version> + <version>2.8.10</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> - <version>2.9.2</version> + <version>2.8.10</version> </dependency> <dependency> <groupId>com.fasterxml</groupId> @@ -346,6 +346,12 @@ <groupId>org.elasticsearch</groupId> <artifactId>elasticsearch</artifactId> <version>2.2.0</version> + <exclusions> + <exclusion> + <groupId>org.apache.lucene</groupId> + <artifactId>lucene-queryparser</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>io.searchbox</groupId> @@ -380,7 +386,7 @@ <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> - <version>3.17</version> + <version>3.15</version> <exclusions> <exclusion> <groupId>commons-logging</groupId> @@ -395,7 +401,7 @@ <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> - <version>3.17</version> + <version>3.15</version> <exclusions> <exclusion> <groupId>commons-logging</groupId> @@ -570,7 +576,7 @@ <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> - <version>4.5.2</version> + <version>4.5.3</version> </dependency> <!-- for testing --> <dependency> @@ -603,7 +609,7 @@ <dependency> <groupId>commons-beanutils</groupId> <artifactId>commons-beanutils</artifactId> - <version>1.9.2</version> + <version>1.9.3</version> </dependency> <!-- OpenID Connect Dependencies --> <dependency> @@ -645,6 +651,19 @@ <version>${jacocoVersion}</version> <classifier>runtime</classifier> </dependency> + <!-- Music --> + <dependency> + <groupId>org.onap.portal.sdk</groupId> + <artifactId>epsdk-music</artifactId> + <version>${epsdk.version}</version> + <classifier>jar-with-dependencies</classifier> + <exclusions> + <exclusion> + <groupId>org.onap.music</groupId> + <artifactId>*</artifactId> + </exclusion> + </exclusions> + </dependency> </dependencies> <reporting> 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 06657301..c3fdf0a9 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 @@ -61,6 +61,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; @@ -100,6 +101,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,24 +121,24 @@ 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); @Autowired private DataAccessService dataAccessService; - + @Autowired private UserRolesService userRolesService; - + @Autowired private ExternalAccessRolesService externalAccessRolesService; private RegistryAdapter schedulerRegistryAdapter; - String UEB_APP_KEY = PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_KEY); - + String uebAppKey = PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_KEY); + public ViewResolver viewResolver() { return super.viewResolver(); } @@ -160,14 +162,14 @@ 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(remotecentralizedsystemaccess.equalsIgnoreCase("true")){ + 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 @@ -180,7 +182,7 @@ public class ExternalAppConfig extends AppConfig implements Configurable { List<EPApp> appList; //to get all centralized apps List<EPApp> centralizedAppList = dataAccessService.executeNamedQuery("getCentralizedApps", null, null); - if(centralizedAppList != null && centralizedAppList.size() > 0){ + if(centralizedAppList != null && !centralizedAppList.isEmpty()){ for(int i = 0; i < centralizedAppList.size(); i++){ //syncRoles(does a sync on functions, roles and role functions) externalAccessRolesService.syncApplicationRolesWithEcompDB(centralizedAppList.get(i)); @@ -197,7 +199,7 @@ public class ExternalAppConfig extends AppConfig implements Configurable { for(int k = 0; k < aafUserList.length(); k++){ EPUser user = null; List<EPUser> usersList = null; - List<EPUserApp> userRolesList = new ArrayList<EPUserApp>(); + List<EPUserApp> userRolesList = new ArrayList<>(); JSONObject userRole = (JSONObject) aafUserList.get(k); Gson gson = new Gson(); ExternalAuthUserRole userRoleObj = gson.fromJson(userRole.toString(), ExternalAuthUserRole.class); @@ -208,36 +210,32 @@ public class ExternalAppConfig extends AppConfig implements Configurable { Map<String, String> orgUserId = new HashMap<>(); orgUserId.put("orgUserIdValue", userRoleObj.getUser()); usersList = dataAccessService.executeNamedQuery("epUserAppId", orgUserId, null); - if(usersList != null && usersList.size() > 0){ + if(usersList != null && !usersList.isEmpty()){ user = usersList.get(0); } if(user == null){ // add user to fn_user(needs to be revisited after getting user info from AAF PORTAL-172) } - //for each role and user in that role, check if user exists in fn_user_role. If not, add - /*userRolesList = userRolesService.getUserRolesList(centralizedAppList.get(0).getId(), user.getId(), Long.valueOf(externalRoleDescription.getId())); - if(userRolesList == null || userRolesList.isEmpty()){ - // add userRole to fn_user_role(needs to be revisited after getting user info from AAF PORTAL-172) - }*/ } } - + } } } } } - + public DataAccessService dataAccessService() { return super.dataAccessService(); } + @Override public String[] tileDefinitions() { return super.tileDefinitions(); } public List<String> addTileDefinitions() { - List<String> definitions = new ArrayList<String>(); + List<String> definitions = new ArrayList<>(); definitions.add("/WEB-INF/defs/definitions.xml"); return definitions; } @@ -264,7 +262,7 @@ public class ExternalAppConfig extends AppConfig implements Configurable { @Bean public org.onap.portalsdk.core.auth.LoginStrategy coreLoginStrategy() { - if (SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM).trim().equalsIgnoreCase("OIDC")) + if ("OIDC".equalsIgnoreCase(SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM).trim())) return new OpenIdConnectLoginStrategy(); else return new SimpleLoginStrategy(); @@ -273,7 +271,7 @@ public class ExternalAppConfig extends AppConfig implements Configurable { @Bean public LoginStrategy loginStrategy() { - if (SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM).trim().equalsIgnoreCase("OIDC")) + if ("OIDC".equalsIgnoreCase(SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM).trim())) return new OpenIdConnectLoginStrategy(); else return new SimpleLoginStrategy(); @@ -285,13 +283,6 @@ public class ExternalAppConfig extends AppConfig implements Configurable { @Override public void addInterceptors(InterceptorRegistry registry) { - // registry.addInterceptor(new - // StaticResourcesInterceptor()).addPathPatterns("/index.htm", - // "/applicationsHome", "/widgetsHome", "/admins", "/users", - // "/applications", "/widgets"); - // Excludes login/logout pages and REST endpoints used by other - // application servers. - registry.addInterceptor(sessionTimeoutInterceptor()).excludePathPatterns("/oid-login", "/portalApi/healthCheck", "/portalApi/healthCheck/", "/portalApi/healthCheckSuspend", "/portalApi/healthCheckSuspend/", "/portalApi/healthCheckResume", "/portalApi/healthCheckResume/", "/login_external", diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/conf/ExternalAppInitializer.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/conf/ExternalAppInitializer.java index 62051b1d..1c3c5ceb 100644 --- a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/conf/ExternalAppInitializer.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/conf/ExternalAppInitializer.java @@ -51,11 +51,7 @@ public class ExternalAppInitializer extends AppInitializer{ @Override protected Class<?>[] getServletConfigClasses() { -// Class<?>[] configClasses = super.getServletConfigClasses(); -// Class<?>[] additionalConfigClasses = Arrays.copyOf(configClasses, configClasses.length); -// addConfigClass(additionalConfigClasses, ExternalAppConfig.class); -// return additionalConfigClasses; -// + return new Class[] {ExternalAppConfig.class}; } diff --git a/ecomp-portal-BE-os/src/main/resources/cache.ccf b/ecomp-portal-BE-os/src/main/resources/cache.ccf index d21404b0..5c1296ae 100644 --- a/ecomp-portal-BE-os/src/main/resources/cache.ccf +++ b/ecomp-portal-BE-os/src/main/resources/cache.ccf @@ -1,9 +1,9 @@ # DEFAULT CACHE REGION jcs.default=DC -jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes +jcs.default.cacheattributes=org.apache.commons.jcs.engine.CompositeCacheAttributes jcs.default.cacheattributes.MaxObjects=1000 -jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache -jcs.default.elementattributes=org.apache.jcs.engine.ElementAttributes +jcs.default.cacheattributes.MemoryCacheName=org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache +jcs.default.elementattributes=org.apache.commons.jcs.engine.ElementAttributes jcs.default.elementattributes.IsEternal=true jcs.default.elementattributes.IsSpool=true @@ -13,18 +13,18 @@ jcs.default.elementattributes.IsSpool=true #jcs.default.cacheattributes.MaxMemoryIdleTimeSeconds=3600 #jcs.default.cacheattributes.ShrinkerIntervalSeconds=60 #jcs.default.cacheattributes.MaxSpoolPerRun=500 -#jcs.default.elementattributes=org.apache.jcs.engine.ElementAttributes +#jcs.default.elementattributes=org.apache.commons.jcs.engine.ElementAttributes #jcs.default.elementattributes.IsEternal=false # AUXILLARY CACHE CONFIGURATION -jcs.auxiliary.DC=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory -jcs.auxiliary.DC.attributes=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes +jcs.auxiliary.DC=org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory +jcs.auxiliary.DC.attributes=org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes jcs.auxiliary.DC.attributes.DiskPath=/tmp # PRE-DEFINED REGION FOR LOOKUP DATA jcs.region.lookUpObjectCache=DC -jcs.region.lookUpObjectCache.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes +jcs.region.lookUpObjectCache.cacheattributes=org.apache.commons.jcs.engine.CompositeCacheAttributes jcs.region.lookUpObjectCache.cacheattributes.MaxObjects=4000 -jcs.region.lookUpObjectCache.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache +jcs.region.lookUpObjectCache.cacheattributes.MemoryCacheName=org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache diff --git a/ecomp-portal-BE-os/src/main/resources/music.properties b/ecomp-portal-BE-os/src/main/resources/music.properties new file mode 100644 index 00000000..22d0a02d --- /dev/null +++ b/ecomp-portal-BE-os/src/main/resources/music.properties @@ -0,0 +1,27 @@ +music.endpoint = http://vm-ep-dev4.research.att.com/MUSIC/rest/ +music.version = v2 +music.keyspace = keyspaces +music.session.keyspace = test_session +music.tables = tables +music.session.attr.tables = spring_session_attributes +music.session.meta.tables = spring_session +music.rows = rows +music.sesion.rows = +music.x.minor.version = 3 +music.x.patch.version = 0 +music.aid = +music.ns = com.att.ecomp.portal.demeter +music.user.id = m00468@portal.ecomp.att.com +music.password = friedG33nS- +music.consistency.info = type +music.consistency.info.value = eventual +music.cache = false +music.session.max.inactive.interval.seconds = 1800 +#By default it's eventual +music.atomic.get = false +music.atomic.put = true + +cassandra.host=135.197.226.103 +zookeeper.host=135.197.226.103 +cassandra.user=cassandra +cassandra.password=cassandra
\ No newline at end of file diff --git a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/web.xml b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/web.xml index ee60d326..d31739f7 100644 --- a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/web.xml +++ b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/web.xml @@ -69,7 +69,16 @@ <listener> <listener-class>org.onap.portalapp.portal.listener.UserSessionListener</listener-class> </listener> - + <filter> + <filter-name>springSessionRepositoryFilter</filter-name> + <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> + </filter> + <filter-mapping> + <filter-name>springSessionRepositoryFilter</filter-name> + <url-pattern>/*</url-pattern> + <dispatcher>REQUEST</dispatcher> + <dispatcher>ERROR</dispatcher> + </filter-mapping> <filter> <filter-name>CorsFilter</filter-name> <filter-class>org.apache.catalina.filters.CorsFilter</filter-class> |