Cox-Automotive/alks-cli

PowerShell user profile script output causes false error when getting password from keystore

gdawson-vauto opened this issue · 0 comments

Windows PowerShell
alks sessions open

In developer.js line 99: clortho.getFromKeychain(ALKS_USERID) an error is returned if the PowerShell user profile script writes to stdout/err (not sure which).

In my profile script, I had Start-SshAgent -Quiet which was writing Identity added: C:\Users\gdawson/.ssh/id_rsa (C:\Users\gdawson/.ssh/id_rsa). This is being caught as an error on line 109 (in devloper.js: exports.getPasswordFromKeystore).

Workaround: Don't output within profile script
Suggested: Would it be better to run the PowerShell command with no profile? Would require PR to clortho.

Example: (I added the gpfk>ipss>err log)

D:\git\openSource\alks-cli\node_modules\clortho [master ≡ +0 ~3 -0 !]> alks sessions open --verbose                                                                                                                         ALKS v3.0.3
[sessions-open]: getting developer
[sessions-open]: getting auth
[developer]: checking for access token
[developer]: no access token found, falling back to password
[developer]: gpfk>ipss>err: Error: Identity added: C:\Users\gdawson/.ssh/id_rsa (C:\Users\gdawson/.ssh/id_rsa)

[developer]: no password found, prompting user
[developer]: getting password from prompt
? Password [hidden] [input is hidden]