When using cloak_ecto in a typed Ecto Schema (see https://hexdocs.pm/typed_ecto_schema/), Dialyxir (see https://hex.pm/packages/dialyxir) halts with an unknown type error:
$ mix dialyzer
[…]
lib/db/contact.ex:0:unknown_type
Unknown type: Cloak.Ecto.SHA256.t/0.
________________________________________________________________________________
lib/db/contact.ex:0:unknown_type
Unknown type: DB.Encrypted.Binary.t/0.
Ecto Schema:
defmodule DB.Contact do
typed_schema "contact" do
field(:email, DB.Encrypted.Binary)
end
end
defmodule DB.Encrypted.Binary do
use Cloak.Ecto.Binary, vault: Transport.Vault
end
See https://github.com/etalab/transport-site/blob/master/apps/transport/lib/db/contact.ex, to reproduce the problem remove the line in .dialyzer_ignore.exs.
When using cloak_ecto in a typed Ecto Schema (see https://hexdocs.pm/typed_ecto_schema/), Dialyxir (see https://hex.pm/packages/dialyxir) halts with an unknown type error:
Ecto Schema:
See https://github.com/etalab/transport-site/blob/master/apps/transport/lib/db/contact.ex, to reproduce the problem remove the line in
.dialyzer_ignore.exs.