-
Notifications
You must be signed in to change notification settings - Fork 31
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
Add custom key metadata #48
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Great work!
Thanks for the awesome work, this is exactly what I was looking for! I thought it would work out the box included in the main vault binary, but seems not. EDIT: Just found that its looking to be included in the Vault 1.9 release -> https://github.com/hashicorp/vault/milestone/100 |
Thanks for the comment, @bradly-swart! I wanted to confirm the statement that you provided in your EDIT. This feature will be part of the Vault 1.9 release. |
Overview
kv-v2 does not provide the ability to specify custom key metadata to describe a secret. A possible workaround is to store this metadata as part of the secret data itself. Doing so results in the metadata having the same ACL access as the data. This change includes a new
custom_metadata
field to the key metadata that will allow users to specify arbitrary version-agnostic metadata.Design of Change
How was this change implemented?
A new
custom_metadata
field has been added to the key metadata as a map of string-to-string key-value pairs (i.e.map<string, string>
). Thewrite
(POST and PUT) andread
operations for the/<mount>/metadata/:path
endpoint have been modified to handle this new field. In the case of a POST or PUT, validation will be run against the input. The provided map cannot have more than 64 keys. If the key count is less than 64, the following checks are performed for each key-value pair:All errors will be rolled up and returned as a
multierror
. If no errors are found, thecustom_metadata
field will be stored alongside the other key metadata. There is no patching support for this field at this time. With that said, the value in storage will be completely overwritten by the provided value in the request. If thecustom_metadata
field is not provided in a request, the stored value should persist as is.Related Issues/Pull Requests
Resolves Vault Issue #7905
Associated with Vault PR #12218
Contributor Checklist