cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [1/2] cxf-fediz git commit: Move "canHandleRequest" code into parent SigninHandler
Date Fri, 25 Sep 2015 14:50:09 GMT
Repository: cxf-fediz
Updated Branches:
  refs/heads/master f719a01a3 -> 7aced7164


Move "canHandleRequest" code into parent SigninHandler


Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/f6feaf34
Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/f6feaf34
Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/f6feaf34

Branch: refs/heads/master
Commit: f6feaf347d2ffd0ab5f50cbec79f46aea01053d3
Parents: f719a01
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Fri Sep 25 14:37:02 2015 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Fri Sep 25 14:37:02 2015 +0100

----------------------------------------------------------------------
 .../cxf/fediz/core/handler/SigninHandler.java       |  9 ++++++++-
 .../fediz/tomcat7/handler/TomcatSigninHandler.java  | 16 ----------------
 .../fediz/tomcat8/handler/TomcatSigninHandler.java  | 16 ----------------
 3 files changed, 8 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/f6feaf34/plugins/core/src/main/java/org/apache/cxf/fediz/core/handler/SigninHandler.java
----------------------------------------------------------------------
diff --git a/plugins/core/src/main/java/org/apache/cxf/fediz/core/handler/SigninHandler.java
b/plugins/core/src/main/java/org/apache/cxf/fediz/core/handler/SigninHandler.java
index edd7302..5119196 100644
--- a/plugins/core/src/main/java/org/apache/cxf/fediz/core/handler/SigninHandler.java
+++ b/plugins/core/src/main/java/org/apache/cxf/fediz/core/handler/SigninHandler.java
@@ -52,7 +52,14 @@ public class SigninHandler<T> implements RequestHandler<T>
{
 
     @Override
     public boolean canHandleRequest(HttpServletRequest request) {
-        return FederationConstants.ACTION_SIGNIN.equals(request.getParameter(FederationConstants.PARAM_ACTION));
+        if (fedizContext.getProtocol() instanceof FederationProtocol
+            && FederationConstants.ACTION_SIGNIN.equals(request.getParameter(FederationConstants.PARAM_ACTION)))
{
+            return true;
+        } else if (fedizContext.getProtocol() instanceof SAMLProtocol
+                   && request.getParameter(SAMLSSOConstants.RELAY_STATE) != null)
{
+            return true;
+        }
+        return false;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/f6feaf34/plugins/tomcat7/src/main/java/org/apache/cxf/fediz/tomcat7/handler/TomcatSigninHandler.java
----------------------------------------------------------------------
diff --git a/plugins/tomcat7/src/main/java/org/apache/cxf/fediz/tomcat7/handler/TomcatSigninHandler.java
b/plugins/tomcat7/src/main/java/org/apache/cxf/fediz/tomcat7/handler/TomcatSigninHandler.java
index c48c91e..476fbbf 100644
--- a/plugins/tomcat7/src/main/java/org/apache/cxf/fediz/tomcat7/handler/TomcatSigninHandler.java
+++ b/plugins/tomcat7/src/main/java/org/apache/cxf/fediz/tomcat7/handler/TomcatSigninHandler.java
@@ -28,12 +28,8 @@ import javax.servlet.http.HttpServletResponse;
 import org.apache.catalina.Session;
 import org.apache.catalina.authenticator.Constants;
 import org.apache.catalina.connector.Request;
-import org.apache.cxf.fediz.core.FederationConstants;
 import org.apache.cxf.fediz.core.FedizPrincipal;
-import org.apache.cxf.fediz.core.SAMLSSOConstants;
-import org.apache.cxf.fediz.core.config.FederationProtocol;
 import org.apache.cxf.fediz.core.config.FedizContext;
-import org.apache.cxf.fediz.core.config.SAMLProtocol;
 import org.apache.cxf.fediz.core.handler.SigninHandler;
 import org.apache.cxf.fediz.core.processor.FedizResponse;
 import org.apache.cxf.fediz.tomcat7.FederationAuthenticator;
@@ -78,18 +74,6 @@ public class TomcatSigninHandler extends SigninHandler<FedizPrincipal>
{
         return principal;
     }
 
-    @Override
-    public boolean canHandleRequest(HttpServletRequest request) {
-        if (super.getFedizContext().getProtocol() instanceof FederationProtocol
-            && FederationConstants.ACTION_SIGNIN.equals(request.getParameter(FederationConstants.PARAM_ACTION)))
{
-            return true;
-        } else if (super.getFedizContext().getProtocol() instanceof SAMLProtocol
-                   && request.getParameter(SAMLSSOConstants.RELAY_STATE) != null)
{
-            return true;
-        }
-        return false;
-    }
-
     public Object getLandingPage() {
         return landingPage;
     }

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/f6feaf34/plugins/tomcat8/src/main/java/org/apache/cxf/fediz/tomcat8/handler/TomcatSigninHandler.java
----------------------------------------------------------------------
diff --git a/plugins/tomcat8/src/main/java/org/apache/cxf/fediz/tomcat8/handler/TomcatSigninHandler.java
b/plugins/tomcat8/src/main/java/org/apache/cxf/fediz/tomcat8/handler/TomcatSigninHandler.java
index ea297ff..27d353a 100644
--- a/plugins/tomcat8/src/main/java/org/apache/cxf/fediz/tomcat8/handler/TomcatSigninHandler.java
+++ b/plugins/tomcat8/src/main/java/org/apache/cxf/fediz/tomcat8/handler/TomcatSigninHandler.java
@@ -28,12 +28,8 @@ import javax.servlet.http.HttpServletResponse;
 import org.apache.catalina.Session;
 import org.apache.catalina.authenticator.Constants;
 import org.apache.catalina.connector.Request;
-import org.apache.cxf.fediz.core.FederationConstants;
 import org.apache.cxf.fediz.core.FedizPrincipal;
-import org.apache.cxf.fediz.core.SAMLSSOConstants;
-import org.apache.cxf.fediz.core.config.FederationProtocol;
 import org.apache.cxf.fediz.core.config.FedizContext;
-import org.apache.cxf.fediz.core.config.SAMLProtocol;
 import org.apache.cxf.fediz.core.handler.SigninHandler;
 import org.apache.cxf.fediz.core.processor.FedizResponse;
 import org.apache.cxf.fediz.tomcat8.FederationAuthenticator;
@@ -78,18 +74,6 @@ public class TomcatSigninHandler extends SigninHandler<FedizPrincipal>
{
         return principal;
     }
 
-    @Override
-    public boolean canHandleRequest(HttpServletRequest request) {
-        if (super.getFedizContext().getProtocol() instanceof FederationProtocol
-            && FederationConstants.ACTION_SIGNIN.equals(request.getParameter(FederationConstants.PARAM_ACTION)))
{
-            return true;
-        } else if (super.getFedizContext().getProtocol() instanceof SAMLProtocol
-                   && request.getParameter(SAMLSSOConstants.RELAY_STATE) != null)
{
-            return true;
-        }
-        return false;
-    }
-
     public Object getLandingPage() {
         return landingPage;
     }


Mime
View raw message