Skip to content

Validate monitoring username at parse time#47821

Merged
danhermann merged 6 commits intoelastic:masterfrom
danhermann:47711_auth_username
Oct 29, 2019
Merged

Validate monitoring username at parse time#47821
danhermann merged 6 commits intoelastic:masterfrom
danhermann:47711_auth_username

Conversation

@danhermann
Copy link
Copy Markdown
Contributor

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

@danhermann danhermann added the :Core/Infra/Monitoring DEPRECATED, DO NOT USE label Oct 9, 2019
@elasticmachine
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

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

@danhermann
Copy link
Copy Markdown
Contributor Author

@elasticmachine, run elasticsearch-ci/2

@danhermann
Copy link
Copy Markdown
Contributor Author

@elasticmachine, run elasticsearch-ci/bwc

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

@elasticmachine update branch

@danhermann
Copy link
Copy Markdown
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.

5 participants