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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +31 -0
- data/README.md +37 -30
- data/app/controllers/quo_vadis/password_resets_controller.rb +11 -8
- data/app/controllers/quo_vadis/passwords_controller.rb +4 -2
- data/app/controllers/quo_vadis/recovery_codes_controller.rb +1 -1
- data/app/controllers/quo_vadis/sessions_controller.rb +2 -2
- data/app/controllers/quo_vadis/totps_controller.rb +1 -1
- data/app/mailers/quo_vadis/mailer.rb +16 -16
- data/app/models/quo_vadis/account.rb +14 -0
- data/app/models/quo_vadis/log.rb +4 -2
- data/app/models/quo_vadis/password.rb +16 -0
- data/{test/dummy/app → app}/views/quo_vadis/confirmations/edit.html.erb +0 -0
- data/{test/dummy/app → app}/views/quo_vadis/confirmations/edit_email.html.erb +0 -0
- data/{test/dummy/app → app}/views/quo_vadis/confirmations/index.html.erb +0 -0
- data/{test/dummy/app → app}/views/quo_vadis/confirmations/new.html.erb +0 -0
- data/{test/dummy/app → app}/views/quo_vadis/logs/index.html.erb +3 -1
- data/{test/dummy/app → app}/views/quo_vadis/mailer/account_confirmation.text.erb +0 -0
- data/{test/dummy/app → app}/views/quo_vadis/mailer/email_change_notification.text.erb +0 -0
- data/{test/dummy/app → app}/views/quo_vadis/mailer/identifier_change_notification.text.erb +0 -0
- data/{test/dummy/app → app}/views/quo_vadis/mailer/password_change_notification.text.erb +0 -0
- data/{test/dummy/app → app}/views/quo_vadis/mailer/password_reset_notification.text.erb +0 -0
- data/{test/dummy/app → app}/views/quo_vadis/mailer/recovery_codes_generation_notification.text.erb +0 -0
- data/{test/dummy/app → app}/views/quo_vadis/mailer/reset_password.text.erb +0 -0
- data/{test/dummy/app → app}/views/quo_vadis/mailer/totp_reuse_notification.text.erb +0 -0
- data/{test/dummy/app → app}/views/quo_vadis/mailer/totp_setup_notification.text.erb +0 -0
- data/{test/dummy/app → app}/views/quo_vadis/mailer/twofa_deactivated_notification.text.erb +0 -0
- data/{test/dummy/app → app}/views/quo_vadis/password_resets/edit.html.erb +1 -9
- data/{test/dummy/app → app}/views/quo_vadis/password_resets/index.html.erb +0 -0
- data/{test/dummy/app → app}/views/quo_vadis/password_resets/new.html.erb +0 -0
- data/{test/dummy/app → app}/views/quo_vadis/passwords/edit.html.erb +1 -9
- data/{test/dummy/app → app}/views/quo_vadis/recovery_codes/challenge.html.erb +0 -0
- data/{test/dummy/app → app}/views/quo_vadis/recovery_codes/index.html.erb +0 -0
- data/{test/dummy/app → app}/views/quo_vadis/sessions/index.html.erb +0 -0
- data/{test/dummy/app → app}/views/quo_vadis/sessions/new.html.erb +0 -0
- data/{test/dummy/app → app}/views/quo_vadis/totps/challenge.html.erb +0 -0
- data/{test/dummy/app → app}/views/quo_vadis/totps/new.html.erb +0 -0
- data/{test/dummy/app → app}/views/quo_vadis/twofas/show.html.erb +0 -0
- data/config/locales/quo_vadis.en.yml +30 -1
- data/config/routes.rb +4 -4
- data/lib/generators/quo_vadis/install_generator.rb +1 -1
- data/lib/quo_vadis/controller.rb +2 -3
- data/lib/quo_vadis/defaults.rb +1 -1
- data/lib/quo_vadis/model.rb +8 -11
- data/lib/quo_vadis/version.rb +1 -1
- data/lib/quo_vadis.rb +6 -4
- data/test/dummy/config/initializers/quo_vadis.rb +0 -4
- data/test/integration/logging_test.rb +13 -4
- data/test/integration/password_change_test.rb +16 -10
- data/test/integration/password_login_test.rb +14 -2
- data/test/integration/password_reset_test.rb +6 -6
- data/test/integration/totps_test.rb +1 -1
- data/test/mailers/mailer_test.rb +49 -32
- data/test/models/account_test.rb +24 -2
- data/test/models/model_test.rb +4 -1
- data/test/models/password_test.rb +16 -0
- data/test/models/recovery_code_test.rb +7 -1
- data/test/models/token_test.rb +1 -1
- 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
|
data/test/models/token_test.rb
CHANGED
@@ -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.
|
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.
|
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-
|
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
|