99designs / keyring

Go library providing a uniform interface across a range of secure credential stores
MIT License
580 stars 138 forks source link

Expand pass dir path #86

Closed benjamb closed 2 years ago

benjamb commented 3 years ago

While you can avoid using --opt=value format to ensure ~ gets expanded by the shell, it was irritating enough for me to contribute this small change.

mtibben commented 3 years ago

~ is expanded by the shell. Expanding ~ and none of the other shell expansions seems arbitrary

benjamb commented 3 years ago

~ doesn't get expanded by the shell when you pass options in the format of --opt=value, i.e. --pass-dir=~/.pass/awsvault/.

I based the implementation off the code here: https://github.com/99designs/keyring/blob/master/file.go#L43

agargiulo commented 2 years ago

I based the implementation off the code here: https://github.com/99designs/keyring/blob/master/file.go#L43

Ironically, your change at least properly ignores ~agargiulo/ for expansion while the thing you linked breaks:

[~] $ aws-vault --backend=file --file-dir=~agargiulo/thisCanNotWorkCanIt  list
aws-vault: error: list: mkdir /Users/agargiuloagargiulo: permission denied