quo_vadis 1.3.2 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +11 -7
- data/CHANGELOG.md +33 -0
- data/Gemfile +11 -1
- data/LICENSE.txt +21 -0
- data/README.md +434 -127
- data/Rakefile +14 -16
- data/app/controllers/quo_vadis/confirmations_controller.rb +56 -0
- data/app/controllers/quo_vadis/logs_controller.rb +20 -0
- data/app/controllers/quo_vadis/password_resets_controller.rb +65 -0
- data/app/controllers/quo_vadis/passwords_controller.rb +26 -0
- data/app/controllers/quo_vadis/recovery_codes_controller.rb +54 -0
- data/app/controllers/quo_vadis/sessions_controller.rb +50 -132
- data/app/controllers/quo_vadis/totps_controller.rb +72 -0
- data/app/controllers/quo_vadis/twofas_controller.rb +26 -0
- data/app/mailers/quo_vadis/mailer.rb +73 -0
- data/app/models/quo_vadis/account.rb +59 -0
- data/app/models/quo_vadis/account_confirmation_token.rb +17 -0
- data/app/models/quo_vadis/log.rb +57 -0
- data/app/models/quo_vadis/password.rb +52 -0
- data/app/models/quo_vadis/password_reset_token.rb +17 -0
- data/app/models/quo_vadis/recovery_code.rb +26 -0
- data/app/models/quo_vadis/session.rb +55 -0
- data/app/models/quo_vadis/token.rb +42 -0
- data/app/models/quo_vadis/totp.rb +56 -0
- data/bin/console +15 -0
- data/bin/rails +21 -0
- data/bin/setup +8 -0
- data/config/locales/quo_vadis.en.yml +51 -18
- data/config/routes.rb +40 -12
- data/db/migrate/202102150904_setup.rb +48 -0
- data/lib/generators/quo_vadis/install_generator.rb +4 -23
- data/lib/quo_vadis.rb +100 -106
- data/lib/quo_vadis/controller.rb +227 -0
- data/lib/quo_vadis/crypt.rb +43 -0
- data/lib/quo_vadis/current_request_details.rb +11 -0
- data/lib/quo_vadis/defaults.rb +18 -0
- data/lib/quo_vadis/encrypted_type.rb +17 -0
- data/lib/quo_vadis/engine.rb +9 -11
- data/lib/quo_vadis/hmacable.rb +26 -0
- data/lib/quo_vadis/ip_masking.rb +31 -0
- data/lib/quo_vadis/model.rb +86 -0
- data/lib/quo_vadis/version.rb +3 -1
- data/quo_vadis.gemspec +20 -24
- data/test/dummy/README.markdown +1 -0
- data/test/dummy/Rakefile +2 -6
- data/test/dummy/app/controllers/application_controller.rb +0 -1
- data/test/dummy/app/controllers/articles_controller.rb +8 -11
- data/test/dummy/app/controllers/sign_ups_controller.rb +42 -0
- data/test/dummy/app/controllers/users_controller.rb +13 -5
- data/test/dummy/app/models/application_record.rb +3 -0
- data/test/dummy/app/models/article.rb +2 -1
- data/test/dummy/app/models/person.rb +5 -2
- data/test/dummy/app/models/user.rb +4 -1
- data/test/dummy/app/views/articles/also_secret.html.erb +1 -0
- data/test/dummy/app/views/articles/index.html.erb +1 -1
- data/test/dummy/app/views/articles/secret.html.erb +1 -0
- data/test/dummy/app/views/articles/very_secret.html.erb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +41 -25
- data/test/dummy/app/views/quo_vadis/confirmations/edit.html.erb +10 -0
- data/test/dummy/app/views/quo_vadis/confirmations/index.html.erb +5 -0
- data/test/dummy/app/views/quo_vadis/confirmations/new.html.erb +16 -0
- data/test/dummy/app/views/quo_vadis/logs/index.html.erb +28 -0
- data/test/dummy/app/views/quo_vadis/mailer/account_confirmation.text.erb +4 -0
- data/test/dummy/app/views/quo_vadis/mailer/email_change_notification.text.erb +8 -0
- data/test/dummy/app/views/quo_vadis/mailer/identifier_change_notification.text.erb +8 -0
- data/test/dummy/app/views/quo_vadis/mailer/password_change_notification.text.erb +8 -0
- data/test/dummy/app/views/quo_vadis/mailer/password_reset_notification.text.erb +8 -0
- data/test/dummy/app/views/quo_vadis/mailer/recovery_codes_generation_notification.text.erb +8 -0
- data/test/dummy/app/views/quo_vadis/mailer/reset_password.text.erb +4 -0
- data/test/dummy/app/views/quo_vadis/mailer/totp_reuse_notification.text.erb +6 -0
- data/test/dummy/app/views/quo_vadis/mailer/totp_setup_notification.text.erb +8 -0
- data/test/dummy/app/views/quo_vadis/mailer/twofa_deactivated_notification.text.erb +8 -0
- data/test/dummy/app/views/quo_vadis/password_resets/edit.html.erb +25 -0
- data/test/dummy/app/views/quo_vadis/password_resets/index.html.erb +5 -0
- data/test/dummy/app/views/quo_vadis/password_resets/new.html.erb +12 -0
- data/test/dummy/app/views/quo_vadis/passwords/edit.html.erb +30 -0
- data/test/dummy/app/views/quo_vadis/recovery_codes/challenge.html.erb +11 -0
- data/test/dummy/app/views/quo_vadis/recovery_codes/index.html.erb +25 -0
- data/test/dummy/app/views/quo_vadis/sessions/index.html.erb +26 -0
- data/test/dummy/app/views/quo_vadis/sessions/new.html.erb +24 -0
- data/test/dummy/app/views/quo_vadis/totps/challenge.html.erb +11 -0
- data/test/dummy/app/views/quo_vadis/totps/new.html.erb +17 -0
- data/test/dummy/app/views/quo_vadis/twofas/show.html.erb +20 -0
- data/test/dummy/app/views/sign_ups/new.html.erb +37 -0
- data/test/dummy/app/views/sign_ups/show.html.erb +5 -0
- data/test/dummy/app/views/users/new.html.erb +32 -9
- data/test/dummy/config.ru +6 -3
- data/test/dummy/config/application.rb +18 -9
- data/test/dummy/config/boot.rb +3 -9
- data/test/dummy/config/database.yml +2 -14
- data/test/dummy/config/environment.rb +2 -3
- data/test/dummy/config/initializers/quo_vadis.rb +5 -82
- data/test/dummy/config/routes.rb +11 -3
- data/test/dummy/db/migrate/202102121932_create_users.rb +10 -0
- data/test/dummy/db/migrate/202102121935_create_people.rb +10 -0
- data/test/dummy/db/schema.rb +80 -21
- data/test/fixtures/quo_vadis/mailer/account_confirmation.text +4 -0
- data/test/fixtures/quo_vadis/mailer/email_change_notification.text +8 -0
- data/test/fixtures/quo_vadis/mailer/identifier_change_notification.text +8 -0
- data/test/fixtures/quo_vadis/mailer/password_change_notification.text +8 -0
- data/test/fixtures/quo_vadis/mailer/password_reset_notification.text +8 -0
- data/test/fixtures/quo_vadis/mailer/recovery_codes_generation_notification.text +8 -0
- data/test/fixtures/quo_vadis/mailer/reset_password.text +4 -0
- data/test/fixtures/quo_vadis/mailer/totp_reuse_notification.text +6 -0
- data/test/fixtures/quo_vadis/mailer/totp_setup_notification.text +8 -0
- data/test/fixtures/quo_vadis/mailer/twofa_deactivated_notification.text +8 -0
- data/test/integration/account_confirmation_test.rb +112 -0
- data/test/integration/controller_test.rb +280 -0
- data/test/integration/logging_test.rb +235 -0
- data/test/integration/password_change_test.rb +93 -0
- data/test/integration/password_login_test.rb +125 -0
- data/test/integration/password_reset_test.rb +136 -0
- data/test/integration/recovery_codes_test.rb +48 -0
- data/test/integration/sessions_test.rb +86 -0
- data/test/integration/sign_up_test.rb +26 -12
- data/test/integration/totps_test.rb +96 -0
- data/test/integration/twofa_test.rb +82 -0
- data/test/mailers/mailer_test.rb +200 -0
- data/test/models/account_test.rb +34 -0
- data/test/models/crypt_test.rb +22 -0
- data/test/models/log_test.rb +16 -0
- data/test/models/mask_ip_test.rb +27 -0
- data/test/models/model_test.rb +66 -0
- data/test/models/password_test.rb +163 -0
- data/test/models/recovery_code_test.rb +54 -0
- data/test/models/session_test.rb +67 -0
- data/test/models/token_test.rb +70 -0
- data/test/models/totp_test.rb +68 -0
- data/test/quo_vadis_test.rb +39 -3
- data/test/test_helper.rb +42 -72
- metadata +122 -193
- data/app/controllers/controller_mixin.rb +0 -109
- data/app/mailers/quo_vadis/notifier.rb +0 -30
- data/app/models/model_mixin.rb +0 -128
- data/lib/generators/quo_vadis/templates/migration.rb.erb +0 -18
- data/lib/generators/quo_vadis/templates/quo_vadis.rb.erb +0 -96
- data/test/dummy/.gitignore +0 -2
- data/test/dummy/app/helpers/application_helper.rb +0 -2
- data/test/dummy/app/helpers/articles_helper.rb +0 -2
- data/test/dummy/app/views/articles/new.html.erb +0 -11
- data/test/dummy/app/views/layouts/sessions.html.erb +0 -3
- data/test/dummy/app/views/quo_vadis/notifier/change_password.text.erb +0 -9
- data/test/dummy/app/views/quo_vadis/notifier/invite.text.erb +0 -8
- data/test/dummy/app/views/sessions/edit.html.erb +0 -11
- data/test/dummy/app/views/sessions/forgotten.html.erb +0 -13
- data/test/dummy/app/views/sessions/invite.html.erb +0 -31
- data/test/dummy/app/views/sessions/new.html.erb +0 -15
- data/test/dummy/config/environments/development.rb +0 -26
- data/test/dummy/config/environments/production.rb +0 -49
- data/test/dummy/config/environments/test.rb +0 -37
- data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/test/dummy/config/initializers/inflections.rb +0 -10
- data/test/dummy/config/initializers/mime_types.rb +0 -5
- data/test/dummy/config/initializers/rack_patch.rb +0 -16
- data/test/dummy/config/initializers/secret_token.rb +0 -7
- data/test/dummy/config/initializers/session_store.rb +0 -8
- data/test/dummy/config/locales/en.yml +0 -5
- data/test/dummy/config/locales/quo_vadis.en.yml +0 -21
- data/test/dummy/db/migrate/20110124125037_create_users.rb +0 -13
- data/test/dummy/db/migrate/20110124131535_create_articles.rb +0 -14
- data/test/dummy/db/migrate/20110127094709_add_authentication_to_users.rb +0 -18
- data/test/dummy/db/migrate/20111004112209_create_people.rb +0 -13
- data/test/dummy/db/migrate/20111004132342_add_authentication_to_people.rb +0 -18
- data/test/dummy/public/404.html +0 -26
- data/test/dummy/public/422.html +0 -26
- data/test/dummy/public/500.html +0 -26
- data/test/dummy/public/javascripts/application.js +0 -2
- data/test/dummy/public/javascripts/controls.js +0 -965
- data/test/dummy/public/javascripts/dragdrop.js +0 -974
- data/test/dummy/public/javascripts/effects.js +0 -1123
- data/test/dummy/public/javascripts/prototype.js +0 -6001
- data/test/dummy/public/javascripts/rails.js +0 -175
- data/test/dummy/public/stylesheets/.gitkeep +0 -0
- data/test/dummy/script/rails +0 -6
- data/test/integration/activation_test.rb +0 -108
- data/test/integration/authenticate_test.rb +0 -39
- data/test/integration/blocked_test.rb +0 -23
- data/test/integration/config_test.rb +0 -132
- data/test/integration/cookie_test.rb +0 -67
- data/test/integration/csrf_test.rb +0 -41
- data/test/integration/forgotten_test.rb +0 -93
- data/test/integration/helper_test.rb +0 -18
- data/test/integration/locale_test.rb +0 -197
- data/test/integration/navigation_test.rb +0 -7
- data/test/integration/sign_in_person_test.rb +0 -26
- data/test/integration/sign_in_test.rb +0 -24
- data/test/integration/sign_out_test.rb +0 -20
- data/test/support/integration_case.rb +0 -11
- data/test/unit/user_test.rb +0 -75
@@ -0,0 +1,54 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class RecoveryCodeTest < ActiveSupport::TestCase
|
4
|
+
|
5
|
+
setup do
|
6
|
+
@user = User.create! name: 'bob', email: 'bob@example.com', password: '123456789abc'
|
7
|
+
@rc = QuoVadis::RecoveryCode.new(account: @user.qv_account).tap &:save!
|
8
|
+
end
|
9
|
+
|
10
|
+
|
11
|
+
test 'code can be retrieved initially' do
|
12
|
+
assert_equal 11, @rc.code.length
|
13
|
+
end
|
14
|
+
|
15
|
+
|
16
|
+
test 'code does not change' do
|
17
|
+
code = @rc.code
|
18
|
+
@rc.valid?
|
19
|
+
assert_equal code, @rc.code
|
20
|
+
end
|
21
|
+
|
22
|
+
|
23
|
+
test 'code not available after finding' do
|
24
|
+
rc = QuoVadis::RecoveryCode.find @rc.id
|
25
|
+
assert_nil rc.code
|
26
|
+
end
|
27
|
+
|
28
|
+
|
29
|
+
test 'authenticate' do
|
30
|
+
code = @rc.code
|
31
|
+
refute @rc.authenticate_code 'wrong'
|
32
|
+
assert @rc.authenticate_code code
|
33
|
+
end
|
34
|
+
|
35
|
+
|
36
|
+
test 'recovery code is destroyed after successful use' do
|
37
|
+
code = @rc.code
|
38
|
+
assert @rc.authenticate_code code
|
39
|
+
assert @rc.destroyed?
|
40
|
+
end
|
41
|
+
|
42
|
+
test 'generate a fresh set of codes' do
|
43
|
+
account = @user.qv_account
|
44
|
+
codes = []
|
45
|
+
assert_difference 'QuoVadis::RecoveryCode.count', 5 do
|
46
|
+
codes = account.generate_recovery_codes
|
47
|
+
end
|
48
|
+
assert_equal 5, codes.length
|
49
|
+
codes.each do |code|
|
50
|
+
assert_instance_of String, code
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class SessionTest < ActiveSupport::TestCase
|
4
|
+
|
5
|
+
test 'expired?' do
|
6
|
+
refute QuoVadis::Session.new.expired?
|
7
|
+
assert QuoVadis::Session.new(lifetime_expires_at: 1.day.ago).expired?
|
8
|
+
refute QuoVadis::Session.new(lifetime_expires_at: 1.day.from_now).expired?
|
9
|
+
|
10
|
+
QuoVadis.session_idle_timeout 5.minutes
|
11
|
+
refute QuoVadis::Session.new(lifetime_expires_at: 1.day.from_now, last_seen_at: 1.minute.ago).expired?
|
12
|
+
assert QuoVadis::Session.new(lifetime_expires_at: 1.day.from_now, last_seen_at: 10.minutes.ago).expired?
|
13
|
+
end
|
14
|
+
|
15
|
+
|
16
|
+
test 'logout_other_sessions' do
|
17
|
+
user = User.create! name: 'bob', email: 'bob@example.com', password: '123456789abc'
|
18
|
+
account = user.qv_account
|
19
|
+
s0 = account.sessions.create! ip: 'ip', user_agent: 'useragent'
|
20
|
+
s1 = account.sessions.create! ip: 'ip', user_agent: 'useragent'
|
21
|
+
|
22
|
+
s0.logout_other_sessions
|
23
|
+
|
24
|
+
refute s0.destroyed?
|
25
|
+
assert s1.destroyed?
|
26
|
+
end
|
27
|
+
|
28
|
+
|
29
|
+
test 'reset authenticated with second factor' do
|
30
|
+
user = User.create! name: 'bob', email: 'bob@example.com', password: '123456789abc'
|
31
|
+
account = user.qv_account
|
32
|
+
session = account.sessions.create! ip: 'ip', user_agent: 'useragent'
|
33
|
+
|
34
|
+
refute session.second_factor_authenticated?
|
35
|
+
session.authenticated_with_second_factor
|
36
|
+
assert session.second_factor_authenticated?
|
37
|
+
session.reset_authenticated_with_second_factor
|
38
|
+
refute session.second_factor_authenticated?
|
39
|
+
end
|
40
|
+
|
41
|
+
|
42
|
+
test 'replace' do
|
43
|
+
user = User.create! name: 'bob', email: 'bob@example.com', password: '123456789abc'
|
44
|
+
account = user.qv_account
|
45
|
+
|
46
|
+
session = account.sessions.create! ip: 'ip', user_agent: 'useragent'
|
47
|
+
sess = session.replace
|
48
|
+
|
49
|
+
assert_instance_of QuoVadis::Session, sess
|
50
|
+
assert session.destroyed?
|
51
|
+
refute_equal session.id, sess.id
|
52
|
+
|
53
|
+
refute_includes account.sessions, session
|
54
|
+
assert_includes account.sessions, sess
|
55
|
+
|
56
|
+
session
|
57
|
+
.attributes
|
58
|
+
.reject { |name, _| %w[id created_at created_on updated_at updated_on].include? name }
|
59
|
+
.each do |name, value|
|
60
|
+
if value.nil?
|
61
|
+
assert_nil sess.send(name)
|
62
|
+
else
|
63
|
+
assert_equal value, sess.send(name)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class TokenTest < ActiveSupport::TestCase
|
4
|
+
|
5
|
+
setup do
|
6
|
+
u = User.create! name: 'bob', email: 'bob@example.com', password: '123456789abc'
|
7
|
+
@account = u.qv_account
|
8
|
+
end
|
9
|
+
|
10
|
+
|
11
|
+
test 'account confirmation' do
|
12
|
+
token = QuoVadis::AccountConfirmationToken.generate @account
|
13
|
+
assert_match /^\d+-\d+--\h+$/, token
|
14
|
+
assert_equal @account, QuoVadis::AccountConfirmationToken.find_account(token)
|
15
|
+
end
|
16
|
+
|
17
|
+
test 'account confirmation expired' do
|
18
|
+
token = QuoVadis::AccountConfirmationToken.generate @account
|
19
|
+
travel QuoVadis.account_confirmation_token_lifetime + 1.second
|
20
|
+
assert_nil QuoVadis::AccountConfirmationToken.find_account(token)
|
21
|
+
end
|
22
|
+
|
23
|
+
test 'account confirmation already done' do
|
24
|
+
token = QuoVadis::AccountConfirmationToken.generate @account
|
25
|
+
@account.confirmed!
|
26
|
+
assert_nil QuoVadis::AccountConfirmationToken.find_account(token)
|
27
|
+
end
|
28
|
+
|
29
|
+
test 'account confirmation token tampered with' do
|
30
|
+
assert_nil QuoVadis::AccountConfirmationToken.find_account(nil)
|
31
|
+
assert_nil QuoVadis::AccountConfirmationToken.find_account('')
|
32
|
+
assert_nil QuoVadis::AccountConfirmationToken.find_account('asdf')
|
33
|
+
|
34
|
+
token = QuoVadis::AccountConfirmationToken.generate @account
|
35
|
+
id, expires_at, hash = token.match(/^(\d+)-(\d+)--(\h+)$/).captures
|
36
|
+
fake_token = "#{id}-#{expires_at.to_i + 1}--#{hash}"
|
37
|
+
assert_nil QuoVadis::AccountConfirmationToken.find_account(fake_token)
|
38
|
+
end
|
39
|
+
|
40
|
+
|
41
|
+
test 'password reset' do
|
42
|
+
token = QuoVadis::PasswordResetToken.generate @account
|
43
|
+
assert_match /^\d+-\d+--\h+$/, token
|
44
|
+
assert_equal @account, QuoVadis::PasswordResetToken.find_account(token)
|
45
|
+
end
|
46
|
+
|
47
|
+
test 'password reset expired' do
|
48
|
+
token = QuoVadis::PasswordResetToken.generate @account
|
49
|
+
travel QuoVadis.password_reset_token_lifetime + 1.second
|
50
|
+
assert_nil QuoVadis::PasswordResetToken.find_account(token)
|
51
|
+
end
|
52
|
+
|
53
|
+
test 'password reset already done' do
|
54
|
+
token = QuoVadis::PasswordResetToken.generate @account
|
55
|
+
@account.password.update password: 'secretsecret'
|
56
|
+
assert_nil QuoVadis::PasswordResetToken.find_account(token)
|
57
|
+
end
|
58
|
+
|
59
|
+
test 'password reset token tampered with' do
|
60
|
+
assert_nil QuoVadis::PasswordResetToken.find_account(nil)
|
61
|
+
assert_nil QuoVadis::PasswordResetToken.find_account('')
|
62
|
+
assert_nil QuoVadis::PasswordResetToken.find_account('asdf')
|
63
|
+
|
64
|
+
token = QuoVadis::PasswordResetToken.generate @account
|
65
|
+
id, expires_at, hash = token.match(/^(\d+)-(\d+)--(\h+)$/).captures
|
66
|
+
fake_token = "#{id}-#{expires_at.to_i + 1}--#{hash}"
|
67
|
+
assert_nil QuoVadis::PasswordResetToken.find_account(fake_token)
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class TotpTest < ActiveSupport::TestCase
|
4
|
+
|
5
|
+
test 'key changes for each new object' do
|
6
|
+
totp = QuoVadis::Totp.new
|
7
|
+
refute_empty totp.key
|
8
|
+
|
9
|
+
totp2 = QuoVadis::Totp.new
|
10
|
+
refute_empty totp2.key
|
11
|
+
|
12
|
+
refute_equal totp.key, totp2.key
|
13
|
+
end
|
14
|
+
|
15
|
+
|
16
|
+
test 'key is encrypted in database' do
|
17
|
+
user = User.create! name: 'bob', email: 'bob@example.com', password: '123456789abc'
|
18
|
+
totp = user.qv_account.create_totp last_used_at: 1.minute.ago
|
19
|
+
refute_equal totp.key, totp.read_attribute_before_type_cast(:key)
|
20
|
+
end
|
21
|
+
|
22
|
+
|
23
|
+
test 'validates provided hmac' do
|
24
|
+
totp = QuoVadis::Totp.new account: QuoVadis::Account.new
|
25
|
+
hmac = totp.hmac_key
|
26
|
+
assert totp.valid?
|
27
|
+
|
28
|
+
totp.provided_hmac_key = 'wrong'
|
29
|
+
refute totp.valid?
|
30
|
+
refute_empty totp.errors[:key]
|
31
|
+
|
32
|
+
totp.provided_hmac_key = hmac
|
33
|
+
assert totp.valid?
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
test 'verify' do
|
38
|
+
user = User.create! name: 'bob', email: 'bob@example.com', password: '123456789abc'
|
39
|
+
|
40
|
+
qv_totp = QuoVadis::Totp.new account: user.qv_account
|
41
|
+
totp = ROTP::TOTP.new qv_totp.key
|
42
|
+
|
43
|
+
otp = totp.now
|
44
|
+
|
45
|
+
assert qv_totp.verify otp # one time
|
46
|
+
refute qv_totp.verify otp
|
47
|
+
|
48
|
+
travel 30.seconds
|
49
|
+
otp2 = totp.now
|
50
|
+
refute_equal otp, otp2
|
51
|
+
assert qv_totp.verify otp2
|
52
|
+
end
|
53
|
+
|
54
|
+
|
55
|
+
test 'reused?' do
|
56
|
+
user = User.create! name: 'bob', email: 'bob@example.com', password: '123456789abc'
|
57
|
+
|
58
|
+
qv_totp = QuoVadis::Totp.new account: user.qv_account
|
59
|
+
totp = ROTP::TOTP.new qv_totp.key
|
60
|
+
|
61
|
+
otp = totp.now
|
62
|
+
|
63
|
+
assert qv_totp.verify otp # one time
|
64
|
+
refute qv_totp.verify otp
|
65
|
+
assert qv_totp.reused? otp
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
data/test/quo_vadis_test.rb
CHANGED
@@ -1,7 +1,43 @@
|
|
1
|
-
require
|
1
|
+
require "test_helper"
|
2
2
|
|
3
3
|
class QuoVadisTest < ActiveSupport::TestCase
|
4
|
-
|
5
|
-
|
4
|
+
|
5
|
+
def test_that_it_has_a_version_number
|
6
|
+
assert QuoVadis::VERSION
|
7
|
+
end
|
8
|
+
|
9
|
+
|
10
|
+
test 'translate' do
|
11
|
+
assert_equal 'Welcome back!', QuoVadis.translate('flash.login.success')
|
12
|
+
assert_equal 'You have 3 recovery codes left.', QuoVadis.translate('flash.recovery_code.success', count: 3)
|
13
|
+
assert_nil QuoVadis.translate('does_not_exist')
|
14
|
+
end
|
15
|
+
|
16
|
+
|
17
|
+
test 'identifier' do
|
18
|
+
assert_equal :email, QuoVadis.identifier('User')
|
19
|
+
end
|
20
|
+
|
21
|
+
|
22
|
+
test 'humanise_identifier' do
|
23
|
+
assert_equal 'Email', QuoVadis.humanise_identifier('User')
|
6
24
|
end
|
25
|
+
|
26
|
+
|
27
|
+
test 'identifiers' do
|
28
|
+
assert_equal [:username, :email], QuoVadis.send(:identifiers)
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
test 'detect_identifier' do
|
33
|
+
assert_equal 'email', QuoVadis.send(:detect_identifier, ['foo', 'email', 'commit'])
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
test 'find_account_by_identifier_in_params' do
|
38
|
+
u = User.create! name: 'bob', email: 'bob@example.com', password: '123456789abc'
|
39
|
+
assert_equal u.qv_account,
|
40
|
+
QuoVadis.find_account_by_identifier_in_params({'foo' => 'bar', 'email' => 'bob@example.com', 'commit' => 'Save'})
|
41
|
+
end
|
42
|
+
|
7
43
|
end
|
data/test/test_helper.rb
CHANGED
@@ -1,88 +1,58 @@
|
|
1
|
-
# Configure Rails Envinronment
|
2
1
|
ENV["RAILS_ENV"] = "test"
|
3
2
|
|
4
|
-
|
3
|
+
require_relative "../test/dummy/config/environment"
|
4
|
+
ActiveRecord::Migrator.migrations_paths = [File.expand_path("../test/dummy/db/migrate", __dir__)]
|
5
|
+
ActiveRecord::Migrator.migrations_paths << File.expand_path('../db/migrate', __dir__)
|
5
6
|
require "rails/test_help"
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
ActionMailer::Base.default_url_options[:host] = "www.example.com"
|
8
|
+
require 'capybara/rails'
|
9
|
+
require 'capybara/minitest'
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
# Configure capybara for integration testing
|
14
|
-
require "capybara/rails"
|
15
|
-
Capybara.default_driver = :rack_test
|
16
|
-
Capybara.default_selector = :css
|
17
|
-
|
18
|
-
# Run any available migration
|
19
|
-
ActiveRecord::Migrator.migrate File.expand_path("../dummy/db/migrate/", __FILE__)
|
20
|
-
|
21
|
-
# Load support files
|
22
|
-
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
23
|
-
|
24
|
-
#
|
25
|
-
# Common methods
|
11
|
+
# integration tests or system tests?
|
26
12
|
#
|
13
|
+
# system ones use a real browser and can therefore test css layout and js
|
14
|
+
# but integration ones are faster
|
15
|
+
class IntegrationTest < ActionDispatch::IntegrationTest
|
16
|
+
# include Capybara::DSL
|
17
|
+
# include Capybara::Minitest::Assertions
|
27
18
|
|
28
|
-
|
29
|
-
visit sign_in_path
|
30
|
-
fill_in 'username', :with => username
|
31
|
-
fill_in 'password', :with => password
|
32
|
-
click_button 'Sign in'
|
33
|
-
end
|
19
|
+
# include QuoVadis::Engine.routes.url_helpers
|
34
20
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
click_button 'Send me that email'
|
39
|
-
end
|
40
|
-
|
41
|
-
def user_factory(name, username, password, email = nil)
|
42
|
-
User.create! :name => name, :username => username, :password => password, :email => email
|
43
|
-
end
|
44
|
-
|
45
|
-
def person_factory(name, username, password, email = nil)
|
46
|
-
Person.create! :name => name, :username => username, :password => password, :email => email
|
47
|
-
end
|
21
|
+
# setup do
|
22
|
+
# @routes = QuoVadis::Engine.routes
|
23
|
+
# end
|
48
24
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
QuoVadis.signed_out_url = :root
|
54
|
-
QuoVadis.signed_in_hook = nil
|
55
|
-
QuoVadis.failed_sign_in_hook = nil
|
56
|
-
QuoVadis.signed_out_hook = nil
|
57
|
-
QuoVadis.layout = 'application'
|
58
|
-
QuoVadis.from = 'noreply@example.com'
|
59
|
-
QuoVadis.subject_change_password = 'Change your password'
|
60
|
-
QuoVadis.subject_invitation = 'Activate your account'
|
61
|
-
QuoVadis.remember_for = 2.weeks
|
62
|
-
QuoVadis.blocked = false
|
63
|
-
end
|
25
|
+
teardown do
|
26
|
+
Capybara.reset_session!
|
27
|
+
Capybara.use_default_driver
|
28
|
+
end
|
64
29
|
|
30
|
+
# https://philna.sh/blog/2020/01/15/test-signed-cookies-in-rails
|
31
|
+
#
|
32
|
+
# ActionDispatch::IntegrationTest's `cookies` is a Rack::Test::CookieJar
|
33
|
+
# not an ActionDispatch::Cookies::CookieJar, and doesn't have the #encrypted
|
34
|
+
# or #signed methods. So construct an ActionDispatch cookie jar.
|
35
|
+
def jar(_session = nil)
|
36
|
+
_request, _cookies = if _session
|
37
|
+
[_session.request, _session.cookies]
|
38
|
+
else
|
39
|
+
[@request, cookies]
|
40
|
+
end
|
41
|
+
|
42
|
+
ActionDispatch::Cookies::CookieJar.build(_request, _cookies.to_hash)
|
43
|
+
end
|
65
44
|
|
66
|
-
#
|
67
|
-
# Code below from https://github.com/nruth/show_me_the_cookies
|
68
|
-
#
|
69
45
|
|
70
|
-
def
|
71
|
-
|
72
|
-
existing_cookie.name.downcase == cookie_name
|
73
|
-
end
|
74
|
-
end
|
46
|
+
def assert_session_replaced(&block)
|
47
|
+
id = jar.encrypted[QuoVadis.cookie_name]
|
75
48
|
|
76
|
-
|
77
|
-
cookie_jar.instance_variable_get(:@cookies).select do |existing_cookie|
|
78
|
-
existing_cookie.name.downcase == cookie_name
|
79
|
-
end.first
|
80
|
-
end
|
49
|
+
yield
|
81
50
|
|
82
|
-
|
83
|
-
Capybara.current_session.driver.browser.current_session.instance_variable_get(:@rack_mock_session).cookie_jar
|
84
|
-
end
|
51
|
+
_id = jar.encrypted[QuoVadis.cookie_name]
|
85
52
|
|
86
|
-
|
87
|
-
|
53
|
+
refute_equal id, _id
|
54
|
+
refute QuoVadis::Session.exists? id
|
55
|
+
assert QuoVadis::Session.exists? _id
|
56
|
+
assert controller.logged_in?
|
57
|
+
end
|
88
58
|
end
|
metadata
CHANGED
@@ -1,106 +1,72 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quo_vadis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Stewart
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 3.0.4
|
20
|
-
- - "<"
|
17
|
+
- - ">="
|
21
18
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
19
|
+
version: '6'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
|
-
- - "
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: 3.0.4
|
30
|
-
- - "<"
|
24
|
+
- - ">="
|
31
25
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
26
|
+
version: '6'
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
|
-
name: bcrypt
|
28
|
+
name: bcrypt
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
36
30
|
requirements:
|
37
31
|
- - "~>"
|
38
32
|
- !ruby/object:Gem::Version
|
39
|
-
version: 3.
|
33
|
+
version: 3.1.7
|
40
34
|
type: :runtime
|
41
35
|
prerelease: false
|
42
36
|
version_requirements: !ruby/object:Gem::Requirement
|
43
37
|
requirements:
|
44
38
|
- - "~>"
|
45
39
|
- !ruby/object:Gem::Version
|
46
|
-
version: 3.
|
40
|
+
version: 3.1.7
|
47
41
|
- !ruby/object:Gem::Dependency
|
48
|
-
name:
|
42
|
+
name: rotp
|
49
43
|
requirement: !ruby/object:Gem::Requirement
|
50
44
|
requirements:
|
51
45
|
- - ">="
|
52
46
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
54
|
-
type: :
|
47
|
+
version: '6'
|
48
|
+
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
51
|
requirements:
|
58
52
|
- - ">="
|
59
53
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
54
|
+
version: '6'
|
61
55
|
- !ruby/object:Gem::Dependency
|
62
|
-
name:
|
56
|
+
name: rqrcode
|
63
57
|
requirement: !ruby/object:Gem::Requirement
|
64
58
|
requirements:
|
65
59
|
- - "~>"
|
66
60
|
- !ruby/object:Gem::Version
|
67
|
-
version: '
|
68
|
-
type: :
|
61
|
+
version: '2.0'
|
62
|
+
type: :runtime
|
69
63
|
prerelease: false
|
70
64
|
version_requirements: !ruby/object:Gem::Requirement
|
71
65
|
requirements:
|
72
66
|
- - "~>"
|
73
67
|
- !ruby/object:Gem::Version
|
74
|
-
version: '
|
75
|
-
|
76
|
-
name: launchy
|
77
|
-
requirement: !ruby/object:Gem::Requirement
|
78
|
-
requirements:
|
79
|
-
- - ">="
|
80
|
-
- !ruby/object:Gem::Version
|
81
|
-
version: '0'
|
82
|
-
type: :development
|
83
|
-
prerelease: false
|
84
|
-
version_requirements: !ruby/object:Gem::Requirement
|
85
|
-
requirements:
|
86
|
-
- - ">="
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
version: '0'
|
89
|
-
- !ruby/object:Gem::Dependency
|
90
|
-
name: rake
|
91
|
-
requirement: !ruby/object:Gem::Requirement
|
92
|
-
requirements:
|
93
|
-
- - ">="
|
94
|
-
- !ruby/object:Gem::Version
|
95
|
-
version: '0'
|
96
|
-
type: :development
|
97
|
-
prerelease: false
|
98
|
-
version_requirements: !ruby/object:Gem::Requirement
|
99
|
-
requirements:
|
100
|
-
- - ">="
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
version: '0'
|
103
|
-
description: Simple username/password authentication for Rails 3.
|
68
|
+
version: '2.0'
|
69
|
+
description:
|
104
70
|
email:
|
105
71
|
- boss@airbladesoftware.com
|
106
72
|
executables: []
|
@@ -110,100 +76,139 @@ files:
|
|
110
76
|
- ".gitignore"
|
111
77
|
- CHANGELOG.md
|
112
78
|
- Gemfile
|
79
|
+
- LICENSE.txt
|
113
80
|
- README.md
|
114
81
|
- Rakefile
|
115
|
-
- app/controllers/
|
82
|
+
- app/controllers/quo_vadis/confirmations_controller.rb
|
83
|
+
- app/controllers/quo_vadis/logs_controller.rb
|
84
|
+
- app/controllers/quo_vadis/password_resets_controller.rb
|
85
|
+
- app/controllers/quo_vadis/passwords_controller.rb
|
86
|
+
- app/controllers/quo_vadis/recovery_codes_controller.rb
|
116
87
|
- app/controllers/quo_vadis/sessions_controller.rb
|
117
|
-
- app/
|
118
|
-
- app/
|
88
|
+
- app/controllers/quo_vadis/totps_controller.rb
|
89
|
+
- app/controllers/quo_vadis/twofas_controller.rb
|
90
|
+
- app/mailers/quo_vadis/mailer.rb
|
91
|
+
- app/models/quo_vadis/account.rb
|
92
|
+
- app/models/quo_vadis/account_confirmation_token.rb
|
93
|
+
- app/models/quo_vadis/log.rb
|
94
|
+
- app/models/quo_vadis/password.rb
|
95
|
+
- app/models/quo_vadis/password_reset_token.rb
|
96
|
+
- app/models/quo_vadis/recovery_code.rb
|
97
|
+
- app/models/quo_vadis/session.rb
|
98
|
+
- app/models/quo_vadis/token.rb
|
99
|
+
- app/models/quo_vadis/totp.rb
|
100
|
+
- bin/console
|
101
|
+
- bin/rails
|
102
|
+
- bin/setup
|
119
103
|
- config/locales/quo_vadis.en.yml
|
120
104
|
- config/routes.rb
|
105
|
+
- db/migrate/202102150904_setup.rb
|
121
106
|
- lib/generators/quo_vadis/install_generator.rb
|
122
|
-
- lib/generators/quo_vadis/templates/migration.rb.erb
|
123
|
-
- lib/generators/quo_vadis/templates/quo_vadis.rb.erb
|
124
107
|
- lib/quo_vadis.rb
|
108
|
+
- lib/quo_vadis/controller.rb
|
109
|
+
- lib/quo_vadis/crypt.rb
|
110
|
+
- lib/quo_vadis/current_request_details.rb
|
111
|
+
- lib/quo_vadis/defaults.rb
|
112
|
+
- lib/quo_vadis/encrypted_type.rb
|
125
113
|
- lib/quo_vadis/engine.rb
|
114
|
+
- lib/quo_vadis/hmacable.rb
|
115
|
+
- lib/quo_vadis/ip_masking.rb
|
116
|
+
- lib/quo_vadis/model.rb
|
126
117
|
- lib/quo_vadis/version.rb
|
127
118
|
- quo_vadis.gemspec
|
128
|
-
- test/dummy
|
119
|
+
- test/dummy/README.markdown
|
129
120
|
- test/dummy/Rakefile
|
130
121
|
- test/dummy/app/controllers/application_controller.rb
|
131
122
|
- test/dummy/app/controllers/articles_controller.rb
|
123
|
+
- test/dummy/app/controllers/sign_ups_controller.rb
|
132
124
|
- test/dummy/app/controllers/users_controller.rb
|
133
|
-
- test/dummy/app/
|
134
|
-
- test/dummy/app/helpers/articles_helper.rb
|
125
|
+
- test/dummy/app/models/application_record.rb
|
135
126
|
- test/dummy/app/models/article.rb
|
136
127
|
- test/dummy/app/models/person.rb
|
137
128
|
- test/dummy/app/models/user.rb
|
129
|
+
- test/dummy/app/views/articles/also_secret.html.erb
|
138
130
|
- test/dummy/app/views/articles/index.html.erb
|
139
|
-
- test/dummy/app/views/articles/
|
131
|
+
- test/dummy/app/views/articles/secret.html.erb
|
132
|
+
- test/dummy/app/views/articles/very_secret.html.erb
|
140
133
|
- test/dummy/app/views/layouts/application.html.erb
|
141
|
-
- test/dummy/app/views/
|
142
|
-
- test/dummy/app/views/quo_vadis/
|
143
|
-
- test/dummy/app/views/quo_vadis/
|
144
|
-
- test/dummy/app/views/
|
145
|
-
- test/dummy/app/views/
|
146
|
-
- test/dummy/app/views/
|
147
|
-
- test/dummy/app/views/
|
134
|
+
- test/dummy/app/views/quo_vadis/confirmations/edit.html.erb
|
135
|
+
- test/dummy/app/views/quo_vadis/confirmations/index.html.erb
|
136
|
+
- test/dummy/app/views/quo_vadis/confirmations/new.html.erb
|
137
|
+
- test/dummy/app/views/quo_vadis/logs/index.html.erb
|
138
|
+
- test/dummy/app/views/quo_vadis/mailer/account_confirmation.text.erb
|
139
|
+
- test/dummy/app/views/quo_vadis/mailer/email_change_notification.text.erb
|
140
|
+
- test/dummy/app/views/quo_vadis/mailer/identifier_change_notification.text.erb
|
141
|
+
- test/dummy/app/views/quo_vadis/mailer/password_change_notification.text.erb
|
142
|
+
- test/dummy/app/views/quo_vadis/mailer/password_reset_notification.text.erb
|
143
|
+
- test/dummy/app/views/quo_vadis/mailer/recovery_codes_generation_notification.text.erb
|
144
|
+
- test/dummy/app/views/quo_vadis/mailer/reset_password.text.erb
|
145
|
+
- test/dummy/app/views/quo_vadis/mailer/totp_reuse_notification.text.erb
|
146
|
+
- test/dummy/app/views/quo_vadis/mailer/totp_setup_notification.text.erb
|
147
|
+
- test/dummy/app/views/quo_vadis/mailer/twofa_deactivated_notification.text.erb
|
148
|
+
- test/dummy/app/views/quo_vadis/password_resets/edit.html.erb
|
149
|
+
- test/dummy/app/views/quo_vadis/password_resets/index.html.erb
|
150
|
+
- test/dummy/app/views/quo_vadis/password_resets/new.html.erb
|
151
|
+
- test/dummy/app/views/quo_vadis/passwords/edit.html.erb
|
152
|
+
- test/dummy/app/views/quo_vadis/recovery_codes/challenge.html.erb
|
153
|
+
- test/dummy/app/views/quo_vadis/recovery_codes/index.html.erb
|
154
|
+
- test/dummy/app/views/quo_vadis/sessions/index.html.erb
|
155
|
+
- test/dummy/app/views/quo_vadis/sessions/new.html.erb
|
156
|
+
- test/dummy/app/views/quo_vadis/totps/challenge.html.erb
|
157
|
+
- test/dummy/app/views/quo_vadis/totps/new.html.erb
|
158
|
+
- test/dummy/app/views/quo_vadis/twofas/show.html.erb
|
159
|
+
- test/dummy/app/views/sign_ups/new.html.erb
|
160
|
+
- test/dummy/app/views/sign_ups/show.html.erb
|
148
161
|
- test/dummy/app/views/users/new.html.erb
|
149
162
|
- test/dummy/config.ru
|
150
163
|
- test/dummy/config/application.rb
|
151
164
|
- test/dummy/config/boot.rb
|
152
165
|
- test/dummy/config/database.yml
|
153
166
|
- test/dummy/config/environment.rb
|
154
|
-
- test/dummy/config/environments/development.rb
|
155
|
-
- test/dummy/config/environments/production.rb
|
156
|
-
- test/dummy/config/environments/test.rb
|
157
|
-
- test/dummy/config/initializers/backtrace_silencers.rb
|
158
|
-
- test/dummy/config/initializers/inflections.rb
|
159
|
-
- test/dummy/config/initializers/mime_types.rb
|
160
167
|
- test/dummy/config/initializers/quo_vadis.rb
|
161
|
-
- test/dummy/config/initializers/rack_patch.rb
|
162
|
-
- test/dummy/config/initializers/secret_token.rb
|
163
|
-
- test/dummy/config/initializers/session_store.rb
|
164
|
-
- test/dummy/config/locales/en.yml
|
165
|
-
- test/dummy/config/locales/quo_vadis.en.yml
|
166
168
|
- test/dummy/config/routes.rb
|
167
|
-
- test/dummy/db/migrate/
|
168
|
-
- test/dummy/db/migrate/
|
169
|
-
- test/dummy/db/migrate/20110127094709_add_authentication_to_users.rb
|
170
|
-
- test/dummy/db/migrate/20111004112209_create_people.rb
|
171
|
-
- test/dummy/db/migrate/20111004132342_add_authentication_to_people.rb
|
169
|
+
- test/dummy/db/migrate/202102121932_create_users.rb
|
170
|
+
- test/dummy/db/migrate/202102121935_create_people.rb
|
172
171
|
- test/dummy/db/schema.rb
|
173
|
-
- test/dummy/public/404.html
|
174
|
-
- test/dummy/public/422.html
|
175
|
-
- test/dummy/public/500.html
|
176
172
|
- test/dummy/public/favicon.ico
|
177
|
-
- test/
|
178
|
-
- test/
|
179
|
-
- test/
|
180
|
-
- test/
|
181
|
-
- test/
|
182
|
-
- test/
|
183
|
-
- test/
|
184
|
-
- test/
|
185
|
-
- test/
|
186
|
-
- test/
|
187
|
-
- test/integration/
|
188
|
-
- test/integration/
|
189
|
-
- test/integration/
|
190
|
-
- test/integration/
|
191
|
-
- test/integration/
|
192
|
-
- test/integration/
|
193
|
-
- test/integration/
|
194
|
-
- test/integration/
|
195
|
-
- test/integration/sign_in_person_test.rb
|
196
|
-
- test/integration/sign_in_test.rb
|
197
|
-
- test/integration/sign_out_test.rb
|
173
|
+
- test/fixtures/quo_vadis/mailer/account_confirmation.text
|
174
|
+
- test/fixtures/quo_vadis/mailer/email_change_notification.text
|
175
|
+
- test/fixtures/quo_vadis/mailer/identifier_change_notification.text
|
176
|
+
- test/fixtures/quo_vadis/mailer/password_change_notification.text
|
177
|
+
- test/fixtures/quo_vadis/mailer/password_reset_notification.text
|
178
|
+
- test/fixtures/quo_vadis/mailer/recovery_codes_generation_notification.text
|
179
|
+
- test/fixtures/quo_vadis/mailer/reset_password.text
|
180
|
+
- test/fixtures/quo_vadis/mailer/totp_reuse_notification.text
|
181
|
+
- test/fixtures/quo_vadis/mailer/totp_setup_notification.text
|
182
|
+
- test/fixtures/quo_vadis/mailer/twofa_deactivated_notification.text
|
183
|
+
- test/integration/account_confirmation_test.rb
|
184
|
+
- test/integration/controller_test.rb
|
185
|
+
- test/integration/logging_test.rb
|
186
|
+
- test/integration/password_change_test.rb
|
187
|
+
- test/integration/password_login_test.rb
|
188
|
+
- test/integration/password_reset_test.rb
|
189
|
+
- test/integration/recovery_codes_test.rb
|
190
|
+
- test/integration/sessions_test.rb
|
198
191
|
- test/integration/sign_up_test.rb
|
192
|
+
- test/integration/totps_test.rb
|
193
|
+
- test/integration/twofa_test.rb
|
194
|
+
- test/mailers/mailer_test.rb
|
195
|
+
- test/models/account_test.rb
|
196
|
+
- test/models/crypt_test.rb
|
197
|
+
- test/models/log_test.rb
|
198
|
+
- test/models/mask_ip_test.rb
|
199
|
+
- test/models/model_test.rb
|
200
|
+
- test/models/password_test.rb
|
201
|
+
- test/models/recovery_code_test.rb
|
202
|
+
- test/models/session_test.rb
|
203
|
+
- test/models/token_test.rb
|
204
|
+
- test/models/totp_test.rb
|
199
205
|
- test/quo_vadis_test.rb
|
200
|
-
- test/support/integration_case.rb
|
201
206
|
- test/test_helper.rb
|
202
|
-
- test/unit/user_test.rb
|
203
207
|
homepage: https://github.com/airblade/quo_vadis
|
204
|
-
licenses:
|
208
|
+
licenses:
|
209
|
+
- MIT
|
205
210
|
metadata: {}
|
206
|
-
post_install_message:
|
211
|
+
post_install_message:
|
207
212
|
rdoc_options: []
|
208
213
|
require_paths:
|
209
214
|
- lib
|
@@ -218,84 +223,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
218
223
|
- !ruby/object:Gem::Version
|
219
224
|
version: '0'
|
220
225
|
requirements: []
|
221
|
-
|
222
|
-
|
223
|
-
signing_key:
|
226
|
+
rubygems_version: 3.1.2
|
227
|
+
signing_key:
|
224
228
|
specification_version: 4
|
225
|
-
summary:
|
226
|
-
test_files:
|
227
|
-
- test/dummy/.gitignore
|
228
|
-
- test/dummy/Rakefile
|
229
|
-
- test/dummy/app/controllers/application_controller.rb
|
230
|
-
- test/dummy/app/controllers/articles_controller.rb
|
231
|
-
- test/dummy/app/controllers/users_controller.rb
|
232
|
-
- test/dummy/app/helpers/application_helper.rb
|
233
|
-
- test/dummy/app/helpers/articles_helper.rb
|
234
|
-
- test/dummy/app/models/article.rb
|
235
|
-
- test/dummy/app/models/person.rb
|
236
|
-
- test/dummy/app/models/user.rb
|
237
|
-
- test/dummy/app/views/articles/index.html.erb
|
238
|
-
- test/dummy/app/views/articles/new.html.erb
|
239
|
-
- test/dummy/app/views/layouts/application.html.erb
|
240
|
-
- test/dummy/app/views/layouts/sessions.html.erb
|
241
|
-
- test/dummy/app/views/quo_vadis/notifier/change_password.text.erb
|
242
|
-
- test/dummy/app/views/quo_vadis/notifier/invite.text.erb
|
243
|
-
- test/dummy/app/views/sessions/edit.html.erb
|
244
|
-
- test/dummy/app/views/sessions/forgotten.html.erb
|
245
|
-
- test/dummy/app/views/sessions/invite.html.erb
|
246
|
-
- test/dummy/app/views/sessions/new.html.erb
|
247
|
-
- test/dummy/app/views/users/new.html.erb
|
248
|
-
- test/dummy/config.ru
|
249
|
-
- test/dummy/config/application.rb
|
250
|
-
- test/dummy/config/boot.rb
|
251
|
-
- test/dummy/config/database.yml
|
252
|
-
- test/dummy/config/environment.rb
|
253
|
-
- test/dummy/config/environments/development.rb
|
254
|
-
- test/dummy/config/environments/production.rb
|
255
|
-
- test/dummy/config/environments/test.rb
|
256
|
-
- test/dummy/config/initializers/backtrace_silencers.rb
|
257
|
-
- test/dummy/config/initializers/inflections.rb
|
258
|
-
- test/dummy/config/initializers/mime_types.rb
|
259
|
-
- test/dummy/config/initializers/quo_vadis.rb
|
260
|
-
- test/dummy/config/initializers/rack_patch.rb
|
261
|
-
- test/dummy/config/initializers/secret_token.rb
|
262
|
-
- test/dummy/config/initializers/session_store.rb
|
263
|
-
- test/dummy/config/locales/en.yml
|
264
|
-
- test/dummy/config/locales/quo_vadis.en.yml
|
265
|
-
- test/dummy/config/routes.rb
|
266
|
-
- test/dummy/db/migrate/20110124125037_create_users.rb
|
267
|
-
- test/dummy/db/migrate/20110124131535_create_articles.rb
|
268
|
-
- test/dummy/db/migrate/20110127094709_add_authentication_to_users.rb
|
269
|
-
- test/dummy/db/migrate/20111004112209_create_people.rb
|
270
|
-
- test/dummy/db/migrate/20111004132342_add_authentication_to_people.rb
|
271
|
-
- test/dummy/db/schema.rb
|
272
|
-
- test/dummy/public/404.html
|
273
|
-
- test/dummy/public/422.html
|
274
|
-
- test/dummy/public/500.html
|
275
|
-
- test/dummy/public/favicon.ico
|
276
|
-
- test/dummy/public/javascripts/application.js
|
277
|
-
- test/dummy/public/javascripts/controls.js
|
278
|
-
- test/dummy/public/javascripts/dragdrop.js
|
279
|
-
- test/dummy/public/javascripts/effects.js
|
280
|
-
- test/dummy/public/javascripts/prototype.js
|
281
|
-
- test/dummy/public/javascripts/rails.js
|
282
|
-
- test/dummy/public/stylesheets/.gitkeep
|
283
|
-
- test/dummy/script/rails
|
284
|
-
- test/integration/activation_test.rb
|
285
|
-
- test/integration/authenticate_test.rb
|
286
|
-
- test/integration/blocked_test.rb
|
287
|
-
- test/integration/config_test.rb
|
288
|
-
- test/integration/cookie_test.rb
|
289
|
-
- test/integration/csrf_test.rb
|
290
|
-
- test/integration/forgotten_test.rb
|
291
|
-
- test/integration/helper_test.rb
|
292
|
-
- test/integration/locale_test.rb
|
293
|
-
- test/integration/navigation_test.rb
|
294
|
-
- test/integration/sign_in_person_test.rb
|
295
|
-
- test/integration/sign_in_test.rb
|
296
|
-
- test/integration/sign_out_test.rb
|
297
|
-
- test/integration/sign_up_test.rb
|
298
|
-
- test/quo_vadis_test.rb
|
299
|
-
- test/support/integration_case.rb
|
300
|
-
- test/test_helper.rb
|
301
|
-
- test/unit/user_test.rb
|
229
|
+
summary: Multifactor authentication for Rails 6.
|
230
|
+
test_files: []
|