mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-28 14:52:24 +00:00
Remove getters and setters from JdbcDaoImpl so IoC container cannot modify MappingSqlQuerys (thanks to David Durham for bug report).
This commit is contained in:
parent
a15691d9d7
commit
c0f1d4e19d
@ -1,4 +1,4 @@
|
|||||||
/* Copyright 2004 Acegi Technology Pty Limited
|
/* Copyright 2004, 2005 Acegi Technology Pty Limited
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -95,15 +95,6 @@ public class JdbcDaoImpl extends JdbcDaoSupport implements AuthenticationDao {
|
|||||||
|
|
||||||
//~ Methods ================================================================
|
//~ Methods ================================================================
|
||||||
|
|
||||||
public void setAuthoritiesByUsernameMapping(
|
|
||||||
MappingSqlQuery authoritiesByUsernameQuery) {
|
|
||||||
this.authoritiesByUsernameMapping = authoritiesByUsernameQuery;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MappingSqlQuery getAuthoritiesByUsernameMapping() {
|
|
||||||
return authoritiesByUsernameMapping;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows the default query string used to retrieve authorities based on
|
* Allows the default query string used to retrieve authorities based on
|
||||||
* username to be overriden, if default table or column names need to be
|
* username to be overriden, if default table or column names need to be
|
||||||
@ -162,14 +153,6 @@ public class JdbcDaoImpl extends JdbcDaoSupport implements AuthenticationDao {
|
|||||||
return usernameBasedPrimaryKey;
|
return usernameBasedPrimaryKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUsersByUsernameMapping(MappingSqlQuery usersByUsernameQuery) {
|
|
||||||
this.usersByUsernameMapping = usersByUsernameQuery;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MappingSqlQuery getUsersByUsernameMapping() {
|
|
||||||
return usersByUsernameMapping;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows the default query string used to retrieve users based on username
|
* Allows the default query string used to retrieve users based on username
|
||||||
* to be overriden, if default table or column names need to be changed.
|
* to be overriden, if default table or column names need to be changed.
|
||||||
@ -243,9 +226,8 @@ public class JdbcDaoImpl extends JdbcDaoSupport implements AuthenticationDao {
|
|||||||
* in a subclass
|
* in a subclass
|
||||||
*/
|
*/
|
||||||
protected void initMappingSqlQueries() {
|
protected void initMappingSqlQueries() {
|
||||||
setUsersByUsernameMapping(new UsersByUsernameMapping(getDataSource()));
|
this.usersByUsernameMapping = new UsersByUsernameMapping(getDataSource());
|
||||||
setAuthoritiesByUsernameMapping(new AuthoritiesByUsernameMapping(
|
this.authoritiesByUsernameMapping = new AuthoritiesByUsernameMapping(getDataSource());
|
||||||
getDataSource()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//~ Inner Classes ==========================================================
|
//~ Inner Classes ==========================================================
|
||||||
|
@ -87,12 +87,6 @@ public class JdbcDaoTests extends TestCase {
|
|||||||
|
|
||||||
dao.setUsersByUsernameQuery("SELECT USERS FROM FOO");
|
dao.setUsersByUsernameQuery("SELECT USERS FROM FOO");
|
||||||
assertEquals("SELECT USERS FROM FOO", dao.getUsersByUsernameQuery());
|
assertEquals("SELECT USERS FROM FOO", dao.getUsersByUsernameQuery());
|
||||||
|
|
||||||
dao.setAuthoritiesByUsernameMapping(new MockMappingSqlQuery());
|
|
||||||
assertTrue(dao.getAuthoritiesByUsernameMapping() != null);
|
|
||||||
|
|
||||||
dao.setUsersByUsernameMapping(new MockMappingSqlQuery());
|
|
||||||
assertTrue(dao.getUsersByUsernameMapping() != null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testLookupFailsIfUserHasNoGrantedAuthorities()
|
public void testLookupFailsIfUserHasNoGrantedAuthorities()
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
<action dev="benalex" type="fix">Correct synchronization issue with FilterToBeanProxy initialization</action>
|
<action dev="benalex" type="fix">Correct synchronization issue with FilterToBeanProxy initialization</action>
|
||||||
<action dev="benalex" type="update">Refactor Authentication.isAuthenticated() handling to be more performance</action>
|
<action dev="benalex" type="update">Refactor Authentication.isAuthenticated() handling to be more performance</action>
|
||||||
<action dev="benalex" type="fix">Silently catch NotSerializableException in AbstractProcessingFilter if rootCause is not Serializable</action>
|
<action dev="benalex" type="fix">Silently catch NotSerializableException in AbstractProcessingFilter if rootCause is not Serializable</action>
|
||||||
|
<action dev="benalex" type="fix">Remove getters and setters from JdbcDaoImpl so IoC container cannot modify MappingSqlQuerys</action>
|
||||||
</release>
|
</release>
|
||||||
<release version="0.8.2" date="2005-04-20">
|
<release version="0.8.2" date="2005-04-20">
|
||||||
<action dev="benalex" type="fix">Correct location of AuthenticationSimpleHttpInvokerRequestExecutor in clientContext.xml</action>
|
<action dev="benalex" type="fix">Correct location of AuthenticationSimpleHttpInvokerRequestExecutor in clientContext.xml</action>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user