-
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
URL option for BaseRunAsSuperuserCommand #81025
Changes from all commits
a700e8a
84d1590
8985bf7
0d01fd8
24e9d21
33824c5
24c793c
36735f5
072b863
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -14,7 +14,7 @@ the native realm and built-in users. | |||||||||
bin/elasticsearch-reset-password | ||||||||||
[-a, --auto] [-b, --batch] [-E <KeyValuePair] | ||||||||||
[-f, --force] [-h, --help] [-i, --interactive] | ||||||||||
[-s, --silent] [-u, --username] [-v, --verbose] | ||||||||||
[-s, --silent] [-u, --username] [--url] [-v, --verbose] | ||||||||||
---- | ||||||||||
|
||||||||||
[discrete] | ||||||||||
|
@@ -59,12 +59,17 @@ option. For more information about debugging connection failures, see | |||||||||
|
||||||||||
`-u, --username`:: The username of the native realm user or built-in user. | ||||||||||
|
||||||||||
`--url`:: Specifies the base URL (hostname and port of the local node) that the tool uses to submit API | ||||||||||
requests to {es}. The default value is determined from the settings in your | ||||||||||
`elasticsearch.yml` file. If `xpack.security.http.ssl.enabled` is set to `true`, | ||||||||||
Comment on lines
+63
to
+64
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jkakavas, I think it's worth indicating which settings determine the default value. What do you think? This change would also apply to the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not that simple actually. It can be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Of course it's not that simple 😆 , which is probably why you opted for simplicity in your original description. I'm 👍 with keeping your original text -- thank you for the explanation! |
||||||||||
you must specify an HTTPS URL. | ||||||||||
|
||||||||||
`-v --verbose`:: Shows verbose output in the console. | ||||||||||
[discrete] | ||||||||||
=== Examples | ||||||||||
|
||||||||||
The following example resets the password of the `elastic` user to an auto-generated value and | ||||||||||
prints the new password in the console. | ||||||||||
prints the new password in the console: | ||||||||||
|
||||||||||
[source,shell] | ||||||||||
---- | ||||||||||
|
@@ -78,3 +83,11 @@ in the terminal for the desired password: | |||||||||
---- | ||||||||||
bin/elasticsearch-reset-password --username user1 -i | ||||||||||
---- | ||||||||||
|
||||||||||
The following example resets the password of a native user with username `user2` to an auto-generated value | ||||||||||
prints the new password in the console. The specified URL indicates where the elasticsearch-reset-password | ||||||||||
tool attempts to reach the local {es} node: | ||||||||||
[source,shell] | ||||||||||
---- | ||||||||||
bin/elasticsearch-reset-password --url "https://172.0.0.3:9200" --username user2 -i | ||||||||||
---- |
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.
Do you think it would be preferable that we drop the "If
xpack.security.http.ssl.enabled
is set totrue
,you must specify an HTTPS URL" scheme condition, by having the tool check for that itself (like it does for the "default URL")?
Moreover, a URL is more than the scheme and the host and port pair, and using DNS names to refer to the node might not be ideal, as it might not be included in the SAN of the cert.
Do you think it would be preferable that this option be more focused on the ip and port that the local node can be reached at?
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.
I contemplated the same but in the end settled to a single option as a simpler thing, happy to discuss.
true but what we should be aiming for here is not naming strictness for the sake of it but a name for the option that’s understandable by (or at least explainable for ) the majority of users. I think that
url
fits the bill.the idea is that if you ever need to use this parameter you do so because you know that you want to talk to the node at an ip or hostname that is in the SANs but CommandLineHttpClient picks another. So you know what should be in the url (either a hostname or an IP address )
If we change this to two parameters then yes it makes sense , we shouldn’t be asking the users for a third parameter (scheme) but I’m not 100% that ee should change.
Do we introduce an ip and a port parameter? Do we mandate both if one is passed or have default values for the port ?
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.
I don't have a preference. Having to specify both the ip and the port simultaneously (as is the case with this
url
parameter), as a single option is OK.