[java-identity-provider] branch main updated: IDP-1801 - NPEs on invalid enum values in LDAP factory bean

Scott Cantor cantor.2 at osu.edu
Wed Apr 21 15:36:22 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=e5c57094bc606b4b397d60aa098469d210c876e3

The following commit(s) were added to refs/heads/main by this push:
       new  e5c57094b IDP-1801 - NPEs on invalid enum values in LDAP factory bean
e5c57094b is described below

commit e5c57094bc606b4b397d60aa098469d210c876e3
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Wed Apr 21 11:36:19 2021 -0400

    IDP-1801 - NPEs on invalid enum values in LDAP factory bean
    
    https://issues.shibboleth.net/jira/browse/IDP-1801
---
 .../idp/authn/config/LDAPAuthenticationFactoryBean.java          | 9 +++++++++
 1 file changed, 9 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 1a2c4e318..eae5847ec 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
@@ -295,14 +295,23 @@ public class LDAPAuthenticationFactoryBean extends AbstractFactoryBean<Authentic
 
   public void setAuthenticatorType(@Nonnull @NotEmpty final String type) {
     authenticatorType = AuthenticatorType.fromLabel(type);
+    if (authenticatorType == null) {
+        throw new IllegalArgumentException("authenticatorType property did not have a valid value");
+    }
   }
 
   public void setTrustType(@Nonnull @NotEmpty final String type) {
     trustType = TrustType.fromLabel(type);
+    if (trustType == null) {
+        throw new IllegalArgumentException("trustType property did not have a valid value");
+    }
   }
 
   public void setConnectionStrategyType(@Nonnull @NotEmpty final String type) {
     connectionStrategyType = ConnectionStrategyType.fromLabel(type);
+    if (connectionStrategyType == null) {
+        throw new IllegalArgumentException("connectionStrategyType property did not have a valid value");
+    }
   }
 
   public void setLdapUrl(@Nullable @NotEmpty final String url) {

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


More information about the commits mailing list