Moved Spring Security handlers to default callback packag, getting rid of the (ugly) springsecurity package.

This commit is contained in:
Arjen Poutsma
2008-02-25 14:34:37 +00:00
parent c68df1a55d
commit 1922082b41
12 changed files with 228 additions and 37 deletions

View File

@@ -16,8 +16,8 @@ import org.springframework.ws.context.DefaultMessageContext;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.server.EndpointInterceptor;
import org.springframework.ws.soap.SoapMessage;
import org.springframework.ws.soap.security.wss4j.callback.springsecurity.SpringSecurityDigestPasswordValidationCallbackHandler;
import org.springframework.ws.soap.security.wss4j.callback.springsecurity.SpringSecurityPlainTextPasswordValidationCallbackHandler;
import org.springframework.ws.soap.security.wss4j.callback.SpringDigestPasswordValidationCallbackHandler;
import org.springframework.ws.soap.security.wss4j.callback.SpringPlainTextPasswordValidationCallbackHandler;
public abstract class Wss4jMessageInterceptorSpringSecurityCallbackHandlerTestCase extends Wss4jTestCase {
@@ -82,8 +82,8 @@ public abstract class Wss4jMessageInterceptorSpringSecurityCallbackHandlerTestCa
interceptor.setSecurementActions(actions);
}
if (digest) {
SpringSecurityDigestPasswordValidationCallbackHandler callbackHandler =
new SpringSecurityDigestPasswordValidationCallbackHandler();
SpringDigestPasswordValidationCallbackHandler callbackHandler =
new SpringDigestPasswordValidationCallbackHandler();
InMemoryDaoImpl userDetailsService = new InMemoryDaoImpl();
userDetailsService.setUserProperties(users);
userDetailsService.afterPropertiesSet();
@@ -93,8 +93,8 @@ public abstract class Wss4jMessageInterceptorSpringSecurityCallbackHandlerTestCa
interceptor.afterPropertiesSet();
}
else {
SpringSecurityPlainTextPasswordValidationCallbackHandler callbackHandler =
new SpringSecurityPlainTextPasswordValidationCallbackHandler();
SpringPlainTextPasswordValidationCallbackHandler callbackHandler =
new SpringPlainTextPasswordValidationCallbackHandler();
Authentication authResult = new TestingAuthenticationToken("Bert", "Ernie", new GrantedAuthority[0]);
control.expectAndReturn(mock.authenticate(new UsernamePasswordAuthenticationToken("Bert", "Ernie")),
authResult);

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.soap.security.xwss.callback.springsecurity;
package org.springframework.ws.soap.security.xwss.callback;
import java.io.InputStream;
import java.security.KeyStore;
@@ -33,9 +33,9 @@ import org.springframework.security.providers.TestingAuthenticationToken;
import org.springframework.security.providers.x509.X509AuthenticationToken;
import org.springframework.ws.soap.security.callback.CleanupCallback;
public class SpringSecurityCertificateValidationCallbackHandlerTest extends TestCase {
public class SpringCertificateValidationCallbackHandlerTest extends TestCase {
private SpringSecurityCertificateValidationCallbackHandler callbackHandler;
private SpringCertificateValidationCallbackHandler callbackHandler;
private MockControl control;
@@ -46,7 +46,7 @@ public class SpringSecurityCertificateValidationCallbackHandlerTest extends Test
private CertificateValidationCallback callback;
protected void setUp() throws Exception {
callbackHandler = new SpringSecurityCertificateValidationCallbackHandler();
callbackHandler = new SpringCertificateValidationCallbackHandler();
control = MockControl.createControl(AuthenticationManager.class);
mock = (AuthenticationManager) control.getMock();
callbackHandler.setAuthenticationManager(mock);

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.soap.security.xwss.callback.springsecurity;
package org.springframework.ws.soap.security.xwss.callback;
import com.sun.xml.wss.impl.callback.PasswordValidationCallback;
import junit.framework.TestCase;
@@ -28,9 +28,9 @@ import org.springframework.security.userdetails.UserDetailsService;
import org.springframework.security.userdetails.UsernameNotFoundException;
import org.springframework.ws.soap.security.callback.CleanupCallback;
public class SpringSecurityDigestPasswordValidationCallbackHandlerTest extends TestCase {
public class SpringDigestPasswordValidationCallbackHandlerTest extends TestCase {
private SpringSecurityDigestPasswordValidationCallbackHandler callbackHandler;
private SpringDigestPasswordValidationCallbackHandler callbackHandler;
private MockControl control;
@@ -43,7 +43,7 @@ public class SpringSecurityDigestPasswordValidationCallbackHandlerTest extends T
private PasswordValidationCallback callback;
protected void setUp() throws Exception {
callbackHandler = new SpringSecurityDigestPasswordValidationCallbackHandler();
callbackHandler = new SpringDigestPasswordValidationCallbackHandler();
control = MockControl.createControl(UserDetailsService.class);
mock = (UserDetailsService) control.getMock();
callbackHandler.setUserDetailsService(mock);

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.soap.security.xwss.callback.springsecurity;
package org.springframework.ws.soap.security.xwss.callback;
import com.sun.xml.wss.impl.callback.PasswordValidationCallback;
import junit.framework.TestCase;
@@ -29,9 +29,9 @@ import org.springframework.security.providers.TestingAuthenticationToken;
import org.springframework.security.providers.UsernamePasswordAuthenticationToken;
import org.springframework.ws.soap.security.callback.CleanupCallback;
public class SpringSecurityPlainTextPasswordValidationCallbackHandlerTest extends TestCase {
public class SpringPlainTextPasswordValidationCallbackHandlerTest extends TestCase {
private SpringSecurityPlainTextPasswordValidationCallbackHandler callbackHandler;
private SpringPlainTextPasswordValidationCallbackHandler callbackHandler;
private MockControl control;
@@ -44,7 +44,7 @@ public class SpringSecurityPlainTextPasswordValidationCallbackHandlerTest extend
private String password;
protected void setUp() throws Exception {
callbackHandler = new SpringSecurityPlainTextPasswordValidationCallbackHandler();
callbackHandler = new SpringPlainTextPasswordValidationCallbackHandler();
control = MockControl.createControl(AuthenticationManager.class);
mock = (AuthenticationManager) control.getMock();
callbackHandler.setAuthenticationManager(mock);

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.soap.security.xwss.callback.springsecurity;
package org.springframework.ws.soap.security.xwss.callback;
import com.sun.xml.wss.impl.callback.PasswordCallback;
import com.sun.xml.wss.impl.callback.UsernameCallback;
@@ -24,12 +24,12 @@ import org.springframework.security.Authentication;
import org.springframework.security.context.SecurityContextHolder;
import org.springframework.security.providers.UsernamePasswordAuthenticationToken;
public class SpringSecurityUsernamePasswordCallbackHandlerTest extends TestCase {
public class SpringUsernamePasswordCallbackHandlerTest extends TestCase {
private SpringSecurityUsernamePasswordCallbackHandler handler;
private SpringUsernamePasswordCallbackHandler handler;
protected void setUp() throws Exception {
handler = new SpringSecurityUsernamePasswordCallbackHandler();
handler = new SpringUsernamePasswordCallbackHandler();
Authentication authentication = new UsernamePasswordAuthenticationToken("Bert", "Ernie");
SecurityContextHolder.getContext().setAuthentication(authentication);
}