[java-shib-common COMMIT] in /branches/REL_1: doc/RELEASE-NOTES.txt src/main/java/edu/internet2/middleware/shibboleth...

noreply at shibboleth.net noreply at shibboleth.net
Mon Oct 20 12:46:38 EDT 2014


Author: scantor
Date: Mon Oct 20 12:46:38 2014
New Revision: 1109

URL: http://svn.shibboleth.net/view/java-shib-common?rev=1109&view=rev
Log:
SC-197 - Target of value/scope rules in Permit/Deny context are ignored

Modified:
    branches/REL_1/doc/RELEASE-NOTES.txt
    branches/REL_1/src/main/java/edu/internet2/middleware/shibboleth/common/attribute/filtering/provider/match/basic/AbstractAttributeTargetedRegexMatchFunctor.java
    branches/REL_1/src/main/java/edu/internet2/middleware/shibboleth/common/attribute/filtering/provider/match/basic/AbstractAttributeTargetedStringMatchFunctor.java

Modified: branches/REL_1/doc/RELEASE-NOTES.txt
URL: http://svn.shibboleth.net/view/java-shib-common/branches/REL_1/doc/RELEASE-NOTES.txt?rev=1109&r1=1108&r2=1109&view=diff
==============================================================================
--- branches/REL_1/doc/RELEASE-NOTES.txt (original)
+++ branches/REL_1/doc/RELEASE-NOTES.txt Mon Oct 20 12:46:38 2014
@@ -1,6 +1,7 @@
 Changes in Release 1.4.3
 =============================================
 [SC-196] - IdP will send empty Subject:NameID in assertion
+[SC-197] - Target of value/scope rules in Permit/Deny context are ignored
 
 Changes in Release 1.4.2
 =============================================

Modified: branches/REL_1/src/main/java/edu/internet2/middleware/shibboleth/common/attribute/filtering/provider/match/basic/AbstractAttributeTargetedRegexMatchFunctor.java
URL: http://svn.shibboleth.net/view/java-shib-common/branches/REL_1/src/main/java/edu/internet2/middleware/shibboleth/common/attribute/filtering/provider/match/basic/AbstractAttributeTargetedRegexMatchFunctor.java?rev=1109&r1=1108&r2=1109&view=diff
==============================================================================
--- branches/REL_1/src/main/java/edu/internet2/middleware/shibboleth/common/attribute/filtering/provider/match/basic/AbstractAttributeTargetedRegexMatchFunctor.java (original)
+++ branches/REL_1/src/main/java/edu/internet2/middleware/shibboleth/common/attribute/filtering/provider/match/basic/AbstractAttributeTargetedRegexMatchFunctor.java Mon Oct 20 12:46:38 2014
@@ -18,11 +18,19 @@
 package edu.internet2.middleware.shibboleth.common.attribute.filtering.provider.match.basic;
 
 import org.opensaml.xml.util.DatatypeHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import edu.internet2.middleware.shibboleth.common.attribute.filtering.provider.FilterProcessingException;
+import edu.internet2.middleware.shibboleth.common.attribute.filtering.provider.ShibbolethFilteringContext;
 
 /**
  * Base class for match functions that match a regular expresion against an attribute's value.
  */
 public abstract class AbstractAttributeTargetedRegexMatchFunctor extends AbstractRegexMatchFunctor {
+
+    /** Class logger. */
+    private final Logger log = LoggerFactory.getLogger(AbstractAttributeTargetedRegexMatchFunctor.class);
 
     /** ID of the attribute whose values will be evaluated. */
     private String attributeId;
@@ -44,4 +52,25 @@
     public void setAttributeId(String id) {
         attributeId = DatatypeHelper.safeTrimOrNullString(id);
     }
+    
+    /** {@inheritDoc} */
+    public boolean evaluatePermitValue(ShibbolethFilteringContext filterContext, String id,
+            Object attributeValue) throws FilterProcessingException {
+        warnOnTargeted(id);
+        return super.evaluatePermitValue(filterContext, id, attributeValue);
+    }
+    
+    /**
+     * Emits a warning in the event that a target attribute is configured, because this target is
+     * ignored during Permit/Deny rule evaluation.
+     * 
+     * @param actualId the actual attribute being evaluated
+     */
+    protected void warnOnTargeted(String actualId) {
+        if (attributeId != null) {
+            log.warn("Ignoring targeted attribute '{}' in permit/deny rule, applying to actual attribute '{}'",
+                    attributeId, actualId);
+        }
+    }
+
 }

Modified: branches/REL_1/src/main/java/edu/internet2/middleware/shibboleth/common/attribute/filtering/provider/match/basic/AbstractAttributeTargetedStringMatchFunctor.java
URL: http://svn.shibboleth.net/view/java-shib-common/branches/REL_1/src/main/java/edu/internet2/middleware/shibboleth/common/attribute/filtering/provider/match/basic/AbstractAttributeTargetedStringMatchFunctor.java?rev=1109&r1=1108&r2=1109&view=diff
==============================================================================
--- branches/REL_1/src/main/java/edu/internet2/middleware/shibboleth/common/attribute/filtering/provider/match/basic/AbstractAttributeTargetedStringMatchFunctor.java (original)
+++ branches/REL_1/src/main/java/edu/internet2/middleware/shibboleth/common/attribute/filtering/provider/match/basic/AbstractAttributeTargetedStringMatchFunctor.java Mon Oct 20 12:46:38 2014
@@ -18,12 +18,20 @@
 package edu.internet2.middleware.shibboleth.common.attribute.filtering.provider.match.basic;
 
 import org.opensaml.xml.util.DatatypeHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+

[... 41 lines stripped ...]


More information about the commits mailing list