Skip to content
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

Conversion to edn should be opt-in IMO #100

Open
ieugen opened this issue Jul 20, 2023 · 1 comment
Open

Conversion to edn should be opt-in IMO #100

ieugen opened this issue Jul 20, 2023 · 1 comment

Comments

@ieugen
Copy link
Contributor

ieugen commented Jul 20, 2023

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:

  • Secret is converted to edn by default
  • There is no option to OPT-OUT of this feature

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:

  • I need to depend on json library
  • There is extra work needed to be done for nothing: json -> edn -> json .

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
Copy link
Contributor Author

ieugen commented Aug 10, 2023

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

  • file format is harder to check against the version in vault - visually
  • the hash of the data changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant