SEC-1010: Moved TestingAuthenticationProvider and token to main core src tree and updated poms to match

This commit is contained in:
Luke Taylor 2008-10-15 06:35:11 +00:00
parent 6c8a82fa13
commit c947d42146
7 changed files with 15 additions and 42 deletions

View File

@ -17,6 +17,7 @@
<artifactId>spring-security-core</artifactId>
<version>${project.version}</version>
</dependency>
<!--
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
@ -24,6 +25,7 @@
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
-->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>

View File

@ -22,8 +22,9 @@ import org.springframework.security.AuthenticationException;
/**
* An {@link AuthenticationProvider} implementation for the {@link TestingAuthenticationToken}.<p>It simply
* accepts as valid whatever is contained within the <code>TestingAuthenticationToken</code>.</p>
* <p>The purpose of this implementation is to facilitate unit testing. This provider should <B>never be enabled
* on a production system</b>.</p>
* <p>
* The purpose of this implementation is to facilitate unit testing. This provider should <b>never be enabled
* on a production system</b>.
*
* @author Ben Alex
* @version $Id$
@ -37,10 +38,6 @@ public class TestingAuthenticationProvider implements AuthenticationProvider {
}
public boolean supports(Class authentication) {
if (TestingAuthenticationToken.class.isAssignableFrom(authentication)) {
return true;
} else {
return false;
}
return TestingAuthenticationToken.class.isAssignableFrom(authentication);
}
}

View File

@ -20,8 +20,9 @@ import org.springframework.security.util.AuthorityUtils;
/**
* An {@link org.springframework.security.Authentication} implementation that is designed for use whilst unit testing.<p>The
* corresponding authentication provider is {@link TestingAuthenticationProvider}.</p>
* An {@link org.springframework.security.Authentication} implementation that is designed for use whilst unit testing.
* <p>
* The corresponding authentication provider is {@link TestingAuthenticationProvider}.
*
* @author Ben Alex
* @version $Id$
@ -36,15 +37,15 @@ public class TestingAuthenticationToken extends AbstractAuthenticationToken {
//~ Constructors ===================================================================================================
public TestingAuthenticationToken(Object principal, Object credentials) {
super(null);
super(null);
this.principal = principal;
this.credentials = credentials;
}
this.credentials = credentials;
}
public TestingAuthenticationToken(Object principal, Object credentials, String... authorities) {
this(principal, credentials, AuthorityUtils.stringArrayToAuthorityArray(authorities));
}
this(principal, credentials, AuthorityUtils.stringArrayToAuthorityArray(authorities));
}
public TestingAuthenticationToken(Object principal, Object credentials, GrantedAuthority[] authorities) {
super(authorities);

View File

@ -14,13 +14,6 @@
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>${project.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>

View File

@ -16,13 +16,6 @@
<artifactId>spring-security-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>${project.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>

View File

@ -17,12 +17,6 @@
<artifactId>spring-security-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<classifier>tests</classifier>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>

View File

@ -18,13 +18,6 @@
<artifactId>spring-security-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>${project.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-acl</artifactId>