sdeleuze
02/09/2018, 4:11 PMaleksandrsl
02/09/2018, 7:44 PMdanny
02/09/2018, 9:17 PMaleksandrsl
02/10/2018, 12:00 PMauthenticationProvider
that depends on userDetailsServiceProvider
@get: Bean
val userDetailsServiceProvider = JdbcDaoImpl().apply { ... }
@get: Bean
val authenticationProvider = DaoAuthenticationProvider().apply {
setUserDetailsService(userDetailsServiceProvider)
}
And it seems that initialization of authenticationProvider
forces userDeatailsServiceProvider
bean creation in constructor
public Security(@Autowired @Qualifier("dataSource") @NotNull DataSource appDataSource) {
Intrinsics.checkParameterIsNotNull(appDataSource, "appDataSource");
super();
// Some lines skipped
DaoAuthenticationProvider var7 = new DaoAuthenticationProvider();
var7.setUserDetailsService((UserDetailsService)this.getUserDetailsServiceProvider()); // This seems to be a problem
this.authenticationProvider = var7;
this.securityEvaluationContextExtensionProvider = new SecurityEvaluationContextExtension();
}
And problem is cured by this change
val authenticationProvider
@Bean get() = DaoAuthenticationProvider().apply {
setUserDetailsService(userDetailsServiceProvider)
}
This way initialization of authenticationProvider
happens later on demand, when class is constructed and BeanFactory
injected.aleksandrsl
02/10/2018, 1:05 PM@get: Bean
val authenticationProvider by lazy {
DaoAuthenticationProvider().apply {
setUserDetailsService(userDetailsServiceProvider)
}
}
mplacona
02/12/2018, 2:15 PMmplacona
02/12/2018, 2:15 PMsdeleuze
02/12/2018, 3:07 PMjackson-module-kotlin
dependency when appropriate https://github.com/spring-io/initializr/commit/4d0fac5df0c5b12c86ee8174b1b03c0227e9b676Michael
02/14/2018, 8:10 PMMichael
02/14/2018, 8:11 PM@Autowired var dependency: Dependency? = null
? or is there a cleaner way.Michael
02/14/2018, 8:12 PM?.
sdeleuze
02/15/2018, 8:47 AMlateinit var
works nicely with @ConfigurationProperties
. If that's true that would be super nice since Boot 2.0 will not support immutable data classes yet (2.1 should). Could you try the following approach with your projects and say me if I missed something of if it works as expected.sdeleuze
02/15/2018, 8:48 AMvar
which I was using previously)sdeleuze
02/15/2018, 11:11 AMsdeleuze
02/15/2018, 5:16 PMKeith Donald
02/19/2018, 7:15 PMdh44t
02/19/2018, 7:48 PMdh44t
02/19/2018, 7:48 PMMichael
02/20/2018, 4:10 PMselector
header in the subscription?Mario Ruiz
02/23/2018, 3:48 PM@Import
as a single KClass, instead of an array of KClassYuriy Yunikov
02/24/2018, 9:28 AMsendilkumarn [JHipster]
02/25/2018, 9:01 AMsendilkumarn [JHipster]
02/25/2018, 9:08 AMaleksandrsl
02/25/2018, 2:54 PM-Xjsr305=strict
compiler argument that is added by spring initializr forces to override methods like findById
the following way override fun findById(id: Long): Optional<User>
. But it seems that this override is the wrong one, and it should be override fun findById(id: Long?): Optional<User>
cause with the last one security annotations works the right way.enleur
03/01/2018, 8:31 AMenleur
03/01/2018, 8:31 AMCzar
03/01/2018, 8:41 AMPere Casafont
03/01/2018, 9:49 AMdiesieben07
03/01/2018, 10:03 AMjackson-module-kotlin
.diesieben07
03/01/2018, 10:03 AM