isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1031380 - in /incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis: extensions/ viewer/restful/viewer/authentication/ viewer/restful/viewer/embedded/
Date Fri, 05 Nov 2010 00:57:36 GMT
Author: danhaywood
Date: Fri Nov  5 00:57:36 2010
New Revision: 1031380

URL: http://svn.apache.org/viewvc?rev=1031380&view=rev
Log:
fixes on restful viewer to run using webserver

Added:
    incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/authentication/AuthenticationSessionLookupStrategyParams.java
      - copied, changed from r1029373, incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/authentication/AuthenticationSessionLookupStrategyExtended.java
    incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/authentication/AuthenticationSessionLookupStrategyTrusted.java
Removed:
    incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/extensions/
    incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/authentication/AuthenticationSessionLookupStrategyExtended.java
Modified:
    incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/embedded/EmbeddedWebViewerRestful.java

Copied: incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/authentication/AuthenticationSessionLookupStrategyParams.java
(from r1029373, incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/authentication/AuthenticationSessionLookupStrategyExtended.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/authentication/AuthenticationSessionLookupStrategyParams.java?p2=incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/authentication/AuthenticationSessionLookupStrategyParams.java&p1=incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/authentication/AuthenticationSessionLookupStrategyExtended.java&r1=1029373&r2=1031380&rev=1031380&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/authentication/AuthenticationSessionLookupStrategyExtended.java
(original)
+++ incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/authentication/AuthenticationSessionLookupStrategyParams.java
Fri Nov  5 00:57:36 2010
@@ -6,36 +6,26 @@ import javax.servlet.http.HttpServletReq
 
 import org.apache.isis.metamodel.authentication.AuthenticationSession;
 import org.apache.isis.runtime.authentication.AuthenticationRequestPassword;
-import org.apache.isis.runtime.authentication.standard.exploration.AuthenticationRequestExploration;
 import org.apache.isis.runtime.context.IsisContext;
-import org.apache.isis.runtime.system.DeploymentType;
 import org.apache.isis.webapp.auth.AuthenticationSessionLookupStrategyDefault;
 
-public class AuthenticationSessionLookupStrategyExtended extends AuthenticationSessionLookupStrategyDefault
{
+public class AuthenticationSessionLookupStrategyParams extends AuthenticationSessionLookupStrategyDefault
{
 
-	@Override
-	public AuthenticationSession lookup(ServletRequest servletRequest,
-			ServletResponse servletResponse) {
-		AuthenticationSession session = super.lookup(servletRequest, servletResponse);
-		if (session != null) {
-			return session;
-		}
-		
-        final DeploymentType deploymentType = IsisContext.getDeploymentType();
-
-        if (deploymentType.isExploring()) {
-        	AuthenticationRequestExploration request = new AuthenticationRequestExploration();
-        	return IsisContext.getAuthenticationManager().authenticate(request);
+    @Override
+    public AuthenticationSession lookup(ServletRequest servletRequest, ServletResponse servletResponse)
{
+        AuthenticationSession session = super.lookup(servletRequest, servletResponse);
+        if (session != null) {
+            return session;
         }
 
         HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest;
         String user = httpServletRequest.getParameter("user");
         String password = httpServletRequest.getParameter("password");
-        
+
         if (user == null || password == null) {
-        	return null;
+            return null;
         }
         AuthenticationRequestPassword request = new AuthenticationRequestPassword(user, password);
-		return IsisContext.getAuthenticationManager().authenticate(request);
-	}
+        return IsisContext.getAuthenticationManager().authenticate(request);
+    }
 }

Added: incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/authentication/AuthenticationSessionLookupStrategyTrusted.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/authentication/AuthenticationSessionLookupStrategyTrusted.java?rev=1031380&view=auto
==============================================================================
--- incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/authentication/AuthenticationSessionLookupStrategyTrusted.java
(added)
+++ incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/authentication/AuthenticationSessionLookupStrategyTrusted.java
Fri Nov  5 00:57:36 2010
@@ -0,0 +1,24 @@
+package org.apache.isis.viewer.restful.viewer.authentication;
+
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+
+import org.apache.isis.metamodel.authentication.AuthenticationSession;
+import org.apache.isis.runtime.authentication.standard.exploration.AuthenticationRequestExploration;
+import org.apache.isis.runtime.context.IsisContext;
+import org.apache.isis.webapp.auth.AuthenticationSessionLookupStrategyDefault;
+
+public class AuthenticationSessionLookupStrategyTrusted extends AuthenticationSessionLookupStrategyDefault
{
+
+    @Override
+    public AuthenticationSession lookup(ServletRequest servletRequest, ServletResponse servletResponse)
{
+        AuthenticationSession session = super.lookup(servletRequest, servletResponse);
+        if (session != null) {
+            return session;
+        }
+
+        // will always succeed.
+        AuthenticationRequestExploration request = new AuthenticationRequestExploration();
+        return IsisContext.getAuthenticationManager().authenticate(request);
+    }
+}

Modified: incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/embedded/EmbeddedWebViewerRestful.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/embedded/EmbeddedWebViewerRestful.java?rev=1031380&r1=1031379&r2=1031380&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/embedded/EmbeddedWebViewerRestful.java
(original)
+++ incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/embedded/EmbeddedWebViewerRestful.java
Fri Nov  5 00:57:36 2010
@@ -4,7 +4,7 @@ import org.apache.isis.commons.lang.MapU
 import org.apache.isis.runtime.web.EmbeddedWebViewer;
 import org.apache.isis.runtime.web.WebAppSpecification;
 import org.apache.isis.viewer.restful.viewer.RestfulApplication;
-import org.apache.isis.viewer.restful.viewer.authentication.AuthenticationSessionLookupStrategyExtended;
+import org.apache.isis.viewer.restful.viewer.authentication.AuthenticationSessionLookupStrategyParams;
 import org.apache.isis.webapp.IsisSessionFilter;
 import org.apache.isis.webapp.StaticContentFilter;
 import org.apache.isis.webapp.servlets.ResourceServlet;
@@ -23,7 +23,7 @@ final class EmbeddedWebViewerRestful ext
 	    
 	    webAppSpec.addFilterSpecification(
 	    		IsisSessionFilter.class, 
-	    		MapUtils.asMap(IsisSessionFilter.AUTHENTICATION_SESSION_LOOKUP_STRATEGY_KEY, AuthenticationSessionLookupStrategyExtended.class.getName()),
+	    		MapUtils.asMap(IsisSessionFilter.AUTHENTICATION_SESSION_LOOKUP_STRATEGY_KEY, AuthenticationSessionLookupStrategyParams.class.getName()),
 	    		RestfulViewerInstaller.EVERYTHING);
 	    webAppSpec.addServletSpecification(
 	    		HttpServletDispatcher.class, RestfulViewerInstaller.ROOT);



Mime
View raw message