devise-uncommon_password 0.3.6 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c7f79f3899e83a01351cf9eca77965b763ad9091b3119723818ab5c405724e5
|
4
|
+
data.tar.gz: 6fa5690a6dee123a91331110ba4c34e1dbf2bbaa8ac2f2501a23199e9870d68b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07d1607d4933f54d01abb2425acc87359a040dd11aa13e8fdec15cbbaecbe109f3ef3ea12993915bfdc08039088686a7eaaebfafd7b6d926c18ef973e7f2fdbe
|
7
|
+
data.tar.gz: 468adc1e4cb81b29e78bac9d7699461ebff55835d22ef14df6c0d077e47e2ce0b4504d15ca14046c4b9784d1c69496739f4e6443483c307f90b334bc6bc8673f
|
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
[![Build Status](https://travis-ci.org/HCLarsen/devise-uncommon_password.svg?branch=master)](https://travis-ci.org/HCLarsen/devise-uncommon_password)
|
4
4
|
[![Code Climate](https://codeclimate.com/github/HCLarsen/devise-uncommon_password.svg)](https://codeclimate.com/github/HCLarsen/devise-uncommon_password)
|
5
5
|
|
6
|
-
Devise::UncommonPassword is an extension for the devise gem, which prevents users from signing up using one of the 100 most common passwords. The list is derived from the darkweb2017_top10K.txt found at: https://github.com/danielmiessler/SecLists/tree/master/Passwords.
|
6
|
+
Devise::UncommonPassword is an extension for the [devise](https://github.com/heartcombo/devise) gem, which prevents users from signing up using one of the 100 most common passwords. The list is derived from the darkweb2017_top10K.txt found at: https://github.com/danielmiessler/SecLists/tree/master/Passwords.
|
7
7
|
|
8
8
|
## Usage
|
9
9
|
|
@@ -23,6 +23,23 @@ By default, the password is checked against the 100 most common passwords that f
|
|
23
23
|
config.password_matches = 1000
|
24
24
|
```
|
25
25
|
|
26
|
+
### Internationalization and Customization
|
27
|
+
|
28
|
+
The default message for users who attempt to use a common password is:
|
29
|
+
|
30
|
+
```
|
31
|
+
is a very common password. Please choose something harder to guess.
|
32
|
+
```
|
33
|
+
|
34
|
+
This can be changed by modifying the `devise.en.yml` file, under errors/messages/common_password. Translations can be provided using the devise translation files in the same location.
|
35
|
+
|
36
|
+
```yml
|
37
|
+
en:
|
38
|
+
errors:
|
39
|
+
messages:
|
40
|
+
common_password: 'is a very common password. Please choose something harder to guess.'
|
41
|
+
```
|
42
|
+
|
26
43
|
## Installation
|
27
44
|
Add this line to your application's Gemfile:
|
28
45
|
|
@@ -16,7 +16,6 @@ module Devise
|
|
16
16
|
file.each { |password| passwords << password.chomp.downcase }
|
17
17
|
end
|
18
18
|
passwords.select! {|password| Devise.password_length.include? password.length }
|
19
|
-
#passwords[0..99]
|
20
19
|
passwords[0..Devise.password_matches-1]
|
21
20
|
end
|
22
21
|
|
@@ -32,7 +31,7 @@ module Devise
|
|
32
31
|
|
33
32
|
def not_common_password
|
34
33
|
if Devise::Models::UncommonPassword.common_passwords.include? password.downcase
|
35
|
-
errors.add(:password,
|
34
|
+
errors.add(:password, :common_password)
|
36
35
|
end
|
37
36
|
end
|
38
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise-uncommon_password
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Larsen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -81,6 +81,7 @@ files:
|
|
81
81
|
- README.md
|
82
82
|
- Rakefile
|
83
83
|
- lib/devise/uncommon_password.rb
|
84
|
+
- lib/devise/uncommon_password/locales/en.yml
|
84
85
|
- lib/devise/uncommon_password/model.rb
|
85
86
|
- lib/devise/uncommon_password/passwords.txt
|
86
87
|
- lib/devise/uncommon_password/version.rb
|