common-fate / granted

The easiest way to access your cloud.
https://granted.dev
MIT License
956 stars 90 forks source link

File keychain backend should bail in credential process rather than hanging #637

Open chrnorm opened 2 months ago

chrnorm commented 2 months ago

Reported by Gautam in our community Slack and related to #610.

granted credential-process hangs waiting for input on unlocking the credential file. The solution proposed in #610 is to install pass, but Gautam is using a shared machine and it isn't desirable to force everyone to use pass.

Rather than prompting for user input we should bail if the credential file password is unset.

This will likely involve setting PromptFunc in the keychain config struct to return an error when used with the credential_process integration.

gautamg795 commented 2 months ago

Rather than prompting for user input we should bail if the credential file password is unset.

FWIW, I think the behavior while this "worked" for me wasn't to bail, but to just proceed by using an empty password? I'm actually not totally sure; I might not have ever utilized the credential helper explicitly by passing a --profile to the AWS CLI that was different than the assumed profile. But the behavior right now is that I can't use any AWS commands while credential_helper is set up for a profile without hanging (Ctrl-C / Ctrl-\ doesn't work — only kill from a different TTY).