quo_vadis 2.0.2 → 2.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +31 -0
  3. data/README.md +37 -30
  4. data/app/controllers/quo_vadis/password_resets_controller.rb +11 -8
  5. data/app/controllers/quo_vadis/passwords_controller.rb +4 -2
  6. data/app/controllers/quo_vadis/recovery_codes_controller.rb +1 -1
  7. data/app/controllers/quo_vadis/sessions_controller.rb +2 -2
  8. data/app/controllers/quo_vadis/totps_controller.rb +1 -1
  9. data/app/mailers/quo_vadis/mailer.rb +16 -16
  10. data/app/models/quo_vadis/account.rb +14 -0
  11. data/app/models/quo_vadis/log.rb +4 -2
  12. data/app/models/quo_vadis/password.rb +16 -0
  13. data/{test/dummy/app → app}/views/quo_vadis/confirmations/edit.html.erb +0 -0
  14. data/{test/dummy/app → app}/views/quo_vadis/confirmations/edit_email.html.erb +0 -0
  15. data/{test/dummy/app → app}/views/quo_vadis/confirmations/index.html.erb +0 -0
  16. data/{test/dummy/app → app}/views/quo_vadis/confirmations/new.html.erb +0 -0
  17. data/{test/dummy/app → app}/views/quo_vadis/logs/index.html.erb +3 -1
  18. data/{test/dummy/app → app}/views/quo_vadis/mailer/account_confirmation.text.erb +0 -0
  19. data/{test/dummy/app → app}/views/quo_vadis/mailer/email_change_notification.text.erb +0 -0
  20. data/{test/dummy/app → app}/views/quo_vadis/mailer/identifier_change_notification.text.erb +0 -0
  21. data/{test/dummy/app → app}/views/quo_vadis/mailer/password_change_notification.text.erb +0 -0
  22. data/{test/dummy/app → app}/views/quo_vadis/mailer/password_reset_notification.text.erb +0 -0
  23. data/{test/dummy/app → app}/views/quo_vadis/mailer/recovery_codes_generation_notification.text.erb +0 -0
  24. data/{test/dummy/app → app}/views/quo_vadis/mailer/reset_password.text.erb +0 -0
  25. data/{test/dummy/app → app}/views/quo_vadis/mailer/totp_reuse_notification.text.erb +0 -0
  26. data/{test/dummy/app → app}/views/quo_vadis/mailer/totp_setup_notification.text.erb +0 -0
  27. data/{test/dummy/app → app}/views/quo_vadis/mailer/twofa_deactivated_notification.text.erb +0 -0
  28. data/{test/dummy/app → app}/views/quo_vadis/password_resets/edit.html.erb +1 -9
  29. data/{test/dummy/app → app}/views/quo_vadis/password_resets/index.html.erb +0 -0
  30. data/{test/dummy/app → app}/views/quo_vadis/password_resets/new.html.erb +0 -0
  31. data/{test/dummy/app → app}/views/quo_vadis/passwords/edit.html.erb +1 -9
  32. data/{test/dummy/app → app}/views/quo_vadis/recovery_codes/challenge.html.erb +0 -0
  33. data/{test/dummy/app → app}/views/quo_vadis/recovery_codes/index.html.erb +0 -0
  34. data/{test/dummy/app → app}/views/quo_vadis/sessions/index.html.erb +0 -0
  35. data/{test/dummy/app → app}/views/quo_vadis/sessions/new.html.erb +0 -0
  36. data/{test/dummy/app → app}/views/quo_vadis/totps/challenge.html.erb +0 -0
  37. data/{test/dummy/app → app}/views/quo_vadis/totps/new.html.erb +0 -0
  38. data/{test/dummy/app → app}/views/quo_vadis/twofas/show.html.erb +0 -0
  39. data/config/locales/quo_vadis.en.yml +30 -1
  40. data/config/routes.rb +4 -4
  41. data/lib/generators/quo_vadis/install_generator.rb +1 -1
  42. data/lib/quo_vadis/controller.rb +2 -3
  43. data/lib/quo_vadis/defaults.rb +1 -1
  44. data/lib/quo_vadis/model.rb +8 -11
  45. data/lib/quo_vadis/version.rb +1 -1
  46. data/lib/quo_vadis.rb +6 -4
  47. data/test/dummy/config/initializers/quo_vadis.rb +0 -4
  48. data/test/integration/logging_test.rb +13 -4
  49. data/test/integration/password_change_test.rb +16 -10
  50. data/test/integration/password_login_test.rb +14 -2
  51. data/test/integration/password_reset_test.rb +6 -6
  52. data/test/integration/totps_test.rb +1 -1
  53. data/test/mailers/mailer_test.rb +49 -32
  54. data/test/models/account_test.rb +24 -2
  55. data/test/models/model_test.rb +4 -1
  56. data/test/models/password_test.rb +16 -0
  57. data/test/models/recovery_code_test.rb +7 -1
  58. data/test/models/token_test.rb +1 -1
  59. metadata +28 -28
@@ -42,13 +42,19 @@ class RecoveryCodeTest < ActiveSupport::TestCase
42
42
  test 'generate a fresh set of codes' do
43
43
  account = @user.qv_account
44
44
  codes = []
45
- assert_difference 'QuoVadis::RecoveryCode.count', 5 do
45
+ assert_difference 'QuoVadis::RecoveryCode.count', (-1 + 5) do
46
46
  codes = account.generate_recovery_codes
47
47
  end
48
48
  assert_equal 5, codes.length
49
+ assert_equal 5, account.recovery_codes.count
49
50
  codes.each do |code|
50
51
  assert_instance_of String, code
51
52
  end
53
+
54
+ new_codes = account.generate_recovery_codes
55
+ assert_equal 5, new_codes.length
56
+ assert_equal 5, account.recovery_codes.count
57
+ refute_equal new_codes, codes
52
58
  end
53
59
 
54
60
  end
@@ -52,7 +52,7 @@ class TokenTest < ActiveSupport::TestCase
52
52
 
53
53
  test 'password reset already done' do
54
54
  token = QuoVadis::PasswordResetToken.generate @account
55
- @account.password.update password: 'secretsecret'
55
+ @account.password.reset 'secretsecret', 'secretsecret'
56
56
  assert_nil QuoVadis::PasswordResetToken.find_account(token)
57
57
  end
58
58
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quo_vadis
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Stewart
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-24 00:00:00.000000000 Z
11
+ date: 2021-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -97,6 +97,32 @@ files:
97
97
  - app/models/quo_vadis/session.rb
98
98
  - app/models/quo_vadis/token.rb
99
99
  - app/models/quo_vadis/totp.rb
100
+ - app/views/quo_vadis/confirmations/edit.html.erb
101
+ - app/views/quo_vadis/confirmations/edit_email.html.erb
102
+ - app/views/quo_vadis/confirmations/index.html.erb
103
+ - app/views/quo_vadis/confirmations/new.html.erb
104
+ - app/views/quo_vadis/logs/index.html.erb
105
+ - app/views/quo_vadis/mailer/account_confirmation.text.erb
106
+ - app/views/quo_vadis/mailer/email_change_notification.text.erb
107
+ - app/views/quo_vadis/mailer/identifier_change_notification.text.erb
108
+ - app/views/quo_vadis/mailer/password_change_notification.text.erb
109
+ - app/views/quo_vadis/mailer/password_reset_notification.text.erb
110
+ - app/views/quo_vadis/mailer/recovery_codes_generation_notification.text.erb
111
+ - app/views/quo_vadis/mailer/reset_password.text.erb
112
+ - app/views/quo_vadis/mailer/totp_reuse_notification.text.erb
113
+ - app/views/quo_vadis/mailer/totp_setup_notification.text.erb
114
+ - app/views/quo_vadis/mailer/twofa_deactivated_notification.text.erb
115
+ - app/views/quo_vadis/password_resets/edit.html.erb
116
+ - app/views/quo_vadis/password_resets/index.html.erb
117
+ - app/views/quo_vadis/password_resets/new.html.erb
118
+ - app/views/quo_vadis/passwords/edit.html.erb
119
+ - app/views/quo_vadis/recovery_codes/challenge.html.erb
120
+ - app/views/quo_vadis/recovery_codes/index.html.erb
121
+ - app/views/quo_vadis/sessions/index.html.erb
122
+ - app/views/quo_vadis/sessions/new.html.erb
123
+ - app/views/quo_vadis/totps/challenge.html.erb
124
+ - app/views/quo_vadis/totps/new.html.erb
125
+ - app/views/quo_vadis/twofas/show.html.erb
100
126
  - bin/console
101
127
  - bin/rails
102
128
  - bin/setup
@@ -131,32 +157,6 @@ files:
131
157
  - test/dummy/app/views/articles/secret.html.erb
132
158
  - test/dummy/app/views/articles/very_secret.html.erb
133
159
  - test/dummy/app/views/layouts/application.html.erb
134
- - test/dummy/app/views/quo_vadis/confirmations/edit.html.erb
135
- - test/dummy/app/views/quo_vadis/confirmations/edit_email.html.erb
136
- - test/dummy/app/views/quo_vadis/confirmations/index.html.erb
137
- - test/dummy/app/views/quo_vadis/confirmations/new.html.erb
138
- - test/dummy/app/views/quo_vadis/logs/index.html.erb
139
- - test/dummy/app/views/quo_vadis/mailer/account_confirmation.text.erb
140
- - test/dummy/app/views/quo_vadis/mailer/email_change_notification.text.erb
141
- - test/dummy/app/views/quo_vadis/mailer/identifier_change_notification.text.erb
142
- - test/dummy/app/views/quo_vadis/mailer/password_change_notification.text.erb
143
- - test/dummy/app/views/quo_vadis/mailer/password_reset_notification.text.erb
144
- - test/dummy/app/views/quo_vadis/mailer/recovery_codes_generation_notification.text.erb
145
- - test/dummy/app/views/quo_vadis/mailer/reset_password.text.erb
146
- - test/dummy/app/views/quo_vadis/mailer/totp_reuse_notification.text.erb
147
- - test/dummy/app/views/quo_vadis/mailer/totp_setup_notification.text.erb
148
- - test/dummy/app/views/quo_vadis/mailer/twofa_deactivated_notification.text.erb
149
- - test/dummy/app/views/quo_vadis/password_resets/edit.html.erb
150
- - test/dummy/app/views/quo_vadis/password_resets/index.html.erb
151
- - test/dummy/app/views/quo_vadis/password_resets/new.html.erb
152
- - test/dummy/app/views/quo_vadis/passwords/edit.html.erb
153
- - test/dummy/app/views/quo_vadis/recovery_codes/challenge.html.erb
154
- - test/dummy/app/views/quo_vadis/recovery_codes/index.html.erb
155
- - test/dummy/app/views/quo_vadis/sessions/index.html.erb
156
- - test/dummy/app/views/quo_vadis/sessions/new.html.erb
157
- - test/dummy/app/views/quo_vadis/totps/challenge.html.erb
158
- - test/dummy/app/views/quo_vadis/totps/new.html.erb
159
- - test/dummy/app/views/quo_vadis/twofas/show.html.erb
160
160
  - test/dummy/app/views/sign_ups/new.html.erb
161
161
  - test/dummy/app/views/sign_ups/show.html.erb
162
162
  - test/dummy/app/views/users/new.html.erb