Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select browser using environment variable #170

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AndreasSko
Copy link

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

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 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 still be the same.
@hashicorp-cla
Copy link

hashicorp-cla commented May 7, 2021

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants