devise-secure_password 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +7 -0
  2. data/CODE_OF_CONDUCT.md +74 -0
  3. data/Dockerfile +44 -0
  4. data/Dockerfile.prev +44 -0
  5. data/Gemfile +13 -0
  6. data/Gemfile.lock +280 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +326 -0
  9. data/Rakefile +11 -0
  10. data/app/controllers/devise/passwords_with_policy_controller.rb +52 -0
  11. data/app/views/devise/passwords_with_policy/edit.html.erb +16 -0
  12. data/bin/console +14 -0
  13. data/bin/setup +6 -0
  14. data/config/locales/en.yml +71 -0
  15. data/devise-secure_password.gemspec +57 -0
  16. data/docker-entrypoint.sh +6 -0
  17. data/gemfiles/rails-5_0_6.gemfile +17 -0
  18. data/gemfiles/rails-5_1_4.gemfile +16 -0
  19. data/lib/devise/secure_password.rb +70 -0
  20. data/lib/devise/secure_password/controllers/active_helpers.rb +40 -0
  21. data/lib/devise/secure_password/controllers/devise_helpers.rb +64 -0
  22. data/lib/devise/secure_password/hooks/password_requires_regular_updates.rb +5 -0
  23. data/lib/devise/secure_password/models/password_disallows_frequent_changes.rb +60 -0
  24. data/lib/devise/secure_password/models/password_disallows_frequent_reuse.rb +71 -0
  25. data/lib/devise/secure_password/models/password_has_required_content.rb +131 -0
  26. data/lib/devise/secure_password/models/password_requires_regular_updates.rb +56 -0
  27. data/lib/devise/secure_password/models/previous_password.rb +20 -0
  28. data/lib/devise/secure_password/routes.rb +11 -0
  29. data/lib/devise/secure_password/version.rb +5 -0
  30. data/lib/generators/devise/secure_password/install_generator.rb +30 -0
  31. data/lib/generators/devise/templates/README.txt +21 -0
  32. data/lib/generators/devise/templates/secure_password.rb +43 -0
  33. data/lib/support/string/character_counter.rb +53 -0
  34. data/pkg/devise-secure_password-1.0.0.gem +0 -0
  35. metadata +471 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 00d5d30f86cefff26a345bde115922d2d583c6a74b8d6830f0a0b9d5ec802e17
4
+ data.tar.gz: 5a3aa00bb6435a899afe0087a898c740b4c17695be22838a4358622735442da2
5
+ SHA512:
6
+ metadata.gz: 762d9483186e02dc9a55c179aacecc1a17a650976c021d99dc3c3b7ee062eb178913dfe2b5230d941df9fa8af547bcc6f87beea9c49ef5fbf3aeca2a8e6ecc98
7
+ data.tar.gz: ea292213e1cf5b216613c2c0ee513e12b90749924ebcf3902846a49b73560d54107884887b746d2cd8207dfa33010275f773783ea7ee4026a15ecbaa23fee66f
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at mark.eissler@valimail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Dockerfile ADDED
@@ -0,0 +1,44 @@
1
+ #
2
+ # Dockerfile for devise-secure_password
3
+ #
4
+ # prompt> docker build -t secure-password-dev .
5
+ # prompt> docker run -it secure-password-dev /bin/bash
6
+ # prompt> pushd . && cd spec/rails-app-X_y_z
7
+ # prompt> gem install bundler && RAILS_TARGET=X.y.z bundle install --jobs 20 --retry 5
8
+ # prompt> RAILS_ENV='test' bundle exec rake db:migrate
9
+ # prompt> popd
10
+ # prompt> gem install bundler && RAILS_TARGET=X.y.z bundle install --jobs 20 --retry 5
11
+ # prompt> RAILS_TARGET=X.y.z bundle exec rake test:spec
12
+ #
13
+ # NOTE: The order in which you run 'bundle install' in spec/rails and then in
14
+ # the top directory is important.
15
+ #
16
+ FROM circleci/ruby:2.5.0-browsers
17
+ LABEL maintainer="Mark Eissler <mark.eissler@valimail.com>"
18
+
19
+ ENV BUILD_HOME='/secure-password-gem'
20
+
21
+ # Configure the main working directory. This is the base directory used in any
22
+ # further RUN, COPY, and ENTRYPOINT commands.
23
+ RUN sudo mkdir -p ${BUILD_HOME}
24
+ WORKDIR ${BUILD_HOME}
25
+
26
+ # Copy main application
27
+ COPY . ./
28
+
29
+ # Fix permissions on /gem directory
30
+ RUN set -x \
31
+ && sudo chown -R circleci:circleci ${BUILD_HOME}
32
+
33
+ # Start xvfb automatically
34
+ ENV DISPLAY :99
35
+
36
+ # Update docker-entrypoint.sh
37
+ RUN set -x \
38
+ && cp docker-entrypoint.sh /docker-entrypoint.sh \
39
+ && chmod 755 /docker-entrypoint.sh \
40
+ && chown circleci:circleci /docker-entrypoint.sh
41
+
42
+ ENTRYPOINT ["/docker-entrypoint.sh"]
43
+
44
+ CMD ["/bin/bash"]
data/Dockerfile.prev ADDED
@@ -0,0 +1,44 @@
1
+ #
2
+ # Dockerfile for devise-secure_password
3
+ #
4
+ # prompt> docker build -t secure-password-dev .
5
+ # prompt> docker run -it secure-password-dev /bin/bash
6
+ # prompt> pushd . && cd spec/rails-app-X_y_z
7
+ # prompt> gem install bundler && RAILS_TARGET=X.y.z bundle install --jobs 20 --retry 5
8
+ # prompt> RAILS_ENV='test' bundle exec rake db:migrate
9
+ # prompt> popd
10
+ # prompt> gem install bundler && RAILS_TARGET=X.y.z bundle install --jobs 20 --retry 5
11
+ # prompt> RAILS_TARGET=X.y.z bundle exec rake test:spec
12
+ #
13
+ # NOTE: The order in which you run 'bundle install' in spec/rails and then in
14
+ # the top directory is important.
15
+ #
16
+ FROM circleci/ruby:2.4.3-browsers
17
+ LABEL maintainer="Mark Eissler <mark.eissler@valimail.com>"
18
+
19
+ ENV BUILD_HOME='/secure-password-gem'
20
+
21
+ # Configure the main working directory. This is the base directory used in any
22
+ # further RUN, COPY, and ENTRYPOINT commands.
23
+ RUN sudo mkdir -p ${BUILD_HOME}
24
+ WORKDIR ${BUILD_HOME}
25
+
26
+ # Copy main application
27
+ COPY . ./
28
+
29
+ # Fix permissions on /gem directory
30
+ RUN set -x \
31
+ && sudo chown -R circleci:circleci ${BUILD_HOME}
32
+
33
+ # Start xvfb automatically
34
+ ENV DISPLAY :99
35
+
36
+ # Update docker-entrypoint.sh
37
+ RUN set -x \
38
+ && cp docker-entrypoint.sh /docker-entrypoint.sh \
39
+ && chmod 755 /docker-entrypoint.sh \
40
+ && chown circleci:circleci /docker-entrypoint.sh
41
+
42
+ ENTRYPOINT ["/docker-entrypoint.sh"]
43
+
44
+ CMD ["/bin/bash"]
data/Gemfile ADDED
@@ -0,0 +1,13 @@
1
+ source 'https://rubygems.org'
2
+
3
+ #
4
+ # Configure the build:
5
+ #
6
+ # prompt> gem install bundler && bundle install
7
+ #
8
+
9
+ gemspec
10
+
11
+ group :test do
12
+ gem 'shoulda-matchers', git: 'https://github.com/thoughtbot/shoulda-matchers.git', branch: 'rails-5'
13
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,280 @@
1
+ GIT
2
+ remote: https://github.com/thoughtbot/shoulda-matchers.git
3
+ revision: 4b160bd19ecca7f97d7ac22dccd5fde9b0da5a9f
4
+ branch: rails-5
5
+ specs:
6
+ shoulda-matchers (3.1.2)
7
+ activesupport (>= 4.2.0)
8
+
9
+ PATH
10
+ remote: .
11
+ specs:
12
+ devise-secure_password (1.0.0)
13
+ devise (>= 4.0.0, < 5.0.0)
14
+ railties (>= 5.0.0, < 6.0.0)
15
+
16
+ GEM
17
+ remote: https://rubygems.org/
18
+ specs:
19
+ actioncable (5.1.5)
20
+ actionpack (= 5.1.5)
21
+ nio4r (~> 2.0)
22
+ websocket-driver (~> 0.6.1)
23
+ actionmailer (5.1.5)
24
+ actionpack (= 5.1.5)
25
+ actionview (= 5.1.5)
26
+ activejob (= 5.1.5)
27
+ mail (~> 2.5, >= 2.5.4)
28
+ rails-dom-testing (~> 2.0)
29
+ actionpack (5.1.5)
30
+ actionview (= 5.1.5)
31
+ activesupport (= 5.1.5)
32
+ rack (~> 2.0)
33
+ rack-test (>= 0.6.3)
34
+ rails-dom-testing (~> 2.0)
35
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
36
+ actionview (5.1.5)
37
+ activesupport (= 5.1.5)
38
+ builder (~> 3.1)
39
+ erubi (~> 1.4)
40
+ rails-dom-testing (~> 2.0)
41
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
42
+ activejob (5.1.5)
43
+ activesupport (= 5.1.5)
44
+ globalid (>= 0.3.6)
45
+ activemodel (5.1.5)
46
+ activesupport (= 5.1.5)
47
+ activerecord (5.1.5)
48
+ activemodel (= 5.1.5)
49
+ activesupport (= 5.1.5)
50
+ arel (~> 8.0)
51
+ activesupport (5.1.5)
52
+ concurrent-ruby (~> 1.0, >= 1.0.2)
53
+ i18n (~> 0.7)
54
+ minitest (~> 5.1)
55
+ tzinfo (~> 1.1)
56
+ addressable (2.5.2)
57
+ public_suffix (>= 2.0.2, < 4.0)
58
+ ansi (1.5.0)
59
+ arel (8.0.0)
60
+ ast (2.4.0)
61
+ bcrypt (3.1.11)
62
+ builder (3.2.3)
63
+ capybara (2.18.0)
64
+ addressable
65
+ mini_mime (>= 0.1.3)
66
+ nokogiri (>= 1.3.3)
67
+ rack (>= 1.0.0)
68
+ rack-test (>= 0.5.4)
69
+ xpath (>= 2.0, < 4.0)
70
+ capybara-screenshot (1.0.18)
71
+ capybara (>= 1.0, < 3)
72
+ launchy
73
+ childprocess (0.8.0)
74
+ ffi (~> 1.0, >= 1.0.11)
75
+ coffee-rails (4.2.2)
76
+ coffee-script (>= 2.2.0)
77
+ railties (>= 4.0.0)
78
+ coffee-script (2.4.1)
79
+ coffee-script-source
80
+ execjs
81
+ coffee-script-source (1.12.2)
82
+ concurrent-ruby (1.0.5)
83
+ crass (1.0.3)
84
+ database_cleaner (1.6.2)
85
+ devise (4.4.1)
86
+ bcrypt (~> 3.0)
87
+ orm_adapter (~> 0.1)
88
+ railties (>= 4.1.0, < 5.2)
89
+ responders
90
+ warden (~> 1.2.3)
91
+ diff-lcs (1.3)
92
+ docile (1.1.5)
93
+ erubi (1.7.1)
94
+ erubis (2.7.0)
95
+ execjs (2.7.0)
96
+ ffi (1.9.23)
97
+ flay (2.10.0)
98
+ erubis (~> 2.7.0)
99
+ path_expander (~> 1.0)
100
+ ruby_parser (~> 3.0)
101
+ sexp_processor (~> 4.0)
102
+ globalid (0.4.1)
103
+ activesupport (>= 4.2.0)
104
+ hirb (0.7.3)
105
+ i18n (0.9.5)
106
+ concurrent-ruby (~> 1.0)
107
+ json (2.1.0)
108
+ launchy (2.4.3)
109
+ addressable (~> 2.3)
110
+ libv8 (3.16.14.19)
111
+ loofah (2.2.0)
112
+ crass (~> 1.0.2)
113
+ nokogiri (>= 1.5.9)
114
+ mail (2.7.0)
115
+ mini_mime (>= 0.1.1)
116
+ method_source (0.9.0)
117
+ mini_mime (1.0.0)
118
+ mini_portile2 (2.3.0)
119
+ minitest (5.11.3)
120
+ nio4r (2.2.0)
121
+ nokogiri (1.8.2)
122
+ mini_portile2 (~> 2.3.0)
123
+ orm_adapter (0.5.0)
124
+ parallel (1.12.1)
125
+ parser (2.5.0.3)
126
+ ast (~> 2.4.0)
127
+ path_expander (1.0.2)
128
+ powerpack (0.1.1)
129
+ public_suffix (3.0.2)
130
+ rack (2.0.4)
131
+ rack-test (0.8.3)
132
+ rack (>= 1.0, < 3)
133
+ rails (5.1.5)
134
+ actioncable (= 5.1.5)
135
+ actionmailer (= 5.1.5)
136
+ actionpack (= 5.1.5)
137
+ actionview (= 5.1.5)
138
+ activejob (= 5.1.5)
139
+ activemodel (= 5.1.5)
140
+ activerecord (= 5.1.5)
141
+ activesupport (= 5.1.5)
142
+ bundler (>= 1.3.0)
143
+ railties (= 5.1.5)
144
+ sprockets-rails (>= 2.0.0)
145
+ rails-dom-testing (2.0.3)
146
+ activesupport (>= 4.2.0)
147
+ nokogiri (>= 1.6)
148
+ rails-html-sanitizer (1.0.3)
149
+ loofah (~> 2.0)
150
+ railties (5.1.5)
151
+ actionpack (= 5.1.5)
152
+ activesupport (= 5.1.5)
153
+ method_source
154
+ rake (>= 0.8.7)
155
+ thor (>= 0.18.1, < 2.0)
156
+ rainbow (3.0.0)
157
+ rake (12.3.0)
158
+ rb-fsevent (0.10.3)
159
+ rb-inotify (0.9.10)
160
+ ffi (>= 0.5.0, < 2)
161
+ ref (2.0.0)
162
+ responders (2.4.0)
163
+ actionpack (>= 4.2.0, < 5.3)
164
+ railties (>= 4.2.0, < 5.3)
165
+ rspec (3.7.0)
166
+ rspec-core (~> 3.7.0)
167
+ rspec-expectations (~> 3.7.0)
168
+ rspec-mocks (~> 3.7.0)
169
+ rspec-core (3.7.1)
170
+ rspec-support (~> 3.7.0)
171
+ rspec-expectations (3.7.0)
172
+ diff-lcs (>= 1.2.0, < 2.0)
173
+ rspec-support (~> 3.7.0)
174
+ rspec-mocks (3.7.0)
175
+ diff-lcs (>= 1.2.0, < 2.0)
176
+ rspec-support (~> 3.7.0)
177
+ rspec-rails (3.7.2)
178
+ actionpack (>= 3.0)
179
+ activesupport (>= 3.0)
180
+ railties (>= 3.0)
181
+ rspec-core (~> 3.7.0)
182
+ rspec-expectations (~> 3.7.0)
183
+ rspec-mocks (~> 3.7.0)
184
+ rspec-support (~> 3.7.0)
185
+ rspec-support (3.7.1)
186
+ rspec_junit_formatter (0.3.0)
187
+ rspec-core (>= 2, < 4, != 2.12.0)
188
+ rubocop (0.53.0)
189
+ parallel (~> 1.10)
190
+ parser (>= 2.5)
191
+ powerpack (~> 0.1)
192
+ rainbow (>= 2.2.2, < 4.0)
193
+ ruby-progressbar (~> 1.7)
194
+ unicode-display_width (~> 1.0, >= 1.0.1)
195
+ ruby-progressbar (1.9.0)
196
+ ruby2ruby (2.4.1)
197
+ ruby_parser (~> 3.1)
198
+ sexp_processor (~> 4.6)
199
+ ruby_parser (3.11.0)
200
+ sexp_processor (~> 4.9)
201
+ rubyzip (1.2.1)
202
+ sass (3.5.5)
203
+ sass-listen (~> 4.0.0)
204
+ sass-listen (4.0.0)
205
+ rb-fsevent (~> 0.9, >= 0.9.4)
206
+ rb-inotify (~> 0.9, >= 0.9.7)
207
+ sass-rails (5.0.7)
208
+ railties (>= 4.0.0, < 6)
209
+ sass (~> 3.1)
210
+ sprockets (>= 2.8, < 4.0)
211
+ sprockets-rails (>= 2.0, < 4.0)
212
+ tilt (>= 1.1, < 3)
213
+ selenium-webdriver (3.10.0)
214
+ childprocess (~> 0.5)
215
+ rubyzip (~> 1.2)
216
+ sexp_processor (4.10.1)
217
+ simplecov (0.15.1)
218
+ docile (~> 1.1.0)
219
+ json (>= 1.8, < 3)
220
+ simplecov-html (~> 0.10.0)
221
+ simplecov-console (0.4.2)
222
+ ansi
223
+ hirb
224
+ simplecov
225
+ simplecov-html (0.10.2)
226
+ sprockets (3.7.1)
227
+ concurrent-ruby (~> 1.0)
228
+ rack (> 1, < 3)
229
+ sprockets-rails (3.2.1)
230
+ actionpack (>= 4.0)
231
+ activesupport (>= 4.0)
232
+ sprockets (>= 3.0.0)
233
+ sqlite3 (1.3.13)
234
+ therubyracer (0.12.3)
235
+ libv8 (~> 3.16.14.15)
236
+ ref
237
+ thor (0.20.0)
238
+ thread_safe (0.3.6)
239
+ tilt (2.0.8)
240
+ tzinfo (1.2.5)
241
+ thread_safe (~> 0.1)
242
+ unicode-display_width (1.3.0)
243
+ warden (1.2.7)
244
+ rack (>= 1.0)
245
+ websocket-driver (0.6.5)
246
+ websocket-extensions (>= 0.1.0)
247
+ websocket-extensions (0.1.3)
248
+ xpath (3.0.0)
249
+ nokogiri (~> 1.8)
250
+
251
+ PLATFORMS
252
+ ruby
253
+
254
+ DEPENDENCIES
255
+ bundler (~> 1.16, >= 1.16.1)
256
+ capybara (~> 2.16, >= 2.16.1)
257
+ capybara-screenshot (~> 1.0, >= 1.0.18)
258
+ coffee-rails (~> 4.2)
259
+ database_cleaner (~> 1.6, >= 1.6.2)
260
+ devise (~> 4.0)
261
+ devise-secure_password!
262
+ flay (~> 2.10, >= 2.10.0)
263
+ launchy (~> 2.4, >= 2.4.3)
264
+ rails (~> 5.1, >= 5.1.4)
265
+ rake (~> 12.3)
266
+ rspec (~> 3.7)
267
+ rspec-rails (~> 3.7)
268
+ rspec_junit_formatter (~> 0.3)
269
+ rubocop (~> 0)
270
+ ruby2ruby (~> 2.4, >= 2.4.0)
271
+ sass-rails (~> 5.0)
272
+ selenium-webdriver (~> 3.7, >= 3.7.0)
273
+ shoulda-matchers!
274
+ simplecov (~> 0.15.1)
275
+ simplecov-console (~> 0.4.2)
276
+ sqlite3 (~> 1.3, >= 1.3.13)
277
+ therubyracer (~> 0.12.3)
278
+
279
+ BUNDLED WITH
280
+ 1.16.1