[java-identity-provider] 12/51: IDP-1121 Remove AuthenticationMethod filters

Rod Widdowson rdw at steadingsoftware.com
Wed Feb 6 08:42:43 EST 2019


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

rdw pushed a commit to branch master
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=edbe2cb351a367f2226f6845edd03cc4f148228f

commit edbe2cb351a367f2226f6845edd03cc4f148228f
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Wed Nov 28 16:16:57 2018 +0000

    IDP-1121 Remove AuthenticationMethod filters
    
    https://issues.shibboleth.net/jira/browse/IDP-1121
---
 .../impl/AuthenticationMethodPolicyRule.java       | 59 --------------
 .../impl/AuthenticationMethodRegexpPolicyRule.java | 59 --------------
 .../impl/AuthenticationMethodPolicyRuleTest.java   | 93 ----------------------
 .../AuthenticationMethodRegexpPolicyRuleTest.java  | 81 -------------------
 .../impl/AttributeFilterNamespaceHandler.java      | 12 +--
 .../impl/AuthenticationMethodRegexRuleParser.java  | 54 -------------
 .../impl/AuthenticationMethodRuleParser.java       | 54 -------------
 .../AuthenticationMethodRegexRuleParserTest.java   | 36 ---------
 .../policy/AuthenticationMethodRuleParserTest.java | 35 --------
 .../filter/policyrule/afp/authenticationMethod.xml |  5 --
 .../policyrule/afp/authenticationMethodRegex.xml   |  4 -
 .../src/main/resources/schema/shibboleth-afp.xsd   | 22 -----
 12 files changed, 2 insertions(+), 512 deletions(-)

diff --git a/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/policyrule/filtercontext/impl/AuthenticationMethodPolicyRule.java b/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/policyrule/filtercontext/impl/AuthenticationMethodPolicyRule.java
deleted file mode 100644
index 8d961fb..0000000
--- a/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/policyrule/filtercontext/impl/AuthenticationMethodPolicyRule.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the University Corporation for Advanced Internet Development,
- * Inc. (UCAID) under one or more contributor license agreements.  See the
- * NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The UCAID licenses this file to You under the Apache
- * License, Version 2.0 (the "License"); you may not use this file except in
- * compliance with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.shibboleth.idp.attribute.filter.policyrule.filtercontext.impl;
-
-import javax.annotation.Nonnull;
-
-import net.shibboleth.idp.attribute.filter.context.AttributeFilterContext;
-import net.shibboleth.idp.attribute.filter.policyrule.impl.AbstractStringPolicyRule;
-import net.shibboleth.utilities.java.support.component.ComponentSupport;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Compare the authentication method for this resolution with the provided string.
- */
-public class AuthenticationMethodPolicyRule extends AbstractStringPolicyRule {
-
-    /** Class logger. */
-    @Nonnull private final Logger log = LoggerFactory.getLogger(AuthenticationMethodPolicyRule.class);
-
-    /**
-     * Compare the authentication method for this resolution with the provided string.
-     * 
-     * @param filterContext the context
-     * @return whether it matches
-     * 
-     *         {@inheritDoc}
-     */
-    @Override public Tristate matches(@Nonnull final AttributeFilterContext filterContext) {
-
-        ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this);
-
-        @SuppressWarnings("deprecation") final String method = filterContext.getPrincipalAuthenticationMethod();
-        if (null == method) {
-            log.warn("{} No authetication method found for comparison", getLogPrefix());
-            return Tristate.FAIL;
-        }
-        log.debug("{} Found authentication method: {}", getLogPrefix(), method);
-
-        return stringCompare(method);
-    }
-
-}
\ No newline at end of file
diff --git a/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/policyrule/filtercontext/impl/AuthenticationMethodRegexpPolicyRule.java b/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/policyrule/filtercontext/impl/AuthenticationMethodRegexpPolicyRule.java
deleted file mode 100644
index 481bca4..0000000
--- a/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/policyrule/filtercontext/impl/AuthenticationMethodRegexpPolicyRule.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the University Corporation for Advanced Internet Development,
- * Inc. (UCAID) under one or more contributor license agreements.  See the
- * NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The UCAID licenses this file to You under the Apache
- * License, Version 2.0 (the "License"); you may not use this file except in
- * compliance with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.shibboleth.idp.attribute.filter.policyrule.filtercontext.impl;
-
-import javax.annotation.Nonnull;
-
-import net.shibboleth.idp.attribute.filter.context.AttributeFilterContext;
-import net.shibboleth.idp.attribute.filter.policyrule.impl.AbstractRegexpPolicyRule;
-import net.shibboleth.utilities.java.support.component.ComponentSupport;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Compare the authentication method for this resolution with the provided regexp.
- */
-public class AuthenticationMethodRegexpPolicyRule extends AbstractRegexpPolicyRule {
-
-    /** Class logger. */
-    @Nonnull private final Logger log = LoggerFactory.getLogger(AuthenticationMethodRegexpPolicyRule.class);
-
-    /**
-     * Compare the authentication method for this resolution with the provided regexp.
-     * 
-     * @param filterContext the context
-     * @return whether it matches
-     * 
-     *         {@inheritDoc}
-     */
-    @Override public Tristate matches(@Nonnull final AttributeFilterContext filterContext) {
-
-        ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this);
-
-        @SuppressWarnings("deprecation") final String method = filterContext.getPrincipalAuthenticationMethod();
-        if (null == method) {
-            log.warn("{} No authetication method found for comparison", getLogPrefix());
-            return Tristate.FAIL;
-        }
-        log.debug("{} Found authentication method: {}", getLogPrefix(), method);
-
-        return regexpCompare(method);
-    }
-
-}
\ No newline at end of file
diff --git a/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/policyrule/filtercontext/impl/AuthenticationMethodPolicyRuleTest.java b/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/policyrule/filtercontext/impl/AuthenticationMethodPolicyRuleTest.java
deleted file mode 100644
index 1283e67..0000000
--- a/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/policyrule/filtercontext/impl/AuthenticationMethodPolicyRuleTest.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the University Corporation for Advanced Internet Development,
- * Inc. (UCAID) under one or more contributor license agreements.  See the
- * NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The UCAID licenses this file to You under the Apache
- * License, Version 2.0 (the "License"); you may not use this file except in
- * compliance with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.shibboleth.idp.attribute.filter.policyrule.filtercontext.impl;
-
-import net.shibboleth.idp.attribute.filter.PolicyRequirementRule.Tristate;
-import net.shibboleth.idp.attribute.filter.context.AttributeFilterContext;
-import net.shibboleth.idp.attribute.filter.matcher.impl.DataSources;
-import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
-import net.shibboleth.utilities.java.support.component.UninitializedComponentException;
-
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
-/**
- * Tests for {@link AuthenticationMethodPolicyRule}.
- */
-public class AuthenticationMethodPolicyRuleTest {
-
-    protected static String METHOD = "AuthnMethod";
-    
-    private AuthenticationMethodPolicyRule getMatcher() throws ComponentInitializationException {
-        return getMatcher(true);
-    }
-    
-    protected static AttributeFilterContext filterContextWithAuthn(String authn) {
-        
-        AttributeFilterContext context = new AttributeFilterContext();
-        context.setPrincipalAuthenticationMethod(authn);
-        return context;
-    }
-    
-    private AuthenticationMethodPolicyRule getMatcher(boolean caseSensitive) throws ComponentInitializationException {
-        final AuthenticationMethodPolicyRule matcher = new AuthenticationMethodPolicyRule();
-        matcher.setMatchString(METHOD);
-        matcher.setIgnoreCase(!caseSensitive);
-        matcher.setId("Test");
-        matcher.initialize();
-        return matcher;
-    }
-
-    @Test public void testNull() throws ComponentInitializationException {
-
-        try {
-            new AuthenticationMethodPolicyRule().matches(null);
-            Assert.fail();
-        } catch (UninitializedComponentException ex) {
-            // OK
-        }
-    }
-
-    @Test public void testUnpopulated()
-            throws ComponentInitializationException {
-        Assert.assertEquals(getMatcher().matches(DataSources.unPopulatedFilterContext()), Tristate.FAIL);
-    }
-
-    @Test public void testNoIssuer()
-            throws ComponentInitializationException {
-        Assert.assertEquals(getMatcher().matches(filterContextWithAuthn(null)), Tristate.FAIL);
-    }
-
-    @Test public void testCaseSensitive() throws ComponentInitializationException {
-
-        final AuthenticationMethodPolicyRule matcher = getMatcher();
-
-        Assert.assertEquals(matcher.matches(filterContextWithAuthn(METHOD+METHOD)), Tristate.FALSE);
-        Assert.assertEquals(matcher.matches(filterContextWithAuthn(METHOD.toLowerCase())), Tristate.FALSE);
-        Assert.assertEquals(matcher.matches(filterContextWithAuthn(METHOD)), Tristate.TRUE);
-    }
-
-    @Test public void testCaseInsensitive() throws ComponentInitializationException {
-
-        final AuthenticationMethodPolicyRule matcher = getMatcher(false);
-
-        Assert.assertEquals(matcher.matches(filterContextWithAuthn(METHOD+METHOD)), Tristate.FALSE);
-        Assert.assertEquals(matcher.matches(filterContextWithAuthn(METHOD.toLowerCase())), Tristate.TRUE);
-        Assert.assertEquals(matcher.matches(filterContextWithAuthn(METHOD)), Tristate.TRUE);
-    }
-}
\ No newline at end of file
diff --git a/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/policyrule/filtercontext/impl/AuthenticationMethodRegexpPolicyRuleTest.java b/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/policyrule/filtercontext/impl/AuthenticationMethodRegexpPolicyRuleTest.java
deleted file mode 100644
index 1c68777..0000000
--- a/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/policyrule/filtercontext/impl/AuthenticationMethodRegexpPolicyRuleTest.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the University Corporation for Advanced Internet Development,
- * Inc. (UCAID) under one or more contributor license agreements.  See the
- * NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The UCAID licenses this file to You under the Apache
- * License, Version 2.0 (the "License"); you may not use this file except in
- * compliance with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.shibboleth.idp.attribute.filter.policyrule.filtercontext.impl;
-
-import net.shibboleth.idp.attribute.filter.AttributeFilterException;
-import net.shibboleth.idp.attribute.filter.PolicyRequirementRule.Tristate;
-import net.shibboleth.idp.attribute.filter.context.AttributeFilterContext;
-import net.shibboleth.idp.attribute.filter.matcher.impl.DataSources;
-import net.shibboleth.idp.attribute.filter.policyrule.filtercontext.impl.AuthenticationMethodRegexpPolicyRule;
-import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
-import net.shibboleth.utilities.java.support.component.UninitializedComponentException;
-
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
-/**
- * Tests for {@link AuthenticationMethodRegexpPolicyRule}.
- */
-public class AuthenticationMethodRegexpPolicyRuleTest {
-
-    protected static String METHOD = "AuthnMethod";
-    
-    protected static AttributeFilterContext filterContextWithAuthn(String authn) {
-        
-        AttributeFilterContext context = new AttributeFilterContext();
-        context.setPrincipalAuthenticationMethod(authn);
-        return context;
-    }
-    
-    private AuthenticationMethodRegexpPolicyRule getMatcher() throws ComponentInitializationException {
-        final AuthenticationMethodRegexpPolicyRule matcher = new AuthenticationMethodRegexpPolicyRule();
-        matcher.setRegularExpression("^Authn.*");
-        matcher.setId("Test");
-        matcher.initialize();
-        return matcher;
-    }
-
-    @Test public void testNull() throws ComponentInitializationException, AttributeFilterException {
-
-        try {
-            new AuthenticationMethodRegexpPolicyRule().matches(null);
-            Assert.fail();
-        } catch (UninitializedComponentException ex) {
-            // OK
-        }
-    }
-
-    @Test public void testUnpopulated()
-            throws ComponentInitializationException, AttributeFilterException {
-        Assert.assertEquals(getMatcher().matches(DataSources.unPopulatedFilterContext()), Tristate.FAIL);
-    }
-
-    @Test public void testNoIssuer()
-            throws ComponentInitializationException, AttributeFilterException {
-        Assert.assertEquals(getMatcher().matches(filterContextWithAuthn(null)), Tristate.FAIL);
-    }
-
-    @Test public void testRegexp() throws ComponentInitializationException, AttributeFilterException {
-
-        final AuthenticationMethodRegexpPolicyRule matcher = getMatcher();
-
-        Assert.assertEquals(matcher.matches(filterContextWithAuthn("foo")), Tristate.FALSE);
-        Assert.assertEquals(matcher.matches(filterContextWithAuthn(METHOD)), Tristate.TRUE);
-    }
-
-}
\ No newline at end of file
diff --git a/idp-attribute-filter-spring/src/main/java/net/shibboleth/idp/attribute/filter/spring/impl/AttributeFilterNamespaceHandler.java b/idp-attribute-filter-spring/src/main/java/net/shibboleth/idp/attribute/filter/spring/impl/AttributeFilterNamespaceHandler.java
index 416daa6..16139e6 100644
--- a/idp-attribute-filter-spring/src/main/java/net/shibboleth/idp/attribute/filter/spring/impl/AttributeFilterNamespaceHandler.java
+++ b/idp-attribute-filter-spring/src/main/java/net/shibboleth/idp/attribute/filter/spring/impl/AttributeFilterNamespaceHandler.java
@@ -17,6 +17,8 @@
 
 package net.shibboleth.idp.attribute.filter.spring.impl;
 
+import org.springframework.beans.factory.xml.BeanDefinitionParser;
+
 import net.shibboleth.ext.spring.util.BaseSpringNamespaceHandler;
 import net.shibboleth.idp.attribute.filter.spring.BaseFilterParser;
 import net.shibboleth.idp.attribute.filter.spring.basic.impl.AndMatcherParser;
@@ -32,8 +34,6 @@ import net.shibboleth.idp.attribute.filter.spring.policyrule.impl.AttributeIssue
 import net.shibboleth.idp.attribute.filter.spring.policyrule.impl.AttributeIssuerRuleParser;
 import net.shibboleth.idp.attribute.filter.spring.policyrule.impl.AttributeRequesterRegexRuleParser;
 import net.shibboleth.idp.attribute.filter.spring.policyrule.impl.AttributeRequesterRuleParser;
-import net.shibboleth.idp.attribute.filter.spring.policyrule.impl.AuthenticationMethodRegexRuleParser;
-import net.shibboleth.idp.attribute.filter.spring.policyrule.impl.AuthenticationMethodRuleParser;
 import net.shibboleth.idp.attribute.filter.spring.policyrule.impl.NumOfAttributeValuesRuleParser;
 import net.shibboleth.idp.attribute.filter.spring.policyrule.impl.PredicateRuleParser;
 import net.shibboleth.idp.attribute.filter.spring.policyrule.impl.PrincipalNameRegexRuleParser;
@@ -48,8 +48,6 @@ import net.shibboleth.idp.attribute.filter.spring.saml.impl.AttributeRequesterNa
 import net.shibboleth.idp.attribute.filter.spring.saml.impl.MappedAttributeInMetadataRuleParser;
 import net.shibboleth.idp.attribute.filter.spring.saml.impl.RegistrationAuthorityRuleParser;
 
-import org.springframework.beans.factory.xml.BeanDefinitionParser;
-
 /** Namespace handler for the attribute filtering engine. */
 public class AttributeFilterNamespaceHandler extends BaseSpringNamespaceHandler {
 
@@ -112,12 +110,6 @@ public class AttributeFilterNamespaceHandler extends BaseSpringNamespaceHandler
 
         registerBeanDefinitionParser(PrincipalNameRegexRuleParser.SCHEMA_TYPE, new PrincipalNameRegexRuleParser());
 
-        registerBeanDefinitionParser(AuthenticationMethodRuleParser.SCHEMA_TYPE,
-                new AuthenticationMethodRuleParser());
-
-        registerBeanDefinitionParser(AuthenticationMethodRegexRuleParser.SCHEMA_TYPE,
-                new AuthenticationMethodRegexRuleParser());
-
         registerBeanDefinitionParser(NumOfAttributeValuesRuleParser.SCHEMA_TYPE,
                 new NumOfAttributeValuesRuleParser());
 
diff --git a/idp-attribute-filter-spring/src/main/java/net/shibboleth/idp/attribute/filter/spring/policyrule/impl/AuthenticationMethodRegexRuleParser.java b/idp-attribute-filter-spring/src/main/java/net/shibboleth/idp/attribute/filter/spring/policyrule/impl/AuthenticationMethodRegexRuleParser.java
deleted file mode 100644
index 21071c6..0000000
--- a/idp-attribute-filter-spring/src/main/java/net/shibboleth/idp/attribute/filter/spring/policyrule/impl/AuthenticationMethodRegexRuleParser.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the University Corporation for Advanced Internet Development,
- * Inc. (UCAID) under one or more contributor license agreements.  See the
- * NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The UCAID licenses this file to You under the Apache
- * License, Version 2.0 (the "License"); you may not use this file except in
- * compliance with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.shibboleth.idp.attribute.filter.spring.policyrule.impl;
-
-import javax.annotation.Nonnull;
-import javax.xml.namespace.QName;
-
-import org.springframework.beans.factory.support.BeanDefinitionBuilder;
-import org.springframework.beans.factory.xml.ParserContext;
-import org.w3c.dom.Element;
-
-import net.shibboleth.idp.attribute.filter.policyrule.filtercontext.impl.AuthenticationMethodRegexpPolicyRule;
-import net.shibboleth.idp.attribute.filter.spring.BaseFilterParser;
-import net.shibboleth.utilities.java.support.primitive.DeprecationSupport;
-import net.shibboleth.utilities.java.support.primitive.DeprecationSupport.ObjectType;
-
-/**
- * Bean definition parser for {@link AuthenticationMethodRegexpPolicyRule}.
- */
-public class AuthenticationMethodRegexRuleParser extends AbstractRegexPolicyRuleParser {
-
-    /** Schema type. */
-    public static final QName SCHEMA_TYPE = new QName(BaseFilterParser.NAMESPACE, "AuthenticationMethodRegex");
-
-    /** {@inheritDoc} */
-    @Override @Nonnull protected Class<AuthenticationMethodRegexpPolicyRule> getNativeBeanClass() {
-        return AuthenticationMethodRegexpPolicyRule.class;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void doNativeParse(@Nonnull final Element element, @Nonnull final ParserContext parserContext,
-            @Nonnull final BeanDefinitionBuilder builder) {
-        super.doNativeParse(element, parserContext, builder);
-        
-        DeprecationSupport.warn(ObjectType.XSITYPE, SCHEMA_TYPE.toString(),
-                parserContext.getReaderContext().getResource().getDescription(), null);
-    }
-
-}
\ No newline at end of file
diff --git a/idp-attribute-filter-spring/src/main/java/net/shibboleth/idp/attribute/filter/spring/policyrule/impl/AuthenticationMethodRuleParser.java b/idp-attribute-filter-spring/src/main/java/net/shibboleth/idp/attribute/filter/spring/policyrule/impl/AuthenticationMethodRuleParser.java
deleted file mode 100644
index ed94ce7..0000000
--- a/idp-attribute-filter-spring/src/main/java/net/shibboleth/idp/attribute/filter/spring/policyrule/impl/AuthenticationMethodRuleParser.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the University Corporation for Advanced Internet Development,
- * Inc. (UCAID) under one or more contributor license agreements.  See the
- * NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The UCAID licenses this file to You under the Apache
- * License, Version 2.0 (the "License"); you may not use this file except in
- * compliance with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.shibboleth.idp.attribute.filter.spring.policyrule.impl;
-
-import javax.annotation.Nonnull;
-import javax.xml.namespace.QName;
-
-import org.springframework.beans.factory.support.BeanDefinitionBuilder;
-import org.springframework.beans.factory.xml.ParserContext;
-import org.w3c.dom.Element;
-
-import net.shibboleth.idp.attribute.filter.policyrule.filtercontext.impl.AuthenticationMethodPolicyRule;
-import net.shibboleth.idp.attribute.filter.spring.BaseFilterParser;
-import net.shibboleth.utilities.java.support.primitive.DeprecationSupport;
-import net.shibboleth.utilities.java.support.primitive.DeprecationSupport.ObjectType;
-
-/**
- * Bean definition parser for {@link AuthenticationMethodPolicyRule}.
- */
-public class AuthenticationMethodRuleParser extends AbstractStringPolicyRuleParser {
-
-    /** Schema type. */
-    public static final QName SCHEMA_TYPE = new QName(BaseFilterParser.NAMESPACE, "AuthenticationMethod");
-
-    /** {@inheritDoc} */
-    @Override @Nonnull protected Class<AuthenticationMethodPolicyRule> getNativeBeanClass() {
-        return AuthenticationMethodPolicyRule.class;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void doNativeParse(@Nonnull final Element element, @Nonnull final ParserContext parserContext,
-            @Nonnull final BeanDefinitionBuilder builder) {
-        super.doNativeParse(element, parserContext, builder);
-        
-        DeprecationSupport.warn(ObjectType.XSITYPE, SCHEMA_TYPE.toString(),
-                parserContext.getReaderContext().getResource().getDescription(), null);
-    }
-    
-}
\ No newline at end of file
diff --git a/idp-attribute-filter-spring/src/test/java/net/shibboleth/idp/attribute/filter/spring/policy/AuthenticationMethodRegexRuleParserTest.java b/idp-attribute-filter-spring/src/test/java/net/shibboleth/idp/attribute/filter/spring/policy/AuthenticationMethodRegexRuleParserTest.java
deleted file mode 100644
index 0018d84..0000000
--- a/idp-attribute-filter-spring/src/test/java/net/shibboleth/idp/attribute/filter/spring/policy/AuthenticationMethodRegexRuleParserTest.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the University Corporation for Advanced Internet Development,
- * Inc. (UCAID) under one or more contributor license agreements.  See the
- * NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The UCAID licenses this file to You under the Apache
- * License, Version 2.0 (the "License"); you may not use this file except in
- * compliance with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.shibboleth.idp.attribute.filter.spring.policy;
-
-import net.shibboleth.idp.attribute.filter.policyrule.filtercontext.impl.AuthenticationMethodRegexpPolicyRule;
-import net.shibboleth.idp.attribute.filter.spring.BaseAttributeFilterParserTest;
-import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
-
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
-public class AuthenticationMethodRegexRuleParserTest extends BaseAttributeFilterParserTest {
-
-
-    @Test public void policy() throws ComponentInitializationException {
-
-        AuthenticationMethodRegexpPolicyRule rule = (AuthenticationMethodRegexpPolicyRule) getPolicyRule("authenticationMethodRegex.xml");
-        Assert.assertEquals(rule.getRegularExpression(), "^urn:oasis:names:tc:SAML:2\\.0:ac:classes:[^:]*$");
-    }
- 
-}
diff --git a/idp-attribute-filter-spring/src/test/java/net/shibboleth/idp/attribute/filter/spring/policy/AuthenticationMethodRuleParserTest.java b/idp-attribute-filter-spring/src/test/java/net/shibboleth/idp/attribute/filter/spring/policy/AuthenticationMethodRuleParserTest.java
deleted file mode 100644
index 128f7b1..0000000
--- a/idp-attribute-filter-spring/src/test/java/net/shibboleth/idp/attribute/filter/spring/policy/AuthenticationMethodRuleParserTest.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the University Corporation for Advanced Internet Development,
- * Inc. (UCAID) under one or more contributor license agreements.  See the
- * NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The UCAID licenses this file to You under the Apache
- * License, Version 2.0 (the "License"); you may not use this file except in
- * compliance with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.shibboleth.idp.attribute.filter.spring.policy;
-
-import net.shibboleth.idp.attribute.filter.policyrule.filtercontext.impl.AuthenticationMethodPolicyRule;
-import net.shibboleth.idp.attribute.filter.spring.BaseAttributeFilterParserTest;
-import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
-
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
-public class AuthenticationMethodRuleParserTest extends BaseAttributeFilterParserTest {
-
-    @Test public void policy() throws ComponentInitializationException {
-
-        AuthenticationMethodPolicyRule arRule = (AuthenticationMethodPolicyRule) getPolicyRule("authenticationMethod.xml");
-        Assert.assertEquals(arRule.getMatchString(), "urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport");
-    }
- 
-}
diff --git a/idp-attribute-filter-spring/src/test/resources/net/shibboleth/idp/attribute/filter/policyrule/afp/authenticationMethod.xml b/idp-attribute-filter-spring/src/test/resources/net/shibboleth/idp/attribute/filter/policyrule/afp/authenticationMethod.xml
deleted file mode 100644
index 4938a5b..0000000
--- a/idp-attribute-filter-spring/src/test/resources/net/shibboleth/idp/attribute/filter/policyrule/afp/authenticationMethod.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<AttributeFilterPolicy id="MostBasicExample" xmlns="urn:mace:shibboleth:2.0:afp" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="urn:mace:shibboleth:2.0:afp http://shibboleth.net/schema/idp/shibboleth-afp.xsd">
-    <PolicyRequirementRule xsi:type="AuthenticationMethod"
-        value="urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport" />
-</AttributeFilterPolicy>
diff --git a/idp-attribute-filter-spring/src/test/resources/net/shibboleth/idp/attribute/filter/policyrule/afp/authenticationMethodRegex.xml b/idp-attribute-filter-spring/src/test/resources/net/shibboleth/idp/attribute/filter/policyrule/afp/authenticationMethodRegex.xml
deleted file mode 100644
index 37784f4..0000000
--- a/idp-attribute-filter-spring/src/test/resources/net/shibboleth/idp/attribute/filter/policyrule/afp/authenticationMethodRegex.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<AttributeFilterPolicy id="MostBasicExample" xmlns="urn:mace:shibboleth:2.0:afp" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="urn:mace:shibboleth:2.0:afp http://shibboleth.net/schema/idp/shibboleth-afp.xsd">
-    <PolicyRequirementRule xsi:type="AuthenticationMethodRegex" regex="^urn:oasis:names:tc:SAML:2\.0:ac:classes:[^:]*$" />
-</AttributeFilterPolicy>
diff --git a/idp-schema/src/main/resources/schema/shibboleth-afp.xsd b/idp-schema/src/main/resources/schema/shibboleth-afp.xsd
index 66d93dd..0d2198f 100644
--- a/idp-schema/src/main/resources/schema/shibboleth-afp.xsd
+++ b/idp-schema/src/main/resources/schema/shibboleth-afp.xsd
@@ -340,17 +340,6 @@
         </complexContent>
     </complexType>
 
-    <complexType name="AuthenticationMethod">
-        <annotation>
-            <documentation>
-                A match function that matches the authentication method against the specified value.
-            </documentation>
-        </annotation>
-        <complexContent>
-            <extension base="afp:StringMatchType"/>
-        </complexContent>
-    </complexType>
-
     <complexType name="Value">
         <annotation>
             <documentation>
@@ -453,17 +442,6 @@
         </complexContent>
     </complexType>
 
-    <complexType name="AuthenticationMethodRegex">
-        <annotation>
-            <documentation>
-                A match function that matches the authentication method against the specified regular expression.
-            </documentation>
-        </annotation>
-        <complexContent>
-            <extension base="afp:RegexMatchType"/>
-        </complexContent>
-    </complexType>
-
     <complexType name="ValueRegex">
         <annotation>
             <documentation>

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


More information about the commits mailing list