common-fate / granted

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

--exec broken on 0.20.4 #573

Closed jhuntwork closed 6 months ago

jhuntwork commented 6 months ago

It seems like 0.20.4 broke the --exec feature.

On 0.20.4:

$ GRANTED_QUIET=true FORCE_NO_ALIAS=true assumego ReadOnlyPlus --exec 'aws ec2 describe-fleets'
GrantedExec ASIAXXXXXXXXXXXXXXXX [redacted secret key] None us-east-1 None false None None None None aws ec2describe-fleets

On 0.20.3:

$ GRANTED_QUIET=true FORCE_NO_ALIAS=true assumego ReadOnlyPlus --exec 'aws ec2 describe-fleets'
{
    "Fleets": []
}
jhuntwork commented 6 months ago

It seems like maybe this was intentional after all, with the idea that one would be using the wrapped assume alias, but that isn't working for me here either. I get no output. Credentials are acquired but it does not seem to be executing anything.

$ assume lab-1/ReadOnlyPlus --exec -- aws s3 get-caller-identity
[✔] [lab-1/ReadOnlyPlus](us-east-1) session credentials will expire in 12 hours
$
jhuntwork commented 6 months ago

My mistake, I had mismatched versions of assume in my path between 0.20.3 and 0.20.4. The original behavior is still unexpected to me, but I guess it's intended that we use --exec only with the assume wrapper script. Closing, thanks.