devise-secure_password 1.0.6 → 2.0.1

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.
Files changed (63) hide show
  1. checksums.yaml +5 -5
  2. data/Changelog.md +39 -4
  3. data/Dockerfile +1 -1
  4. data/Dockerfile.prev +3 -3
  5. data/Gemfile +2 -1
  6. data/Gemfile.lock +218 -214
  7. data/README.md +33 -10
  8. data/app/controllers/devise/passwords_with_policy_controller.rb +55 -14
  9. data/app/views/devise/passwords_with_policy/edit.html.erb +5 -1
  10. data/config/locales/en.yml +51 -0
  11. data/devise-secure_password.gemspec +22 -23
  12. data/gemfiles/rails_6_0.gemfile +57 -0
  13. data/gemfiles/rails_6_0.gemfile.lock +347 -0
  14. data/gemfiles/rails_6_1.gemfile +57 -0
  15. data/gemfiles/rails_6_1.gemfile.lock +352 -0
  16. data/lib/devise/secure_password.rb +4 -9
  17. data/lib/devise/secure_password/controllers/devise_helpers.rb +4 -50
  18. data/lib/devise/secure_password/controllers/helpers.rb +58 -0
  19. data/lib/devise/secure_password/grammar.rb +13 -0
  20. data/lib/devise/secure_password/models/password_disallows_frequent_changes.rb +3 -1
  21. data/lib/devise/secure_password/models/password_disallows_frequent_reuse.rb +1 -0
  22. data/lib/devise/secure_password/models/password_has_required_content.rb +53 -15
  23. data/lib/devise/secure_password/models/password_requires_regular_updates.rb +0 -2
  24. data/lib/devise/secure_password/version.rb +1 -1
  25. data/lib/support/string/character_counter.rb +3 -1
  26. data/pkg/devise-secure_password-2.0.0.gem +0 -0
  27. data/pkg/devise-secure_password-2.0.1.gem +0 -0
  28. metadata +67 -169
  29. data/coverage/assets/0.10.2/application.css +0 -799
  30. data/coverage/assets/0.10.2/application.js +0 -1707
  31. data/coverage/assets/0.10.2/colorbox/border.png +0 -0
  32. data/coverage/assets/0.10.2/colorbox/controls.png +0 -0
  33. data/coverage/assets/0.10.2/colorbox/loading.gif +0 -0
  34. data/coverage/assets/0.10.2/colorbox/loading_background.png +0 -0
  35. data/coverage/assets/0.10.2/favicon_green.png +0 -0
  36. data/coverage/assets/0.10.2/favicon_red.png +0 -0
  37. data/coverage/assets/0.10.2/favicon_yellow.png +0 -0
  38. data/coverage/assets/0.10.2/loading.gif +0 -0
  39. data/coverage/assets/0.10.2/magnify.png +0 -0
  40. data/coverage/assets/0.10.2/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  41. data/coverage/assets/0.10.2/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  42. data/coverage/assets/0.10.2/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  43. data/coverage/assets/0.10.2/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  44. data/coverage/assets/0.10.2/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  45. data/coverage/assets/0.10.2/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  46. data/coverage/assets/0.10.2/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  47. data/coverage/assets/0.10.2/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  48. data/coverage/assets/0.10.2/smoothness/images/ui-icons_222222_256x240.png +0 -0
  49. data/coverage/assets/0.10.2/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
  50. data/coverage/assets/0.10.2/smoothness/images/ui-icons_454545_256x240.png +0 -0
  51. data/coverage/assets/0.10.2/smoothness/images/ui-icons_888888_256x240.png +0 -0
  52. data/coverage/assets/0.10.2/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
  53. data/coverage/index.html +0 -4115
  54. data/devise-secure_password-1.0.0.gem +0 -0
  55. data/gemfiles/rails-5_0_6.gemfile +0 -17
  56. data/gemfiles/rails-5_0_6.gemfile.lock +0 -286
  57. data/gemfiles/rails-5_1_4.gemfile +0 -16
  58. data/gemfiles/rails-5_1_4.gemfile.lock +0 -282
  59. data/lib/devise/secure_password/controllers/active_helpers.rb +0 -45
  60. data/lib/devise/secure_password/hooks/password_requires_regular_updates.rb +0 -5
  61. data/pkg/devise-secure_password-1.0.3.gem +0 -0
  62. data/pkg/devise-secure_password-1.0.4.gem +0 -0
  63. data/pkg/devise-secure_password-1.0.5.gem +0 -0
@@ -1,45 +0,0 @@
1
- module Devise
2
- module SecurePassword
3
- module Controllers
4
- module ActiveHelpers
5
- extend ActiveSupport::Concern
6
-
7
- included do
8
- before_action :pending_password_expired_redirect!, except: [:destroy]
9
- end
10
-
11
- # Redirect to password change page if password needs to be changed.
12
- def pending_password_expired_redirect!
13
- return unless skip_current_controller? && redirected_in_session? && warden.session && warden.session['secure_password_expired']
14
- redirect_to edit_user_password_with_policy_url, alert: "#{error_string_for_password_expired}."
15
- end
16
-
17
- def redirected_in_session?
18
- warden.authenticated? && warden.session['secure_password_last_controller'] == 'Devise::SessionsController'
19
- end
20
-
21
- # Prevent infinite loops and allow specified controllers to bypass.
22
- # @NOTE: The ability to extend this list may be made public, in the
23
- # future if that functionality is needed.
24
- def skip_current_controller?
25
- exclusion_list = [
26
- 'Devise::SessionsController',
27
- 'Devise::PasswordsWithPolicyController#edit',
28
- 'Devise::PasswordsWithPolicyController#update',
29
- 'DeviseInvitable::RegistrationsController#edit',
30
- 'DeviseInvitable::RegistrationsController#update'
31
- ]
32
- !(exclusion_list.include?("#{self.class.name}#" + action_name) || (exclusion_list & self.class.ancestors.map(&:to_s)).any?)
33
- end
34
-
35
- def error_string_for_password_expired
36
- return 'password expired' unless warden.user.class.respond_to?(:password_maximum_age)
37
- I18n.t(
38
- 'secure_password.password_requires_regular_updates.errors.messages.password_expired',
39
- timeframe: distance_of_time_in_words(warden.user.class.password_maximum_age)
40
- )
41
- end
42
- end
43
- end
44
- end
45
- end
@@ -1,5 +0,0 @@
1
- Warden::Manager.after_authentication do |user, warden, options|
2
- if user.respond_to?(:password_expired?)
3
- warden.session(options[:scope])[:secure_password_expired] = user.password_expired?
4
- end
5
- end
Binary file
Binary file
Binary file