Fixed the url settings to only call the toArray. Plus I changed one of the tests to use the single value style
Original commit: elastic/x-pack-elasticsearch@16326d2b6c
This commit is contained in:
parent
f517a6a8f3
commit
4b0f7c4379
|
@ -48,14 +48,7 @@ public class ActiveDirectoryConnectionFactory extends AbstractComponent implemen
|
|||
}
|
||||
userSearchDN = componentSettings.get(AD_USER_SEARCH_BASEDN_SETTING, buildDnFromDomain(domainName));
|
||||
|
||||
String[] ldapUrls = componentSettings.getAsArray(URLS_SETTING);
|
||||
if (ldapUrls == null) {
|
||||
String url = componentSettings.get(URLS_SETTING);
|
||||
ldapUrls = url == null ? null : new String[]{url};
|
||||
}
|
||||
if (ldapUrls == null) {
|
||||
ldapUrls = new String[] { "ldaps://" + domainName + ":636" };
|
||||
}
|
||||
String[] ldapUrls = componentSettings.getAsArray(URLS_SETTING, new String[] { "ldaps://" + domainName + ":636"});
|
||||
|
||||
ImmutableMap.Builder<String, Serializable> builder = ImmutableMap.<String, Serializable>builder()
|
||||
.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory")
|
||||
|
|
|
@ -48,10 +48,6 @@ public class StandardLdapConnectionFactory extends AbstractComponent implements
|
|||
throw new ShieldException("Missing required ldap setting [" + USER_DN_TEMPLATES_SETTING + "]");
|
||||
}
|
||||
String[] ldapUrls = componentSettings.getAsArray(URLS_SETTING);
|
||||
if (ldapUrls == null) {
|
||||
String url = componentSettings.get(URLS_SETTING);
|
||||
ldapUrls = url == null ? null : new String[]{url};
|
||||
}
|
||||
if (ldapUrls == null) {
|
||||
throw new ShieldException("Missing required ldap setting [" + URLS_SETTING + "]");
|
||||
}
|
||||
|
|
|
@ -114,7 +114,7 @@ public class ActiveDirectoryFactoryTests extends ElasticsearchTestCase {
|
|||
|
||||
public static Settings buildAdSettings(String ldapUrl, String adDomainName) {
|
||||
return ImmutableSettings.builder()
|
||||
.putArray(SETTINGS_PREFIX + ActiveDirectoryConnectionFactory.URLS_SETTING, ldapUrl)
|
||||
.put(SETTINGS_PREFIX + ActiveDirectoryConnectionFactory.URLS_SETTING, ldapUrl)
|
||||
.put(SETTINGS_PREFIX + ActiveDirectoryConnectionFactory.AD_DOMAIN_NAME_SETTING, adDomainName)
|
||||
.build();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue