[java-shib-attribute] 01/06: JSATTR-5 Remove deprecations

Rod Widdowson rdw at steadingsoftware.com
Thu Nov 24 11:02:01 UTC 2022


This is an automated email from the git hooks/post-receive script.

rdw pushed a commit to branch main
in repository java-shib-attribute.

View the commit online:
http://git.shibboleth.net/view/?p=java-shib-attribute.git;a=commit;h=c5e0602db8d8f21bfc69b1a44b1585d278710f56

commit c5e0602db8d8f21bfc69b1a44b1585d278710f56
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Mon Nov 21 16:07:28 2022 +0000

    JSATTR-5 Remove deprecations
    
    https://shibboleth.atlassian.net/browse/JSATTR-5
    
    Remove <SourceValue ignoreCase="true" />
---
 .../resolver/ad/mapped/impl/SourceValue.java       | 28 +---------------------
 .../resolver/ad/mapped/impl/SourceValueTest.java   | 11 ---------
 .../spring/ad/mapped/impl/SourceValueParser.java   | 11 ---------
 .../schema/shibboleth-attribute-resolver.xsd       |  5 ----
 .../ad/mapped/impl/SourceValueParserTest.java      | 20 ----------------
 .../spring/ad/mapped/resolver/sourceValueBoth.xml  | 10 --------
 .../ad/mapped/resolver/sourceValueDeprecated.xml   | 10 --------
 7 files changed, 1 insertion(+), 94 deletions(-)

diff --git a/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/ad/mapped/impl/SourceValue.java b/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/ad/mapped/impl/SourceValue.java
index 724e5a252..1e34dec70 100644
--- a/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/ad/mapped/impl/SourceValue.java
+++ b/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/ad/mapped/impl/SourceValue.java
@@ -26,9 +26,7 @@ import com.google.common.base.MoreObjects;
 import net.shibboleth.shared.component.AbstractInitializableComponent;
 import net.shibboleth.shared.component.ComponentInitializationException;
 import net.shibboleth.shared.logic.Constraint;
-import net.shibboleth.shared.primitive.DeprecationSupport;
 import net.shibboleth.shared.primitive.StringSupport;
-import net.shibboleth.shared.primitive.DeprecationSupport.ObjectType;
 
 /**
  * Represents incoming attribute values and rules used for matching them. The value may include regular expressions.
@@ -87,30 +85,6 @@ public class SourceValue extends AbstractInitializableComponent {
         return caseSensitive;
     }
 
-    /**
-     * Set whether to ignore the case.
-     *
-     * @param theIgnoreCase whether case should be ignored when matching.  Null defaults to false;
-     * @deprecated in V4 - use setCaseSensitive
-     */
-    @Deprecated public void setIgnoreCase(final boolean theIgnoreCase) {
-        checkSetterPreconditions();
-        DeprecationSupport.warnOnce(ObjectType.METHOD, "setIgnoreCase", null, "setCaseSensitive");
-            setCaseSensitive(!theIgnoreCase);
-    }
-
-
-    /**
-     * Gets whether case should be ignored when matching.
-     *
-     * @return whether case should be ignored when matching
-     * @deprecated in V4 - use isCaseSensitive
-     */
-    @Deprecated public boolean isIgnoreCase() {
-        DeprecationSupport.warnOnce(ObjectType.METHOD, "isIgnoreCase", null, "isCaseSensitive");
-        return !isCaseSensitive();
-    }
-
     /**
      * Set whether partial matches should be allowed.
      *
@@ -164,7 +138,7 @@ public class SourceValue extends AbstractInitializableComponent {
 
     /** {@inheritDoc} */
     @Override public String toString() {
-        return MoreObjects.toStringHelper(this).add("value", value).add("IsIgnoreCase", isIgnoreCase())
+        return MoreObjects.toStringHelper(this).add("value", value).add("caseSensitive", isCaseSensitive())
                 .add("isPartialMatch", isPartialMatch()).toString();
     }
 
diff --git a/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/mapped/impl/SourceValueTest.java b/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/mapped/impl/SourceValueTest.java
index 020006b49..ddea8eb40 100644
--- a/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/mapped/impl/SourceValueTest.java
+++ b/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/mapped/impl/SourceValueTest.java
@@ -62,17 +62,6 @@ public class SourceValueTest {
         assertTrue(new SourceValue().isCaseSensitive());
     }
     
-    @SuppressWarnings("deprecation")
-    @Test public void deprecated() throws ComponentInitializationException {
-        final SourceValue value = new SourceValue();
-        assertTrue(value.isCaseSensitive());
-        value.setIgnoreCase(true);
-        assertFalse(value.isCaseSensitive());
-        value.setCaseSensitive(false);
-        assertFalse(value.isCaseSensitive());
-        assertTrue(value.isIgnoreCase());
-    }
-
     @Nonnull public static SourceValue newSourceValue(final String value, final boolean ignoreCase,
             final boolean partialMatch) throws ComponentInitializationException {
 
diff --git a/shib-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/ad/mapped/impl/SourceValueParser.java b/shib-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/ad/mapped/impl/SourceValueParser.java
index 2b56a512f..026515c80 100644
--- a/shib-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/ad/mapped/impl/SourceValueParser.java
+++ b/shib-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/ad/mapped/impl/SourceValueParser.java
@@ -66,17 +66,6 @@ public class SourceValueParser extends AbstractCustomBeanDefinitionParser {
         if (config.hasAttributeNS(null, "caseSensitive")) {
             caseSensitive = StringSupport.trimOrNull(config.getAttributeNS(null, "caseSensitive"));
             builder.addPropertyValue("caseSensitive", SpringSupport.getStringValueAsBoolean(caseSensitive));
-            if (config.hasAttributeNS(null, "ignoreCase")) {
-                log.warn("{}: Both \"caseSensitive\" and \"ignoreCase\" specified, only the former will be used",
-                        parserContext.getReaderContext().getResource().getDescription());
-            }
-        } else if (config.hasAttributeNS(null, "ignoreCase")) {
-            DeprecationSupport.warnOnce(ObjectType.ELEMENT,
-                    "ignoreCase",
-                    parserContext.getReaderContext().getResource().getDescription(),
-                    "caseSensitive");
-            builder.addPropertyValue("ignoreCase", SpringSupport.getStringValueAsBoolean(
-                    config.getAttributeNS(null, "ignoreCase")));
         }
 
         String partialMatch = null;
diff --git a/shib-attribute-resolver-spring/src/main/resources/schema/shibboleth-attribute-resolver.xsd b/shib-attribute-resolver-spring/src/main/resources/schema/shibboleth-attribute-resolver.xsd
index 78bec7ee4..bf176546d 100644
--- a/shib-attribute-resolver-spring/src/main/resources/schema/shibboleth-attribute-resolver.xsd
+++ b/shib-attribute-resolver-spring/src/main/resources/schema/shibboleth-attribute-resolver.xsd
@@ -294,11 +294,6 @@
                 <complexType>
                     <simpleContent>
                         <extension base="string">
-                            <attribute name="ignoreCase" type="resolver:string">
-                                <annotation>
-                                    <documentation>DEPRECATED: If true, value matching will be case-insensitive.</documentation>
-                                </annotation>
-                            </attribute>
                             <attribute name="caseSensitive" type="resolver:string">
                                 <annotation>
                                     <documentation>If true, value matching will be case-sensitive.</documentation>
diff --git a/shib-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/ad/mapped/impl/SourceValueParserTest.java b/shib-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/ad/mapped/impl/SourceValueParserTest.java
index 7d5d43f53..6fff48087 100644
--- a/shib-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/ad/mapped/impl/SourceValueParserTest.java
+++ b/shib-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/ad/mapped/impl/SourceValueParserTest.java
@@ -100,24 +100,4 @@ public class SourceValueParserTest extends BaseAttributeDefinitionParserTest {
         assertFalse(value.isCaseSensitive());
         assertFalse(value.isPartialMatch());
     }
-
-    
-    @SuppressWarnings("deprecation")
-    @Test public void deprecated() {
-        SourceValue value = getSourceValue("resolver/sourceValueDeprecated.xml");
-
-        assertFalse(value.isCaseSensitive());
-        assertTrue(value.isIgnoreCase());
-        assertTrue(value.isPartialMatch());
-        assertEquals(value.getValue(), "sourceValueAttributes1");
-    }
-
-    @Test public void both() {
-        SourceValue value = getSourceValue("resolver/sourceValueBoth.xml");
-
-        assertTrue(value.isCaseSensitive());
-        assertFalse(value.isPartialMatch());
-    }
-
-
 }
diff --git a/shib-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/ad/mapped/resolver/sourceValueBoth.xml b/shib-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/ad/mapped/resolver/sourceValueBoth.xml
deleted file mode 100644
index 8ff0e9c5f..000000000
--- a/shib-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/ad/mapped/resolver/sourceValueBoth.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<AttributeDefinition xmlns="urn:mace:shibboleth:2.0:resolver" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	id="container" 
-	xsi:schemaLocation="urn:mace:shibboleth:2.0:resolver http://shibboleth.net/schema/idp/shibboleth-attribute-resolver.xsd"
-	xsi:type="Mapped">
-    <InputAttributeDefinition ref="TheOrphan" />                    
-	<ValueMap>
-		<ReturnValue>return</ReturnValue>
-		<SourceValue ignoreCase="true" caseSensitive="true" partialMatch="false">sourceValueAttributes1</SourceValue>
-	</ValueMap>
-</AttributeDefinition>
diff --git a/shib-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/ad/mapped/resolver/sourceValueDeprecated.xml b/shib-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/ad/mapped/resolver/sourceValueDeprecated.xml
deleted file mode 100644
index 2386913d4..000000000
--- a/shib-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/ad/mapped/resolver/sourceValueDeprecated.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<AttributeDefinition xmlns="urn:mace:shibboleth:2.0:resolver" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	id="container" 
-	xsi:schemaLocation="urn:mace:shibboleth:2.0:resolver http://shibboleth.net/schema/idp/shibboleth-attribute-resolver.xsd"
-	xsi:type="Mapped">
-    <InputAttributeDefinition ref="TheOrphan" />                    
-	<ValueMap>
-		<ReturnValue>return</ReturnValue>
-		<SourceValue ignoreCase="true" partialMatch="true">sourceValueAttributes1</SourceValue>
-	</ValueMap>
-</AttributeDefinition>

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list