-
Notifications
You must be signed in to change notification settings - Fork 22
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-cli get" doesn't return YAML formatted value when secret isn't a string #96
Comments
it works fine with |
What about |
(vault-cli) kael@consoude ~/dev/vault-cli (git:master)% cat test.json [0]
{
"foo": "bar",
"train": [1,2,3,4],
"GNU": {
"Linux": {
"Debian": "Buster"
}
}
}
(vault-cli) kael@consoude ~/dev/vault-cli (git:master)% vault set --stdin --yaml secret < test.json [0]
Done
(vault-cli) kael@consoude ~/dev/vault-cli (git:master)% vault get secret [0]
---
GNU:
Linux:
Debian: Buster
foo: bar
train:
- 1
- 2
- 3
- 4
(vault-cli) kael@consoude ~/dev/vault-cli (git:master)% vault get --text secret [0]
---
GNU:
Linux:
Debian: Buster
foo: bar
train:
- 1
- 2
- 3
- 4
(vault-cli) kael@consoude ~/dev/vault-cli (git:master)% vault get --yaml secret [0]
---
GNU:
Linux:
Debian: Buster
foo: bar
train:
- 1
- 2
- 3
- 4 |
yep, without |
I'll close this for now, please feel free to re-open if there's still a problem. |
What about the 2nd example ? |
Oh, maybe I didn't understand your point then. |
It looks like the official vault binary always writes as a string, and will try to read as complex object only when writing. The ticket says:
I think we're not in this case. The secret is a string, because with the official vault command, it seems to always be a string. Given that the vault api supports arbitrary json types when reading and writing, the fact the official vault command decides to limit itself to storing string seems weird, and I'm yet to be convinced we're not doing the right thing. What would you have us do ? Should the secrets |
vault-cli get
doesn't return YAML formatted value when secret isn't a string.When secret value isn't a string, output of
vault get secret
should be the same as output ofvault get --yaml secret
.Reproducer1 (tested with Python 3.6.8)
Reproducer2 (tested with Python 3.6.8)
It looks like force_yaml is always false (
secret
is always a string).The text was updated successfully, but these errors were encountered: