-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Provide ability to only read "data", rather than wrapped data. #1737
Comments
jq is your friend here... "jq '.data'" should do the trick! |
Yeah, I looked at jq, but that seems like a kludge. I'd rather not introduce another dependency. This seems like a natural fit for first class support from vault, especially since vault already supports drilling into data with |
Also, I'd love to read data in yaml format. I realize there's something like jq for yaml, but now, if I want some paths in json format, and other paths in yaml format (perhaps because they are read by different apps/tools), I have to introduce two dependencies. |
You can have the output printed as yaml via the |
Yeah, I'm aware of For example, I would only want the following output:
(without lease_id and all the other vault metadata) |
Also ran into this. We used to do:
No longer works 😢 |
@bradwitte I can tell you with certainty that the behavior you're describing hasn't been the case for at least two years. :-) |
Ha! I don't operate our vault installation so that is a bit out of my control. In any case, I worked around it by placing the secret in a field called "data". That way I didn't have to change the downstream automation.
Hope that helps someone. |
@bradwitte If you are actually running Vault prior to 0.5 (which is as far back as I tested) you definitely need to upgrade. We've had huge numbers of bug fixes, including a number of very important ones, plus security fixes since then. |
Very odd - we definitely are not on a version that old. Being discrete about the field works fine, it just had me scratching my head for a bit. Thanks for looking into it. |
Actually, looks like my workaround doesn't work:
Note the nested "data". It is happily cramming the json object into that single field. Which is what I asked it to do. ;) So I guess I need to add jq to my automation. Bummer. |
It's not clear to me what you were doing before. I wasn't able to reproduce with any version of the client. |
Unfortunately I can't verify the versions since I have upgraded my client and haven't tracked what I was running or what the server was running in the past. I guess put me down as a 👍 for this request if it is ever reconsidered. Thanks again! |
I've just hit this issue trying to store a json file that I'd like to get out in the exact same fashion. I also expected
...and then reading out the original via:
|
So I think the reason I've been so confused is that, as far as I can tell (by going to a pre-0.9.2) version, this has never worked. So this isn't a bug report -- I thought it was detailing a functionality regression -- it's a feature request. Tracking in #3987 |
Unless someone else can provide versions in which it did work that sounds fair to me. |
Thank you @jefferai for the super quick response and resolution to support the special case! 😍 |
NP! |
I'd like to be able to pull secrets out of vault in the same structure in which they are put in the vault (without a wrapper) i.e. I want to retrieve only the
data
for a particular path.Currently, if I do this:
And then attempt to read the value back:
Notice that the data is wrapped in another json object.
I can retrieve individual fields within data by using the
-field
option (e.g.-field=user
). But there's no way (that I have found) to retrieve only the data. i.e. I only want to retrieveI tried
-field=data
, but that results inField data not present in secret
, which makes sense, because data is not part of the actual secret. It's just part of the metadata.The same request applies to the HTTP API as well.
It seems like this could be implemented as a new cli option and HTTP param.
I can see this being beneficial in two use cases
The text was updated successfully, but these errors were encountered: