Comments (3)
@SimonLab
It did resolve the issue for me, together with your suggestion: "Cloak.Ecto.SHA256, default: "")"
I hope the PR will solve the issue without "workarounds" :)
from cloak_ecto.
This is my solution for the issue:
changeset
|> get_field(:contact_email)
|> case do
nil ->
changeset
email ->
put_change(changeset, :contact_email_hash, email)
end
from cloak_ecto.
Thanks @vitalis this resolves the issue when the contact_email
is nil
but I don't think it does when the current contact_email_hash
is nil.
If I'm not mistaken put_change(changeset, :contact_email_hash, email)
will call the equal?/2
which then calls the private function has_string/1
which contains the call to String.valid?
, breaking with the current nil
value
from cloak_ecto.
Related Issues (20)
- Not possible to compile with Ecto 3.6.0 HOT 10
- Missing function `:crypto.block_encrypt/4 ` in Erlang 24 HOT 3
- The version `1.2.0` generates an unexpected error HOT 5
- Decrypt for postgresql's native encrypt function? HOT 1
- Remove insecure example from docs HOT 1
- Trouble loading the Cloak.Ecto.PBKDF2 library HOT 1
- Drop dependency on :pbkdf2
- Documentation: cloak.migrate.ecto mix task ignores labels and is order-dependent HOT 1
- Create unique contraint for encrypted or hashed column
- Add a `Decimal` type
- Support custom Ecto embeds in `Cloak.Migrator` HOT 2
- SQLite3 support? HOT 1
- Migrator breaks with Ecto.Enum field in the same schema
- Undocumented support for migrations (workaround) HOT 1
- order by HOT 2
- can't define label when define MyApp.Encrypted.Binary HOT 1
- Unknown type error in Dialyxir when using cloak_ecto with typed_ecto_schema
- The documentation link to the source are broken
- :error when decrypting field HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cloak_ecto.