renamed to remove "Cas" from Filter names since its in th CAS package
This commit is contained in:
parent
ad9521f139
commit
a862741129
|
|
@ -24,7 +24,7 @@ import java.net.URLEncoder;
|
|||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public final class CasAuthenticationFilter extends AbstractCasFilter {
|
||||
public final class AuthenticationFilter extends AbstractCasFilter {
|
||||
|
||||
/**
|
||||
* The URL to the CAS Server login.
|
||||
|
|
@ -41,15 +41,15 @@ public final class CasAuthenticationFilter extends AbstractCasFilter {
|
|||
*/
|
||||
private final boolean gateway;
|
||||
|
||||
public CasAuthenticationFilter(final String serverName, final String serviceUrl, final String casServerLoginUrl) {
|
||||
public AuthenticationFilter(final String serverName, final String serviceUrl, final String casServerLoginUrl) {
|
||||
this(serverName, serviceUrl, true, casServerLoginUrl, false, false);
|
||||
}
|
||||
|
||||
public CasAuthenticationFilter(final String serverName, final String serviceUrl, final String casServerLoginUrl, boolean renew, boolean gateway) {
|
||||
public AuthenticationFilter(final String serverName, final String serviceUrl, final String casServerLoginUrl, boolean renew, boolean gateway) {
|
||||
this(serverName, serviceUrl, true, casServerLoginUrl, renew, gateway);
|
||||
}
|
||||
|
||||
public CasAuthenticationFilter(String serverName, String serviceUrl, boolean useSession, String casServerLoginUrl, boolean renew, boolean gateway) {
|
||||
public AuthenticationFilter(String serverName, String serviceUrl, boolean useSession, String casServerLoginUrl, boolean renew, boolean gateway) {
|
||||
super(serverName, serviceUrl, useSession);
|
||||
CommonUtils.assertNotNull(casServerLoginUrl,
|
||||
"the CAS Server Login URL cannot be null.");
|
||||
|
|
@ -7,9 +7,10 @@ package org.jasig.cas.client.web.filter;
|
|||
|
||||
import org.jasig.cas.authentication.principal.Principal;
|
||||
import org.jasig.cas.client.authorization.AuthorizationException;
|
||||
import org.jasig.cas.client.authorization.CasAuthorizedDecider;
|
||||
import org.jasig.cas.client.authorization.AuthorizedDecider;
|
||||
import org.jasig.cas.client.util.CommonUtils;
|
||||
import org.jasig.cas.client.validation.Assertion;
|
||||
import org.springframework.web.util.WebUtils;
|
||||
|
||||
import javax.servlet.Filter;
|
||||
import javax.servlet.FilterChain;
|
||||
|
|
@ -34,21 +35,21 @@ import java.io.IOException;
|
|||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @see CasAuthorizedDecider
|
||||
* @see AuthorizedDecider
|
||||
* @since 3.0
|
||||
*/
|
||||
public final class CasAuthorizationFilter implements Filter {
|
||||
public final class AuthorizationFilter implements Filter {
|
||||
|
||||
/**
|
||||
* Decider that determines whether a specified principal has access to the
|
||||
* resource or not.
|
||||
*/
|
||||
private final CasAuthorizedDecider decider;
|
||||
private final AuthorizedDecider decider;
|
||||
|
||||
/**
|
||||
* @param casAuthorizedDecider the thing actually deciding to grant access or not.
|
||||
*/
|
||||
public CasAuthorizationFilter(final CasAuthorizedDecider casAuthorizedDecider) {
|
||||
public AuthorizationFilter(final AuthorizedDecider casAuthorizedDecider) {
|
||||
CommonUtils.assertNotNull(casAuthorizedDecider,
|
||||
"the casAuthorizedDecider cannot be null.");
|
||||
this.decider = casAuthorizedDecider;
|
||||
|
|
@ -63,14 +64,7 @@ public final class CasAuthorizationFilter implements Filter {
|
|||
throws IOException, ServletException {
|
||||
final HttpServletRequest request = (HttpServletRequest) servletRequest;
|
||||
final HttpServletResponse response = (HttpServletResponse) servletResponse;
|
||||
final Assertion assertion = (Assertion) request.getSession()
|
||||
.getAttribute(AbstractCasFilter.CONST_ASSERTION);
|
||||
|
||||
if (assertion == null) {
|
||||
throw new ServletException(
|
||||
"assertion session attribute expected but not found.");
|
||||
}
|
||||
|
||||
final Assertion assertion = (Assertion) WebUtils.getRequiredSessionAttribute(request, AbstractCasFilter.CONST_ASSERTION);
|
||||
final Principal principal = assertion.getPrincipal();
|
||||
|
||||
final boolean authorized = this.decider
|
||||
|
|
@ -31,7 +31,7 @@ import java.io.IOException;
|
|||
* @see TicketValidator
|
||||
* @since 3.0
|
||||
*/
|
||||
public final class CasValidationFilter extends AbstractCasFilter {
|
||||
public final class TicketValidationFilter extends AbstractCasFilter {
|
||||
|
||||
/**
|
||||
* Instance of the ticket validator.
|
||||
|
|
@ -52,7 +52,7 @@ public final class CasValidationFilter extends AbstractCasFilter {
|
|||
* @param serviceUrl the url to always redirect to.
|
||||
* @param ticketValidator the validator to validate the tickets.
|
||||
*/
|
||||
public CasValidationFilter(final String serverName, final String serviceUrl, final TicketValidator ticketValidator) {
|
||||
public TicketValidationFilter(final String serverName, final String serviceUrl, final TicketValidator ticketValidator) {
|
||||
this(serverName, serviceUrl, true, ticketValidator, false);
|
||||
}
|
||||
|
||||
|
|
@ -65,7 +65,7 @@ public final class CasValidationFilter extends AbstractCasFilter {
|
|||
* @param ticketValidator the validator to validate the tickets.
|
||||
* @param redirectAfterValidation whether to redirect to remove the ticket.
|
||||
*/
|
||||
public CasValidationFilter(final String serverName, final String serviceUrl, final boolean useSession, final TicketValidator ticketValidator, final boolean redirectAfterValidation) {
|
||||
public TicketValidationFilter(final String serverName, final String serviceUrl, final boolean useSession, final TicketValidator ticketValidator, final boolean redirectAfterValidation) {
|
||||
super(serverName, serviceUrl, useSession);
|
||||
CommonUtils.assertNotNull(ticketValidator,
|
||||
"ticketValidator cannot be null.");
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
<bean
|
||||
id="casValidationFilter"
|
||||
class="org.jasig.cas.client.web.filter.CasValidationFilter">
|
||||
class="org.jasig.cas.client.web.filter.TicketValidationFilter">
|
||||
<constructor-arg index="0" value="localhost:8443"/>
|
||||
<constructor-arg index="1">
|
||||
<null/>
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
|
||||
<bean
|
||||
id="casAuthenticationFilter"
|
||||
class="org.jasig.cas.client.web.filter.CasAuthenticationFilter">
|
||||
class="org.jasig.cas.client.web.filter.AuthenticationFilter">
|
||||
<constructor-arg index="0" value="localhost:8443"/>
|
||||
<constructor-arg index="1">
|
||||
<null/>
|
||||
|
|
@ -56,13 +56,13 @@
|
|||
|
||||
<bean
|
||||
id="casAuthorizationFilter"
|
||||
class="org.jasig.cas.client.web.filter.CasAuthorizationFilter">
|
||||
class="org.jasig.cas.client.web.filter.AuthorizationFilter">
|
||||
<constructor-arg index="0" ref="decider"></constructor-arg>
|
||||
</bean>
|
||||
|
||||
<bean
|
||||
id="decider"
|
||||
class="org.jasig.cas.client.authorization.DefaultCasAuthorizedDeciderImpl">
|
||||
class="org.jasig.cas.client.authorization.DefaultAuthorizedDeciderImpl">
|
||||
<constructor-arg index="0">
|
||||
<list>
|
||||
<value>battags</value>
|
||||
|
|
|
|||
Loading…
Reference in New Issue