[java-identity-provider] branch main updated: IDP-1742 - Improve deprecation warnings for LDAP properties

Scott Cantor cantor.2 at osu.edu
Thu Jun 17 14:29:54 UTC 2021


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

scantor pushed a commit to branch main
in repository java-identity-provider.

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

The following commit(s) were added to refs/heads/main by this push:
       new  2e352de94 IDP-1742 - Improve deprecation warnings for LDAP properties
2e352de94 is described below

commit 2e352de9437eb993d22a5bb9fa433bd3f9d0a66b
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Jun 17 10:29:51 2021 -0400

    IDP-1742 - Improve deprecation warnings for LDAP properties
    
    https://issues.shibboleth.net/jira/browse/IDP-1742
---
 .../spring/dc/ldap/impl/LDAPDataConnectorParser.java    | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/dc/ldap/impl/LDAPDataConnectorParser.java b/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/dc/ldap/impl/LDAPDataConnectorParser.java
index dcc8fe5b9..c33af7f97 100644
--- a/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/dc/ldap/impl/LDAPDataConnectorParser.java
+++ b/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/dc/ldap/impl/LDAPDataConnectorParser.java
@@ -127,12 +127,21 @@ public class LDAPDataConnectorParser extends AbstractDataConnectorParser {
             @Nonnull final BeanDefinitionBuilder builder) {
         log.debug("{} Parsing XML configuration {}", getLogPrefix(), config);
 
+        // V4 Deprecation
         final List<Element> oldProperties = ElementSupport.getChildElementsByTagNameNS(config,
                 AttributeResolverNamespaceHandler.NAMESPACE, "LDAPProperty");
-        if (oldProperties != null && !oldProperties.isEmpty()) {
-            // V4 Deprecation
-            DeprecationSupport.warn(ObjectType.ELEMENT, "LDAPProperty", "LDAP Connector",
-                    "(replacement depends on property)");
+        for (final Element oldProperty : oldProperties) {
+            final String oldPropName = oldProperty.getAttributeNS(null, "name");
+            if ("com.sun.jndi.ldap.connect.timeout".equals(oldPropName)) {
+                DeprecationSupport.warn(ObjectType.ELEMENT, "LDAPProperty " + oldPropName, "LDAPConnector",
+                        "LDAPConnector/@connectTimeout");
+            } else if ("com.sun.jndi.ldap.read.timeout".equals(oldPropName)) {
+                DeprecationSupport.warn(ObjectType.ELEMENT, "LDAPProperty " + oldPropName, "LDAPConnector",
+                        "LDAPConnector/@responseTimeout");
+            } else {
+                DeprecationSupport.warn(ObjectType.ELEMENT, "LDAPProperty " + oldPropName, "LDAPConnector",
+                        "(replacement depends on property)");
+            }
         }
         
         final V2Parser v2Parser = new V2Parser(config, getLogPrefix());

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


More information about the commits mailing list