You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2019/12/04 13:03:44 UTC

[isis] branch master updated (ad4f87d -> be066d4)

This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git.


    from ad4f87d  ISIS-2205: fixes bad paths for Antora
     new eab19bc  ISIS-2212: moves AuthenticationSessionStrategy and its subtypes from runtime-web to restfulobjects.server
     new 1078f3a  ISIS-2212: uses class literals insted of strings where possible in config of WebModuleRestfulObjects
     new fef973c  ISIS-2212: injects IsisConfiguration into WebModuleRestfulObjects
     new 7108d55  ISIS-2212; refactors for constructor injection for WebModuleH2Console
     new 7ed4b10  ISIS-2212: uses class literals in WebModuleLogOnExceptionLogger where possible
     new e3e2919  ISIS-2212: refactors to constructor injection for WebModuleWicket
     new 8558c5e  ISIS-2212: uses class literals in WebModuleShiro where possible
     new be066d4  ISIS-1297: KeycloakAuthenticator now correctly uses the AuthenticationSessionWormhole threadlocal

The 8 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../logonlog/WebModuleLogOnExceptionLogger.java    |  8 +--
 .../isis/security/keycloak/WebModuleKeycloak.java  |  2 -
 .../authentication/KeycloakAuthenticator.java      |  3 +-
 .../apache/isis/security/shiro/WebModuleShiro.java |  9 ++--
 .../IsisRestfulObjectsSessionFilter.java           |  4 +-
 .../restfulobjects/WebModuleRestfulObjects.java    | 34 ++++++------
 .../auth/AuthenticationSessionStrategy.java        |  2 +-
 .../AuthenticationSessionStrategyAbstract.java     |  2 +-
 .../AuthenticationSessionStrategyBasicAuth.java    |  2 +-
 .../auth/AuthenticationSessionStrategyDefault.java |  2 +-
 .../isis/viewer/wicket/viewer/WebModuleWicket.java | 62 ++++++++++------------
 .../h2console/webmodule/WebModuleH2Console.java    | 13 +++--
 12 files changed, 69 insertions(+), 74 deletions(-)
 rename core/{runtime-web/src/main/java/org/apache/isis/webapp => viewers/restfulobjects/server/src/main/java/org/apache/isis/viewer/restfulobjects/server}/auth/AuthenticationSessionStrategy.java (97%)
 rename core/{runtime-web/src/main/java/org/apache/isis/webapp => viewers/restfulobjects/server/src/main/java/org/apache/isis/viewer/restfulobjects/server}/auth/AuthenticationSessionStrategyAbstract.java (97%)
 rename core/{runtime-web/src/main/java/org/apache/isis/webapp => viewers/restfulobjects/server/src/main/java/org/apache/isis/viewer/restfulobjects/server}/auth/AuthenticationSessionStrategyBasicAuth.java (98%)
 rename core/{runtime-web/src/main/java/org/apache/isis/webapp => viewers/restfulobjects/server/src/main/java/org/apache/isis/viewer/restfulobjects/server}/auth/AuthenticationSessionStrategyDefault.java (98%)


[isis] 08/08: ISIS-1297: KeycloakAuthenticator now correctly uses the AuthenticationSessionWormhole threadlocal

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git

commit be066d4749f38211ce65269fab1141e20fa1b164
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Wed Dec 4 12:58:07 2019 +0000

    ISIS-1297: KeycloakAuthenticator now correctly uses the AuthenticationSessionWormhole threadlocal
    
    ... and the thread-local in WebModuleKeycloak is now properly defunct and can be removed.
---
 .../main/java/org/apache/isis/security/keycloak/WebModuleKeycloak.java | 2 --
 .../isis/security/keycloak/authentication/KeycloakAuthenticator.java   | 3 ++-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/core/security/keycloak/src/main/java/org/apache/isis/security/keycloak/WebModuleKeycloak.java b/core/security/keycloak/src/main/java/org/apache/isis/security/keycloak/WebModuleKeycloak.java
index 945524c..29bc4fd 100644
--- a/core/security/keycloak/src/main/java/org/apache/isis/security/keycloak/WebModuleKeycloak.java
+++ b/core/security/keycloak/src/main/java/org/apache/isis/security/keycloak/WebModuleKeycloak.java
@@ -43,8 +43,6 @@ import static org.apache.isis.commons.internal.exceptions._Exceptions.unexpected
 @Order(Ordered.HIGHEST_PRECEDENCE + 100)
 public final class WebModuleKeycloak implements WebModule  {
 
-    public final static ThreadLocal<AuthenticationSession> sessionByThread = new ThreadLocal<>();
-
     private final static String KEYCLOAK_FILTER_CLASS_NAME =
             KeycloakFilter.class.getName();
 
diff --git a/core/security/keycloak/src/main/java/org/apache/isis/security/keycloak/authentication/KeycloakAuthenticator.java b/core/security/keycloak/src/main/java/org/apache/isis/security/keycloak/authentication/KeycloakAuthenticator.java
index fe6fb06..c1068bb 100644
--- a/core/security/keycloak/src/main/java/org/apache/isis/security/keycloak/authentication/KeycloakAuthenticator.java
+++ b/core/security/keycloak/src/main/java/org/apache/isis/security/keycloak/authentication/KeycloakAuthenticator.java
@@ -28,6 +28,7 @@ import org.apache.isis.security.authentication.AuthenticationRequest;
 import org.apache.isis.security.authentication.AuthenticationSession;
 import org.apache.isis.security.authentication.standard.Authenticator;
 import org.apache.isis.security.keycloak.WebModuleKeycloak;
+import org.apache.isis.webapp.wormhole.AuthenticationSessionWormhole;
 
 @Log4j2 @NoArgsConstructor
 public class KeycloakAuthenticator implements Authenticator {
@@ -53,7 +54,7 @@ public class KeycloakAuthenticator implements Authenticator {
 
     @Override
     public AuthenticationSession authenticate(final AuthenticationRequest request, final String code) {
-        return WebModuleKeycloak.sessionByThread.get();
+        return AuthenticationSessionWormhole.sessionByThread.get();
     }
 
     @Override


[isis] 04/08: ISIS-2212; refactors for constructor injection for WebModuleH2Console

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 7108d55bf901ac4fce2da9736593e6796eb7fb08
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Wed Dec 4 12:38:51 2019 +0000

    ISIS-2212; refactors for constructor injection for WebModuleH2Console
---
 .../extensions/h2console/webmodule/WebModuleH2Console.java  | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/extensions/persistence/h2console/src/main/java/org/apache/isis/extensions/h2console/webmodule/WebModuleH2Console.java b/extensions/persistence/h2console/src/main/java/org/apache/isis/extensions/h2console/webmodule/WebModuleH2Console.java
index 05521f7..6bd99e8 100644
--- a/extensions/persistence/h2console/src/main/java/org/apache/isis/extensions/h2console/webmodule/WebModuleH2Console.java
+++ b/extensions/persistence/h2console/src/main/java/org/apache/isis/extensions/h2console/webmodule/WebModuleH2Console.java
@@ -40,14 +40,19 @@ import lombok.val;
 @Service @Order(0)
 public class WebModuleH2Console implements WebModule  {
 
-    @Inject IsisSystemEnvironment isisSystemEnvironment;
-    @Inject IsisConfiguration isisConfiguration;
-
-
     private final static String SERVLET_NAME = "H2Console";
     private final static String SERVLET_CLASS_NAME = "org.h2.server.web.WebServlet";
     private final static String CONSOLE_PATH = "/db"; //XXX could be made a config value 
 
+    private final IsisSystemEnvironment isisSystemEnvironment;
+    private final IsisConfiguration isisConfiguration;
+
+    @Inject
+    public WebModuleH2Console(IsisSystemEnvironment isisSystemEnvironment, IsisConfiguration isisConfiguration) {
+        this.isisSystemEnvironment = isisSystemEnvironment;
+        this.isisConfiguration = isisConfiguration;
+    }
+
     @Getter private LocalResourcePath localResourcePathIfEnabled;
 
     @Override


[isis] 02/08: ISIS-2212: uses class literals insted of strings where possible in config of WebModuleRestfulObjects

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 1078f3ac31325adfaa760ea3365d0f51689a014f
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Wed Dec 4 12:33:11 2019 +0000

    ISIS-2212: uses class literals insted of strings where possible in config of WebModuleRestfulObjects
---
 .../viewer/restfulobjects/WebModuleRestfulObjects.java     | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/core/viewers/restfulobjects/server/src/main/java/org/apache/isis/viewer/restfulobjects/WebModuleRestfulObjects.java b/core/viewers/restfulobjects/server/src/main/java/org/apache/isis/viewer/restfulobjects/WebModuleRestfulObjects.java
index fdf537e..26c12c9 100644
--- a/core/viewers/restfulobjects/server/src/main/java/org/apache/isis/viewer/restfulobjects/WebModuleRestfulObjects.java
+++ b/core/viewers/restfulobjects/server/src/main/java/org/apache/isis/viewer/restfulobjects/WebModuleRestfulObjects.java
@@ -22,6 +22,8 @@ import javax.servlet.ServletContext;
 import javax.servlet.ServletContextListener;
 import javax.servlet.ServletException;
 
+import org.apache.isis.viewer.restfulobjects.server.auth.AuthenticationSessionStrategyBasicAuth;
+import org.apache.isis.viewer.restfulobjects.server.webapp.IsisTransactionFilterForRestfulObjects;
 import org.springframework.core.annotation.Order;
 
 import org.apache.isis.applib.annotation.DomainService;
@@ -50,9 +52,7 @@ import lombok.val;
 @Order(-80)
 public final class WebModuleRestfulObjects implements WebModule  {
 
-    private final static String RESTEASY_BOOTSTRAPPER = 
-            "org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap";
-
+    private final static String RESTEASY_BOOTSTRAPPER = "org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap";
     private final static String RESTEASY_DISPATCHER = "RestfulObjectsRestEasyDispatcher";
 
     String restfulPathConfigValue;
@@ -97,7 +97,7 @@ public final class WebModuleRestfulObjects implements WebModule  {
 
             filter.setInitParameter(
                     "authenticationSessionStrategy", 
-                    "org.apache.isis.viewer.restfulobjects.server.auth.AuthenticationSessionStrategyBasicAuth");
+                    AuthenticationSessionStrategyBasicAuth.class.getName());
             filter.setInitParameter(
                     "whenNoSession", // what to do if no session was found ...
                     "auto"); // ... 401 and a basic authentication challenge if request originates from web browser
@@ -108,8 +108,8 @@ public final class WebModuleRestfulObjects implements WebModule  {
         }
 
         {
-            val filter = ctx.addFilter("RestfulObjectsRestEasyDispatcher", 
-                    "org.apache.isis.viewer.restfulobjects.server.webapp.IsisTransactionFilterForRestfulObjects");
+            val filter = ctx.addFilter("RestfulObjectsRestEasyDispatcher",
+                    IsisTransactionFilterForRestfulObjects.class.getName());
             filter.addMappingForServletNames(null, true, RESTEASY_DISPATCHER); 
         }
 
@@ -162,6 +162,4 @@ public final class WebModuleRestfulObjects implements WebModule  {
     }
 
 
-
-
 }


[isis] 05/08: ISIS-2212: uses class literals in WebModuleLogOnExceptionLogger where possible

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 7ed4b10084837ed411ea7090c8359f4ec1e19fc5
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Wed Dec 4 12:39:56 2019 +0000

    ISIS-2212: uses class literals in WebModuleLogOnExceptionLogger where possible
---
 .../webapp/modules/logonlog/WebModuleLogOnExceptionLogger.java    | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/core/runtime-web/src/main/java/org/apache/isis/webapp/modules/logonlog/WebModuleLogOnExceptionLogger.java b/core/runtime-web/src/main/java/org/apache/isis/webapp/modules/logonlog/WebModuleLogOnExceptionLogger.java
index ef757bb..5d98083 100644
--- a/core/runtime-web/src/main/java/org/apache/isis/webapp/modules/logonlog/WebModuleLogOnExceptionLogger.java
+++ b/core/runtime-web/src/main/java/org/apache/isis/webapp/modules/logonlog/WebModuleLogOnExceptionLogger.java
@@ -24,6 +24,7 @@ import javax.servlet.ServletContext;
 import javax.servlet.ServletContextListener;
 import javax.servlet.ServletException;
 
+import org.apache.isis.webapp.diagnostics.IsisLogOnExceptionFilter;
 import org.springframework.core.Ordered;
 import org.springframework.core.annotation.Order;
 import org.springframework.stereotype.Service;
@@ -44,10 +45,9 @@ import static org.apache.isis.commons.internal.exceptions._Exceptions.unexpected
 @Service @Order(Ordered.LOWEST_PRECEDENCE)
 public final class WebModuleLogOnExceptionLogger implements WebModule  {
 
-    private final static String LOGONLOGGER_FILTER_CLASS_NAME = 
-            "org.apache.isis.webapp.diagnostics.IsisLogOnExceptionFilter";
-    private final static String LOGONLOGGER_FILTER_NAME = 
-            "IsisLogOnExceptionFilter";
+    private final static String LOGONLOGGER_FILTER_CLASS_NAME = IsisLogOnExceptionFilter.class.getName();
+    private final static String LOGONLOGGER_FILTER_NAME = "IsisLogOnExceptionFilter";
+
     private WebModuleContext webModuleContext;
 
 


[isis] 07/08: ISIS-2212: uses class literals in WebModuleShiro where possible

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 8558c5e3a293f87ce347c913fc1e05c5dc5f2af4
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Wed Dec 4 12:53:56 2019 +0000

    ISIS-2212: uses class literals in WebModuleShiro where possible
---
 .../main/java/org/apache/isis/security/shiro/WebModuleShiro.java | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/core/security/shiro/src/main/java/org/apache/isis/security/shiro/WebModuleShiro.java b/core/security/shiro/src/main/java/org/apache/isis/security/shiro/WebModuleShiro.java
index 6893ee7..635d343 100644
--- a/core/security/shiro/src/main/java/org/apache/isis/security/shiro/WebModuleShiro.java
+++ b/core/security/shiro/src/main/java/org/apache/isis/security/shiro/WebModuleShiro.java
@@ -33,6 +33,7 @@ import org.apache.shiro.web.env.EnvironmentLoaderListener;
 import org.apache.shiro.web.env.IniWebEnvironment;
 import org.apache.shiro.web.env.WebEnvironment;
 import org.apache.shiro.web.filter.mgt.PathMatchingFilterChainResolver;
+import org.apache.shiro.web.servlet.ShiroFilter;
 import org.springframework.core.Ordered;
 import org.springframework.core.annotation.Order;
 import org.springframework.stereotype.Service;
@@ -61,12 +62,8 @@ import lombok.val;
 @Service @Order(Ordered.HIGHEST_PRECEDENCE + 100)
 public final class WebModuleShiro implements WebModule  {
     
-    private final static String SHIRO_LISTENER_CLASS_NAME = 
-            //"org.apache.shiro.web.env.EnvironmentLoaderListener";
-            EnvironmentLoaderListenerForIsis.class.getName();
-
-    private final static String SHIRO_FILTER_CLASS_NAME = 
-            "org.apache.shiro.web.servlet.ShiroFilter";
+    private final static String SHIRO_LISTENER_CLASS_NAME = EnvironmentLoaderListenerForIsis.class.getName();
+    private final static String SHIRO_FILTER_CLASS_NAME = ShiroFilter.class.getName();
 
     private final static String SHIRO_FILTER_NAME = "ShiroFilter";
 


[isis] 01/08: ISIS-2212: moves AuthenticationSessionStrategy and its subtypes from runtime-web to restfulobjects.server

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git

commit eab19bcda28ab97c2f382667c0d49f6ffa99ed60
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Wed Dec 4 12:28:37 2019 +0000

    ISIS-2212: moves AuthenticationSessionStrategy and its subtypes from runtime-web to restfulobjects.server
    
    ... since is only used there, nowhere else.
---
 .../isis/viewer/restfulobjects/IsisRestfulObjectsSessionFilter.java   | 4 ++--
 .../apache/isis/viewer/restfulobjects/WebModuleRestfulObjects.java    | 2 +-
 .../restfulobjects/server}/auth/AuthenticationSessionStrategy.java    | 2 +-
 .../server}/auth/AuthenticationSessionStrategyAbstract.java           | 2 +-
 .../server}/auth/AuthenticationSessionStrategyBasicAuth.java          | 2 +-
 .../server}/auth/AuthenticationSessionStrategyDefault.java            | 2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/core/viewers/restfulobjects/server/src/main/java/org/apache/isis/viewer/restfulobjects/IsisRestfulObjectsSessionFilter.java b/core/viewers/restfulobjects/server/src/main/java/org/apache/isis/viewer/restfulobjects/IsisRestfulObjectsSessionFilter.java
index 5b18714..488fd45 100644
--- a/core/viewers/restfulobjects/server/src/main/java/org/apache/isis/viewer/restfulobjects/IsisRestfulObjectsSessionFilter.java
+++ b/core/viewers/restfulobjects/server/src/main/java/org/apache/isis/viewer/restfulobjects/IsisRestfulObjectsSessionFilter.java
@@ -47,8 +47,8 @@ import org.apache.isis.metamodel.specloader.SpecificationLoader;
 import org.apache.isis.metamodel.specloader.validator.MetaModelInvalidException;
 import org.apache.isis.runtime.system.session.IsisSessionFactory;
 import org.apache.isis.webapp.IsisWebAppUtils;
-import org.apache.isis.webapp.auth.AuthenticationSessionStrategy;
-import org.apache.isis.webapp.auth.AuthenticationSessionStrategyDefault;
+import org.apache.isis.viewer.restfulobjects.server.auth.AuthenticationSessionStrategy;
+import org.apache.isis.viewer.restfulobjects.server.auth.AuthenticationSessionStrategyDefault;
 import org.apache.isis.webapp.modules.templresources.TemplateResourceCachingFilter;
 
 import static org.apache.isis.commons.internal.base._With.requires;
diff --git a/core/viewers/restfulobjects/server/src/main/java/org/apache/isis/viewer/restfulobjects/WebModuleRestfulObjects.java b/core/viewers/restfulobjects/server/src/main/java/org/apache/isis/viewer/restfulobjects/WebModuleRestfulObjects.java
index a09998a..fdf537e 100644
--- a/core/viewers/restfulobjects/server/src/main/java/org/apache/isis/viewer/restfulobjects/WebModuleRestfulObjects.java
+++ b/core/viewers/restfulobjects/server/src/main/java/org/apache/isis/viewer/restfulobjects/WebModuleRestfulObjects.java
@@ -97,7 +97,7 @@ public final class WebModuleRestfulObjects implements WebModule  {
 
             filter.setInitParameter(
                     "authenticationSessionStrategy", 
-                    "org.apache.isis.webapp.auth.AuthenticationSessionStrategyBasicAuth");
+                    "org.apache.isis.viewer.restfulobjects.server.auth.AuthenticationSessionStrategyBasicAuth");
             filter.setInitParameter(
                     "whenNoSession", // what to do if no session was found ...
                     "auto"); // ... 401 and a basic authentication challenge if request originates from web browser
diff --git a/core/runtime-web/src/main/java/org/apache/isis/webapp/auth/AuthenticationSessionStrategy.java b/core/viewers/restfulobjects/server/src/main/java/org/apache/isis/viewer/restfulobjects/server/auth/AuthenticationSessionStrategy.java
similarity index 97%
rename from core/runtime-web/src/main/java/org/apache/isis/webapp/auth/AuthenticationSessionStrategy.java
rename to core/viewers/restfulobjects/server/src/main/java/org/apache/isis/viewer/restfulobjects/server/auth/AuthenticationSessionStrategy.java
index b28d839..e39aaff 100644
--- a/core/runtime-web/src/main/java/org/apache/isis/webapp/auth/AuthenticationSessionStrategy.java
+++ b/core/viewers/restfulobjects/server/src/main/java/org/apache/isis/viewer/restfulobjects/server/auth/AuthenticationSessionStrategy.java
@@ -17,7 +17,7 @@
  *  under the License.
  */
 
-package org.apache.isis.webapp.auth;
+package org.apache.isis.viewer.restfulobjects.server.auth;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
diff --git a/core/runtime-web/src/main/java/org/apache/isis/webapp/auth/AuthenticationSessionStrategyAbstract.java b/core/viewers/restfulobjects/server/src/main/java/org/apache/isis/viewer/restfulobjects/server/auth/AuthenticationSessionStrategyAbstract.java
similarity index 97%
rename from core/runtime-web/src/main/java/org/apache/isis/webapp/auth/AuthenticationSessionStrategyAbstract.java
rename to core/viewers/restfulobjects/server/src/main/java/org/apache/isis/viewer/restfulobjects/server/auth/AuthenticationSessionStrategyAbstract.java
index 4a7f7ab..8bc8925 100644
--- a/core/runtime-web/src/main/java/org/apache/isis/webapp/auth/AuthenticationSessionStrategyAbstract.java
+++ b/core/viewers/restfulobjects/server/src/main/java/org/apache/isis/viewer/restfulobjects/server/auth/AuthenticationSessionStrategyAbstract.java
@@ -16,7 +16,7 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.webapp.auth;
+package org.apache.isis.viewer.restfulobjects.server.auth;
 
 import javax.servlet.ServletContext;
 import javax.servlet.ServletRequest;
diff --git a/core/runtime-web/src/main/java/org/apache/isis/webapp/auth/AuthenticationSessionStrategyBasicAuth.java b/core/viewers/restfulobjects/server/src/main/java/org/apache/isis/viewer/restfulobjects/server/auth/AuthenticationSessionStrategyBasicAuth.java
similarity index 98%
rename from core/runtime-web/src/main/java/org/apache/isis/webapp/auth/AuthenticationSessionStrategyBasicAuth.java
rename to core/viewers/restfulobjects/server/src/main/java/org/apache/isis/viewer/restfulobjects/server/auth/AuthenticationSessionStrategyBasicAuth.java
index 1dde6b9..137a5f8 100644
--- a/core/runtime-web/src/main/java/org/apache/isis/webapp/auth/AuthenticationSessionStrategyBasicAuth.java
+++ b/core/viewers/restfulobjects/server/src/main/java/org/apache/isis/viewer/restfulobjects/server/auth/AuthenticationSessionStrategyBasicAuth.java
@@ -16,7 +16,7 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.webapp.auth;
+package org.apache.isis.viewer.restfulobjects.server.auth;
 
 import java.nio.charset.StandardCharsets;
 import java.util.Base64;
diff --git a/core/runtime-web/src/main/java/org/apache/isis/webapp/auth/AuthenticationSessionStrategyDefault.java b/core/viewers/restfulobjects/server/src/main/java/org/apache/isis/viewer/restfulobjects/server/auth/AuthenticationSessionStrategyDefault.java
similarity index 98%
rename from core/runtime-web/src/main/java/org/apache/isis/webapp/auth/AuthenticationSessionStrategyDefault.java
rename to core/viewers/restfulobjects/server/src/main/java/org/apache/isis/viewer/restfulobjects/server/auth/AuthenticationSessionStrategyDefault.java
index 9413ec5..e96d0a2 100644
--- a/core/runtime-web/src/main/java/org/apache/isis/webapp/auth/AuthenticationSessionStrategyDefault.java
+++ b/core/viewers/restfulobjects/server/src/main/java/org/apache/isis/viewer/restfulobjects/server/auth/AuthenticationSessionStrategyDefault.java
@@ -17,7 +17,7 @@
  *  under the License.
  */
 
-package org.apache.isis.webapp.auth;
+package org.apache.isis.viewer.restfulobjects.server.auth;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;


[isis] 03/08: ISIS-2212: injects IsisConfiguration into WebModuleRestfulObjects

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git

commit fef973c92669596028c416bcc05a684203dd651e
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Wed Dec 4 12:35:38 2019 +0000

    ISIS-2212: injects IsisConfiguration into WebModuleRestfulObjects
---
 .../restfulobjects/WebModuleRestfulObjects.java      | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/core/viewers/restfulobjects/server/src/main/java/org/apache/isis/viewer/restfulobjects/WebModuleRestfulObjects.java b/core/viewers/restfulobjects/server/src/main/java/org/apache/isis/viewer/restfulobjects/WebModuleRestfulObjects.java
index 26c12c9..568b648 100644
--- a/core/viewers/restfulobjects/server/src/main/java/org/apache/isis/viewer/restfulobjects/WebModuleRestfulObjects.java
+++ b/core/viewers/restfulobjects/server/src/main/java/org/apache/isis/viewer/restfulobjects/WebModuleRestfulObjects.java
@@ -18,10 +18,12 @@
  */
 package org.apache.isis.viewer.restfulobjects;
 
+import javax.inject.Inject;
 import javax.servlet.ServletContext;
 import javax.servlet.ServletContextListener;
 import javax.servlet.ServletException;
 
+import org.apache.isis.config.IsisConfiguration;
 import org.apache.isis.viewer.restfulobjects.server.auth.AuthenticationSessionStrategyBasicAuth;
 import org.apache.isis.viewer.restfulobjects.server.webapp.IsisTransactionFilterForRestfulObjects;
 import org.springframework.core.annotation.Order;
@@ -55,7 +57,14 @@ public final class WebModuleRestfulObjects implements WebModule  {
     private final static String RESTEASY_BOOTSTRAPPER = "org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap";
     private final static String RESTEASY_DISPATCHER = "RestfulObjectsRestEasyDispatcher";
 
-    String restfulPathConfigValue;
+    private final IsisConfiguration isisConfiguration;
+    private final String restfulPathConfigValue;
+
+    @Inject
+    public WebModuleRestfulObjects(final IsisConfiguration isisConfiguration) {
+        this.isisConfiguration = isisConfiguration;
+        this.restfulPathConfigValue = isisConfiguration.getViewer().getRestfulobjects().getBasePath();
+    }
 
     @Override
     public String getName() {
@@ -69,15 +78,11 @@ public final class WebModuleRestfulObjects implements WebModule  {
             return;
         }
 
-        val restfulPath = ctx.getConfiguration().getViewer().getRestfulobjects().getBasePath();
-
-        putRestfulPath(restfulPath);
-
-        this.restfulPathConfigValue = restfulPath; // store locally for reuse
+        putRestfulPath(this.restfulPathConfigValue);
 
         // register this module as a viewer
         ctx.addViewer("restfulobjects");
-        ctx.addProtectedPath(suffix(prefix(restfulPath, "/"), "/") + "*" );
+        ctx.addProtectedPath(suffix(prefix(this.restfulPathConfigValue, "/"), "/") + "*" );
     }
 
     @Override
@@ -161,5 +166,4 @@ public final class WebModuleRestfulObjects implements WebModule  {
         return restfulPathEnclosedWithSlashes;
     }
 
-
 }


[isis] 06/08: ISIS-2212: refactors to constructor injection for WebModuleWicket

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git

commit e3e2919ab00a08c9beea8ad5ef7fcf60ecd64a3e
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Wed Dec 4 12:47:04 2019 +0000

    ISIS-2212: refactors to constructor injection for WebModuleWicket
---
 .../isis/viewer/wicket/viewer/WebModuleWicket.java | 62 ++++++++++------------
 1 file changed, 27 insertions(+), 35 deletions(-)

diff --git a/core/viewers/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/WebModuleWicket.java b/core/viewers/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/WebModuleWicket.java
index 2f85b54..64a6e89 100644
--- a/core/viewers/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/WebModuleWicket.java
+++ b/core/viewers/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/WebModuleWicket.java
@@ -25,10 +25,10 @@ import javax.servlet.ServletContext;
 import javax.servlet.ServletContextListener;
 import javax.servlet.ServletException;
 
+import org.apache.isis.config.IsisConfiguration;
 import org.springframework.core.annotation.Order;
 import org.springframework.stereotype.Service;
 
-import org.apache.isis.commons.internal.context._Context;
 import org.apache.isis.commons.internal.environment.IsisSystemEnvironment;
 import org.apache.isis.webapp.modules.WebModule;
 import org.apache.isis.webapp.modules.WebModuleContext;
@@ -40,8 +40,6 @@ import static org.apache.isis.commons.internal.base._Strings.suffix;
 import static org.apache.isis.commons.internal.context._Context.getDefaultClassLoader;
 import static org.apache.isis.commons.internal.exceptions._Exceptions.unexpectedCodeReach;
 
-import lombok.val;
-
 /**
  * WebModule that provides the Wicket Viewer.
  * @since 2.0
@@ -54,11 +52,29 @@ public final class WebModuleWicket implements WebModule  {
 
     private final static String WICKET_FILTER_NAME = "WicketFilter";
 
-    private String pathConfigValue;
-    private String deploymentMode;
-    private String appConfigValue;
+    private final IsisSystemEnvironment isisSystemEnvironment;
+    private final IsisConfiguration isisConfiguration;
+
+    private final String wicketBasePath;
+    private final String deploymentMode;
+    private final String wicketApp;
+
+    @Inject
+    public WebModuleWicket(final IsisSystemEnvironment isisSystemEnvironment, final IsisConfiguration isisConfiguration) {
+        this.isisSystemEnvironment = isisSystemEnvironment;
+        this.isisConfiguration = isisConfiguration;
+
+        wicketBasePath = isisConfiguration.getViewer().getWicket().getBasePath();
+
+        deploymentMode = isisSystemEnvironment.isPrototyping()
+                ? "development"
+                : "deployment";
+
+        wicketApp = isisConfiguration.getViewer().getWicket().getApp();
 
-    @Inject IsisSystemEnvironment isisSystemEnvironment;
+        requireNonNull(wicketBasePath, "Config property 'isis.viewer.wicket.base-path' is required.");
+        requireNonNull(wicketApp, "Config property 'isis.viewer.wicket.app' is required.");
+    }
 
     @Override
     public String getName() {
@@ -67,24 +83,13 @@ public final class WebModuleWicket implements WebModule  {
 
     @Override
     public void prepare(WebModuleContext ctx) {
-
         if(!isAvailable()) {
             return;
         }
 
-        val wicketConf = ctx.getConfiguration().getViewer().getWicket();
-        
-        pathConfigValue = wicketConf.getBasePath();
-
-        deploymentMode = isisSystemEnvironment.isPrototyping()
-                ? "development" 
-                        : "deployment";
-
-        appConfigValue = wicketConf.getApp();
-
         ctx.setHasBootstrapper();
         ctx.addViewer("wicket");
-        ctx.addProtectedPath(suffix(prefix(pathConfigValue, "/"), "/") + "*");
+        ctx.addProtectedPath(suffix(prefix(wicketBasePath, "/"), "/") + "*");
     }
 
     @Override
@@ -106,9 +111,9 @@ public final class WebModuleWicket implements WebModule  {
 
         final String urlPattern = getUrlPattern();
 
-        reg.setInitParameter("applicationClassName", getApplicationClassName());
+        reg.setInitParameter("applicationClassName", wicketApp);
         reg.setInitParameter("filterMappingUrlPattern", urlPattern);
-        reg.setInitParameter("configuration", getWicketMode()); 
+        reg.setInitParameter("configuration", deploymentMode);
         reg.addMappingForUrlPatterns(null, true, urlPattern);
 
         return null; // does not provide a listener
@@ -131,23 +136,10 @@ public final class WebModuleWicket implements WebModule  {
     }
 
     private String getUrlPattern() {
-        final String wicketPath = getWicketPath();
-        final String wicketPathEnclosedWithSlashes = suffix(prefix(wicketPath, "/"), "/");
+        final String wicketPathEnclosedWithSlashes = suffix(prefix(wicketBasePath, "/"), "/");
         final String urlPattern = wicketPathEnclosedWithSlashes + "*";
         return urlPattern;
     }
 
-    private String getWicketPath() {
-        return requireNonNull(pathConfigValue, "This web-module needs to be prepared first.");
-    }
-
-    private String getWicketMode() {
-        return requireNonNull(deploymentMode, "This web-module needs to be prepared first.");
-    }
-
-    private String getApplicationClassName() {
-        return requireNonNull(appConfigValue, "This web-module needs to be prepared first.");
-
-    }
 
 }