Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public char[] readSecret() {
if (useConsole) {
return System.console().readPassword();
} else {
return scanner.next().toCharArray();
return scanner.nextLine().toCharArray();
}
}

Expand Down
14 changes: 14 additions & 0 deletions qa/integration/specs/secret_store_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,20 @@
expect(logstash.stderr_and_stdout).to match(/\\"\$\{tag1\}\\"/)
end

it "add value that contains a space" do
# add two key value pairs to keystore
# hello => hello world
# bye => bye
key = "hello"
value = "hello world"
@logstash.run_cmd(["bash", "-c", "echo -e '#{value}\\nbye' | LOGSTASH_KEYSTORE_PASS=#{logstash_keystore_passowrd} #{@logstash.logstash_home}/bin/logstash-keystore --path.settings #{settings_dir} add #{key} bye"])

test_env["LOGSTASH_KEYSTORE_PASS"] = logstash_keystore_passowrd
logstash = @logstash.run_cmd(["bin/logstash", "-e", "input{ generator{ count => 1 tags => ['${#{key}}', '${bye}'] }}", "--path.settings", settings_dir], true, test_env)
expect(logstash.stderr_and_stdout).to match(/#{value}/)
expect(logstash.stderr_and_stdout).to match(/bye/)
end

context "won't start" do
it "with the wrong password when variables are in settings" do
test_env["LOGSTASH_KEYSTORE_PASS"] = "WRONG_PASSWRD"
Expand Down