-
Notifications
You must be signed in to change notification settings - Fork 25k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validate monitoring username at parse time #47821
Conversation
Pinging @elastic/es-core-features (:Core/Features/Monitoring) |
new Setting.Validator<String>() { | ||
@Override | ||
public void validate(String password) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: comment to why empty
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (one nit)
@elastic/es-core-infra, this work covers both monitoring and settings if you want to review it. |
@elasticmachine, run elasticsearch-ci/2 |
@elasticmachine, run elasticsearch-ci/bwc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, one minor comment
if (Strings.isNullOrEmpty(username) == false) { | ||
if (Strings.isNullOrEmpty(password)) { | ||
throw new SettingsException( | ||
"[" + AUTH_USERNAME_SETTING.getConcreteSettingForNamespace(namespace).getKey() + "] without [" + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we have a more explicit message? This is something a user sees that must be acted upon. Perhaps something for the form "XXX is set but YYY is missing"
@elasticmachine update branch |
@elasticmachine run elasticsearch-ci/2 |
Provides parse-time validation for
AUTH_USERNAME_SETTING
as described in #47711.