-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add HTTP PATCH support for key metadata (#57)
* add PatchOperation to metadata endpoint * add custom_metadata validation to patch handler * return 404 in metadata patch handler when entry does not exist * add cas_required warning in metadata patch handler * run HandlePatchOperation for metadata patch handler * metadata patch validation tests * convert custom_metadata from TypeKVPairs to TypeMap TypeKVPairs results in using a map[string]string whereas TypeMap results in using a map[string]interface{}. Being able to accept null values for custom_metadata fields is important for HTTP PATCH operations as it signals to the handler to remove the field. A shared parser has been added to ensure that the provided non-nil values are indeed parsable as strings. * adding custom_metadata validation and patch tests * go get vault/sdk@patch-field-data-error-handling * fix delete_version_after handling for metadata patch * go fmt * add versions and custom_metadata checks * check for simpler substr in metadata validation test * go get vault/sdk@patch-field-data-error-handling * fix custom metadata parsing * tests for ignored unknown metadata fields * move lock prior to metadata read * add explicit check for cas_required in test despite warning * add godoc for kv metadata patch * remove filter of nils as sdk will do so * add metadata test for nils unsetting values * go get vault/sdk@main; go mod tidy
- Loading branch information
Showing
5 changed files
with
755 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.