miquella / vaulted

Spawning and storage of secure environments
MIT License
253 stars 30 forks source link

Vaulted doesn't properly show vaults with "/" in their name #196

Open Mythra opened 4 years ago

Mythra commented 4 years ago

Attempting to create a vault with / in it's name results in an error normally:

$ vaulted cp tetrate-hub tetrate/hub
Vault 'tetrate-hub'
   Password: 
Vault 'tetrate/hub'
   New password: 
   Confirm password: 
open /home/cynthia/.local/share/vaulted/tetrate/hub: no such file or directory

If you manually go ahead and create the directory everything seems to works fine:

$ mkdir -p /home/cynthia/.local/share/vaulted/tetrate/
$ vaulted cp tetrate-hub tetrate/hub
Vault 'tetrate-hub'
   Password: 
Vault 'tetrate/hub'
   New password: 
   Confirm password: 
$

Although it doesn't show up in vaulted ls:

$ vaulted ls
bs-root
cncf-envoy
tetrate-hub
$

However it is still possible to manually use it:

vaulted -n tetrate/hub
Vault 'tetrate/hub'
   Password: 
   MFA token: [snipped]
tetrate/hub — expires: 7 Oct 2020 04:56 UTC (35h59m58s remaining)

Would you be open to a PR allowing vaulted cp (and other creation mechanisms) to support creating directories like this, and letting vaulted ls show this? Or is this something that you don't want to support, and I shouldn't hope for?