All Projects → vic → comeonin_ecto_password

vic / comeonin_ecto_password

Licence: BSD-3-Clause License
Ecto type for saving encrypted passwords using Comeonin

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to comeonin ecto password

music db
A playground for Ecto using a simple music database
Stars: ✭ 29 (-14.71%)
Mutual labels:  ecto
elixir-revisionair ecto
A Revisionair adapter based on Ecto. Allows you to persist and keep track of revisions of your data structures in any of Ecto's supported databases.
Stars: ✭ 18 (-47.06%)
Mutual labels:  ecto
ecto conditionals
EctoConditionals implements a flexibly functional find_or_create and upsert behavior for Ecto models.
Stars: ✭ 17 (-50%)
Mutual labels:  ecto
mongodb ecto
MongoDB adapter for Ecto
Stars: ✭ 348 (+923.53%)
Mutual labels:  ecto
contextual
🌈 Generate your Ecto contexts using this macro and eliminate boilerplate
Stars: ✭ 18 (-47.06%)
Mutual labels:  ecto
hierarch
Tree structure & hierarchy for ecto models with ltree(Postgres)
Stars: ✭ 30 (-11.76%)
Mutual labels:  ecto
querie
Compose Ecto query from the client side
Stars: ✭ 20 (-41.18%)
Mutual labels:  ecto
txbox
Elixir Bitcoin transaction storage schema, built on Ecto.
Stars: ✭ 14 (-58.82%)
Mutual labels:  ecto
monetized
A lightweight solution for handling and storing money.
Stars: ✭ 46 (+35.29%)
Mutual labels:  ecto
ecto commons
Ecto common validators for Date, Time, URLs, Emails, PostalCodes, Phone Numbers, Luhn checks, etc.
Stars: ✭ 33 (-2.94%)
Mutual labels:  ecto
web trader
📊 Python Flask game that consolidates data from Nasdaq, allowing the user to practice buying and selling stocks.
Stars: ✭ 21 (-38.24%)
Mutual labels:  password-hash
keepassxc-pwned
Check your keepassxc database against previously breached haveibeenpwned passwords
Stars: ✭ 25 (-26.47%)
Mutual labels:  password-hash
exqlite
An SQLite3 driver for Elixir
Stars: ✭ 128 (+276.47%)
Mutual labels:  ecto
ectograph
Ectograph is a set of utility functions for using Ecto in combination with graphql-elixir/graphql
Stars: ✭ 29 (-14.71%)
Mutual labels:  ecto
ex sieve
Implement dynamic filtering and sorting API for Ecto queries
Stars: ✭ 37 (+8.82%)
Mutual labels:  ecto
ecto profiler
Project for Ecto DB profiling
Stars: ✭ 16 (-52.94%)
Mutual labels:  ecto
ecto nested changeset
Helpers for manipulating nested Ecto changesets
Stars: ✭ 23 (-32.35%)
Mutual labels:  ecto
pretty print formatter
Pretty Print Formatter for Elixir Logger module -- Colorize Ecto's SQL ouput 🖌️
Stars: ✭ 22 (-35.29%)
Mutual labels:  ecto
bourne
🚤 Better streaming for Ecto.
Stars: ✭ 71 (+108.82%)
Mutual labels:  ecto
guardian trackable
A Guardian hook to track user sign ins.
Stars: ✭ 25 (-26.47%)
Mutual labels:  ecto

Comeonin Ecto Password

A custom Ecto type for storing encrypted passwords using Comeonin

For ecto 1 compatibility use the ecto-1 branch.

Version 3.x is compatible with comeonin ~> 5.0, use version 2.x for compatibility with older versions.

Usage

On your schema, define secure fields with this type:

field :password, Comeonin.Ecto.Password

Then on your changeset simply cast from plain-text params

changeset
|> cast(attrs, [:password])
|> validate_required([:password])

After casting the password will already be encrypted in the changeset, and can be saved to your table's string column.

To check for validity, do something like:

user = Repo.get_by(User, email: "[email protected]")
Comeonin.Ecto.Password.valid?("plain_password", user.password)

Configuration

In your environment file, choose one of Pbkdf2, Bcrypt, Argon2. The default is 'Pbkdf2, but you still need to include it in your mix.exs`!

config :comeonin, Ecto.Password, Pbkdf2

# when using pkbdf2
config :comeonin, :pbkdf2_rounds, 120_000
config :comeonin, :pbkdf2_salt_len, 512

# when using bcrypt
config :comeonin, :bcrypt_log_rounds, 14

Also, be sure to look at comeonin config

Installation

Available in Hex, the package can be installed as:

Add comeonin_ecto_password to your list of dependencies in mix.exs:

def deps do
  [{:comeonin_ecto_password, "~> 3.0.0"}]
end
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].