spring-projects / spring-vault

Provides familiar Spring abstractions for HashiCorp Vault
https://spring.io/projects/spring-vault
Apache License 2.0
283 stars 186 forks source link

Adding support of KV Patch operation #587

Closed yfaney closed 4 years ago

yfaney commented 4 years ago

Issue Link

Support for KV Patch in VaultTemplate #585

Motivation and Context

This change will enable the support of KV patch operation in VaultKeyValue2Template. Note that this command will only work with Vault Secret Engine V2. During the change, I tweaked a doRead() method to get the metadata properly in V2 access which is required to perform patch operation. Please feel free to suggest improvement of this code. I tried the minimum change so it may have a room to refactor. This change is based on the source code of the vault CLI: https://github.com/hashicorp/vault/blob/master/command/kv_patch.go#L66

How to test this change

Performing mvn install

Test Evidence

Please see the attached screenshot Screen Shot 2020-09-24 at 12 52 04 AM

pivotal-issuemaster commented 4 years ago

@yfaney Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

pivotal-issuemaster commented 4 years ago

@yfaney Thank you for signing the Contributor License Agreement!

yfaney commented 4 years ago

Hi, @mp911de I addressed all of your comments above. Please review my changes again and let me know if there are still something to be changed. Thanks!

yfaney commented 4 years ago

@mp911de awesome, I'll keep that in mind and try following the formatting and license headers in the next time :)

mp911de commented 4 years ago

Thank you for your contribution. That's merged and polished now.