Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Commit

Permalink
Fixes error when '~/.vault-token' contains a trailing newline
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Jason Gwartz authored and Luzifer committed May 2, 2019
1 parent 4d1d07b commit 66ccd94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,5 @@ func vaultTokenFromDisk() string {
return ""
}

return string(data)
return strings.TrimSpace(string(data))
}

0 comments on commit 66ccd94

Please sign in to comment.