devsecops / assumer

An AWS cross-account tool to support human access with MFA for the CLI and GUI.
Apache License 2.0
18 stars 7 forks source link

xdg-open call fails in non-desktop environments #5

Open colinross opened 8 years ago

colinross commented 8 years ago

Context: the assumer executable Environment: local/remote non-desktop environment, such as a docker/vagrant container or remote EC2 instance-- specifically any linux or bsd environment without (xdg-utils)[https://www.freedesktop.org/wiki/Software/xdg-utils/] installed.

For non-desktop environments the call to xdg-open will fail. This occurs if you pass the --gui / -g commandline option, which is compounded by the fact that it is necessary to do so if you wish to retrieve the login url outside of passing the --pry flag and manually inspecting the target_creds object.

@mechcozmo @slietz

pbnj commented 7 years ago

@colinross One thing we can do is wrap the xdg-open call in a begin... rescue... block in Ruby and rescue the exception by throwing the URL to STDOUT.

Do you have an easily replicable scenario to test this for me?