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

vault should tolerate line endings in $HOME/.vault-token #1902

Closed
dch opened this issue Sep 19, 2016 · 1 comment
Closed

vault should tolerate line endings in $HOME/.vault-token #1902

dch opened this issue Sep 19, 2016 · 1 comment

Comments

@dch
Copy link

dch commented Sep 19, 2016

If $HOME/.vault-token has a \n appended, as many text editors like to do silently, vault status and related commands will fail:

$ vault status
Error checking seal status: Get https://vault.blah.com:8200/v1/sys/seal-status: net/http: invalid header field value "blah-blah\n" for key X-Vault-Token

I've looked a bit at the source in builtin/token/disk/command.go and don't see where this is retrieved. Did I miss something?

@jefferai
Copy link
Member

Duplicate of #1774

jasongwartz pushed a commit to jasongwartz/vault-openvpn that referenced this issue May 2, 2019
First of all, thanks for the great tool!

This PR fixes an error encountered by one of our developers which occured when they had manually created the `~/.vault-token` file, and their editor had added a trailing newline. The error comes from the following line: https://github.com/hashicorp/vault/blob/master/api/client.go#L747

The official vault client was patched for this in hashicorp/vault@f8c657a, after issues hashicorp/vault#1774 and hashicorp/vault#1902.
Luzifer pushed a commit to Luzifer/vault-openvpn that referenced this issue May 2, 2019
First of all, thanks for the great tool!

This PR fixes an error encountered by one of our developers which occured when they had manually created the `~/.vault-token` file, and their editor had added a trailing newline. The error comes from the following line: https://github.com/hashicorp/vault/blob/master/api/client.go#L747

The official vault client was patched for this in hashicorp/vault@f8c657a, after issues hashicorp/vault#1774 and hashicorp/vault#1902.
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

No branches or pull requests

2 participants