Skip to content

Commit 0c311c7

Browse files
committed
Added String constructor with 2 arguments
1 parent 75ca3f8 commit 0c311c7

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

logstash-core/lib/logstash/environment.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ module Environment
7777
Setting::PortRange.new("api.http.port", 9600..9700),
7878
Setting::StringSetting.new("api.environment", "production"),
7979
Setting::StringSetting.new("api.auth.type", "none", true, %w(none basic)),
80-
Setting::String.new("api.auth.basic.username", nil, false).nullable,
80+
Setting::StringSetting.new("api.auth.basic.username", nil, false).nullable,
8181
Setting::Password.new("api.auth.basic.password", nil, false).nullable,
8282
Setting::StringSetting.new("api.auth.basic.password_policy.mode", "WARN", true, %w[WARN ERROR]),
8383
Setting::Numeric.new("api.auth.basic.password_policy.length.minimum", 8),
@@ -108,7 +108,7 @@ module Environment
108108
Setting::TimeValue.new("slowlog.threshold.debug", "-1"),
109109
Setting::TimeValue.new("slowlog.threshold.trace", "-1"),
110110
Setting::StringSetting.new("keystore.classname", "org.logstash.secret.store.backend.JavaKeyStore"),
111-
Setting::String.new("keystore.file", ::File.join(::File.join(LogStash::Environment::LOGSTASH_HOME, "config"), "logstash.keystore"), false), # will be populated on
111+
Setting::StringSetting.new("keystore.file", ::File.join(::File.join(LogStash::Environment::LOGSTASH_HOME, "config"), "logstash.keystore"), false), # will be populated on
112112
Setting::NullableString.new("monitoring.cluster_uuid"),
113113
Setting::StringSetting.new("pipeline.buffer.type", "direct", true, ["direct", "heap"])
114114
# post_process

logstash-core/src/main/java/org/logstash/settings/StringSetting.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ public StringSetting(String name, String defaultValue) {
2121
this(name, defaultValue, true, Collections.emptyList());
2222
}
2323

24+
public StringSetting(String name, String defaultValue, boolean strict) {
25+
this(name, defaultValue, strict, Collections.emptyList());
26+
}
27+
2428
@Override
2529
public void validate(String input) throws IllegalArgumentException {
2630
staticValidate(input, possibleStrings, this.getName());

0 commit comments

Comments
 (0)