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
- SHA1:
3
- metadata.gz: 6b6e46ca065dbd8073d717d7a1d05db8a63991f7
4
- data.tar.gz: fc9e53a76cbf976e69c4123cad413bce69de276e
2
+ SHA256:
3
+ metadata.gz: af22c8d91c442547531a83a7f50efc8183ef16ac56224ad817993d0a95ea4014
4
+ data.tar.gz: 182e947de5189af550284b34d91befdfcd5f8077e9d56843e0fa04a04f6ba2aa
5
5
  SHA512:
6
- metadata.gz: c4777b366460e408ff3506eae6474c824ec73f1b627242749163460731d296c246c2a06070cb4b7087c1744913b870e54b82c75c8d0e2fa425d511d517a6e317
7
- data.tar.gz: 888d7ab2caded51451e13523a330662d0b31cd2ba51562ef94a43d5054fed54bee3f3daace817641ccecd8281cf1bcdd289ddc4e36ec358f55a7c3473345b655
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 ':uncommon_password' module to your model:
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
 
@@ -8,4 +8,7 @@ module Devise
8
8
  end
9
9
  end
10
10
 
11
+ # Load default I18n
12
+ I18n.load_path.unshift File.join(File.dirname(__FILE__), *%w[uncommon_password locales en.yml])
13
+
11
14
  Devise.add_module :uncommon_password, model: "devise_uncommon_password/model"
@@ -0,0 +1,4 @@
1
+ en:
2
+ errors:
3
+ messages:
4
+ common_password: 'is a very common password. Please choose something harder to guess.'
@@ -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, "is a very common password. Please choose something harder to guess.")
34
+ errors.add(:password, :common_password)
36
35
  end
37
36
  end
38
37
  end
@@ -1,5 +1,5 @@
1
1
  module Devise
2
2
  module UncommonPassword
3
- VERSION = '0.3.3'
3
+ VERSION = '0.4.1'
4
4
  end
5
5
  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.3.3
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: 2018-06-11 00:00:00.000000000 Z
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: '5.3'
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: '5.3'
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.5'
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.5'
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: '0'
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: '0'
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: '0'
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
- rubyforge_project:
102
- rubygems_version: 2.6.13
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: []