devise-two-factor 5.0.0 → 6.3.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.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +6 -0
  3. data/.github/workflows/ci.yml +10 -3
  4. data/.github/workflows/push.yml +28 -0
  5. data/.markdownlint.json +6 -0
  6. data/Appraisals +15 -30
  7. data/CHANGELOG.md +33 -0
  8. data/README.md +79 -37
  9. data/Rakefile +2 -0
  10. data/SECURITY.md +5 -0
  11. data/UPGRADING.md +38 -15
  12. data/devise-two-factor.gemspec +8 -14
  13. data/gemfiles/rails_7.0.gemfile +2 -2
  14. data/gemfiles/{rails_4.2.gemfile → rails_7.1.gemfile} +2 -2
  15. data/gemfiles/{rails_5.0.gemfile → rails_7.2.gemfile} +2 -2
  16. data/gemfiles/{rails_5.1.gemfile → rails_8.0.gemfile} +2 -2
  17. data/gemfiles/{rails_4.1.gemfile → rails_8.1.gemfile} +2 -2
  18. data/lib/devise-two-factor.rb +7 -4
  19. data/lib/devise_two_factor/models/two_factor_authenticatable.rb +13 -14
  20. data/lib/devise_two_factor/models/two_factor_backupable.rb +6 -2
  21. data/lib/devise_two_factor/spec_helpers/two_factor_authenticatable_shared_examples.rb +5 -5
  22. data/lib/devise_two_factor/spec_helpers/two_factor_backupable_shared_examples.rb +52 -24
  23. data/lib/devise_two_factor/strategies/two_factor_authenticatable.rb +8 -2
  24. data/lib/devise_two_factor/strategies/two_factor_backupable.rb +6 -4
  25. data/lib/devise_two_factor/version.rb +1 -1
  26. data/spec/devise/models/two_factor_authenticatable_spec.rb +5 -1
  27. data/spec/devise/models/two_factor_backupable_spec.rb +4 -0
  28. data/spec/spec_helper.rb +0 -1
  29. metadata +45 -109
  30. checksums.yaml.gz.sig +0 -0
  31. data/certs/tinfoil-cacert.pem +0 -41
  32. data/certs/tinfoilsecurity-gems-cert.pem +0 -35
  33. data/gemfiles/rails_5.2.gemfile +0 -8
  34. data/gemfiles/rails_6.0.gemfile +0 -8
  35. data/gemfiles/rails_6.1.gemfile +0 -8
  36. data.tar.gz.sig +0 -0
  37. metadata.gz.sig +0 -0
@@ -2,7 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "railties", "~> 4.1"
6
- gem "activesupport", "~> 4.1"
5
+ gem "railties", "8.1.0"
6
+ gem "activesupport", "8.1.0"
7
7
 
8
8
  gemspec path: "../"
@@ -1,11 +1,13 @@
1
+ require 'logger'
1
2
  require 'devise'
2
3
  require 'devise_two_factor/models'
3
4
  require 'devise_two_factor/strategies'
4
5
 
5
6
  module Devise
6
- # The length of generated OTP secrets
7
+ # The length of randomly generated OTP shared secret (in bytes).
8
+ # The secrets will be base32-encoded and have a length 1.6 times the configured value.
7
9
  mattr_accessor :otp_secret_length
8
- @@otp_secret_length = 24
10
+ @@otp_secret_length = 20
9
11
 
10
12
  # The number of seconds before and after the current
11
13
  # time for which codes will be accepted
@@ -20,7 +22,8 @@ module Devise
20
22
  mattr_accessor :otp_encrypted_attribute_options
21
23
  @@otp_encrypted_attribute_options = {}
22
24
 
23
- # The length of all generated OTP backup codes
25
+ # The length of randomly generated OTP backup codes (in bytes).
26
+ # The codes will be hex-encoded and have a length twice the configured value.
24
27
  mattr_accessor :otp_backup_code_length
25
28
  @@otp_backup_code_length = 16
26
29
 
@@ -31,7 +34,7 @@ module Devise
31
34
  end
32
35
 
33
36
  Devise.add_module(:two_factor_authenticatable, :route => :session, :strategy => true,
34
- :controller => :sessions, :model => true)
37
+ :controller => :sessions, :model => true, :insert_at => 0)
35
38
 
36
39
  Devise.add_module(:two_factor_backupable, :route => :session, :strategy => true,
37
40
  :controller => :sessions, :model => true)
@@ -41,12 +41,11 @@ module Devise
41
41
 
42
42
  if self.consumed_timestep
43
43
  # reconstruct the timestamp of the last consumed timestep
44
- after_timestamp = self.consumed_timestep * otp.interval
44
+ after_timestamp = self.consumed_timestep * totp.interval
45
45
  end
46
46
 
47
- if totp.verify(code.gsub(/\s+/, ""), drift_behind: self.class.otp_allowed_drift, drift_ahead: self.class.otp_allowed_drift, after: after_timestamp)
48
- return consume_otp!
49
- end
47
+ timestamp = totp.verify(code.gsub(/\s+/, ""), drift_behind: self.class.otp_allowed_drift, drift_ahead: self.class.otp_allowed_drift, after: after_timestamp)
48
+ return consume_otp!(totp, timestamp) if timestamp
50
49
 
51
50
  false
52
51
  end
@@ -59,11 +58,6 @@ module Devise
59
58
  otp.at(Time.now)
60
59
  end
61
60
 
62
- # ROTP's TOTP#timecode is private, so we duplicate it here
63
- def current_otp_timestep
64
- Time.now.utc.to_i / otp.interval
65
- end
66
-
67
61
  def otp_provisioning_uri(account, options = {})
68
62
  otp_secret = options[:otp_secret] || self.otp_secret
69
63
  ROTP::TOTP.new(otp_secret, options).provisioning_uri(account)
@@ -78,10 +72,14 @@ module Devise
78
72
 
79
73
  # An OTP cannot be used more than once in a given timestep
80
74
  # Storing timestep of last valid OTP is sufficient to satisfy this requirement
81
- def consume_otp!
82
- if self.consumed_timestep != current_otp_timestep
83
- self.consumed_timestep = current_otp_timestep
84
- return save(validate: false)
75
+ def consume_otp!(otp, timestamp)
76
+ timestep = timestamp / otp.interval
77
+
78
+ if self.consumed_timestep != timestep
79
+ self.consumed_timestep = timestep
80
+ save!(validate: false)
81
+
82
+ return true
85
83
  end
86
84
 
87
85
  false
@@ -93,8 +91,9 @@ module Devise
93
91
  :otp_encrypted_attribute_options,
94
92
  :otp_secret_encryption_key)
95
93
 
94
+ # Geneartes an OTP secret of the specified length, returning it after Base32 encoding.
96
95
  def generate_otp_secret(otp_secret_length = self.otp_secret_length)
97
- ROTP::Base32.random_base32(otp_secret_length)
96
+ ROTP::Base32.random(otp_secret_length)
98
97
  end
99
98
 
100
99
  # Return value will be splatted with ** so return a version of the
@@ -20,7 +20,7 @@ module Devise
20
20
  code_length = self.class.otp_backup_code_length
21
21
 
22
22
  number_of_codes.times do
23
- codes << SecureRandom.hex(code_length / 2) # Hexstring has length 2*n
23
+ codes << SecureRandom.hex(code_length)
24
24
  end
25
25
 
26
26
  hashed_codes = codes.map { |code| Devise::Encryptor.digest(self.class, code) }
@@ -30,15 +30,19 @@ module Devise
30
30
  end
31
31
 
32
32
  # Returns true and invalidates the given code
33
- # iff that code is a valid backup code.
33
+ # if that code is a valid backup code.
34
34
  def invalidate_otp_backup_code!(code)
35
35
  codes = self.otp_backup_codes || []
36
36
 
37
+ # Should we still have some other kind of non iterable result, terminate.
38
+ raise TypeError.new("`otp_backup_codes` is expected to be an Array, got #{codes.class.name}. Hint: If your database does not support arrays, does your model correctly `serialize :otp_backup_codes, Array`?") unless codes.is_a?(Array)
39
+
37
40
  codes.each do |backup_code|
38
41
  next unless Devise::Encryptor.compare(self.class, backup_code, code)
39
42
 
40
43
  codes.delete(backup_code)
41
44
  self.otp_backup_codes = codes
45
+ save!(validate: false)
42
46
  return true
43
47
  end
44
48
 
@@ -13,8 +13,8 @@ RSpec.shared_examples 'two_factor_authenticatable' do
13
13
  end
14
14
 
15
15
  describe '#otp_secret' do
16
- it 'should be of the configured length' do
17
- expect(subject.otp_secret.length).to eq(subject.class.otp_secret_length)
16
+ it 'should be of the expected length' do
17
+ expect(subject.otp_secret.length).to eq(subject.class.otp_secret_length*8/5)
18
18
  end
19
19
  end
20
20
 
@@ -125,15 +125,15 @@ RSpec.shared_examples 'two_factor_authenticatable' do
125
125
 
126
126
  describe '#otp_provisioning_uri' do
127
127
  let(:otp_secret_length) { subject.class.otp_secret_length }
128
- let(:account) { Faker::Internet.email }
128
+ let(:account) { 'user@host.example' }
129
129
  let(:issuer) { 'Tinfoil' }
130
130
 
131
131
  it 'should return uri with specified account' do
132
- expect(subject.otp_provisioning_uri(account)).to match(%r{otpauth://totp/#{CGI.escape(account)}\?secret=\w{#{otp_secret_length}}})
132
+ expect(subject.otp_provisioning_uri(account)).to match(%r{otpauth://totp/#{CGI.escape(account)}\?secret=\w{#{otp_secret_length*8/5}}})
133
133
  end
134
134
 
135
135
  it 'should return uri with issuer option' do
136
- expect(subject.otp_provisioning_uri(account, issuer: issuer)).to match(%r{otpauth://totp/#{issuer}:#{CGI.escape(account)}\?.*secret=\w{#{otp_secret_length}}(&|$)})
136
+ expect(subject.otp_provisioning_uri(account, issuer: issuer)).to match(%r{otpauth://totp/#{issuer}:#{CGI.escape(account)}\?.*secret=\w{#{otp_secret_length*8/5}}(&|$)})
137
137
  expect(subject.otp_provisioning_uri(account, issuer: issuer)).to match(%r{otpauth://totp/#{issuer}:#{CGI.escape(account)}\?.*issuer=#{issuer}(&|$)})
138
138
  end
139
139
  end
@@ -17,7 +17,7 @@ RSpec.shared_examples 'two_factor_backupable' do
17
17
 
18
18
  it 'generates recovery codes of the correct length' do
19
19
  @plaintext_codes.each do |code|
20
- expect(code.length).to eq(subject.class.otp_backup_code_length)
20
+ expect(code.length).to eq(subject.class.otp_backup_code_length*2)
21
21
  end
22
22
  end
23
23
 
@@ -34,7 +34,7 @@ RSpec.shared_examples 'two_factor_backupable' do
34
34
  end
35
35
 
36
36
  context 'with existing recovery codes' do
37
- let(:old_codes) { Faker::Lorem.words }
37
+ let(:old_codes) { ['adam', 'betty', 'charles'] }
38
38
  let(:old_codes_hashed) { old_codes.map { |x| Devise::Encryptor.digest(subject.class, x) } }
39
39
 
40
40
  before do
@@ -49,38 +49,66 @@ RSpec.shared_examples 'two_factor_backupable' do
49
49
  end
50
50
 
51
51
  describe '#invalidate_otp_backup_code!' do
52
- before do
53
- @plaintext_codes = subject.generate_otp_backup_codes!
54
- end
55
52
 
56
- context 'given an invalid recovery code' do
57
- it 'returns false' do
58
- expect(subject.invalidate_otp_backup_code!('password')).to be false
59
- end
60
- end
61
53
 
62
- context 'given a valid recovery code' do
63
- it 'returns true' do
64
- @plaintext_codes.each do |code|
65
- expect(subject.invalidate_otp_backup_code!(code)).to be true
54
+ describe "#invalidate_otp_backup_code!" do
55
+ context "with no backup codes" do
56
+ it "does nothing" do
57
+ expect(subject.invalidate_otp_backup_code!("foo")).to be false
66
58
  end
67
59
  end
68
60
 
69
- it 'invalidates that recovery code' do
70
- code = @plaintext_codes.sample
61
+ context "with an array of backup codes, newly generated" do
62
+ before do
63
+ @plaintext_codes = subject.generate_otp_backup_codes!
64
+ end
65
+
66
+ context 'given an invalid recovery code' do
67
+ it 'returns false' do
68
+ expect(subject.invalidate_otp_backup_code!('password')).to be false
69
+ end
70
+ end
71
+
72
+ context 'given a valid recovery code' do
73
+ it 'returns true' do
74
+ @plaintext_codes.each do |code|
75
+ expect(subject.invalidate_otp_backup_code!(code)).to be true
76
+ end
77
+ end
71
78
 
72
- subject.invalidate_otp_backup_code!(code)
73
- expect(subject.invalidate_otp_backup_code!(code)).to be false
79
+ it 'invalidates that recovery code' do
80
+ code = @plaintext_codes.sample
81
+
82
+ subject.invalidate_otp_backup_code!(code)
83
+ expect(subject.invalidate_otp_backup_code!(code)).to be false
84
+ end
85
+
86
+ it 'does not invalidate the other recovery codes' do
87
+ code = @plaintext_codes.sample
88
+ subject.invalidate_otp_backup_code!(code)
89
+
90
+ @plaintext_codes.delete(code)
91
+
92
+ @plaintext_codes.each do |code|
93
+ expect(subject.invalidate_otp_backup_code!(code)).to be true
94
+ end
95
+ end
96
+ end
74
97
  end
75
98
 
76
- it 'does not invalidate the other recovery codes' do
77
- code = @plaintext_codes.sample
78
- subject.invalidate_otp_backup_code!(code)
99
+ context "with backup codes as a string" do
100
+ before do
101
+ @plaintext_codes = subject.generate_otp_backup_codes!
79
102
 
80
- @plaintext_codes.delete(code)
103
+ # Simulates database adapters that don't understand `t.string :otp_backup_codes, type: array` properly
104
+ # such as SQL Server; and have just returned the serialized string still.
105
+ # and the user not having done:
106
+ # `serialize :otp_backup_codes, Array` in their model
107
+ subject.otp_backup_codes = subject.otp_backup_codes.to_json
108
+ end
81
109
 
82
- @plaintext_codes.each do |code|
83
- expect(subject.invalidate_otp_backup_code!(code)).to be true
110
+ it "raises a meaningful error" do
111
+ expect { subject.invalidate_otp_backup_code!("flork") }.to raise_error(TypeError)
84
112
  end
85
113
  end
86
114
  end
@@ -4,12 +4,18 @@ module Devise
4
4
 
5
5
  def authenticate!
6
6
  resource = mapping.to.find_for_database_authentication(authentication_hash)
7
+
8
+ hashed = false
7
9
  # We authenticate in two cases:
8
10
  # 1. The password and the OTP are correct
9
11
  # 2. The password is correct, and OTP is not required for login
10
12
  # We check the OTP, then defer to DatabaseAuthenticatable
11
- if validate(resource) { validate_otp(resource) }
13
+ if validate(resource) { hashed = true; validate_otp(resource) }
12
14
  super
15
+ else
16
+ # Paranoid mode: do the expensive hash even when resource is nil,
17
+ # to avoid timing-based user enumeration.
18
+ mapping.to.new.password = password if !hashed && Devise.paranoid
13
19
  end
14
20
 
15
21
  fail(Devise.paranoid ? :invalid : :not_found_in_database) unless resource
@@ -21,7 +27,7 @@ module Devise
21
27
 
22
28
  def validate_otp(resource)
23
29
  return true unless resource.otp_required_for_login
24
- return if params[scope]['otp_attempt'].nil?
30
+ return if params[scope].nil? || params[scope]['otp_attempt'].nil?
25
31
  resource.validate_and_consume_otp!(params[scope]['otp_attempt'])
26
32
  end
27
33
  end
@@ -5,10 +5,7 @@ module Devise
5
5
  def authenticate!
6
6
  resource = mapping.to.find_for_database_authentication(authentication_hash)
7
7
 
8
- if validate(resource) { resource.invalidate_otp_backup_code!(params[scope]['otp_attempt']) }
9
- # Devise fails to authenticate invalidated resources, but if we've
10
- # gotten here, the object changed (Since we deleted a recovery code)
11
- resource.save!
8
+ if validate(resource) { validate_backup_code(resource) }
12
9
  super
13
10
  end
14
11
 
@@ -18,6 +15,11 @@ module Devise
18
15
  # but database authenticatable automatically halts on a bad password
19
16
  @halted = false if @result == :failure
20
17
  end
18
+
19
+ def validate_backup_code(resource)
20
+ return if params[scope].nil? || params[scope]['otp_attempt'].nil?
21
+ resource.invalidate_otp_backup_code!(params[scope]['otp_attempt'])
22
+ end
21
23
  end
22
24
  end
23
25
  end
@@ -1,3 +1,3 @@
1
1
  module DeviseTwoFactor
2
- VERSION = '5.0.0'.freeze
2
+ VERSION = '6.3.0'.freeze
3
3
  end
@@ -18,13 +18,17 @@ class TwoFactorAuthenticatableDouble
18
18
 
19
19
  attr_accessor :consumed_timestep
20
20
 
21
- def save(validate)
21
+ def save!(_)
22
22
  # noop for testing
23
23
  true
24
24
  end
25
25
  end
26
26
 
27
27
  describe ::Devise::Models::TwoFactorAuthenticatable do
28
+ it 'should be inserted prior to other devise modules' do
29
+ expect(Devise::ALL.first).to eq(:two_factor_authenticatable)
30
+ end
31
+
28
32
  context 'When included in a class' do
29
33
  subject { TwoFactorAuthenticatableDouble.new }
30
34
 
@@ -17,6 +17,10 @@ class TwoFactorBackupableDouble
17
17
  devise :two_factor_authenticatable, :two_factor_backupable
18
18
 
19
19
  attr_accessor :otp_backup_codes
20
+
21
+ def save!(_)
22
+ true
23
+ end
20
24
  end
21
25
 
22
26
  describe ::Devise::Models::TwoFactorBackupable do
data/spec/spec_helper.rb CHANGED
@@ -18,7 +18,6 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
18
18
  $LOAD_PATH.unshift(File.dirname(__FILE__))
19
19
 
20
20
  require 'rspec'
21
- require 'faker'
22
21
  require 'devise-two-factor'
23
22
  require 'devise_two_factor/spec_helpers'
24
23
 
metadata CHANGED
@@ -1,135 +1,74 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise-two-factor
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 6.3.0
5
5
  platform: ruby
6
6
  authors:
7
- - Shane Wilton
8
- autorequire:
7
+ - Quinn Wilton
9
8
  bindir: bin
10
- cert_chain:
11
- - |
12
- -----BEGIN CERTIFICATE-----
13
- MIIHSjCCBTKgAwIBAgIJAK2u0LojMCNgMA0GCSqGSIb3DQEBBQUAMIGcMQswCQYD
14
- VQQGEwJVUzELMAkGA1UECBMCQ0ExEjAQBgNVBAcTCVBhbG8gQWx0bzEfMB0GA1UE
15
- ChMWVGluZm9pbCBTZWN1cml0eSwgSW5jLjEfM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NRKxUMvbSMas4YaLqkBpQSc+
81
- mcrLWYPiXWsePGu+j08AypE2Ubp4AOSZJN9rBBGotC3gofipo+K/sBiOM9xXI76Q
82
- 0HYOxXPa7D7UQQG1R9i0rcxmf9qepIVYCldmqVkKKDizcDo5UI9lRiLFjDyQhn6l
83
- YFY9bPQ4lKTK5Jr3M6+dV7fHxLhqXyMGs1905IUb7qvB7Bq/f0qJfC0JZuY/qdn2
84
- lL0SeFKOVsjErtobh3u8p8j2USkc8uJgIANHpXEMEExdp899CV/eVjh3TpAR7E6T
85
- mg7Q9Hi6Hh8z+Le9iR4I49vPEWDQEvj35IT6VfwU79UfIOlX+DkW8fFkPbaut3Se
86
- vqIDv6JBG9I16h/HhchntKfM58MI1bNZFBSdZqYOJiL8JIjP8HNIk76Y366ppG29
87
- EhBYYg==
88
- -----END CERTIFICATE-----
89
- date: 2022-07-11 00:00:00.000000000 Z
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
90
11
  dependencies:
91
12
  - !ruby/object:Gem::Dependency
92
13
  name: railties
93
14
  requirement: !ruby/object:Gem::Requirement
94
15
  requirements:
95
- - - "~>"
16
+ - - ">="
96
17
  - !ruby/object:Gem::Version
97
18
  version: '7.0'
19
+ - - "<"
20
+ - !ruby/object:Gem::Version
21
+ version: '8.2'
98
22
  type: :runtime
99
23
  prerelease: false
100
24
  version_requirements: !ruby/object:Gem::Requirement
101
25
  requirements:
102
- - - "~>"
26
+ - - ">="
103
27
  - !ruby/object:Gem::Version
104
28
  version: '7.0'
29
+ - - "<"
30
+ - !ruby/object:Gem::Version
31
+ version: '8.2'
105
32
  - !ruby/object:Gem::Dependency
106
33
  name: activesupport
107
34
  requirement: !ruby/object:Gem::Requirement
108
35
  requirements:
109
- - - "~>"
36
+ - - ">="
110
37
  - !ruby/object:Gem::Version
111
38
  version: '7.0'
39
+ - - "<"
40
+ - !ruby/object:Gem::Version
41
+ version: '8.2'
112
42
  type: :runtime
113
43
  prerelease: false
114
44
  version_requirements: !ruby/object:Gem::Requirement
115
45
  requirements:
116
- - - "~>"
46
+ - - ">="
117
47
  - !ruby/object:Gem::Version
118
48
  version: '7.0'
49
+ - - "<"
50
+ - !ruby/object:Gem::Version
51
+ version: '8.2'
119
52
  - !ruby/object:Gem::Dependency
120
53
  name: devise
121
54
  requirement: !ruby/object:Gem::Requirement
122
55
  requirements:
123
- - - "~>"
56
+ - - ">="
124
57
  - !ruby/object:Gem::Version
125
58
  version: '4.0'
59
+ - - "<"
60
+ - !ruby/object:Gem::Version
61
+ version: '5.0'
126
62
  type: :runtime
127
63
  prerelease: false
128
64
  version_requirements: !ruby/object:Gem::Requirement
129
65
  requirements:
130
- - - "~>"
66
+ - - ">="
131
67
  - !ruby/object:Gem::Version
132
68
  version: '4.0'
69
+ - - "<"
70
+ - !ruby/object:Gem::Version
71
+ version: '5.0'
133
72
  - !ruby/object:Gem::Dependency
134
73
  name: rotp
135
74
  requirement: !ruby/object:Gem::Requirement
@@ -215,27 +154,30 @@ dependencies:
215
154
  - !ruby/object:Gem::Version
216
155
  version: '0'
217
156
  - !ruby/object:Gem::Dependency
218
- name: faker
157
+ name: rake
219
158
  requirement: !ruby/object:Gem::Requirement
220
159
  requirements:
221
- - - ">="
160
+ - - "~>"
222
161
  - !ruby/object:Gem::Version
223
- version: '0'
162
+ version: '13'
224
163
  type: :development
225
164
  prerelease: false
226
165
  version_requirements: !ruby/object:Gem::Requirement
227
166
  requirements:
228
- - - ">="
167
+ - - "~>"
229
168
  - !ruby/object:Gem::Version
230
- version: '0'
231
- description: Barebones two-factor authentication with Devise
232
- email: engineers@tinfoilsecurity.com
169
+ version: '13'
170
+ description: Devise-Two-Factor is a minimalist extension to Devise which offers support
171
+ for two-factor authentication through the TOTP scheme.
233
172
  executables: []
234
173
  extensions: []
235
174
  extra_rdoc_files: []
236
175
  files:
176
+ - ".github/dependabot.yml"
237
177
  - ".github/workflows/ci.yml"
178
+ - ".github/workflows/push.yml"
238
179
  - ".gitignore"
180
+ - ".markdownlint.json"
239
181
  - ".rspec"
240
182
  - Appraisals
241
183
  - CHANGELOG.md
@@ -244,18 +186,14 @@ files:
244
186
  - LICENSE
245
187
  - README.md
246
188
  - Rakefile
189
+ - SECURITY.md
247
190
  - UPGRADING.md
248
- - certs/tinfoil-cacert.pem
249
- - certs/tinfoilsecurity-gems-cert.pem
250
191
  - devise-two-factor.gemspec
251
- - gemfiles/rails_4.1.gemfile
252
- - gemfiles/rails_4.2.gemfile
253
- - gemfiles/rails_5.0.gemfile
254
- - gemfiles/rails_5.1.gemfile
255
- - gemfiles/rails_5.2.gemfile
256
- - gemfiles/rails_6.0.gemfile
257
- - gemfiles/rails_6.1.gemfile
258
192
  - gemfiles/rails_7.0.gemfile
193
+ - gemfiles/rails_7.1.gemfile
194
+ - gemfiles/rails_7.2.gemfile
195
+ - gemfiles/rails_8.0.gemfile
196
+ - gemfiles/rails_8.1.gemfile
259
197
  - lib/devise-two-factor.rb
260
198
  - lib/devise_two_factor/models.rb
261
199
  - lib/devise_two_factor/models/two_factor_authenticatable.rb
@@ -271,11 +209,10 @@ files:
271
209
  - spec/devise/models/two_factor_authenticatable_spec.rb
272
210
  - spec/devise/models/two_factor_backupable_spec.rb
273
211
  - spec/spec_helper.rb
274
- homepage: https://github.com/tinfoil/devise-two-factor
212
+ homepage: https://github.com/devise-two-factor/devise-two-factor
275
213
  licenses:
276
214
  - MIT
277
215
  metadata: {}
278
- post_install_message:
279
216
  rdoc_options: []
280
217
  require_paths:
281
218
  - lib
@@ -290,8 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
290
227
  - !ruby/object:Gem::Version
291
228
  version: '0'
292
229
  requirements: []
293
- rubygems_version: 3.2.32
294
- signing_key:
230
+ rubygems_version: 4.0.3
295
231
  specification_version: 4
296
232
  summary: Barebones two-factor authentication with Devise
297
233
  test_files:
checksums.yaml.gz.sig DELETED
Binary file
@@ -1,41 +0,0 @@
1
- -----BEGIN CERTIFICATE-----
2
- MIIHSjCCBTKgAw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