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