Skip to content
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

Merged
merged 6 commits into from
Oct 29, 2019

Conversation

danhermann
Copy link
Contributor

Provides parse-time validation for AUTH_USERNAME_SETTING as described in #47711.

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (:Core/Features/Monitoring)

@danhermann danhermann changed the title Validate AUTH_USERNAME_SETTING at parse time Validate monitoring username at parse time Oct 9, 2019
new Setting.Validator<String>() {
@Override
public void validate(String password) {

Copy link
Contributor

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

Copy link
Contributor

@jakelandis jakelandis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (one nit)

@danhermann
Copy link
Contributor Author

@elastic/es-core-infra, this work covers both monitoring and settings if you want to review it.

@danhermann
Copy link
Contributor Author

@elasticmachine, run elasticsearch-ci/2

@danhermann
Copy link
Contributor Author

@elasticmachine, run elasticsearch-ci/bwc

Copy link
Member

@rjernst rjernst left a 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 [" +
Copy link
Member

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"

@danhermann
Copy link
Contributor Author

@elasticmachine update branch

@danhermann
Copy link
Contributor Author

@elasticmachine run elasticsearch-ci/2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants