@@ -439,50 +439,7 @@ def validate(value)
439
439
440
440
java_import org . logstash . settings . NullableStringSetting
441
441
java_import org . logstash . settings . PasswordSetting
442
- ValidatedPassword = org . logstash . settings . ValidatedPasswordSetting
443
-
444
- # class ValidatedPassword < Setting::PasswordSetting
445
- # def initialize(name, value, password_policies)
446
- # @password_policies = password_policies
447
- # super(name, value, true)
448
- # end
449
- #
450
- # def coerce(password)
451
- # if password && !password.kind_of?(::LogStash::Util::Password)
452
- # raise(ArgumentError, "Setting `#{name}` could not coerce LogStash::Util::Password value to password")
453
- # end
454
- #
455
- # policies = build_password_policies
456
- # validatedResult = LogStash::Util::PasswordValidator.new(policies).validate(password.value)
457
- # if validatedResult.length() > 0
458
- # if @password_policies.fetch(:mode).eql?("WARN")
459
- # logger.warn("Password #{validatedResult}.")
460
- # else
461
- # raise(ArgumentError, "Password #{validatedResult}.")
462
- # end
463
- # end
464
- # password
465
- # end
466
- #
467
- # def build_password_policies
468
- # policies = {}
469
- # policies[Util::PasswordPolicyType::EMPTY_STRING] = Util::PasswordPolicyParam.new
470
- # policies[Util::PasswordPolicyType::LENGTH] = Util::PasswordPolicyParam.new("MINIMUM_LENGTH", @password_policies.dig(:length, :minimum).to_s)
471
- # if @password_policies.dig(:include, :upper).eql?("REQUIRED")
472
- # policies[Util::PasswordPolicyType::UPPER_CASE] = Util::PasswordPolicyParam.new
473
- # end
474
- # if @password_policies.dig(:include, :lower).eql?("REQUIRED")
475
- # policies[Util::PasswordPolicyType::LOWER_CASE] = Util::PasswordPolicyParam.new
476
- # end
477
- # if @password_policies.dig(:include, :digit).eql?("REQUIRED")
478
- # policies[Util::PasswordPolicyType::DIGIT] = Util::PasswordPolicyParam.new
479
- # end
480
- # if @password_policies.dig(:include, :symbol).eql?("REQUIRED")
481
- # policies[Util::PasswordPolicyType::SYMBOL] = Util::PasswordPolicyParam.new
482
- # end
483
- # policies
484
- # end
485
- # end
442
+ java_import org . logstash . settings . ValidatedPasswordSetting
486
443
487
444
# The CoercibleString allows user to enter any value which coerces to a String.
488
445
# For example for true/false booleans; if the possible_strings are ["foo", "true", "false"]
0 commit comments