[java-identity-provider] 01/06: IDP-1423 Remove the explicit Chaining of filters.
Rod Widdowson
rdw at steadingsoftware.com
Tue Feb 26 09:45:09 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=91aa6fa5ab638b6f3fe740f188fd319121e36042
commit 91aa6fa5ab638b6f3fe740f188fd319121e36042
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Mon Feb 25 16:19:41 2019 +0000
IDP-1423 Remove the explicit Chaining of filters.
https://issues.shibboleth.net/jira/browse/IDP-1423
---
.../metadata/filter/impl/ChainingParser.java | 78 ----------------------
.../metadata/impl/MetadataNamespaceHandler.java | 2 -
.../relyingparty/metadata/filter/ChainingTest.java | 44 ------------
.../spring/relyingparty/metadata/filter/chain.xml | 28 --------
.../main/resources/schema/shibboleth-metadata.xsd | 21 ------
5 files changed, 173 deletions(-)
diff --git a/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/filter/impl/ChainingParser.java b/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/filter/impl/ChainingParser.java
deleted file mode 100644
index 16580dc..0000000
--- a/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/filter/impl/ChainingParser.java
+++ /dev/null
@@ -1,78 +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.profile.spring.relyingparty.metadata.filter.impl;
-
-import java.util.List;
-
-import javax.annotation.Nonnull;
-import javax.xml.namespace.QName;
-
-import net.shibboleth.ext.spring.util.SpringSupport;
-import net.shibboleth.idp.profile.spring.relyingparty.metadata.AbstractMetadataProviderParser;
-import net.shibboleth.utilities.java.support.primitive.DeprecationSupport;
-import net.shibboleth.utilities.java.support.primitive.DeprecationSupport.ObjectType;
-import net.shibboleth.utilities.java.support.xml.ElementSupport;
-
-import org.opensaml.saml.metadata.resolver.filter.MetadataFilterChain;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.support.BeanDefinitionBuilder;
-import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
-import org.springframework.beans.factory.xml.ParserContext;
-import org.w3c.dom.Element;
-
-/**
- * Parser for a <ChainingFilter> filter.
- *
- * @deprecated
- */
-public class ChainingParser extends AbstractSingleBeanDefinitionParser {
-
- /** Element name. */
- @Nonnull public static final QName TYPE_NAME =
- new QName(AbstractMetadataProviderParser.METADATA_NAMESPACE, "ChainingFilter");
-
- /** Class logger. */
- @Nonnull private final Logger log = LoggerFactory.getLogger(ChainingParser.class);
-
- /** {@inheritDoc} */
- @Override protected Class<?> getBeanClass(final Element element) {
- return MetadataFilterChain.class;
- }
-
- /** {@inheritDoc} */
- @Override protected void doParse(final Element element, final ParserContext parserContext,
- final BeanDefinitionBuilder builder) {
-
- DeprecationSupport.warn(ObjectType.XSITYPE, TYPE_NAME.toString(),
- parserContext.getReaderContext().getResource().getDescription(), null);
-
- final List<Element> children =
- ElementSupport.getChildElements(element, AbstractMetadataProviderParser.METADATA_FILTER_ELEMENT_NAME);
-
- if (null != children && !children.isEmpty()) {
- builder.addPropertyValue("filters", SpringSupport.parseCustomElements(children, parserContext));
- }
- }
-
- /** {@inheritDoc} */
- @Override protected boolean shouldGenerateId() {
- return true;
- }
-
-}
\ No newline at end of file
diff --git a/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/impl/MetadataNamespaceHandler.java b/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/impl/MetadataNamespaceHandler.java
index 353bbe6..41f766b 100644
--- a/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/impl/MetadataNamespaceHandler.java
+++ b/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/impl/MetadataNamespaceHandler.java
@@ -21,7 +21,6 @@ import javax.xml.namespace.QName;
import net.shibboleth.ext.spring.util.BaseSpringNamespaceHandler;
import net.shibboleth.idp.profile.spring.relyingparty.metadata.AbstractMetadataProviderParser;
-import net.shibboleth.idp.profile.spring.relyingparty.metadata.filter.impl.ChainingParser;
import net.shibboleth.idp.profile.spring.relyingparty.metadata.filter.impl.EntitiesDescriptorNameParser;
import net.shibboleth.idp.profile.spring.relyingparty.metadata.filter.impl.EntityAttributesFilterParser;
import net.shibboleth.idp.profile.spring.relyingparty.metadata.filter.impl.EntityRoleFilterParser;
@@ -71,7 +70,6 @@ public class MetadataNamespaceHandler extends BaseSpringNamespaceHandler {
// Filters
registerBeanDefinitionParser(RequiredValidUntilParser.TYPE_NAME, new RequiredValidUntilParser());
- registerBeanDefinitionParser(ChainingParser.TYPE_NAME, new ChainingParser());
registerBeanDefinitionParser(EntityAttributesFilterParser.TYPE_NAME, new EntityAttributesFilterParser());
registerBeanDefinitionParser(NameIDFormatFilterParser.TYPE_NAME, new NameIDFormatFilterParser());
registerBeanDefinitionParser(EntityRoleFilterParser.TYPE_NAME, new EntityRoleFilterParser());
diff --git a/idp-profile-spring/src/test/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/filter/ChainingTest.java b/idp-profile-spring/src/test/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/filter/ChainingTest.java
deleted file mode 100644
index 44c1514..0000000
--- a/idp-profile-spring/src/test/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/filter/ChainingTest.java
+++ /dev/null
@@ -1,44 +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.profile.spring.relyingparty.metadata.filter;
-
-import java.io.IOException;
-
-import net.shibboleth.idp.profile.spring.relyingparty.metadata.AbstractMetadataParserTest;
-
-import org.opensaml.saml.metadata.resolver.MetadataResolver;
-import org.opensaml.saml.metadata.resolver.filter.MetadataFilterChain;
-import org.opensaml.saml.metadata.resolver.filter.impl.RequiredValidUntilFilter;
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
-/**
- * Test for Chaining metadata filter parser.
- */
-public class ChainingTest extends AbstractMetadataParserTest {
-
- @Test public void chain() throws IOException {
- MetadataResolver resolver = getBean(MetadataResolver.class, "filter/chain.xml");
-
- final MetadataFilterChain filterChain = (MetadataFilterChain) resolver.getMetadataFilter();
- Assert.assertEquals(filterChain.getFilters().size(), 2);
- Assert.assertEquals(filterChain.getFilters().get(0).getClass(), RequiredValidUntilFilter.class);
- }
-
-
-}
diff --git a/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/filter/chain.xml b/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/filter/chain.xml
deleted file mode 100644
index 90347ef..0000000
--- a/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/filter/chain.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata:MetadataProvider xmlns="urn:oasis:names:tc:SAML:2.0:metadata"
- xmlns:metadata="urn:mace:shibboleth:2.0:metadata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:mace:shibboleth:2.0:metadata http://shibboleth.net/schema/idp/shibboleth-metadata.xsd
- urn:oasis:names:tc:SAML:2.0:metadata http://docs.oasis-open.org/security/saml/v2.0/saml-schema-metadata-2.0.xsd"
-
- failFastInitialization="false" requireValidMetadata="false"
-
- id="requiredValidUntil" xsi:type="metadata:InlineMetadataProvider">
- <metadata:MetadataFilter xsi:type="metadata:ChainingFilter">
- <metadata:MetadataFilter xsi:type="metadata:RequiredValidUntil"
- maxValidityInterval="P2D" />
- <metadata:MetadataFilter xsi:type="metadata:RequiredValidUntil" />
- </metadata:MetadataFilter>
- <EntityDescriptor ID="uk001502"
- entityID="https://sp.example.org/sp/shibboleth">
-
- <SPSSODescriptor
- protocolSupportEnumeration="urn:oasis:names:tc:SAML:1.1:protocol urn:oasis:names:tc:SAML:1.0:protocol urn:oasis:names:tc:SAML:2.0:protocol">
-
- <AssertionConsumerService
- Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST-SimpleSign"
- Location="https://sp.example.org/Shibboleth.sso/SAML2/POST-SimpleSign"
- index="5" />
- </SPSSODescriptor>
- </EntityDescriptor>
-</metadata:MetadataProvider>
-
\ No newline at end of file
diff --git a/idp-schema/src/main/resources/schema/shibboleth-metadata.xsd b/idp-schema/src/main/resources/schema/shibboleth-metadata.xsd
index 6b197cf..3f41688 100644
--- a/idp-schema/src/main/resources/schema/shibboleth-metadata.xsd
+++ b/idp-schema/src/main/resources/schema/shibboleth-metadata.xsd
@@ -1009,27 +1009,6 @@
</annotation>
</element>
- <complexType name="ChainingFilter">
- <annotation>
- <documentation>
- A filter that executes other filters in the order they appear in the configuration.
- </documentation>
- </annotation>
- <complexContent>
- <extension base="shibmd:MetadataFilterType">
- <sequence>
- <element ref="shibmd:MetadataFilter" minOccurs="0" maxOccurs="unbounded">
- <annotation>
- <documentation>
- A filter to be applied to metadata after it has been parsed and validated.
- </documentation>
- </annotation>
- </element>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-
<complexType name="RequiredValidUntil">
<annotation>
<documentation>
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list