Select browser using environment variable #170
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This change only affects the CLI usage when running
vault login
.Currently
vault login
always opens the default browser for login via OIDC. However for security reasons there might be the need to use a different browser which is logged in to OIDC as a higher privileged user (you might not want to browse as an admin for regular work..).This PR adds the option to select a different browser by setting the
BROWSER
environment variable.Example:
BROWSER=/usr/bin/firefox vault login -method=oidc
. The default behaviour will stay the same.Design of Change
The change is pretty straightforward: If the environment variable is set it will overwrite the cmd that was chosen for opening the default browser.
Related Issues/Pull Requests
None
Contributor Checklist
[?] Relevant docs: I'm not sure if docs would need to be updated for this simple change. The
BROWSER
environment variable seems to be more or less a standard. But I'm happy to add some explaination to the docs if wanted :)[x] Backwards compatible: The default behaviour stays the same