Skip to content

Conversation

andsel
Copy link
Contributor

@andsel andsel commented Sep 18, 2025

Release notes

[rn:skip]

What does this PR do?

Translates ValidatedPassword setting class into plain Java. This PR copies the Rspec test also to JUnit, plus removed a log validation test, because mocking of the ValidatedPasswordSetting Java class seems to do not work in Rspec.

Why is it important/What is the impact to the user?

N/A

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files (and/or docker env variables)
  • I have added tests that prove my fix is effective or that my feature works

Author's Checklist

  • [ ]

How to test this PR locally

On config/logstash.yml enable basic authetication on HTTP API with an invalid password and configure password_policy.mode to warn a log message:

api.auth.type: basic
api.auth.basic.username: "logstash-user"
api.auth.basic.password: "invalid"
api.auth.basic.password_policy.mode: WARN 

run Logstash:

bin/logstash -e "input{stdin{}} output{stdout{codec=>rubydebug}}"

and verify that in log appears:

[WARN ][org.logstash.settings.ValidatedPasswordSetting] Password must contain at least one upper case, must contain at least one digit between 0 and 9.

and doesn't crash.

Related issues

@andsel andsel self-assigned this Sep 18, 2025
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

Copy link
Contributor

mergify bot commented Sep 18, 2025

This pull request does not have a backport label. Could you fix it @andsel? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit.
  • If no backport is necessary, please add the backport-skip label

@andsel andsel force-pushed the feature/validated_password_setting_to_java branch from 6ca07fb to fc2e9aa Compare September 18, 2025 15:37
Copy link

@andsel andsel force-pushed the feature/validated_password_setting_to_java branch from fc2e9aa to 37653a5 Compare October 2, 2025 14:49
@elasticmachine
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

History

cc @andsel

@andsel andsel changed the title Feature/validated password setting to java Moved Ruby ValidatedPassword setting to Java implementation Oct 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reimplement LogStash::Setting::ValidatedPassword to Java
2 participants