amperity / vault-clj

Clojure client for Hashicorp's Vault secret management system.
Other
70 stars 17 forks source link

Conversion to edn should be opt-in IMO #100

Open ieugen opened 1 year ago

ieugen commented 1 year ago

Hi,

Using version 1.x for vault-clj with kv2 secret engine. I have some code to fetch a secret and write it as a file (a software to streamline docker stack deployment). The secret is a plain json and it should be written as a plain json file since the app that consumes it expects it to be json.

I noticed a couple of things:

When dealing with clojure, having to work with EDN is a good thing. Not so much when you have to use the original data type stored in the secret.

For version 1.x there is no way to opt out of EDN conversion so I will have to implement a step to serialize edn -> json. Not hard but:

IMO edn conversion should be opt-in in vault-clj, or at least opt-out. I am favoring it to be opt-in but it might not be ok now unless we break backward compatibility (version 2.x :D ) .

ieugen commented 1 year ago

Another downside of the json -> edn -> json is that the json keys get re-arranged. This causes some issues: