]> source.dussan.org Git - archiva.git/commitdiff
Adding ldap properties
authorMartin Stockhammer <martin_s@apache.org>
Sun, 3 Jan 2021 18:12:24 +0000 (19:12 +0100)
committerMartin Stockhammer <martin_s@apache.org>
Sun, 3 Jan 2021 18:12:24 +0000 (19:12 +0100)
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/runtime/DefaultRedbackRuntimeConfigurationAdmin.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/v2/LdapConfiguration.java

index 56e3ba1bf629cf8dd3f1b018672de6a5f76cfcce..256865ec70273fcf641a34f4290385f20c9dd07c 100644 (file)
@@ -495,6 +495,9 @@ public class DefaultRedbackRuntimeConfigurationAdmin
         if (LDAP_MAPPER.isPrefixMapping( key )) {
             return LDAP_MAPPER.getPrefixString( key, conf.getLdapGroupMappings( ) );
         }
+        if (conf.getLdapConfiguration().getExtraProperties().containsKey( key )) {
+            return conf.getLdapConfiguration( ).getExtraProperties( ).get( key );
+        }
 
         if ( USER_MANAGER_IMPL.equals( key ) )
         {
@@ -538,6 +541,9 @@ public class DefaultRedbackRuntimeConfigurationAdmin
         if (LDAP_MAPPER.isPrefixMapping( key )) {
             return LDAP_MAPPER.getPrefixString( key, conf.getLdapGroupMappings( ) );
         }
+        if (conf.getLdapConfiguration().getExtraProperties().containsKey( key )) {
+            return conf.getLdapConfiguration( ).getExtraProperties( ).get( key );
+        }
 
         if ( conf.getConfigurationProperties().containsKey( key ) )
         {
index 20026bafbeaec3a360a3604689037a5a29dc42e7..ef070ce33d1005dd6f00ec6152e70100a9c32e16 100644 (file)
@@ -26,6 +26,7 @@ import java.util.TreeMap;
 
 /**
  * @author Martin Stockhammer <martin_s@apache.org>
+ * @since 3.0
  */
 @XmlRootElement(name="ldapConfiguration")
 public class LdapConfiguration implements Serializable
@@ -73,7 +74,7 @@ public class LdapConfiguration implements Serializable
 
     public void setHostName( String hostName )
     {
-        this.hostName = hostName;
+        this.hostName = hostName==null?"":hostName;
     }
 
     @Schema(description = "The port to use to connect to the LDAP server")
@@ -106,7 +107,7 @@ public class LdapConfiguration implements Serializable
 
     public void setBaseDn( String baseDn )
     {
-        this.baseDn = baseDn;
+        this.baseDn = baseDn == null ? "" : baseDn;
     }
 
     @Schema(description = "The distinguished name of the bind user which is used to bind to the LDAP server")
@@ -117,7 +118,7 @@ public class LdapConfiguration implements Serializable
 
     public void setBindDn( String bindDn )
     {
-        this.bindDn = bindDn;
+        this.bindDn = bindDn == null ? "" : bindDn;
     }
 
     @Schema(description = "The password used to bind to the ldap server")
@@ -128,7 +129,7 @@ public class LdapConfiguration implements Serializable
 
     public void setBindPassword( String bindPassword )
     {
-        this.bindPassword = bindPassword;
+        this.bindPassword = bindPassword==null?"":bindPassword;
     }
 
     @Schema(description = "The distinguished name of the base to use for searching group.")
@@ -139,7 +140,7 @@ public class LdapConfiguration implements Serializable
 
     public void setGroupsBaseDn( String groupsBaseDn )
     {
-        this.groupsBaseDn = groupsBaseDn;
+        this.groupsBaseDn = groupsBaseDn==null?"":groupsBaseDn;
     }
 
     @Schema(description = "The authentication method used to bind to the LDAP server (PLAINTEXT, SASL, ...)")
@@ -150,7 +151,7 @@ public class LdapConfiguration implements Serializable
 
     public void setAuthenticationMethod( String authenticationMethod )
     {
-        this.authenticationMethod = authenticationMethod;
+        this.authenticationMethod = authenticationMethod==null?"":authenticationMethod;
     }
 
     @Schema(description = "True, if the LDAP bind authentication is used for logging in to Archiva")