[java-identity-provider] branch main updated: IDP-2159 - Expose LDAP reconnect properties

Daniel Fisher dfisher at vt.edu
Mon Aug 21 12:55:15 UTC 2023


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

dfisher 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=5b4fb773aec266d057333a3be2e707a83b6f0c5a

The following commit(s) were added to refs/heads/main by this push:
     new 5b4fb773a IDP-2159 - Expose LDAP reconnect properties
5b4fb773a is described below

commit 5b4fb773aec266d057333a3be2e707a83b6f0c5a
Author: Daniel Fisher <dfisher at vt.edu>
AuthorDate: Mon Aug 21 08:50:22 2023 -0400

    IDP-2159 - Expose LDAP reconnect properties
    
    https://shibboleth.atlassian.net/browse/IDP-2159
    
    Update LDAP authn factory bean to consume autoReconnect and reconnectTimeout.
---
 .../config/LDAPAuthenticationFactoryBean.java      | 22 ++++++++++++++++++++++
 .../config/LDAPAuthenticationFactoryBeanTest.java  |  2 ++
 .../idp/flows/authn/password-authn-beans.xml       |  2 ++
 3 files changed, 26 insertions(+)

diff --git a/idp-authn-api/src/main/java/net/shibboleth/idp/authn/config/LDAPAuthenticationFactoryBean.java b/idp-authn-api/src/main/java/net/shibboleth/idp/authn/config/LDAPAuthenticationFactoryBean.java
index 92e1eb8f6..05a569fc3 100644
--- a/idp-authn-api/src/main/java/net/shibboleth/idp/authn/config/LDAPAuthenticationFactoryBean.java
+++ b/idp-authn-api/src/main/java/net/shibboleth/idp/authn/config/LDAPAuthenticationFactoryBean.java
@@ -326,6 +326,12 @@ public class LDAPAuthenticationFactoryBean extends AbstractFactoryBean<Authentic
     /** Wait time for operation responses. */
     private Duration responseTimeout;
 
+    /** Whether to automatically reconnect to the server when a connection is lost. */
+    private boolean autoReconnect;
+
+    /** Wait time for reconnects. */
+    private Duration reconnectTimeout;
+
     /** Trust configuration when using certificate based trust. */
     private CredentialConfig trustCertificatesCredentialConfig;
 
@@ -507,6 +513,20 @@ public class LDAPAuthenticationFactoryBean extends AbstractFactoryBean<Authentic
         responseTimeout = timeout;
     }
 
+    /** Set {@link #autoReconnect}.
+     * @param b what to set
+     */
+    public void setAutoReconnect(final boolean b) {
+        autoReconnect = b;
+    }
+
+    /** Set {@link #reconnectTimeout}.
+     * @param timeout what to set
+     */
+    public void setReconnectTimeout(@Nullable final Duration timeout) {
+        reconnectTimeout = timeout;
+    }
+
     /** Set {@link #trustCertificatesCredentialConfig}.
      * @param config to set
      */
@@ -800,6 +820,8 @@ public class LDAPAuthenticationFactoryBean extends AbstractFactoryBean<Authentic
         config.setStartTLSTimeout(startTLSTimeout);
         config.setConnectTimeout(connectTimeout);
         config.setResponseTimeout(responseTimeout);
+        config.setAutoReconnect(autoReconnect);
+        config.setReconnectTimeout(reconnectTimeout);
         switch (connectionStrategyType) {
         case ROUND_ROBIN:
             config.setConnectionStrategy(new RoundRobinConnectionStrategy());
diff --git a/idp-authn-api/src/test/java/net/shibboleth/idp/authn/config/LDAPAuthenticationFactoryBeanTest.java b/idp-authn-api/src/test/java/net/shibboleth/idp/authn/config/LDAPAuthenticationFactoryBeanTest.java
index bb32e5f09..6b5f84e57 100644
--- a/idp-authn-api/src/test/java/net/shibboleth/idp/authn/config/LDAPAuthenticationFactoryBeanTest.java
+++ b/idp-authn-api/src/test/java/net/shibboleth/idp/authn/config/LDAPAuthenticationFactoryBeanTest.java
@@ -86,6 +86,8 @@ public class LDAPAuthenticationFactoryBeanTest {
         factoryBean.setStartTLSTimeout(Duration.ofSeconds(3));
         factoryBean.setConnectTimeout(Duration.ofSeconds(3));
         factoryBean.setResponseTimeout(Duration.ofSeconds(3));
+        factoryBean.setAutoReconnect(true);
+        factoryBean.setReconnectTimeout(Duration.ofSeconds(10));
         factoryBean.setDisablePooling(false);
         factoryBean.setBlockWaitTime(Duration.ofSeconds(3));
         factoryBean.setPrunePeriod(Duration.ofMinutes(5));
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/authn/password-authn-beans.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/authn/password-authn-beans.xml
index 619c88cc6..f399f51d1 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/authn/password-authn-beans.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/authn/password-authn-beans.xml
@@ -132,6 +132,8 @@
         p:startTLSTimeout="%{idp.authn.LDAP.startTLSTimeout:PT3S}"
         p:connectTimeout="%{idp.authn.LDAP.connectTimeout:PT3S}"
         p:responseTimeout="%{idp.authn.LDAP.responseTimeout:PT3S}"
+        p:autoReconnect="%{idp.authn.LDAP.autoReconnect:true}"
+        p:reconnectTimeout="%{idp.authn.LDAP.reconnectTimeout:PT10S}"
         p:trustCertificatesCredentialConfig-ref="shibboleth.authn.LDAP.trustCertificates"
         p:truststoreCredentialConfig-ref="shibboleth.authn.LDAP.truststore"
         p:disablePooling="%{idp.authn.LDAP.disablePooling:false}"

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


More information about the commits mailing list