Skip to content

Conversation

rjernst
Copy link
Member

@rjernst rjernst commented Apr 11, 2025

When reading a string value from stdin the keystore add command currently looks directly at stdin. However, stdin may also be consumed while reading the keystore password. This commit changes the add command to use the reader from the termainl instead of looking at stdin directly.

closes #98115

When reading a string value from stdin the keystore add command currently looks directly at stdin. However, stdin may also be consumed while reading the keystore password. This commit changes the add command to use the reader from the termainl instead of looking at stdin directly. closes elastic#98115
@rjernst rjernst added >bug :Core/Infra/CLI CLI utilities, scripts, and infrastructure v8.18.1 v8.19.0 v9.0.1 v9.1.0 labels Apr 11, 2025
@rjernst rjernst requested a review from a team as a code owner April 11, 2025 21:53
@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Apr 11, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@elasticsearchmachine
Copy link
Collaborator

Hi @rjernst, I've created a changelog YAML for you.

@rjernst
Copy link
Member Author

rjernst commented Apr 11, 2025

The fix here turned out to be trivial. The add command can use the same reader instance that the base keystore command uses, which they both get through the Terminal.

Copy link
Contributor

@ldematte ldematte left a comment

Choose a reason for hiding this comment

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

LGTM

@rjernst rjernst merged commit b47bd3a into elastic:main Apr 14, 2025
17 checks passed
@rjernst rjernst deleted the keystore/use_reader branch April 14, 2025 19:56
rjernst added a commit to rjernst/elasticsearch that referenced this pull request Apr 16, 2025
As a followon to elastic#126729, the add string keystore command doesn't need to use a reader at all (and it was incorrect for it to close the reader from the terminal). Instead, the Terminal abstraction already handles how to get at line by line secrets. This commit removes that usage of reader and uses readSecret calls instead. closes elastic#126882
rjernst added a commit to rjernst/elasticsearch that referenced this pull request Apr 16, 2025
When reading a string value from stdin the keystore add command currently looks directly at stdin. However, stdin may also be consumed while reading the keystore password. This commit changes the add command to use the reader from the termainl instead of looking at stdin directly. closes elastic#98115
rjernst added a commit to rjernst/elasticsearch that referenced this pull request Apr 16, 2025
When reading a string value from stdin the keystore add command currently looks directly at stdin. However, stdin may also be consumed while reading the keystore password. This commit changes the add command to use the reader from the termainl instead of looking at stdin directly. closes elastic#98115
rjernst added a commit to rjernst/elasticsearch that referenced this pull request Apr 16, 2025
When reading a string value from stdin the keystore add command currently looks directly at stdin. However, stdin may also be consumed while reading the keystore password. This commit changes the add command to use the reader from the termainl instead of looking at stdin directly. closes elastic#98115
elasticsearchmachine pushed a commit that referenced this pull request Apr 16, 2025
When reading a string value from stdin the keystore add command currently looks directly at stdin. However, stdin may also be consumed while reading the keystore password. This commit changes the add command to use the reader from the termainl instead of looking at stdin directly. closes #98115
elasticsearchmachine pushed a commit that referenced this pull request Apr 17, 2025
When reading a string value from stdin the keystore add command currently looks directly at stdin. However, stdin may also be consumed while reading the keystore password. This commit changes the add command to use the reader from the termainl instead of looking at stdin directly. closes #98115 Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
elasticsearchmachine pushed a commit that referenced this pull request Apr 17, 2025
When reading a string value from stdin the keystore add command currently looks directly at stdin. However, stdin may also be consumed while reading the keystore password. This commit changes the add command to use the reader from the termainl instead of looking at stdin directly. closes #98115 Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
rjernst added a commit that referenced this pull request Apr 18, 2025
As a followon to #126729, the add string keystore command doesn't need to use a reader at all (and it was incorrect for it to close the reader from the terminal). Instead, the Terminal abstraction already handles how to get at line by line secrets. This commit removes that usage of reader and uses readSecret calls instead. closes #126882
rjernst added a commit to rjernst/elasticsearch that referenced this pull request Apr 18, 2025
As a followon to elastic#126729, the add string keystore command doesn't need to use a reader at all (and it was incorrect for it to close the reader from the terminal). Instead, the Terminal abstraction already handles how to get at line by line secrets. This commit removes that usage of reader and uses readSecret calls instead. closes elastic#126882
rjernst added a commit to rjernst/elasticsearch that referenced this pull request Apr 18, 2025
As a followon to elastic#126729, the add string keystore command doesn't need to use a reader at all (and it was incorrect for it to close the reader from the terminal). Instead, the Terminal abstraction already handles how to get at line by line secrets. This commit removes that usage of reader and uses readSecret calls instead. closes elastic#126882
rjernst added a commit to rjernst/elasticsearch that referenced this pull request Apr 18, 2025
As a followon to elastic#126729, the add string keystore command doesn't need to use a reader at all (and it was incorrect for it to close the reader from the terminal). Instead, the Terminal abstraction already handles how to get at line by line secrets. This commit removes that usage of reader and uses readSecret calls instead. closes elastic#126882
elasticsearchmachine pushed a commit that referenced this pull request Apr 18, 2025
…7069) As a followon to #126729, the add string keystore command doesn't need to use a reader at all (and it was incorrect for it to close the reader from the terminal). Instead, the Terminal abstraction already handles how to get at line by line secrets. This commit removes that usage of reader and uses readSecret calls instead. closes #126882
elasticsearchmachine pushed a commit that referenced this pull request Apr 18, 2025
…7070) As a followon to #126729, the add string keystore command doesn't need to use a reader at all (and it was incorrect for it to close the reader from the terminal). Instead, the Terminal abstraction already handles how to get at line by line secrets. This commit removes that usage of reader and uses readSecret calls instead. closes #126882
elasticsearchmachine pushed a commit that referenced this pull request Apr 18, 2025
…7068) As a followon to #126729, the add string keystore command doesn't need to use a reader at all (and it was incorrect for it to close the reader from the terminal). Instead, the Terminal abstraction already handles how to get at line by line secrets. This commit removes that usage of reader and uses readSecret calls instead. closes #126882
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug :Core/Infra/CLI CLI utilities, scripts, and infrastructure Team:Core/Infra Meta label for core/infra team v8.18.1 v8.19.0 v9.0.1 v9.1.0

3 participants