bitc / hs-vault-tool

Haskell client library for HashiCorp's Vault tool (via HTTP API)
10 stars 9 forks source link

Support Vault 0.10 #4

Closed CYBAI closed 5 years ago

CYBAI commented 6 years ago

In vault 0.10, there're some prefix between mounted path and the secret search path. When upgrading from vault 0.9 to vault 0.10, we should separate them for secret engine v2.

(@bitc I'd like to update the unit test if current implementation is fine. Thanks!)

bitc commented 6 years ago

Thanks for this pull request. Could you please explain in one or two more sentences what this pull request does and why it's needed?

Also, will this break support for vault versions 0.9 and lower?

Thanks

CYBAI commented 6 years ago

Hi @bitc , thanks for confirmation about the change. Let me answer the second question first.

Also, will this break support for vault versions 0.9 and lower?

I think Yes, it would break the support of vault version 0.9 and lower. After vault 0.10, the KV secret engine v2 will be default. But, for 0.9 or other lower versions, it would be v1.

Ref: https://www.vaultproject.io/docs/secrets/kv/index.html#kv-version-2

Could you please explain in one or two more sentences what this pull request does and why it's needed?

So, this PR aims to support KV secret engine v2 that there're some difference in endpoint.

Operation Difference
Read There is only difference in path.
List There is only difference in path.
Create/Update Difference in path and new version uses POST for both update and create operations. + for v2 payload should be wrapped into "data" object.
Remove Difference in path.

(Note: This table is copied from spring-projects/spring-vault#242)

alexbiehl commented 5 years ago

@bitc @CYBAI What is the status on this one?

CYBAI commented 5 years ago

@bitc ping for review

bitc commented 5 years ago

I've merged this. let me know if anyone needs me to release a new hackage version