Passrock
Ruby client library for programmatic access to the Passrock Binary Database.
This library adheres to SemVer. Pre v1.0.0 is considered alpha level software.
Installation
Add this line to your application's Gemfile:
gem 'passrock'
And then execute:
$ bundle
Usage
Plain Ol' Ruby (PORO)
require 'passrock'
passrock_db = Passrock::PasswordDb.new(:password_db => '/path/to/passrock_db_dir', :private_key => 'your private key')
passrock_db.secure?('password')
passrock_db.insecure?('PASSWORD')
Ruby on Rails
This library provides a custom ActiveModel validation:
Passrock.configure do |config|
config.password_db = '/path/to/passrock_db_dir'
config.private_key = 'your private key'
end
validates :password, :passrock_secure => true
activerecord:
errors:
messages:
passrock_secure: "appears to be a commonly used password"
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Specs
To run the spec suite:
bundle install
cp .env.example .env # and change the env values
bundle exec rake spec