devise-2fa 0.1.1 → 0.2.0
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.
- checksums.yaml +5 -5
- data/.circleci/config.yml +46 -0
- data/.gitignore +8 -0
- data/Gemfile +3 -22
- data/README.md +13 -14
- data/Rakefile +6 -28
- data/bin/rspec +10 -0
- data/bin/setup +12 -0
- data/{devise-2fa.gemspec → devise_2fa.gemspec} +15 -8
- data/lib/devise-2fa/version.rb +1 -1
- data/lib/devise_two_factorable/models/two_factorable.rb +5 -1
- data/{test → spec}/dummy/Rakefile +2 -3
- data/{test/dummy/app/mailers/.gitkeep → spec/dummy/app/assets/images/.keep} +0 -0
- data/spec/dummy/app/assets/javascripts/application.js +3 -0
- data/{test/dummy/lib/assets/.gitkeep → spec/dummy/app/assets/javascripts/channels/.keep} +0 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/{test → spec}/dummy/app/controllers/application_controller.rb +4 -1
- data/{test/dummy/public/favicon.ico → spec/dummy/app/controllers/concerns/.keep} +0 -0
- data/{test → spec}/dummy/app/helpers/application_helper.rb +0 -0
- data/spec/dummy/app/models/application_record.rb +3 -0
- data/spec/dummy/app/models/concerns/.keep +0 -0
- data/spec/dummy/app/models/user.rb +6 -0
- data/spec/dummy/app/views/layouts/application.html.erb +19 -0
- data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +25 -0
- data/spec/dummy/bin/update +25 -0
- data/spec/dummy/bin/yarn +11 -0
- data/spec/dummy/config.ru +5 -0
- data/spec/dummy/config/application.rb +14 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/{test → spec}/dummy/config/database.yml +10 -10
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +61 -0
- data/{test → spec}/dummy/config/environments/test.rb +15 -5
- data/spec/dummy/config/initializers/assets.rb +4 -0
- data/{test → spec}/dummy/config/initializers/backtrace_silencers.rb +0 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +5 -0
- data/{test → spec}/dummy/config/initializers/devise.rb +134 -56
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/{test → spec}/dummy/config/initializers/inflections.rb +6 -5
- data/{test → spec}/dummy/config/initializers/mime_types.rb +0 -1
- data/{test → spec}/dummy/config/initializers/wrap_parameters.rb +5 -5
- data/spec/dummy/config/locales/devise.en.yml +68 -0
- data/spec/dummy/config/locales/devise.two_factor.en.yml +57 -0
- data/spec/dummy/config/locales/en.yml +2 -0
- data/spec/dummy/config/puma.rb +9 -0
- data/spec/dummy/config/routes.rb +4 -0
- data/spec/dummy/config/spring.rb +6 -0
- data/spec/dummy/config/storage.yml +8 -0
- data/spec/dummy/db/migrate/20190311184605_devise_create_users.rb +44 -0
- data/{test/dummy/db/migrate/20130131160351_devise_otp_add_to_users.rb → spec/dummy/db/migrate/20190312222952_devise_two_factor_add_to_users.rb} +4 -5
- data/spec/dummy/db/schema.rb +39 -0
- data/spec/dummy/lib/assets/.keep +0 -0
- data/spec/dummy/package.json +5 -0
- data/spec/dummy/public/404.html +1 -0
- data/spec/dummy/public/422.html +1 -0
- data/spec/dummy/public/500.html +19 -0
- data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/spec/dummy/public/apple-touch-icon.png +0 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/storage/.keep +0 -0
- data/spec/models/user_spec.rb +33 -0
- data/spec/spec_helper.rb +69 -0
- data/spec/system/persistence_spec.rb +59 -0
- data/spec/system/refresh_spec.rb +100 -0
- data/spec/system/token_spec.rb +41 -0
- data/spec/system/users_spec.rb +98 -0
- metadata +213 -123
- data/.travis.yml +0 -28
- data/lib/devise_two_factorable/two_factorable.rb +0 -131
- data/test/dummy/README.rdoc +0 -261
- data/test/dummy/app/assets/javascripts/application.js +0 -13
- data/test/dummy/app/assets/stylesheets/application.css +0 -13
- data/test/dummy/app/controllers/posts_controller.rb +0 -83
- data/test/dummy/app/helpers/posts_helper.rb +0 -2
- data/test/dummy/app/models/post.rb +0 -2
- data/test/dummy/app/models/user.rb +0 -20
- data/test/dummy/app/views/layouts/application.html.erb +0 -14
- data/test/dummy/app/views/posts/_form.html.erb +0 -25
- data/test/dummy/app/views/posts/edit.html.erb +0 -6
- data/test/dummy/app/views/posts/index.html.erb +0 -25
- data/test/dummy/app/views/posts/new.html.erb +0 -5
- data/test/dummy/app/views/posts/show.html.erb +0 -15
- data/test/dummy/config.ru +0 -4
- data/test/dummy/config/application.rb +0 -67
- data/test/dummy/config/boot.rb +0 -10
- data/test/dummy/config/environment.rb +0 -5
- data/test/dummy/config/environments/development.rb +0 -37
- data/test/dummy/config/environments/production.rb +0 -73
- data/test/dummy/config/initializers/secret_token.rb +0 -8
- data/test/dummy/config/initializers/session_store.rb +0 -8
- data/test/dummy/config/locales/en.yml +0 -5
- data/test/dummy/config/routes.rb +0 -6
- data/test/dummy/db/migrate/20130125101430_create_users.rb +0 -9
- data/test/dummy/db/migrate/20130131092406_add_devise_to_users.rb +0 -52
- data/test/dummy/db/migrate/20130131142320_create_posts.rb +0 -10
- data/test/dummy/public/404.html +0 -26
- data/test/dummy/public/422.html +0 -26
- data/test/dummy/public/500.html +0 -25
- data/test/dummy/script/rails +0 -6
- data/test/integration/persistence_test.rb +0 -63
- data/test/integration/refresh_test.rb +0 -103
- data/test/integration/sign_in_test.rb +0 -85
- data/test/integration/token_test.rb +0 -30
- data/test/integration_tests_helper.rb +0 -64
- data/test/model_tests_helper.rb +0 -20
- data/test/models/two_factorable_test.rb +0 -120
- data/test/orm/active_record.rb +0 -4
- data/test/orm/mongoid.rb +0 -13
- data/test/support/mongoid.yml +0 -6
- data/test/support/symmetric_encryption.yml +0 -70
- data/test/test_helper.rb +0 -18
@@ -0,0 +1,59 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe 'Persistence' do
|
6
|
+
subject (:user) { User.create(email: 'mb@geemail.com', password: 'iwantabigmac1') }
|
7
|
+
|
8
|
+
it 'requests the the otp challenge every log in' do
|
9
|
+
enable_otp_and_sign_in user
|
10
|
+
otp_challenge_for user
|
11
|
+
|
12
|
+
visit user_token_path
|
13
|
+
|
14
|
+
expect(current_path).to eq(user_token_path)
|
15
|
+
|
16
|
+
sign_out user
|
17
|
+
sign_in_user user
|
18
|
+
|
19
|
+
expect(current_path).to eq(user_credential_path)
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'a user should be able to set their browser as trusted' do
|
23
|
+
# log in 1fa
|
24
|
+
enable_otp_and_sign_in user
|
25
|
+
otp_challenge_for user
|
26
|
+
|
27
|
+
visit user_token_path
|
28
|
+
expect(current_path).to eq(user_token_path)
|
29
|
+
|
30
|
+
click_link('Trust this browser')
|
31
|
+
|
32
|
+
expect(page).to have_content 'This browser is trusted'
|
33
|
+
sign_out user
|
34
|
+
|
35
|
+
sign_in_user user
|
36
|
+
|
37
|
+
expect(current_path).to eq(root_path)
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'trusted status should expire' do
|
41
|
+
User.otp_trust_persistence = 1
|
42
|
+
user.reload
|
43
|
+
enable_otp_and_sign_in user
|
44
|
+
otp_challenge_for user
|
45
|
+
|
46
|
+
visit user_token_path
|
47
|
+
expect(current_path).to eq(user_token_path)
|
48
|
+
|
49
|
+
click_link('Trust this browser')
|
50
|
+
expect(page).to have_content 'This browser is trusted'
|
51
|
+
|
52
|
+
sign_out user
|
53
|
+
sleep User.otp_trust_persistence.to_i
|
54
|
+
|
55
|
+
sign_in_user user
|
56
|
+
|
57
|
+
expect(current_path).to eq(user_credential_path)
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,100 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe 'Refresh' do
|
6
|
+
subject (:user) { User.create(email: 'mb@geemail.com', password: 'iwantabigmac1') }
|
7
|
+
@old_refresh = User.otp_credentials_refresh
|
8
|
+
User.otp_credentials_refresh = 1.second
|
9
|
+
|
10
|
+
it 'should be able to access their OTP settings without refreshing' do
|
11
|
+
sign_in_user user
|
12
|
+
visit user_token_path
|
13
|
+
|
14
|
+
expect(current_path).to eq(user_token_path)
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'should be prompted for credentials when the credentials_refresh time is expired' do
|
18
|
+
sign_in_user user
|
19
|
+
visit user_token_path
|
20
|
+
|
21
|
+
expect(current_path).to eq(user_token_path)
|
22
|
+
|
23
|
+
sleep(2)
|
24
|
+
visit user_token_path
|
25
|
+
|
26
|
+
expect(current_path).to eq(refresh_user_credential_path)
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'a user should be able to access their OTP settings after refreshing' do
|
30
|
+
sign_in_user user
|
31
|
+
visit user_token_path
|
32
|
+
expect(current_path).to eq(user_token_path)
|
33
|
+
|
34
|
+
sleep(2)
|
35
|
+
|
36
|
+
visit user_token_path
|
37
|
+
expect(current_path).to eq(refresh_user_credential_path)
|
38
|
+
|
39
|
+
fill_in 'user_refresh_password', with: user.password
|
40
|
+
click_button 'Continue'
|
41
|
+
expect(current_path).to eq(user_token_path)
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'a user should NOT be able to access their OTP settings unless refreshing' do
|
45
|
+
sign_in_user user
|
46
|
+
visit user_token_path
|
47
|
+
expect(current_path).to eq(user_token_path)
|
48
|
+
|
49
|
+
sleep(2)
|
50
|
+
|
51
|
+
visit user_token_path
|
52
|
+
expect(current_path).to eq(refresh_user_credential_path)
|
53
|
+
|
54
|
+
fill_in 'user_refresh_password', with: 'wrong password'
|
55
|
+
click_button 'Continue'
|
56
|
+
|
57
|
+
expect(current_path).to eq(refresh_user_credential_path)
|
58
|
+
end
|
59
|
+
|
60
|
+
it 'should ask for their OTP challenge in order to refresh, if they have OTP' do
|
61
|
+
enable_otp_and_sign_in_with_otp user
|
62
|
+
|
63
|
+
sleep(2)
|
64
|
+
visit user_token_path
|
65
|
+
expect(current_path).to eq(refresh_user_credential_path)
|
66
|
+
|
67
|
+
fill_in 'user_refresh_password', with: user.password
|
68
|
+
click_button 'Continue'
|
69
|
+
|
70
|
+
expect(current_path).to eq(refresh_user_credential_path)
|
71
|
+
end
|
72
|
+
|
73
|
+
it 'user should be finally be able to access their settings, if they provide both a password and a valid OTP token' do
|
74
|
+
enable_otp_and_sign_in_with_otp user
|
75
|
+
|
76
|
+
sleep(2)
|
77
|
+
visit user_token_path
|
78
|
+
expect(current_path).to eq(refresh_user_credential_path)
|
79
|
+
|
80
|
+
fill_in 'user_refresh_password', with: user.password
|
81
|
+
fill_in 'user_token', with: ROTP::TOTP.new(user.otp_auth_secret).at(Time.now)
|
82
|
+
click_button 'Continue'
|
83
|
+
|
84
|
+
expect(current_path).to eq(user_token_path)
|
85
|
+
end
|
86
|
+
|
87
|
+
it 'and rejected when the token is blank or null' do
|
88
|
+
enable_otp_and_sign_in_with_otp user
|
89
|
+
|
90
|
+
sleep(2)
|
91
|
+
visit user_token_path
|
92
|
+
expect(current_path).to eq(refresh_user_credential_path)
|
93
|
+
|
94
|
+
fill_in 'user_refresh_password', with: user.password
|
95
|
+
fill_in 'user_token', with: ''
|
96
|
+
click_button 'Continue'
|
97
|
+
|
98
|
+
expect(current_path).to eq(refresh_user_credential_path)
|
99
|
+
end
|
100
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe 'Tokens' do
|
6
|
+
subject (:user) { User.create(email: 'mb@geemail.com', password: 'iwantabigmac1') }
|
7
|
+
|
8
|
+
it 'can be disabled by a user after successfully enabling' do
|
9
|
+
enable_otp_and_sign_in user
|
10
|
+
|
11
|
+
fill_in 'user_token', with: ROTP::TOTP.new(user.otp_auth_secret).at(Time.now)
|
12
|
+
click_button 'Submit Token'
|
13
|
+
|
14
|
+
expect(current_path).to eq(root_path)
|
15
|
+
|
16
|
+
disable_otp
|
17
|
+
sign_out user
|
18
|
+
sign_in_user user
|
19
|
+
|
20
|
+
expect(current_path).to eq(root_path)
|
21
|
+
end
|
22
|
+
|
23
|
+
xit 'cannot be reused' do
|
24
|
+
enable_otp_and_sign_in user
|
25
|
+
|
26
|
+
prev_token = ROTP::TOTP.new(user.otp_auth_secret).at(Time.now)
|
27
|
+
|
28
|
+
fill_in 'user_token', with: prev_token
|
29
|
+
click_button 'Submit Token'
|
30
|
+
|
31
|
+
expect(current_path).to eq(root_path)
|
32
|
+
|
33
|
+
sign_out user
|
34
|
+
sign_in_user user
|
35
|
+
|
36
|
+
fill_in 'user_token', with: prev_token
|
37
|
+
click_button 'Submit Token'
|
38
|
+
|
39
|
+
expect(current_path).to eq(new_user_session_path)
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,98 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe 'Users' do
|
6
|
+
describe 'signing up' do
|
7
|
+
it 'can sign up' do
|
8
|
+
visit '/users/sign_up'
|
9
|
+
fill_in 'user_email', with: 'mb@geemail.com'
|
10
|
+
fill_in 'user_password', with: 'iwantabigmac1'
|
11
|
+
fill_in 'user_password_confirmation', with: 'iwantabigmac1'
|
12
|
+
|
13
|
+
click_button('Sign up')
|
14
|
+
|
15
|
+
expect(page).to have_content 'Welcome! You have signed up successfully.'
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
describe 'logging in' do
|
20
|
+
subject (:user) { User.create(email: 'mb@geemail.com', password: 'iwantabigmac1') }
|
21
|
+
|
22
|
+
it 'can login without using a token' do
|
23
|
+
sign_in_user(user)
|
24
|
+
|
25
|
+
expect(page).to have_content 'Signed in successfully'
|
26
|
+
end
|
27
|
+
|
28
|
+
context 'enabling otp' do
|
29
|
+
before(:each) do
|
30
|
+
sign_in user
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'can enable otp and are prompted for its token' do
|
34
|
+
visit user_token_path
|
35
|
+
|
36
|
+
fill_in 'user_refresh_password', with: user.password
|
37
|
+
click_on 'Continue'
|
38
|
+
check 'user_otp_enabled'
|
39
|
+
click_on 'Continue'
|
40
|
+
|
41
|
+
user.reload
|
42
|
+
expect(user.otp_enabled).to be true
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
context 'with otp enabled' do
|
47
|
+
it 'can login with the correct code' do
|
48
|
+
enable_otp_and_sign_in user
|
49
|
+
fill_in 'user_token', with: ROTP::TOTP.new(user.otp_auth_secret).at(Time.now)
|
50
|
+
click_button 'Submit Token'
|
51
|
+
|
52
|
+
expect(current_path).to eq(root_path)
|
53
|
+
end
|
54
|
+
|
55
|
+
it 'fails with an incorrect code' do
|
56
|
+
enable_otp_and_sign_in user
|
57
|
+
fill_in 'user_token', with: '123456'
|
58
|
+
click_button 'Submit Token'
|
59
|
+
|
60
|
+
expect(current_path).to eq(new_user_session_path)
|
61
|
+
end
|
62
|
+
|
63
|
+
it 'is prompted for its token immediately after signing in' do
|
64
|
+
enable_otp_and_sign_in user
|
65
|
+
|
66
|
+
expect(current_path).to eq(user_credential_path)
|
67
|
+
end
|
68
|
+
|
69
|
+
it 'fails with a blank code' do
|
70
|
+
enable_otp_and_sign_in user
|
71
|
+
fill_in 'user_token', with: ''
|
72
|
+
click_button 'Submit Token'
|
73
|
+
|
74
|
+
expect(current_path).to eq(user_credential_path)
|
75
|
+
end
|
76
|
+
|
77
|
+
it 'fail when the challenge times out' do
|
78
|
+
enable_otp_and_sign_in user
|
79
|
+
|
80
|
+
fill_in 'user_token', with: ROTP::TOTP.new(user.otp_auth_secret).at(1000.seconds.from_now)
|
81
|
+
click_button 'Submit Token'
|
82
|
+
|
83
|
+
expect(current_path).to eq(new_user_session_path)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
context 'unsuccessfully' do
|
88
|
+
it 'fails with an invalid user' do
|
89
|
+
visit '/users/sign_in'
|
90
|
+
fill_in 'user_email', with: 'user@email.invalid'
|
91
|
+
fill_in 'user_password', with: '12345678'
|
92
|
+
click_button('Log in')
|
93
|
+
|
94
|
+
expect(page).to have_content 'Invalid Email or password'
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise-2fa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William A. Todd
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '5.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '5.0'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: devise
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,39 +72,109 @@ dependencies:
|
|
58
72
|
requirements:
|
59
73
|
- - "~>"
|
60
74
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
75
|
+
version: 4.2.0
|
62
76
|
type: :runtime
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
80
|
- - "~>"
|
67
81
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
82
|
+
version: 4.2.0
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: sqlite3
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
87
|
- - "~>"
|
74
88
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
89
|
+
version: 1.3.6
|
76
90
|
type: :development
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
94
|
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 1.3.6
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: selenium-webdriver
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rspec-rails
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: capybara
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rspec
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: pry
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
81
165
|
- !ruby/object:Gem::Version
|
82
166
|
version: '0'
|
83
167
|
description: Time Based OTP/rfc6238 authentication for Devise
|
84
168
|
email:
|
85
|
-
- info@
|
169
|
+
- info@rockcreek.io
|
86
170
|
executables: []
|
87
171
|
extensions: []
|
88
172
|
extra_rdoc_files: []
|
89
173
|
files:
|
174
|
+
- ".circleci/config.yml"
|
90
175
|
- ".gitignore"
|
91
176
|
- ".hound.yml"
|
92
177
|
- ".ruby-style.yml"
|
93
|
-
- ".travis.yml"
|
94
178
|
- Gemfile
|
95
179
|
- LICENSE
|
96
180
|
- README.md
|
@@ -104,8 +188,10 @@ files:
|
|
104
188
|
- app/views/devise/tokens/recovery.html.erb
|
105
189
|
- app/views/devise/tokens/recovery_codes.text.erb
|
106
190
|
- app/views/devise/tokens/show.html.erb
|
191
|
+
- bin/rspec
|
192
|
+
- bin/setup
|
107
193
|
- config/locales/en.yml
|
108
|
-
-
|
194
|
+
- devise_2fa.gemspec
|
109
195
|
- lib/devise-2fa.rb
|
110
196
|
- lib/devise-2fa/version.rb
|
111
197
|
- lib/devise_two_factorable/controllers/helpers.rb
|
@@ -117,69 +203,71 @@ files:
|
|
117
203
|
- lib/devise_two_factorable/mapping.rb
|
118
204
|
- lib/devise_two_factorable/models/two_factorable.rb
|
119
205
|
- lib/devise_two_factorable/routes.rb
|
120
|
-
- lib/devise_two_factorable/two_factorable.rb
|
121
206
|
- lib/generators/active_record/devise_two_factor_generator.rb
|
122
207
|
- lib/generators/active_record/templates/migration.rb
|
123
208
|
- lib/generators/devise_two_factor/devise_two_factor_generator.rb
|
124
209
|
- lib/generators/devise_two_factor/install_generator.rb
|
125
210
|
- lib/generators/devise_two_factor/views_generator.rb
|
126
211
|
- lib/generators/mongoid/devise_two_factor_generator.rb
|
127
|
-
-
|
128
|
-
-
|
129
|
-
-
|
130
|
-
-
|
131
|
-
-
|
132
|
-
-
|
133
|
-
-
|
134
|
-
-
|
135
|
-
-
|
136
|
-
-
|
137
|
-
-
|
138
|
-
-
|
139
|
-
-
|
140
|
-
-
|
141
|
-
-
|
142
|
-
-
|
143
|
-
-
|
144
|
-
-
|
145
|
-
-
|
146
|
-
-
|
147
|
-
-
|
148
|
-
-
|
149
|
-
-
|
150
|
-
-
|
151
|
-
-
|
152
|
-
-
|
153
|
-
-
|
154
|
-
-
|
155
|
-
-
|
156
|
-
-
|
157
|
-
-
|
158
|
-
-
|
159
|
-
-
|
160
|
-
-
|
161
|
-
-
|
162
|
-
-
|
163
|
-
-
|
164
|
-
-
|
165
|
-
-
|
166
|
-
-
|
167
|
-
-
|
168
|
-
-
|
169
|
-
-
|
170
|
-
-
|
171
|
-
-
|
172
|
-
-
|
173
|
-
-
|
174
|
-
-
|
175
|
-
-
|
176
|
-
-
|
177
|
-
-
|
178
|
-
-
|
179
|
-
-
|
180
|
-
-
|
181
|
-
-
|
182
|
-
-
|
212
|
+
- spec/dummy/Rakefile
|
213
|
+
- spec/dummy/app/assets/images/.keep
|
214
|
+
- spec/dummy/app/assets/javascripts/application.js
|
215
|
+
- spec/dummy/app/assets/javascripts/channels/.keep
|
216
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
217
|
+
- spec/dummy/app/controllers/application_controller.rb
|
218
|
+
- spec/dummy/app/controllers/concerns/.keep
|
219
|
+
- spec/dummy/app/helpers/application_helper.rb
|
220
|
+
- spec/dummy/app/models/application_record.rb
|
221
|
+
- spec/dummy/app/models/concerns/.keep
|
222
|
+
- spec/dummy/app/models/user.rb
|
223
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
224
|
+
- spec/dummy/app/views/layouts/mailer.text.erb
|
225
|
+
- spec/dummy/bin/bundle
|
226
|
+
- spec/dummy/bin/rails
|
227
|
+
- spec/dummy/bin/rake
|
228
|
+
- spec/dummy/bin/setup
|
229
|
+
- spec/dummy/bin/update
|
230
|
+
- spec/dummy/bin/yarn
|
231
|
+
- spec/dummy/config.ru
|
232
|
+
- spec/dummy/config/application.rb
|
233
|
+
- spec/dummy/config/boot.rb
|
234
|
+
- spec/dummy/config/database.yml
|
235
|
+
- spec/dummy/config/environment.rb
|
236
|
+
- spec/dummy/config/environments/development.rb
|
237
|
+
- spec/dummy/config/environments/test.rb
|
238
|
+
- spec/dummy/config/initializers/assets.rb
|
239
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
240
|
+
- spec/dummy/config/initializers/cookies_serializer.rb
|
241
|
+
- spec/dummy/config/initializers/devise.rb
|
242
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
243
|
+
- spec/dummy/config/initializers/inflections.rb
|
244
|
+
- spec/dummy/config/initializers/mime_types.rb
|
245
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
246
|
+
- spec/dummy/config/locales/devise.en.yml
|
247
|
+
- spec/dummy/config/locales/devise.two_factor.en.yml
|
248
|
+
- spec/dummy/config/locales/en.yml
|
249
|
+
- spec/dummy/config/puma.rb
|
250
|
+
- spec/dummy/config/routes.rb
|
251
|
+
- spec/dummy/config/spring.rb
|
252
|
+
- spec/dummy/config/storage.yml
|
253
|
+
- spec/dummy/db/migrate/20190311184605_devise_create_users.rb
|
254
|
+
- spec/dummy/db/migrate/20190312222952_devise_two_factor_add_to_users.rb
|
255
|
+
- spec/dummy/db/schema.rb
|
256
|
+
- spec/dummy/lib/assets/.keep
|
257
|
+
- spec/dummy/package.json
|
258
|
+
- spec/dummy/public/404.html
|
259
|
+
- spec/dummy/public/422.html
|
260
|
+
- spec/dummy/public/500.html
|
261
|
+
- spec/dummy/public/apple-touch-icon-precomposed.png
|
262
|
+
- spec/dummy/public/apple-touch-icon.png
|
263
|
+
- spec/dummy/public/favicon.ico
|
264
|
+
- spec/dummy/storage/.keep
|
265
|
+
- spec/models/user_spec.rb
|
266
|
+
- spec/spec_helper.rb
|
267
|
+
- spec/system/persistence_spec.rb
|
268
|
+
- spec/system/refresh_spec.rb
|
269
|
+
- spec/system/token_spec.rb
|
270
|
+
- spec/system/users_spec.rb
|
183
271
|
homepage: http://www.github.com/williamatodd/devise-2fa
|
184
272
|
licenses:
|
185
273
|
- MIT
|
@@ -199,65 +287,67 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
199
287
|
- !ruby/object:Gem::Version
|
200
288
|
version: '0'
|
201
289
|
requirements: []
|
202
|
-
|
203
|
-
rubygems_version: 2.6.1
|
290
|
+
rubygems_version: 3.0.2
|
204
291
|
signing_key:
|
205
292
|
specification_version: 4
|
206
293
|
summary: Includes ActiveRecord and Mongoid ORM support
|
207
294
|
test_files:
|
208
|
-
-
|
209
|
-
-
|
210
|
-
-
|
211
|
-
-
|
212
|
-
-
|
213
|
-
-
|
214
|
-
-
|
215
|
-
-
|
216
|
-
-
|
217
|
-
-
|
218
|
-
-
|
219
|
-
-
|
220
|
-
-
|
221
|
-
-
|
222
|
-
-
|
223
|
-
-
|
224
|
-
-
|
225
|
-
-
|
226
|
-
-
|
227
|
-
-
|
228
|
-
-
|
229
|
-
-
|
230
|
-
-
|
231
|
-
-
|
232
|
-
-
|
233
|
-
-
|
234
|
-
-
|
235
|
-
-
|
236
|
-
-
|
237
|
-
-
|
238
|
-
-
|
239
|
-
-
|
240
|
-
-
|
241
|
-
-
|
242
|
-
-
|
243
|
-
-
|
244
|
-
-
|
245
|
-
-
|
246
|
-
-
|
247
|
-
-
|
248
|
-
-
|
249
|
-
-
|
250
|
-
-
|
251
|
-
-
|
252
|
-
-
|
253
|
-
-
|
254
|
-
-
|
255
|
-
-
|
256
|
-
-
|
257
|
-
-
|
258
|
-
-
|
259
|
-
-
|
260
|
-
-
|
261
|
-
-
|
262
|
-
-
|
263
|
-
-
|
295
|
+
- spec/dummy/Rakefile
|
296
|
+
- spec/dummy/app/assets/images/.keep
|
297
|
+
- spec/dummy/app/assets/javascripts/application.js
|
298
|
+
- spec/dummy/app/assets/javascripts/channels/.keep
|
299
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
300
|
+
- spec/dummy/app/controllers/application_controller.rb
|
301
|
+
- spec/dummy/app/controllers/concerns/.keep
|
302
|
+
- spec/dummy/app/helpers/application_helper.rb
|
303
|
+
- spec/dummy/app/models/application_record.rb
|
304
|
+
- spec/dummy/app/models/concerns/.keep
|
305
|
+
- spec/dummy/app/models/user.rb
|
306
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
307
|
+
- spec/dummy/app/views/layouts/mailer.text.erb
|
308
|
+
- spec/dummy/bin/bundle
|
309
|
+
- spec/dummy/bin/rails
|
310
|
+
- spec/dummy/bin/rake
|
311
|
+
- spec/dummy/bin/setup
|
312
|
+
- spec/dummy/bin/update
|
313
|
+
- spec/dummy/bin/yarn
|
314
|
+
- spec/dummy/config.ru
|
315
|
+
- spec/dummy/config/application.rb
|
316
|
+
- spec/dummy/config/boot.rb
|
317
|
+
- spec/dummy/config/database.yml
|
318
|
+
- spec/dummy/config/environment.rb
|
319
|
+
- spec/dummy/config/environments/development.rb
|
320
|
+
- spec/dummy/config/environments/test.rb
|
321
|
+
- spec/dummy/config/initializers/assets.rb
|
322
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
323
|
+
- spec/dummy/config/initializers/cookies_serializer.rb
|
324
|
+
- spec/dummy/config/initializers/devise.rb
|
325
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
326
|
+
- spec/dummy/config/initializers/inflections.rb
|
327
|
+
- spec/dummy/config/initializers/mime_types.rb
|
328
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
329
|
+
- spec/dummy/config/locales/devise.en.yml
|
330
|
+
- spec/dummy/config/locales/devise.two_factor.en.yml
|
331
|
+
- spec/dummy/config/locales/en.yml
|
332
|
+
- spec/dummy/config/puma.rb
|
333
|
+
- spec/dummy/config/routes.rb
|
334
|
+
- spec/dummy/config/spring.rb
|
335
|
+
- spec/dummy/config/storage.yml
|
336
|
+
- spec/dummy/db/migrate/20190311184605_devise_create_users.rb
|
337
|
+
- spec/dummy/db/migrate/20190312222952_devise_two_factor_add_to_users.rb
|
338
|
+
- spec/dummy/db/schema.rb
|
339
|
+
- spec/dummy/lib/assets/.keep
|
340
|
+
- spec/dummy/package.json
|
341
|
+
- spec/dummy/public/404.html
|
342
|
+
- spec/dummy/public/422.html
|
343
|
+
- spec/dummy/public/500.html
|
344
|
+
- spec/dummy/public/apple-touch-icon-precomposed.png
|
345
|
+
- spec/dummy/public/apple-touch-icon.png
|
346
|
+
- spec/dummy/public/favicon.ico
|
347
|
+
- spec/dummy/storage/.keep
|
348
|
+
- spec/models/user_spec.rb
|
349
|
+
- spec/spec_helper.rb
|
350
|
+
- spec/system/persistence_spec.rb
|
351
|
+
- spec/system/refresh_spec.rb
|
352
|
+
- spec/system/token_spec.rb
|
353
|
+
- spec/system/users_spec.rb
|