go-jira / jira

simple jira command line client in Go
Apache License 2.0
2.68k stars 328 forks source link

stdin password source does not work #308

Open plallin opened 4 years ago

plallin commented 4 years ago

jira version

$ jira version
1.0.22

jira config

$ cat ~/.jira.d/config.yml
endpoint: https://jira.company.com
pasword-source: stdin
project: MYPROJECT

Expectations

As per the README, I would expect jira to be able to take a password input from stdin, as follows:

$ ./password-generator | jira login --endpoint=https://my.jira.endpoint.com --user=USERNAME

Actual result

When passing a password from stdin, jira throws an error and fails to log me in.

$ echo "hunter2" | jira login --endpoint=https://jira.company.com --user=pauline.lallinec
? Jira Password [pauline.lallinec]:

ERROR EOF
^[[65;119R%
 ;119R

Additional notes

I am using MacOS Mojave 10.14.6 (18G2022), however I do not believe this is an issue related to MacOS. I containerized jira within a docker container based on Ubuntu, and got the same result.

tomelliot16 commented 4 years ago

I have run into the same issue on mac and ubuntu.

ma44in commented 4 years ago

I've got the same issue today and could fix it with removing the trailing newline with the '-n' option of echo. So, you could try this:

echo -n "hunter2" | jira login --endpoint=https://jira.company.com --user=pauline.lallinec

plallin commented 4 years ago

Unfortunately that yields the same result:

echo -n "hunter2" | jira login --endpoint=https://jira.company.com --user=pauline.lallinec
? Jira Password [pauline.lallinec]:

ERROR EOF
^[[56;103R%
 ;103R

My configuration file at the time of running this command line is:

endpoint: https://jira.company.com
password-source: stdin
project: MYPROJECT

Version of go-jira: 1.0.22