struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject git commit: Reverts validation of properties via dedicated SecurityJudge interface
Date Tue, 25 Feb 2014 10:09:32 GMT
Repository: struts
Updated Branches:
  refs/heads/develop 7d383d6d3 -> 5d0cf8bac


Reverts validation of properties via dedicated SecurityJudge interface


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/5d0cf8ba
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/5d0cf8ba
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/5d0cf8ba

Branch: refs/heads/develop
Commit: 5d0cf8baca45594ca7b6b4e7160e03f59cb258de
Parents: 7d383d6
Author: Lukasz Lenart <lukaszlenart@apache.org>
Authored: Tue Feb 25 11:08:29 2014 +0100
Committer: Lukasz Lenart <lukaszlenart@apache.org>
Committed: Tue Feb 25 11:08:29 2014 +0100

----------------------------------------------------------------------
 .../xwork2/interceptor/ParametersInterceptor.java      |  8 --------
 .../com/opensymphony/xwork2/ognl/OgnlValueStack.java   |  4 ----
 .../com/opensymphony/xwork2/ognl/PropertiesJudge.java  |  7 -------
 .../opensymphony/xwork2/ognl/SecurityMemberAccess.java | 13 +------------
 .../xwork2/util/MemberAccessValueStack.java            |  4 ----
 5 files changed, 1 insertion(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/5d0cf8ba/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ParametersInterceptor.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ParametersInterceptor.java
b/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ParametersInterceptor.java
index 9dfae95..75911a8 100644
--- a/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ParametersInterceptor.java
+++ b/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ParametersInterceptor.java
@@ -22,7 +22,6 @@ import com.opensymphony.xwork2.XWorkConstants;
 import com.opensymphony.xwork2.conversion.impl.InstantiatingNullHandler;
 import com.opensymphony.xwork2.conversion.impl.XWorkConverter;
 import com.opensymphony.xwork2.inject.Inject;
-import com.opensymphony.xwork2.ognl.PropertiesJudge;
 import com.opensymphony.xwork2.util.ArrayUtils;
 import com.opensymphony.xwork2.util.ClearableValueStack;
 import com.opensymphony.xwork2.util.LocalizedTextUtil;
@@ -313,13 +312,6 @@ public class ParametersInterceptor extends MethodFilterInterceptor {
             MemberAccessValueStack accessValueStack = (MemberAccessValueStack) newStack;
             accessValueStack.setAcceptProperties(acceptParams);
             accessValueStack.setExcludeProperties(excludeParams);
-            if (action instanceof ParameterNameAware) {
-                accessValueStack.setPropertiesJudge(new PropertiesJudge() {
-                    public boolean acceptProperty(String propertyName) {
-                        return ((ParameterNameAware) action).acceptableParameterName(propertyName);
-                    }
-                });
-            }
         }
 
         for (Map.Entry<String, Object> entry : acceptableParameters.entrySet()) {

http://git-wip-us.apache.org/repos/asf/struts/blob/5d0cf8ba/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/OgnlValueStack.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/OgnlValueStack.java b/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/OgnlValueStack.java
index 138db58..76f0d3f 100644
--- a/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/OgnlValueStack.java
+++ b/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/OgnlValueStack.java
@@ -465,10 +465,6 @@ public class OgnlValueStack implements Serializable, ValueStack, ClearableValueS
         securityMemberAccess.setAcceptProperties(acceptedProperties);
     }
 
-    public void setPropertiesJudge(PropertiesJudge judge) {
-        securityMemberAccess.setPropertiesJudge(judge);
-    }
-
     public void setExcludeProperties(Set<Pattern> excludeProperties) {
         securityMemberAccess.setExcludeProperties(excludeProperties);
     }

http://git-wip-us.apache.org/repos/asf/struts/blob/5d0cf8ba/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/PropertiesJudge.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/PropertiesJudge.java b/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/PropertiesJudge.java
deleted file mode 100644
index ed27c0f..0000000
--- a/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/PropertiesJudge.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package com.opensymphony.xwork2.ognl;
-
-public interface PropertiesJudge {
-
-    boolean acceptProperty(String propertyName);
-
-}

http://git-wip-us.apache.org/repos/asf/struts/blob/5d0cf8ba/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/SecurityMemberAccess.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/SecurityMemberAccess.java
b/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/SecurityMemberAccess.java
index b6d3d3f..7bbcbda 100644
--- a/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/SecurityMemberAccess.java
+++ b/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/SecurityMemberAccess.java
@@ -35,7 +35,6 @@ public class SecurityMemberAccess extends DefaultMemberAccess {
     private final boolean allowStaticMethodAccess;
     private Set<Pattern> excludeProperties = Collections.emptySet();
     private Set<Pattern> acceptProperties = Collections.emptySet();
-    private PropertiesJudge propertiesJudge;
 
     public SecurityMemberAccess(boolean method) {
         super(false);
@@ -76,14 +75,7 @@ public class SecurityMemberAccess extends DefaultMemberAccess {
     }
 
     protected boolean isAcceptableProperty(String name) {
-        if ( name == null) {
-            return true;
-        }
-
-        if ((!isExcluded(name)) && isAccepted(name) && (propertiesJudge ==
null || propertiesJudge.acceptProperty(name))) {
-            return true;
-        }
-        return false;
+        return name == null || ((!isExcluded(name)) && isAccepted(name));
     }
 
     protected boolean isAccepted(String paramName) {
@@ -123,7 +115,4 @@ public class SecurityMemberAccess extends DefaultMemberAccess {
         this.acceptProperties = acceptedProperties;
     }
 
-    public void setPropertiesJudge(PropertiesJudge judge) {
-        this.propertiesJudge = judge;
-    }
 }

http://git-wip-us.apache.org/repos/asf/struts/blob/5d0cf8ba/xwork-core/src/main/java/com/opensymphony/xwork2/util/MemberAccessValueStack.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/util/MemberAccessValueStack.java
b/xwork-core/src/main/java/com/opensymphony/xwork2/util/MemberAccessValueStack.java
index 210d67f..51f4e48 100644
--- a/xwork-core/src/main/java/com/opensymphony/xwork2/util/MemberAccessValueStack.java
+++ b/xwork-core/src/main/java/com/opensymphony/xwork2/util/MemberAccessValueStack.java
@@ -1,7 +1,5 @@
 package com.opensymphony.xwork2.util;
 
-import com.opensymphony.xwork2.ognl.PropertiesJudge;
-
 import java.util.Set;
 import java.util.regex.Pattern;
 
@@ -15,6 +13,4 @@ public interface MemberAccessValueStack {
 
     void setAcceptProperties(Set<Pattern> acceptedProperties);
 
-    void setPropertiesJudge(PropertiesJudge judge);
-
 }


Mime
View raw message