-
Notifications
You must be signed in to change notification settings - Fork 55
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
Throw on missing cipher configuration? #117
Comments
Also a thanks from me for |
@cybrox @paulstatezny This is actually an issue for the Lines 295 to 302 in ead16b1
But The only way I can think of to fix this is to make the vault raise an error or log a warning when it boots up, if no valid configuration is given. |
First of all, thank your for maintaining
cloak_ecto
!I was wondering, in terms of usability, wouldn't it make sense for the library to throw an error when no cipher is configured?
As far as I can see, the library is unusable without a suitable configuration.
My reasoning for this is, I just spent an hour attempting to figure out the following error:
However, I searched in all the wrong places. I double checked all my database types, checked if my ecto adapter (myxql) supported the correct data type, updated ecto, etc. etc... After a lot of digging, I ended up adding an
inspect
tolib/cloak_ecto/type.ex
indump/1
's error clause and got this helpful message%Cloak.InvalidConfig{message: "could not encrypt due to missing configuration"}}
As it turns out, I had put the following in my vault module:
After changing
:cyphers
to:ciphers
, as it is spelled in the docs, everything worked fine 🤦So I was wondering, wouldn't it make sense to throw an error when no
cipher
configuration is provided at all?The text was updated successfully, but these errors were encountered: