peopledoc / vault-cli

A configurable command-line interface tool (and python library) to interact with Hashicorp Vault
https://vault-cli.readthedocs.io/
Other
80 stars 21 forks source link

Vault env: Secret that may or may not be there #137

Open ewjoachim opened 4 years ago

ewjoachim commented 4 years ago
vault env -p 'secret?' -- env
vault env -p 'secret=BLA?' -- env

will omit the environment variable altogether if an error happens when trying to read the secret.

ewjoachim commented 4 years ago

Soooo

I think that one of the few things we should do is model the "Secret not found" in a better way. This would change the api, though, but if path1 is ok and path2 not ok:

s = client.get_secrets("")
# I think we should get something like:
{
    "path1": {"key": "value"},
    "path2": InvalidSecret(),
}

Now what I'm not sure is what the expected this is: