password_blacklist 0.1.0.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.md +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +86 -0
- data/data/100k_passwords.txt +100000 -0
- data/lib/password_blacklist/tester.rb +17 -0
- data/lib/password_blacklist/version.rb +3 -0
- data/lib/password_blacklist.rb +10 -0
- data/password_blacklist.gemspec +33 -0
- metadata +166 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8d74390348d89b51e90729e34cf15e6fd3a2abfb
|
4
|
+
data.tar.gz: ccc14c0242edfd5e606d847b5c7cff9cd6949345
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: cad900b9af3114d1470533bb64eb4f852d9760a508d4fc86998c3d49d4b4bbca40425b531dde5fffa13938db24f1de9147bf2b68bb2fe41d36eb5dcdc40b4a3e
|
7
|
+
data.tar.gz: 93368324f2b37db450d741c4fadd1cbb4e3bfafd6dca60c34900102a6694d4cab75d1b51e49d596d42ea9adf543d87d809e9f2948ac97f4147b38dde97e9a4f1
|
data/CHANGELOG.md
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 Gordon Chan
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
# password_blacklist
|
2
|
+
[](http://badge.fury.io/rb/password_blacklist) [](https://gemnasium.com/gchan/password_blacklist) 
|
3
|
+
|
4
|
+
[](https://travis-ci.org/gchan/password_blacklist) [](https://coveralls.io/r/gchan/password_blacklist?branch=master) [](https://codeclimate.com/github/gchan/password_blacklist)
|
5
|
+
|
6
|
+
Check the presence of a string in a blacklist of the top 100,000 commonly used passwords (sourced from Mark Burnett's [ten million password release](https://xato.net/today-i-am-releasing-ten-million-passwords-b6278bbe7495)).
|
7
|
+
|
8
|
+
This very simple Ruby library that can be integrated into your registration/authentication system to prevent users from setting commonly used (and easy to guess) passwords.
|
9
|
+
|
10
|
+
This gem has an insignificant memory footprint with an execution cost of approximately 1 ms. A memory persistence option is available to further reduce execution time.
|
11
|
+
|
12
|
+
## Devise Extension
|
13
|
+
|
14
|
+
Use [`devise_password_blacklist`](https://www.github.com/gchan/devise_password_blacklist) to easily add password blacklisting to your Rails application.
|
15
|
+
|
16
|
+
## Installation
|
17
|
+
|
18
|
+
Gemfile:
|
19
|
+
|
20
|
+
```ruby
|
21
|
+
gem 'password_blacklist'
|
22
|
+
```
|
23
|
+
|
24
|
+
Or install it yourself:
|
25
|
+
|
26
|
+
$ gem install password_blacklist
|
27
|
+
|
28
|
+
## Usage
|
29
|
+
|
30
|
+
```ruby
|
31
|
+
$ irb
|
32
|
+
require 'password_blacklist'
|
33
|
+
|
34
|
+
PasswordBlacklist.test("pokemon")
|
35
|
+
=> true
|
36
|
+
|
37
|
+
PasswordBlacklist.test("AccurateUnicornCoalPaperclip")
|
38
|
+
=> false
|
39
|
+
```
|
40
|
+
|
41
|
+
### Test multiple passwords
|
42
|
+
|
43
|
+
The blacklist file is loaded on every call to `PasswordBlacklist.test`. Use `PasswordBlacklist::Tester` to persist the blacklist in memory (approximately 0.8MB) if you would like to perform lots of password tests in quick succession.
|
44
|
+
|
45
|
+
```ruby
|
46
|
+
require 'password_blacklist'
|
47
|
+
|
48
|
+
tester = PasswordBlacklist::Tester.new
|
49
|
+
=> #<PasswordBlacklist::Tester:0x3ff979c41758>
|
50
|
+
|
51
|
+
tester.test("pokemon")
|
52
|
+
=> true
|
53
|
+
|
54
|
+
tester.test("AccurateUnicornCoalPaperclip")
|
55
|
+
=> false
|
56
|
+
```
|
57
|
+
|
58
|
+
## Supported Ruby versions
|
59
|
+
|
60
|
+
password_blacklist supports MRI Ruby 1.9+ and the JRuby equivalent. The specific Ruby versions we build and test on can be found at [TravisCI](https://travis-ci.org/gchan/password_blacklist).
|
61
|
+
|
62
|
+
## Development
|
63
|
+
|
64
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. Use `bin/benchmark` to run some benchmarks.
|
65
|
+
|
66
|
+
To install this gem onto your local machine, run `bundle exec rake install`.
|
67
|
+
|
68
|
+
To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
69
|
+
|
70
|
+
Run `bundle exec rake spec` to manually launch specs.
|
71
|
+
|
72
|
+
## Contributing
|
73
|
+
|
74
|
+
Bug reports and pull requests are welcome on GitHub at https://www.github.com/gchan/password_blacklist.
|
75
|
+
|
76
|
+
1. Fork it ( https://github.com/gchan/password_blacklist/fork )
|
77
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
78
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
79
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
80
|
+
5. Create a new Pull Request
|
81
|
+
|
82
|
+
## License
|
83
|
+
|
84
|
+
password_blacklist is Copyright (c) 2017 Gordon Chan and is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
85
|
+
|
86
|
+
[](https://github.com/igrigorik/ga-beacon)
|