Comments (1)
@kdawgwilk Cloak.Ecto already supports blind indexes. The differences from blind_index are mainly due to Elixir / Ecto doing things differently than ActiveRecord.
As you noted, you can already use this library to create fields for blind indexes and keep them up to date, like so:
schema "table" do
field :field_name, MyApp.Encrypted.Binary
field :field_name_hash, MyApp.Hashed.HMAC
end
def changeset(struct, attrs \\ %{}) do
struct
|> cast(attrs, [:field_name, :field_name_hash])
|> put_hashed_fields()
end
defp put_hashed_fields(changeset) do
changeset
|> put_change(:field_name_hash, get_field(changeset, :field_name))
end
This is functionally the same as the blind_index gem, and I don't currently see any way to make it simpler within the constraints of Ecto's design. If you have any specific suggestions, let me know!
from cloak_ecto.
Related Issues (20)
- Cloak.Ecto.Type does not conform to the Ecto.Type behavior HOT 3
- In multi-tenant setting HOT 1
- Should Ecto.Type implementations of `equal?/2` be constant time?
- 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
- Missing ETS table on Fly.io HOT 3
- 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
- Migrator doesn't handle plaintext arrays or maps with inner types
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.