Simon Willnauer 2017-11-13 12:07:04 +01:00 committed by GitHub
parent fd392627a0
commit 92f87cab14
2 changed files with 4 additions and 3 deletions

View File

@ -34,7 +34,8 @@ import static org.elasticsearch.xpack.security.Security.setting;
* Instead, realm configuration relies on the <code>validator</code> parameter to * Instead, realm configuration relies on the <code>validator</code> parameter to
* {@link Setting#groupSetting(String, Consumer, Setting.Property...)} in order to validate each realm in a way that respects the * {@link Setting#groupSetting(String, Consumer, Setting.Property...)} in order to validate each realm in a way that respects the
* declared <code>type</code>. * declared <code>type</code>.
* Internally, this validation delegates to {@link AbstractScopedSettings#validate(Settings)} so that validation is reasonably aligned * Internally, this validation delegates to {@link AbstractScopedSettings#validate(Settings, boolean)} so that validation is reasonably
* aligned
* with the way we validate settings globally. * with the way we validate settings globally.
* </p> * </p>
* <p> * <p>
@ -172,7 +173,7 @@ public class RealmSettings {
settingSet.add(ORDER_SETTING); settingSet.add(ORDER_SETTING);
final AbstractScopedSettings validator = new AbstractScopedSettings(settings, settingSet, Setting.Property.NodeScope) { }; final AbstractScopedSettings validator = new AbstractScopedSettings(settings, settingSet, Setting.Property.NodeScope) { };
try { try {
validator.validate(settings); validator.validate(settings, false);
} catch (RuntimeException e) { } catch (RuntimeException e) {
throw new IllegalArgumentException("incorrect configuration for realm [" + getFullSettingKey(name, "") throw new IllegalArgumentException("incorrect configuration for realm [" + getFullSettingKey(name, "")
+ "] of type " + type, e); + "] of type " + type, e);

View File

@ -275,7 +275,7 @@ public class PkiRealmTests extends ESTestCase {
List<Setting<?>> settingList = new ArrayList<>(); List<Setting<?>> settingList = new ArrayList<>();
RealmSettings.addSettings(settingList, Collections.emptyList()); RealmSettings.addSettings(settingList, Collections.emptyList());
ClusterSettings clusterSettings = new ClusterSettings(settings, new HashSet<>(settingList)); ClusterSettings clusterSettings = new ClusterSettings(settings, new HashSet<>(settingList));
clusterSettings.validate(settings); clusterSettings.validate(settings, false);
assertSettingDeprecationsAndWarnings(new Setting[] { SSLConfigurationSettings.withoutPrefix().legacyTruststorePassword }); assertSettingDeprecationsAndWarnings(new Setting[] { SSLConfigurationSettings.withoutPrefix().legacyTruststorePassword });
} }