From e0d0cc20c7ab9d8e03ae22d763944e3046fc4113 Mon Sep 17 00:00:00 2001 From: Luke Taylor Date: Fri, 8 Feb 2008 18:19:27 +0000 Subject: [PATCH] SEC-665: Missed a method name... --- .../authoritymapping/SimpleMappableAttributesRetriever.java | 2 +- .../providers/preauth/UserDetailsByNameServiceWrapper.java | 4 ++-- ...BasedPreAuthenticatedWebAuthenticationDetailsSource.java | 4 ++-- .../authoritymapping/SimpleMappableRolesRetrieverTests.java | 4 ++-- ...PreAuthenticatedWebAuthenticationDetailsSourceTests.java | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/core/src/main/java/org/springframework/security/authoritymapping/SimpleMappableAttributesRetriever.java b/core/src/main/java/org/springframework/security/authoritymapping/SimpleMappableAttributesRetriever.java index c751699b8b..6e94098af5 100755 --- a/core/src/main/java/org/springframework/security/authoritymapping/SimpleMappableAttributesRetriever.java +++ b/core/src/main/java/org/springframework/security/authoritymapping/SimpleMappableAttributesRetriever.java @@ -25,7 +25,7 @@ public class SimpleMappableAttributesRetriever implements MappableAttributesRetr return copy; } - public void setMappableRoles(String[] aMappableRoles) { + public void setMappableAttributes(String[] aMappableRoles) { this.mappableRoles = new String[aMappableRoles.length]; System.arraycopy(aMappableRoles, 0, mappableRoles, 0, mappableRoles.length); } diff --git a/core/src/main/java/org/springframework/security/providers/preauth/UserDetailsByNameServiceWrapper.java b/core/src/main/java/org/springframework/security/providers/preauth/UserDetailsByNameServiceWrapper.java index 52138813ca..cdefb96b38 100755 --- a/core/src/main/java/org/springframework/security/providers/preauth/UserDetailsByNameServiceWrapper.java +++ b/core/src/main/java/org/springframework/security/providers/preauth/UserDetailsByNameServiceWrapper.java @@ -32,9 +32,9 @@ public class UserDetailsByNameServiceWrapper implements AuthenticationUserDetail * Get the UserDetails object from the wrapped UserDetailsService * implementation */ - public UserDetails loadUserDetails(Authentication aJ2eeAuthenticationToken) throws UsernameNotFoundException, + public UserDetails loadUserDetails(Authentication authentication) throws UsernameNotFoundException, DataAccessException { - return userDetailsService.loadUserByUsername(aJ2eeAuthenticationToken.getName()); + return userDetailsService.loadUserByUsername(authentication.getName()); } /** diff --git a/core/src/main/java/org/springframework/security/ui/preauth/j2ee/J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource.java b/core/src/main/java/org/springframework/security/ui/preauth/j2ee/J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource.java index 655c0ce865..385c3bb86d 100755 --- a/core/src/main/java/org/springframework/security/ui/preauth/j2ee/J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource.java +++ b/core/src/main/java/org/springframework/security/ui/preauth/j2ee/J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource.java @@ -60,8 +60,8 @@ public class J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource extends Aut /** * Get a list of Granted Authorities based on the current user's J2EE roles. * - * @param request - * The HttpServletRequest + * @param request The request against which isUserInRole will be called for each role name + * returned by the MappableAttributesRetriever. * @return GrantedAuthority[] mapped from the user's J2EE roles. */ private GrantedAuthority[] getJ2eeBasedGrantedAuthorities(HttpServletRequest request) { diff --git a/core/src/test/java/org/springframework/security/authoritymapping/SimpleMappableRolesRetrieverTests.java b/core/src/test/java/org/springframework/security/authoritymapping/SimpleMappableRolesRetrieverTests.java index 14ce42c7b3..e70f53372a 100755 --- a/core/src/test/java/org/springframework/security/authoritymapping/SimpleMappableRolesRetrieverTests.java +++ b/core/src/test/java/org/springframework/security/authoritymapping/SimpleMappableRolesRetrieverTests.java @@ -6,7 +6,7 @@ import java.util.Collection; import junit.framework.TestCase; /** - * + * * @author TSARDD * @since 18-okt-2007 */ @@ -15,7 +15,7 @@ public class SimpleMappableRolesRetrieverTests extends TestCase { public final void testGetSetMappableRoles() { String[] roles = new String[] { "Role1", "Role2" }; SimpleMappableAttributesRetriever r = new SimpleMappableAttributesRetriever(); - r.setMappableRoles(roles); + r.setMappableAttributes(roles); String[] result = r.getMappableAttributes(); Collection resultColl = Arrays.asList(result); Collection rolesColl = Arrays.asList(roles); diff --git a/core/src/test/java/org/springframework/security/ui/preauth/j2ee/J2eeBasedPreAuthenticatedWebAuthenticationDetailsSourceTests.java b/core/src/test/java/org/springframework/security/ui/preauth/j2ee/J2eeBasedPreAuthenticatedWebAuthenticationDetailsSourceTests.java index 21466ff193..2b1893a685 100755 --- a/core/src/test/java/org/springframework/security/ui/preauth/j2ee/J2eeBasedPreAuthenticatedWebAuthenticationDetailsSourceTests.java +++ b/core/src/test/java/org/springframework/security/ui/preauth/j2ee/J2eeBasedPreAuthenticatedWebAuthenticationDetailsSourceTests.java @@ -19,7 +19,7 @@ import org.springframework.security.GrantedAuthority; import org.springframework.mock.web.MockHttpServletRequest; /** - * + * * @author TSARDD * @since 18-okt-2007 */ @@ -122,7 +122,7 @@ public class J2eeBasedPreAuthenticatedWebAuthenticationDetailsSourceTests extend private MappableAttributesRetriever getMappableRolesRetriever(String[] mappedRoles) { SimpleMappableAttributesRetriever result = new SimpleMappableAttributesRetriever(); - result.setMappableRoles(mappedRoles); + result.setMappableAttributes(mappedRoles); return result; } @@ -134,7 +134,7 @@ public class J2eeBasedPreAuthenticatedWebAuthenticationDetailsSourceTests extend result.setRolePrefix(""); return result; } - + private final HttpServletRequest getRequest(final String userName,final String[] aRoles) { MockHttpServletRequest req = new MockHttpServletRequest() {