[java-identity-provider] 02/02: IDP-1375 Remove deprecation warning from security namespace parsers
Rod Widdowson
rdw at steadingsoftware.com
Tue Mar 26 11:49:22 EDT 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=8f11e2434713dafc359c68f3085f2d3da4b33141
commit 8f11e2434713dafc359c68f3085f2d3da4b33141
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Tue Mar 26 15:47:58 2019 +0000
IDP-1375 Remove deprecation warning from security namespace parsers
https://issues.shibboleth.net/jira/browse/IDP-1375
The three remaining uses have been declared as valid.
---
.../credential/impl/AbstractCredentialParser.java | 4 +-
.../impl/AbstractWarningSecurityParser.java | 82 ----------------------
.../impl/AbstractPKIXValidationInfoParser.java | 4 +-
.../impl/AbstractTrustEngineParser.java | 4 +-
.../impl/PKIXValidationOptionsParser.java | 4 +-
5 files changed, 8 insertions(+), 90 deletions(-)
diff --git a/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/security/credential/impl/AbstractCredentialParser.java b/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/security/credential/impl/AbstractCredentialParser.java
index 108bb07..ddd77c7 100644
--- a/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/security/credential/impl/AbstractCredentialParser.java
+++ b/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/security/credential/impl/AbstractCredentialParser.java
@@ -23,19 +23,19 @@ import javax.xml.namespace.QName;
import org.springframework.beans.factory.support.AbstractBeanDefinition;
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;
import net.shibboleth.ext.spring.util.SpringSupport;
import net.shibboleth.idp.profile.spring.relyingparty.metadata.AbstractMetadataProviderParser;
-import net.shibboleth.idp.profile.spring.relyingparty.security.impl.AbstractWarningSecurityParser;
import net.shibboleth.utilities.java.support.primitive.StringSupport;
import net.shibboleth.utilities.java.support.xml.ElementSupport;
/**
* Base parser for all <Credential> elements.
*/
-public abstract class AbstractCredentialParser extends AbstractWarningSecurityParser {
+public abstract class AbstractCredentialParser extends AbstractSingleBeanDefinitionParser {
/** <Credential>. */
public static final QName CREDENTIAL_ELEMENT_NAME = new QName(AbstractMetadataProviderParser.SECURITY_NAMESPACE,
diff --git a/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/security/impl/AbstractWarningSecurityParser.java b/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/security/impl/AbstractWarningSecurityParser.java
deleted file mode 100644
index 5573d6c..0000000
--- a/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/security/impl/AbstractWarningSecurityParser.java
+++ /dev/null
@@ -1,82 +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.security.impl;
-
-import javax.xml.namespace.QName;
-
-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;
-import org.w3c.dom.Node;
-
-import net.shibboleth.idp.profile.spring.relyingparty.metadata.AbstractMetadataProviderParser;
-import net.shibboleth.idp.profile.spring.relyingparty.metadata.impl.HTTPMetadataProvidersParserSupport;
-import net.shibboleth.utilities.java.support.primitive.DeprecationSupport;
-import net.shibboleth.utilities.java.support.primitive.DeprecationSupport.ObjectType;
-
-/**
- * Base class to issue a deprecation warning on activation.
- * @deprecated remove all super classes in V4.
- */
- at Deprecated
-public class AbstractWarningSecurityParser extends AbstractSingleBeanDefinitionParser {
-
- /** Is this element ultimately parented by a MetadataFilter Element?
- * @param element what to inspect
- * @return if it is.
- */
- private boolean isAllowedDescendant(final Element element) {
- final Node parent = element.getParentNode();
- if ((null == parent)||!(parent instanceof Element)) {
- return false;
- }
- if (AbstractMetadataProviderParser.SECURITY_NAMESPACE.equals(parent.getNamespaceURI())) {
- return isAllowedDescendant((Element) parent);
- }
- final QName filterQname = AbstractMetadataProviderParser.METADATA_FILTER_ELEMENT_NAME;
- final QName trustEngineQname = HTTPMetadataProvidersParserSupport.TLS_TRUST_ENGINE_ELEMENT_NAME;
-
- return (filterQname.getNamespaceURI().equals(parent.getNamespaceURI()) &&
- filterQname.getLocalPart().equals(parent.getLocalName())) ||
- (trustEngineQname.getNamespaceURI().equals(parent.getNamespaceURI())&&
- trustEngineQname.getLocalPart().equals(parent.getLocalName()));
- }
-
- /** {@inheritDoc} */
- @Override
- protected void doParse(final Element element, final BeanDefinitionBuilder builder) {
-
- if (!isAllowedDescendant(element)){
- DeprecationSupport.warnOnce(ObjectType.ELEMENT,
- element.getPrefix() +":" + element.getLocalName(), null, null);
- }
- super.doParse(element, builder);
- }
-
- /** {@inheritDoc} */
- @Override
- protected void doParse(final Element element, final ParserContext parserContext,
- final BeanDefinitionBuilder builder) {
- if (!isAllowedDescendant(element)){
- DeprecationSupport.warnOnce(ObjectType.ELEMENT, element.getPrefix() +":" + element.getLocalName(),
- parserContext.getReaderContext().getResource().getDescription(), null);
- }
- super.doParse(element, parserContext, builder);
- }
-}
diff --git a/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/security/trustengine/impl/AbstractPKIXValidationInfoParser.java b/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/security/trustengine/impl/AbstractPKIXValidationInfoParser.java
index 9971650..58e1aae 100644
--- a/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/security/trustengine/impl/AbstractPKIXValidationInfoParser.java
+++ b/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/security/trustengine/impl/AbstractPKIXValidationInfoParser.java
@@ -23,11 +23,11 @@ import javax.xml.namespace.QName;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.ManagedList;
+import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
import org.springframework.beans.factory.xml.ParserContext;
import org.w3c.dom.Element;
import net.shibboleth.idp.profile.spring.relyingparty.metadata.AbstractMetadataProviderParser;
-import net.shibboleth.idp.profile.spring.relyingparty.security.impl.AbstractWarningSecurityParser;
import net.shibboleth.utilities.java.support.primitive.StringSupport;
import net.shibboleth.utilities.java.support.xml.ElementSupport;
@@ -36,7 +36,7 @@ import net.shibboleth.utilities.java.support.xml.ElementSupport;
* the sub-elements. The derived classes specify which factory bean to create and that in turn converts from string to
* CRL or Certificate (either inline or from a file).
*/
-public abstract class AbstractPKIXValidationInfoParser extends AbstractWarningSecurityParser {
+public abstract class AbstractPKIXValidationInfoParser extends AbstractSingleBeanDefinitionParser {
/** The element <Certificate>. */
private static final QName CERTIFICATE =
diff --git a/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/security/trustengine/impl/AbstractTrustEngineParser.java b/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/security/trustengine/impl/AbstractTrustEngineParser.java
index e3131b2..8d0f024 100644
--- a/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/security/trustengine/impl/AbstractTrustEngineParser.java
+++ b/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/security/trustengine/impl/AbstractTrustEngineParser.java
@@ -19,16 +19,16 @@ package net.shibboleth.idp.profile.spring.relyingparty.security.trustengine.impl
import org.springframework.beans.factory.support.AbstractBeanDefinition;
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;
-import net.shibboleth.idp.profile.spring.relyingparty.security.impl.AbstractWarningSecurityParser;
import net.shibboleth.utilities.java.support.primitive.StringSupport;
/**
* Basis of all parsers for <security:TrustEngine>.
*/
-public abstract class AbstractTrustEngineParser extends AbstractWarningSecurityParser {
+public abstract class AbstractTrustEngineParser extends AbstractSingleBeanDefinitionParser {
/** {@inheritDoc} */
@Override protected String resolveId(final Element element, final AbstractBeanDefinition definition,
diff --git a/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/security/trustengine/impl/PKIXValidationOptionsParser.java b/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/security/trustengine/impl/PKIXValidationOptionsParser.java
index 70dae53..96ca8ac 100644
--- a/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/security/trustengine/impl/PKIXValidationOptionsParser.java
+++ b/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/security/trustengine/impl/PKIXValidationOptionsParser.java
@@ -21,17 +21,17 @@ import javax.xml.namespace.QName;
import org.opensaml.security.x509.PKIXValidationOptions;
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;
import net.shibboleth.idp.profile.spring.relyingparty.metadata.AbstractMetadataProviderParser;
-import net.shibboleth.idp.profile.spring.relyingparty.security.impl.AbstractWarningSecurityParser;
import net.shibboleth.utilities.java.support.primitive.StringSupport;
/**
* A Parser for the < ValidationOptions > within a StaticPKIXSignature.
*/
-public class PKIXValidationOptionsParser extends AbstractWarningSecurityParser {
+public class PKIXValidationOptionsParser extends AbstractSingleBeanDefinitionParser {
/** Validation Options. */
public static final QName ELEMENT_NAME = new QName(AbstractMetadataProviderParser.SECURITY_NAMESPACE,
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list