You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! This is an awesome library, I've integrated it into apps several times before without issues.
I'm in the middle of writing a blog post for how to integrate cloak and cloak_ecto into the Phoenix auth generators, to encrypt the user's email while data is at rest. In my previous attempts, I've always used PostgreSQL as my database. But recently, I've been using SQLite3 more since it is small, lightweight and easy to get set up.
However, I'm wondering if the library does not support the SQLite database adapter for some reason, or if I am not doing something obvious here - I'm getting the following error when trying to insert fields.
[error] GenServer #PID<0.610.0> terminating** (Ecto.ChangeError) value `"me@example.com"`for`SecureApp.Accounts.User.email`in`insert` does not match type SecureApp.Encrypted.Binary
(ecto 3.9.4) lib/ecto/repo/schema.ex:1010: Ecto.Repo.Schema.dump_field!/6
(ecto 3.9.4) lib/ecto/repo/schema.ex:1019: anonymous fn/6 in Ecto.Repo.Schema.dump_fields!/5
(stdlib 4.1.1) maps.erl:411: :maps.fold_1/3
(ecto 3.9.4) lib/ecto/repo/schema.ex:1017: Ecto.Repo.Schema.dump_fields!/5
(ecto 3.9.4) lib/ecto/repo/schema.ex:951: Ecto.Repo.Schema.dump_changes!/7
(ecto 3.9.4) lib/ecto/repo/schema.ex:359: anonymous fn/15 in Ecto.Repo.Schema.do_insert/4
(secure_app 0.1.0) lib/secure_app_web/live/user_registration_live.ex:54: SecureAppWeb.UserRegistrationLive.handle_event/3
I've set up and started the Vault module, as well as integrated the Binary and HMAC types:
I haven't gotten a chance to switch the database adapter over to Postgres yet, but that will be my next debugging step. Just wondering if I am missing something here?
The code (WIP) for the blog post is public, you can find it here. It is a very minimal working example of the error I am seeing.
Thanks!
The text was updated successfully, but these errors were encountered:
Hi! This is an awesome library, I've integrated it into apps several times before without issues.
I'm in the middle of writing a blog post for how to integrate
cloak
andcloak_ecto
into the Phoenix auth generators, to encrypt the user's email while data is at rest. In my previous attempts, I've always used PostgreSQL as my database. But recently, I've been using SQLite3 more since it is small, lightweight and easy to get set up.However, I'm wondering if the library does not support the SQLite database adapter for some reason, or if I am not doing something obvious here - I'm getting the following error when trying to insert fields.
I've set up and started the
Vault
module, as well as integrated theBinary
andHMAC
types:The schema is as following:
I haven't gotten a chance to switch the database adapter over to Postgres yet, but that will be my next debugging step. Just wondering if I am missing something here?
The code (WIP) for the blog post is public, you can find it here. It is a very minimal working example of the error I am seeing.
Thanks!
The text was updated successfully, but these errors were encountered: