You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2019/11/26 10:46:43 UTC
[syncope] branch 2_1_X updated: [SYNCOPE-1518] Conditionally
enabling Wicket's XForwardedRequestWrapperFactory
This is an automated email from the ASF dual-hosted git repository.
ilgrosso pushed a commit to branch 2_1_X
in repository https://gitbox.apache.org/repos/asf/syncope.git
The following commit(s) were added to refs/heads/2_1_X by this push:
new 7939942 [SYNCOPE-1518] Conditionally enabling Wicket's XForwardedRequestWrapperFactory
7939942 is described below
commit 7939942e761f0b2d96c70b5eb5e01e3c305e4970
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Tue Nov 26 11:29:21 2019 +0100
[SYNCOPE-1518] Conditionally enabling Wicket's XForwardedRequestWrapperFactory
---
.../org/apache/syncope/client/console/SyncopeConsoleApplication.java | 5 +++++
client/console/src/main/resources/console.properties | 1 +
docker/console/src/main/resources/console.properties.template | 1 +
fit/console-reference/src/main/resources/console.properties | 1 +
fit/core-reference/src/test/resources/console.properties | 1 +
5 files changed, 9 insertions(+)
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
index b280430..641c9a0 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
@@ -57,6 +57,7 @@ import org.apache.wicket.authroles.authentication.AuthenticatedWebSession;
import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.protocol.http.WebApplication;
+import org.apache.wicket.protocol.http.servlet.XForwardedRequestWrapperFactory;
import org.apache.wicket.protocol.ws.WebSocketAwareCsrfPreventionRequestCycleListener;
import org.apache.wicket.request.cycle.IRequestCycleListener;
import org.apache.wicket.protocol.ws.api.WebSocketResponse;
@@ -209,6 +210,10 @@ public class SyncopeConsoleApplication extends AuthenticatedWebApplication {
getMarkupSettings().setStripWicketTags(true);
getMarkupSettings().setCompressWhitespace(true);
+ if (BooleanUtils.toBoolean(props.getProperty("x-forward"))) {
+ getFilterFactoryManager().add(new XForwardedRequestWrapperFactory());
+ }
+
if (BooleanUtils.toBoolean(props.getProperty("csrf"))) {
getRequestCycleListeners().add(new WebSocketAwareCsrfPreventionRequestCycleListener());
}
diff --git a/client/console/src/main/resources/console.properties b/client/console/src/main/resources/console.properties
index e8ac65e..8353183 100644
--- a/client/console/src/main/resources/console.properties
+++ b/client/console/src/main/resources/console.properties
@@ -48,6 +48,7 @@ topology.corePoolSize=10
topology.maxPoolSize=20
topology.queueCapacity=50
+x-forward=true
csrf=true
security.headers.X-XSS-Protection=1; mode=block
diff --git a/docker/console/src/main/resources/console.properties.template b/docker/console/src/main/resources/console.properties.template
index fe3ecbc..0c1b820 100644
--- a/docker/console/src/main/resources/console.properties.template
+++ b/docker/console/src/main/resources/console.properties.template
@@ -48,6 +48,7 @@ topology.corePoolSize=10
topology.maxPoolSize=20
topology.queueCapacity=50
+x-forward=true
csrf=true
security.headers.X-XSS-Protection=1; mode=block
diff --git a/fit/console-reference/src/main/resources/console.properties b/fit/console-reference/src/main/resources/console.properties
index 28e1822..d4e8b3f 100644
--- a/fit/console-reference/src/main/resources/console.properties
+++ b/fit/console-reference/src/main/resources/console.properties
@@ -48,6 +48,7 @@ topology.corePoolSize=50
topology.maxPoolSize=100
topology.queueCapacity=10
+x-forward=true
csrf=true
security.headers.X-XSS-Protection=1; mode=block
diff --git a/fit/core-reference/src/test/resources/console.properties b/fit/core-reference/src/test/resources/console.properties
index fe998b2..39eaa8c 100644
--- a/fit/core-reference/src/test/resources/console.properties
+++ b/fit/core-reference/src/test/resources/console.properties
@@ -48,6 +48,7 @@ topology.corePoolSize=50
topology.maxPoolSize=100
topology.queueCapacity=10
+x-forward=true
csrf=false
security.headers.X-XSS-Protection=1; mode=block