devise-uncommon_password 0.3.3 → 0.4.1
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
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: af22c8d91c442547531a83a7f50efc8183ef16ac56224ad817993d0a95ea4014
|
4
|
+
data.tar.gz: 182e947de5189af550284b34d91befdfcd5f8077e9d56843e0fa04a04f6ba2aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d2719ea8f85f38d19612b3e2a1f1e0363bdccf68e0feac3468ed24513362ee2f6e82e39c1afeb620d3e3be15da13386d40a272311c6cb9b10b578006db1c396
|
7
|
+
data.tar.gz: 61db0efdb459c7529c322200694efe912c053defa8d95b85891244518fe570b0e95899fe70252adf5b0b593ea85a36501d09325af1565a11c5072a81d54a361e
|
data/README.md
CHANGED
@@ -3,11 +3,11 @@
|
|
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
|
|
10
|
-
Add the
|
10
|
+
Add the `:uncommon_password` module to your model:
|
11
11
|
|
12
12
|
```ruby
|
13
13
|
class AdminUser < ApplicationRecord
|
@@ -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.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Larsen
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '4.2'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '6.2'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '4.2'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '6.2'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: devise
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
version: '3.5'
|
40
40
|
- - "<"
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: '4.
|
42
|
+
version: '4.8'
|
43
43
|
type: :runtime
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -49,21 +49,27 @@ dependencies:
|
|
49
49
|
version: '3.5'
|
50
50
|
- - "<"
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version: '4.
|
52
|
+
version: '4.8'
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: sqlite3
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
56
56
|
requirements:
|
57
57
|
- - ">="
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version:
|
59
|
+
version: 1.3.6
|
60
|
+
- - "<"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '1.5'
|
60
63
|
type: :development
|
61
64
|
prerelease: false
|
62
65
|
version_requirements: !ruby/object:Gem::Requirement
|
63
66
|
requirements:
|
64
67
|
- - ">="
|
65
68
|
- !ruby/object:Gem::Version
|
66
|
-
version:
|
69
|
+
version: 1.3.6
|
70
|
+
- - "<"
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '1.5'
|
67
73
|
description: Devise extension to prevent users from using a common password.
|
68
74
|
email:
|
69
75
|
- clarsenipod@gmail.com
|
@@ -75,6 +81,7 @@ files:
|
|
75
81
|
- README.md
|
76
82
|
- Rakefile
|
77
83
|
- lib/devise/uncommon_password.rb
|
84
|
+
- lib/devise/uncommon_password/locales/en.yml
|
78
85
|
- lib/devise/uncommon_password/model.rb
|
79
86
|
- lib/devise/uncommon_password/passwords.txt
|
80
87
|
- lib/devise/uncommon_password/version.rb
|
@@ -83,7 +90,7 @@ homepage: https://github.com/HCLarsen/devise-uncommon_passwords
|
|
83
90
|
licenses:
|
84
91
|
- MIT
|
85
92
|
metadata: {}
|
86
|
-
post_install_message:
|
93
|
+
post_install_message:
|
87
94
|
rdoc_options: []
|
88
95
|
require_paths:
|
89
96
|
- lib
|
@@ -91,16 +98,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
91
98
|
requirements:
|
92
99
|
- - ">="
|
93
100
|
- !ruby/object:Gem::Version
|
94
|
-
version:
|
101
|
+
version: 2.3.0
|
95
102
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
96
103
|
requirements:
|
97
104
|
- - ">="
|
98
105
|
- !ruby/object:Gem::Version
|
99
106
|
version: '0'
|
100
107
|
requirements: []
|
101
|
-
|
102
|
-
|
103
|
-
signing_key:
|
108
|
+
rubygems_version: 3.0.8
|
109
|
+
signing_key:
|
104
110
|
specification_version: 4
|
105
111
|
summary: Devise extension to prevent users from using a common password.
|
106
112
|
test_files: []
|