1
0
mirror of synced 2026-07-19 09:35:12 +00:00

SEC-890: Corrected use of dataSource property name in RememberMeBDP.

This commit is contained in:
Luke Taylor
2008-06-18 10:35:30 +00:00
parent 7d79ae5424
commit af5f193ec1
2 changed files with 16 additions and 1 deletions
@@ -84,7 +84,7 @@ public class RememberMeBeanDefinitionParser implements BeanDefinitionParser {
tokenRepo = new RuntimeBeanReference(tokenRepository);
} else {
tokenRepo = new RootBeanDefinition(JdbcTokenRepositoryImpl.class);
((BeanDefinition)tokenRepo).getPropertyValues().addPropertyValue(ATT_DATA_SOURCE,
((BeanDefinition)tokenRepo).getPropertyValues().addPropertyValue("dataSource",
new RuntimeBeanReference(dataSource));
}
services.getPropertyValues().addPropertyValue("tokenRepository", tokenRepo);
@@ -349,6 +349,21 @@ public class HttpSecurityBeanDefinitionParserTests {
assertTrue(rememberMeServices instanceof PersistentTokenBasedRememberMeServices);
}
@Test
public void rememberMeServiceWorksWithDataSourceRef() {
setContext(
"<http auto-config='true'>" +
" <remember-me data-source-ref='ds'/>" +
"</http>" +
"<b:bean id='ds' class='org.springframework.security.TestDataSource'> " +
" <b:constructor-arg value='tokendb'/>" +
"</b:bean>" + AUTH_PROVIDER_XML);
Object rememberMeServices = appContext.getBean(BeanIds.REMEMBER_ME_SERVICES);
assertTrue(rememberMeServices instanceof PersistentTokenBasedRememberMeServices);
}
@Test
public void rememberMeServiceWorksWithExternalServicesImpl() throws Exception {
setContext(