From 0d7b990e0ab3b51e279c5619ecd6d1b7e6e2d93d Mon Sep 17 00:00:00 2001 From: Luke Taylor Date: Mon, 31 Aug 2009 22:15:37 +0000 Subject: [PATCH] SEC-1184: Moved ACL cache classes and interface out of jdbc package. --- .../EhCacheBasedAclCache.java | 6 ++---- .../acls/jdbc/BasicLookupStrategy.java | 1 + .../acls/jdbc/JdbcMutableAclService.java | 1 + .../acls/{jdbc => model}/AclCache.java | 5 ++--- .../acls/jdbc/BasicLookupStrategyTests.java | 1 + .../acls/jdbc/EhCacheBasedAclCacheTests.java | 1 + .../acls/jdbc/JdbcMutableAclServiceTests.java | 1 + .../jdbcMutableAclServiceTests-context.xml | 2 +- .../security/config/BeanIds.java | 19 +++++++++++-------- .../config/http/FilterChainOrder.java | 2 +- ...pplicationContext-common-authorization.xml | 2 +- .../applicationContext-dms-secure.xml | 2 +- 12 files changed, 24 insertions(+), 19 deletions(-) rename acl/src/main/java/org/springframework/security/acls/{jdbc => domain}/EhCacheBasedAclCache.java (95%) rename acl/src/main/java/org/springframework/security/acls/{jdbc => model}/AclCache.java (87%) diff --git a/acl/src/main/java/org/springframework/security/acls/jdbc/EhCacheBasedAclCache.java b/acl/src/main/java/org/springframework/security/acls/domain/EhCacheBasedAclCache.java similarity index 95% rename from acl/src/main/java/org/springframework/security/acls/jdbc/EhCacheBasedAclCache.java rename to acl/src/main/java/org/springframework/security/acls/domain/EhCacheBasedAclCache.java index 2263e75714..e1987e387f 100644 --- a/acl/src/main/java/org/springframework/security/acls/jdbc/EhCacheBasedAclCache.java +++ b/acl/src/main/java/org/springframework/security/acls/domain/EhCacheBasedAclCache.java @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.security.acls.jdbc; +package org.springframework.security.acls.domain; import java.io.Serializable; @@ -20,9 +20,7 @@ import net.sf.ehcache.CacheException; import net.sf.ehcache.Ehcache; import net.sf.ehcache.Element; -import org.springframework.security.acls.domain.AclAuthorizationStrategy; -import org.springframework.security.acls.domain.AclImpl; -import org.springframework.security.acls.domain.AuditLogger; +import org.springframework.security.acls.model.AclCache; import org.springframework.security.acls.model.MutableAcl; import org.springframework.security.acls.model.ObjectIdentity; import org.springframework.security.util.FieldUtils; diff --git a/acl/src/main/java/org/springframework/security/acls/jdbc/BasicLookupStrategy.java b/acl/src/main/java/org/springframework/security/acls/jdbc/BasicLookupStrategy.java index 5e176d22dd..188eb21843 100644 --- a/acl/src/main/java/org/springframework/security/acls/jdbc/BasicLookupStrategy.java +++ b/acl/src/main/java/org/springframework/security/acls/jdbc/BasicLookupStrategy.java @@ -43,6 +43,7 @@ import org.springframework.security.acls.domain.ObjectIdentityImpl; import org.springframework.security.acls.domain.PrincipalSid; import org.springframework.security.acls.model.AccessControlEntry; import org.springframework.security.acls.model.Acl; +import org.springframework.security.acls.model.AclCache; import org.springframework.security.acls.model.MutableAcl; import org.springframework.security.acls.model.NotFoundException; import org.springframework.security.acls.model.ObjectIdentity; diff --git a/acl/src/main/java/org/springframework/security/acls/jdbc/JdbcMutableAclService.java b/acl/src/main/java/org/springframework/security/acls/jdbc/JdbcMutableAclService.java index d8cc7b7fc8..59c171a81f 100644 --- a/acl/src/main/java/org/springframework/security/acls/jdbc/JdbcMutableAclService.java +++ b/acl/src/main/java/org/springframework/security/acls/jdbc/JdbcMutableAclService.java @@ -28,6 +28,7 @@ import org.springframework.security.acls.domain.ObjectIdentityImpl; import org.springframework.security.acls.domain.PrincipalSid; import org.springframework.security.acls.model.AccessControlEntry; import org.springframework.security.acls.model.Acl; +import org.springframework.security.acls.model.AclCache; import org.springframework.security.acls.model.AlreadyExistsException; import org.springframework.security.acls.model.ChildrenExistException; import org.springframework.security.acls.model.MutableAcl; diff --git a/acl/src/main/java/org/springframework/security/acls/jdbc/AclCache.java b/acl/src/main/java/org/springframework/security/acls/model/AclCache.java similarity index 87% rename from acl/src/main/java/org/springframework/security/acls/jdbc/AclCache.java rename to acl/src/main/java/org/springframework/security/acls/model/AclCache.java index 4898190138..26ec76048a 100644 --- a/acl/src/main/java/org/springframework/security/acls/jdbc/AclCache.java +++ b/acl/src/main/java/org/springframework/security/acls/model/AclCache.java @@ -12,10 +12,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.security.acls.jdbc; +package org.springframework.security.acls.model; -import org.springframework.security.acls.model.MutableAcl; -import org.springframework.security.acls.model.ObjectIdentity; +import org.springframework.security.acls.jdbc.JdbcAclService; import java.io.Serializable; diff --git a/acl/src/test/java/org/springframework/security/acls/jdbc/BasicLookupStrategyTests.java b/acl/src/test/java/org/springframework/security/acls/jdbc/BasicLookupStrategyTests.java index 1deff75be4..2cb78c73b1 100644 --- a/acl/src/test/java/org/springframework/security/acls/jdbc/BasicLookupStrategyTests.java +++ b/acl/src/test/java/org/springframework/security/acls/jdbc/BasicLookupStrategyTests.java @@ -22,6 +22,7 @@ import org.springframework.security.acls.domain.AclAuthorizationStrategy; import org.springframework.security.acls.domain.AclAuthorizationStrategyImpl; import org.springframework.security.acls.domain.BasePermission; import org.springframework.security.acls.domain.ConsoleAuditLogger; +import org.springframework.security.acls.domain.EhCacheBasedAclCache; import org.springframework.security.acls.domain.ObjectIdentityImpl; import org.springframework.security.acls.domain.PrincipalSid; import org.springframework.security.acls.model.Acl; diff --git a/acl/src/test/java/org/springframework/security/acls/jdbc/EhCacheBasedAclCacheTests.java b/acl/src/test/java/org/springframework/security/acls/jdbc/EhCacheBasedAclCacheTests.java index 84d5aba23e..33518843a5 100644 --- a/acl/src/test/java/org/springframework/security/acls/jdbc/EhCacheBasedAclCacheTests.java +++ b/acl/src/test/java/org/springframework/security/acls/jdbc/EhCacheBasedAclCacheTests.java @@ -22,6 +22,7 @@ import org.springframework.security.acls.domain.AclAuthorizationStrategy; import org.springframework.security.acls.domain.AclAuthorizationStrategyImpl; import org.springframework.security.acls.domain.AclImpl; import org.springframework.security.acls.domain.ConsoleAuditLogger; +import org.springframework.security.acls.domain.EhCacheBasedAclCache; import org.springframework.security.acls.domain.ObjectIdentityImpl; import org.springframework.security.acls.model.MutableAcl; import org.springframework.security.acls.model.ObjectIdentity; diff --git a/acl/src/test/java/org/springframework/security/acls/jdbc/JdbcMutableAclServiceTests.java b/acl/src/test/java/org/springframework/security/acls/jdbc/JdbcMutableAclServiceTests.java index 04b09d3bb3..8e9776b5b6 100644 --- a/acl/src/test/java/org/springframework/security/acls/jdbc/JdbcMutableAclServiceTests.java +++ b/acl/src/test/java/org/springframework/security/acls/jdbc/JdbcMutableAclServiceTests.java @@ -35,6 +35,7 @@ import org.springframework.security.acls.domain.ObjectIdentityImpl; import org.springframework.security.acls.domain.PrincipalSid; import org.springframework.security.acls.model.AccessControlEntry; import org.springframework.security.acls.model.Acl; +import org.springframework.security.acls.model.AclCache; import org.springframework.security.acls.model.AlreadyExistsException; import org.springframework.security.acls.model.ChildrenExistException; import org.springframework.security.acls.model.MutableAcl; diff --git a/acl/src/test/resources/jdbcMutableAclServiceTests-context.xml b/acl/src/test/resources/jdbcMutableAclServiceTests-context.xml index 41ae84fb03..e3090331a8 100644 --- a/acl/src/test/resources/jdbcMutableAclServiceTests-context.xml +++ b/acl/src/test/resources/jdbcMutableAclServiceTests-context.xml @@ -14,7 +14,7 @@ - + diff --git a/config/src/main/java/org/springframework/security/config/BeanIds.java b/config/src/main/java/org/springframework/security/config/BeanIds.java index ea0a998f83..2af6d915f4 100644 --- a/config/src/main/java/org/springframework/security/config/BeanIds.java +++ b/config/src/main/java/org/springframework/security/config/BeanIds.java @@ -9,20 +9,23 @@ package org.springframework.security.config; * @version $Id: BeanIds.java 3770 2009-07-15 23:09:47Z ltaylor $ */ public abstract class BeanIds { + private static final String PREFIX = "org.springframework.security"; + + /** The "global" AuthenticationManager instance, registered by the element */ + public static final String AUTHENTICATION_MANAGER = PREFIX + "authenticationManager"; /** External alias for FilterChainProxy bean, for use in web.xml files */ public static final String SPRING_SECURITY_FILTER_CHAIN = "springSecurityFilterChain"; - public static final String CONTEXT_SOURCE_SETTING_POST_PROCESSOR = "_contextSettingPostProcessor"; + public static final String CONTEXT_SOURCE_SETTING_POST_PROCESSOR = PREFIX + "contextSettingPostProcessor"; - public static final String USER_DETAILS_SERVICE = "_userDetailsService"; + public static final String USER_DETAILS_SERVICE = PREFIX + "userDetailsService"; - public static final String METHOD_ACCESS_MANAGER = "_defaultMethodAccessManager"; - public static final String AUTHENTICATION_MANAGER = "_authenticationManager"; + public static final String METHOD_ACCESS_MANAGER = PREFIX + "defaultMethodAccessManager"; - public static final String FILTER_CHAIN_PROXY = "_filterChainProxy"; + public static final String FILTER_CHAIN_PROXY = PREFIX + "filterChainProxy"; - public static final String METHOD_SECURITY_METADATA_SOURCE_ADVISOR = "_methodSecurityMetadataSourceAdvisor"; - public static final String EMBEDDED_APACHE_DS = "_apacheDirectoryServerContainer"; - public static final String CONTEXT_SOURCE = "_securityContextSource"; + public static final String METHOD_SECURITY_METADATA_SOURCE_ADVISOR = PREFIX + "methodSecurityMetadataSourceAdvisor"; + public static final String EMBEDDED_APACHE_DS = PREFIX + "apacheDirectoryServerContainer"; + public static final String CONTEXT_SOURCE = PREFIX + "securityContextSource"; } diff --git a/config/src/main/java/org/springframework/security/config/http/FilterChainOrder.java b/config/src/main/java/org/springframework/security/config/http/FilterChainOrder.java index 2da83a276e..94aeda9a65 100644 --- a/config/src/main/java/org/springframework/security/config/http/FilterChainOrder.java +++ b/config/src/main/java/org/springframework/security/config/http/FilterChainOrder.java @@ -37,9 +37,9 @@ abstract class FilterChainOrder { public static final int SERVLET_API_SUPPORT_FILTER = FILTER_CHAIN_FIRST + INTERVAL * i++; public static final int REMEMBER_ME_FILTER = FILTER_CHAIN_FIRST + INTERVAL * i++; public static final int ANONYMOUS_FILTER = FILTER_CHAIN_FIRST + INTERVAL * i++; + public static final int SESSION_FIXATION_FILTER = FILTER_CHAIN_FIRST + INTERVAL * i++; public static final int EXCEPTION_TRANSLATION_FILTER = FILTER_CHAIN_FIRST + INTERVAL * i++; public static final int NTLM_FILTER = FILTER_CHAIN_FIRST + INTERVAL * i++; - public static final int SESSION_FIXATION_FILTER = FILTER_CHAIN_FIRST + INTERVAL * i++; public static final int FILTER_SECURITY_INTERCEPTOR = FILTER_CHAIN_FIRST + INTERVAL * i++; public static final int SWITCH_USER_FILTER = FILTER_CHAIN_FIRST + INTERVAL * i++; diff --git a/samples/contacts/src/main/resources/applicationContext-common-authorization.xml b/samples/contacts/src/main/resources/applicationContext-common-authorization.xml index bdb669d0f5..ca8477c6ae 100644 --- a/samples/contacts/src/main/resources/applicationContext-common-authorization.xml +++ b/samples/contacts/src/main/resources/applicationContext-common-authorization.xml @@ -14,7 +14,7 @@ - + diff --git a/samples/dms/src/main/resources/applicationContext-dms-secure.xml b/samples/dms/src/main/resources/applicationContext-dms-secure.xml index 376a96bc4a..5e0dedd1f6 100755 --- a/samples/dms/src/main/resources/applicationContext-dms-secure.xml +++ b/samples/dms/src/main/resources/applicationContext-dms-secure.xml @@ -154,7 +154,7 @@ - +