vaultlib icon indicating copy to clipboard operation
vaultlib copied to clipboard

Feature Proposal: Access to Secret Metadata

Open jambonrose opened this issue 4 years ago • 6 comments

Thanks for the library! We've enjoyed using it at work.

We'd like to continue using it, but we need to access metadata for our secrets (specifically the version of the secret). Would you be open to a pull request that modified Client.GetSecret() such that the vaultSecretKV2.Metadata is included on Secret struct returned by Client.GetSecret() ?

Thanks for taking the time to consider the feature.

jambonrose avatar May 08 '20 22:05 jambonrose

Sorry for delayed answer. It could definitively be an interesting feature. Long time without actively working on the lib, so I will need to get back to it ;)

mch1307 avatar May 13 '20 21:05 mch1307

@jambonrose I would be happy to review/merge your PR(s)

mch1307 avatar May 15 '20 07:05 mch1307

Great! Thanks for considering the feature, and no worries about the delay.

We've made a few changes to the library on our end:

  1. allow tests to be run locally on Mac and Windows (in addition to the original Linux setup; https://github.com/TrueTickets/vaultlib/pull/1)
  2. Run TravisCI tests only on the master branch and PRs (https://github.com/TrueTickets/vaultlib/pull/2; requires changes in the TravisCI Settings panel as well)
  3. update code to run tests in Go 1.11, 1.12, 1.13, and 1.14 (https://github.com/TrueTickets/vaultlib/pull/3; this required some test code modifications due to https://golang.org/doc/go1.13#testing)
  4. create a Metadata struct which is provided with KV v2 secrets (https://github.com/TrueTickets/vaultlib/pull/5)

My proposal was originally just for item 4. Would you be interested in some of this other work on our end, and if so, would you like this work in individual PRs or all-together?

Finally, we have not modified any code around KV v1. Given the changes in https://github.com/TrueTickets/vaultlib/pull/5, would you expect similar changes to KV v1?

We're going to be testing these changes later today. Once I confirm that all of this works as expected, I will open a PR (or several) for you to consider.

jambonrose avatar May 15 '20 11:05 jambonrose

I think the first 3 can be in one PR and the 4th in another one, if that's fine for you.

mch1307 avatar May 15 '20 18:05 mch1307

@jambonrose Any update on this? Thanks

mch1307 avatar Jun 23 '20 14:06 mch1307

We have not forgotten about this! We'll be swinging back around on this front ASAP.

jambonrose avatar Jun 25 '20 18:06 jambonrose