Strongbox.Query (Strongbox v0.1.0-dev)

Copy Markdown View Source

Looking records up by a blind index.

Summary

Functions

Narrows queryable to the records whose blind index field holds value, under any index key of the vault, so lookups keep working while index keys rotate.

Functions

where_index(queryable, field, value)

@spec where_index(Ecto.Queryable.t(), atom(), term()) :: Ecto.Query.t()

Narrows queryable to the records whose blind index field holds value, under any index key of the vault, so lookups keep working while index keys rotate.

User
|> Strongbox.Query.where_index(:email_index, "Jose@Example.com ")
|> Repo.one()

The value is normalized as the index normalizes. With :bytes, an index matches some other values too: check the decrypted value of what comes back.