Skip to content

Commit

Permalink
MOSIP-32842 Fixed partner manager startup issue
Browse files Browse the repository at this point in the history
Signed-off-by: kameshsr <[email protected]>
  • Loading branch information
kameshsr committed May 15, 2024
1 parent 92cacf3 commit b020f53
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package io.mosip.pms.config;

/*
* @author Kamesh Shekhar Prasad
*
*/

import io.mosip.kernel.dataaccess.hibernate.config.HibernateDaoConfig;
import io.mosip.kernel.dataaccess.hibernate.repository.impl.HibernateRepositoryImpl;
import io.mosip.pms.device.authdevice.entity.DeviceDetail;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;

import java.util.Map;

@Configuration
@EnableJpaRepositories(entityManagerFactoryRef = "entityManagerFactory",
basePackages = "io.mosip.pms.device.authdevice.repository.*",
repositoryBaseClass = HibernateRepositoryImpl.class)
@EntityScan(basePackageClasses = { DeviceDetail.class })
public class PartnerManagerDataSourceConfig extends HibernateDaoConfig {


public Map<String, Object> jpaProperties() {
return super.jpaProperties();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@

@SpringBootApplication
@Import(value = {WebSubPublisher.class,RestUtil.class,FilterColumnValidator.class,FilterHelper.class,SearchHelper.class,PageUtils.class})
@ComponentScan(basePackages = {"io.mosip.*", "${mosip.auth.adapter.impl.basepackage}"},excludeFilters = {
@ComponentScan(basePackages = {"io.mosip.pms.*","io.mosip.kernel.websub.api.config",
"io.mosip.kernel.templatemanager.velocity.builder", "${mosip.auth.adapter.impl.basepackage}"},excludeFilters = {
@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = AuthorizedRolesDto.class) })
@EnableAutoConfiguration(exclude = { DataSourceAutoConfiguration.class,
DataSourceTransactionManagerAutoConfiguration.class, HibernateJpaAutoConfiguration.class })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ public HttpFirewall defaultHttpFirewall() {
return new DefaultHttpFirewall();
}

// @Override
// public void configure(WebSecurity webSecurity) throws Exception {
// webSecurity.ignoring().antMatchers(allowedEndPoints());
// super.configure(webSecurity);
// webSecurity.httpFirewall(defaultHttpFirewall());
// }

@Bean
protected SecurityFilterChain configureSecurityFilterChain(final HttpSecurity httpSecurity) throws Exception {
httpSecurity.csrf(http -> http.disable());
Expand All @@ -46,14 +39,6 @@ private String[] allowedEndPoints() {
return new String[]{"*", "/swagger-ui.html"};
}

// @Override
// protected void configure(final HttpSecurity httpSecurity) throws Exception {
// httpSecurity.csrf().disable();
// httpSecurity.httpBasic().and().authorizeRequests().anyRequest().authenticated().and().sessionManagement()
// .sessionCreationPolicy(SessionCreationPolicy.STATELESS).and().exceptionHandling()
// .authenticationEntryPoint(unauthorizedEntryPoint());
// }

@Bean
public AuthenticationEntryPoint unauthorizedEntryPoint() {
return (request, response, authException) -> response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import io.mosip.kernel.dataaccess.hibernate.config.HibernateDaoConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import org.springframework.context.annotation.Import;
Expand Down

0 comments on commit b020f53

Please sign in to comment.