devise_two_factor_authentication 3.0.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 (94) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/tests.yml +42 -0
  3. data/.gitignore +23 -0
  4. data/.rubocop.yml +293 -0
  5. data/CHANGELOG.md +119 -0
  6. data/Gemfile +35 -0
  7. data/LICENSE +19 -0
  8. data/README.md +401 -0
  9. data/Rakefile +16 -0
  10. data/app/controllers/devise/two_factor_authentication_controller.rb +88 -0
  11. data/app/views/devise/two_factor_authentication/max_login_attempts_reached.html.erb +3 -0
  12. data/app/views/devise/two_factor_authentication/show.html.erb +19 -0
  13. data/config/locales/de.yml +8 -0
  14. data/config/locales/en.yml +8 -0
  15. data/config/locales/es.yml +8 -0
  16. data/config/locales/fr.yml +8 -0
  17. data/config/locales/ru.yml +8 -0
  18. data/devise_two_factor_authentication.gemspec +40 -0
  19. data/lib/devise_two_factor_authentication/controllers/helpers.rb +54 -0
  20. data/lib/devise_two_factor_authentication/hooks/two_factor_authenticatable.rb +17 -0
  21. data/lib/devise_two_factor_authentication/models/two_factor_authenticatable.rb +206 -0
  22. data/lib/devise_two_factor_authentication/orm/active_record.rb +14 -0
  23. data/lib/devise_two_factor_authentication/rails.rb +7 -0
  24. data/lib/devise_two_factor_authentication/routes.rb +19 -0
  25. data/lib/devise_two_factor_authentication/schema.rb +31 -0
  26. data/lib/devise_two_factor_authentication/version.rb +3 -0
  27. data/lib/devise_two_factor_authentication.rb +52 -0
  28. data/lib/generators/active_record/templates/migration.rb +15 -0
  29. data/lib/generators/active_record/two_factor_authentication_generator.rb +14 -0
  30. data/lib/generators/two_factor_authentication/two_factor_authentication_generator.rb +17 -0
  31. data/spec/controllers/two_factor_authentication_controller_spec.rb +41 -0
  32. data/spec/features/two_factor_authenticatable_spec.rb +236 -0
  33. data/spec/generators/active_record/two_factor_authentication_generator_spec.rb +36 -0
  34. data/spec/lib/two_factor_authentication/models/two_factor_authenticatable_spec.rb +326 -0
  35. data/spec/rails_app/.gitignore +3 -0
  36. data/spec/rails_app/README.md +3 -0
  37. data/spec/rails_app/Rakefile +9 -0
  38. data/spec/rails_app/app/assets/config/manifest.js +2 -0
  39. data/spec/rails_app/app/assets/javascripts/application.js +1 -0
  40. data/spec/rails_app/app/assets/stylesheets/application.css +4 -0
  41. data/spec/rails_app/app/controllers/application_controller.rb +3 -0
  42. data/spec/rails_app/app/controllers/home_controller.rb +10 -0
  43. data/spec/rails_app/app/helpers/application_helper.rb +8 -0
  44. data/spec/rails_app/app/mailers/.gitkeep +0 -0
  45. data/spec/rails_app/app/models/.gitkeep +0 -0
  46. data/spec/rails_app/app/models/admin.rb +6 -0
  47. data/spec/rails_app/app/models/encrypted_user.rb +15 -0
  48. data/spec/rails_app/app/models/guest_user.rb +17 -0
  49. data/spec/rails_app/app/models/user.rb +14 -0
  50. data/spec/rails_app/app/views/home/dashboard.html.erb +11 -0
  51. data/spec/rails_app/app/views/home/index.html.erb +3 -0
  52. data/spec/rails_app/app/views/layouts/application.html.erb +20 -0
  53. data/spec/rails_app/config/application.rb +64 -0
  54. data/spec/rails_app/config/boot.rb +10 -0
  55. data/spec/rails_app/config/database.yml +19 -0
  56. data/spec/rails_app/config/environment.rb +5 -0
  57. data/spec/rails_app/config/environments/development.rb +28 -0
  58. data/spec/rails_app/config/environments/production.rb +68 -0
  59. data/spec/rails_app/config/environments/test.rb +41 -0
  60. data/spec/rails_app/config/initializers/backtrace_silencers.rb +7 -0
  61. data/spec/rails_app/config/initializers/cookies_serializer.rb +3 -0
  62. data/spec/rails_app/config/initializers/devise.rb +258 -0
  63. data/spec/rails_app/config/initializers/inflections.rb +15 -0
  64. data/spec/rails_app/config/initializers/mime_types.rb +5 -0
  65. data/spec/rails_app/config/initializers/secret_token.rb +7 -0
  66. data/spec/rails_app/config/initializers/session_store.rb +8 -0
  67. data/spec/rails_app/config/initializers/wrap_parameters.rb +14 -0
  68. data/spec/rails_app/config/locales/devise.en.yml +59 -0
  69. data/spec/rails_app/config/locales/en.yml +5 -0
  70. data/spec/rails_app/config/routes.rb +65 -0
  71. data/spec/rails_app/config.ru +4 -0
  72. data/spec/rails_app/db/migrate/20140403184646_devise_create_users.rb +42 -0
  73. data/spec/rails_app/db/migrate/20140407172619_two_factor_authentication_add_to_users.rb +15 -0
  74. data/spec/rails_app/db/migrate/20140407215513_add_nickanme_to_users.rb +7 -0
  75. data/spec/rails_app/db/migrate/20151224171231_add_encrypted_columns_to_user.rb +9 -0
  76. data/spec/rails_app/db/migrate/20151224180310_populate_otp_column.rb +19 -0
  77. data/spec/rails_app/db/migrate/20151228230340_remove_otp_secret_key_from_user.rb +5 -0
  78. data/spec/rails_app/db/migrate/20160209032439_devise_create_admins.rb +42 -0
  79. data/spec/rails_app/db/schema.rb +54 -0
  80. data/spec/rails_app/lib/assets/.gitkeep +0 -0
  81. data/spec/rails_app/lib/sms_provider.rb +17 -0
  82. data/spec/rails_app/public/404.html +26 -0
  83. data/spec/rails_app/public/422.html +26 -0
  84. data/spec/rails_app/public/500.html +25 -0
  85. data/spec/rails_app/public/favicon.ico +0 -0
  86. data/spec/rails_app/script/rails +9 -0
  87. data/spec/spec_helper.rb +27 -0
  88. data/spec/support/authenticated_model_helper.rb +59 -0
  89. data/spec/support/capybara.rb +3 -0
  90. data/spec/support/controller_helper.rb +16 -0
  91. data/spec/support/features_spec_helper.rb +42 -0
  92. data/spec/support/sms_provider.rb +5 -0
  93. data/spec/support/totp_helper.rb +11 -0
  94. metadata +294 -0
metadata ADDED
@@ -0,0 +1,294 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: devise_two_factor_authentication
3
+ version: !ruby/object:Gem::Version
4
+ version: 3.0.0
5
+ platform: ruby
6
+ authors:
7
+ - baarkerlounger
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-07-05 00:00:00.000000000 Z
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: 3.1.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 3.1.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: devise
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: randexp
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rotp
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: 4.0.0
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: 4.0.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: encryptor
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: bundler
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rake
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: 3.0.1
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: 3.0.1
125
+ - !ruby/object:Gem::Dependency
126
+ name: capybara
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '2.5'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '2.5'
139
+ - !ruby/object:Gem::Dependency
140
+ name: pry
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: timecop
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
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ description: |2
168
+ ### Features ###
169
+ * control sms code pattern
170
+ * configure max login attempts
171
+ * per user level control if he really need two factor authentication
172
+ * your own sms logic
173
+ email:
174
+ - baarkerlounger@protonmail.com
175
+ executables: []
176
+ extensions: []
177
+ extra_rdoc_files: []
178
+ files:
179
+ - ".github/workflows/tests.yml"
180
+ - ".gitignore"
181
+ - ".rubocop.yml"
182
+ - CHANGELOG.md
183
+ - Gemfile
184
+ - LICENSE
185
+ - README.md
186
+ - Rakefile
187
+ - app/controllers/devise/two_factor_authentication_controller.rb
188
+ - app/views/devise/two_factor_authentication/max_login_attempts_reached.html.erb
189
+ - app/views/devise/two_factor_authentication/show.html.erb
190
+ - config/locales/de.yml
191
+ - config/locales/en.yml
192
+ - config/locales/es.yml
193
+ - config/locales/fr.yml
194
+ - config/locales/ru.yml
195
+ - devise_two_factor_authentication.gemspec
196
+ - lib/devise_two_factor_authentication.rb
197
+ - lib/devise_two_factor_authentication/controllers/helpers.rb
198
+ - lib/devise_two_factor_authentication/hooks/two_factor_authenticatable.rb
199
+ - lib/devise_two_factor_authentication/models/two_factor_authenticatable.rb
200
+ - lib/devise_two_factor_authentication/orm/active_record.rb
201
+ - lib/devise_two_factor_authentication/rails.rb
202
+ - lib/devise_two_factor_authentication/routes.rb
203
+ - lib/devise_two_factor_authentication/schema.rb
204
+ - lib/devise_two_factor_authentication/version.rb
205
+ - lib/generators/active_record/templates/migration.rb
206
+ - lib/generators/active_record/two_factor_authentication_generator.rb
207
+ - lib/generators/two_factor_authentication/two_factor_authentication_generator.rb
208
+ - spec/controllers/two_factor_authentication_controller_spec.rb
209
+ - spec/features/two_factor_authenticatable_spec.rb
210
+ - spec/generators/active_record/two_factor_authentication_generator_spec.rb
211
+ - spec/lib/two_factor_authentication/models/two_factor_authenticatable_spec.rb
212
+ - spec/rails_app/.gitignore
213
+ - spec/rails_app/README.md
214
+ - spec/rails_app/Rakefile
215
+ - spec/rails_app/app/assets/config/manifest.js
216
+ - spec/rails_app/app/assets/javascripts/application.js
217
+ - spec/rails_app/app/assets/stylesheets/application.css
218
+ - spec/rails_app/app/controllers/application_controller.rb
219
+ - spec/rails_app/app/controllers/home_controller.rb
220
+ - spec/rails_app/app/helpers/application_helper.rb
221
+ - spec/rails_app/app/mailers/.gitkeep
222
+ - spec/rails_app/app/models/.gitkeep
223
+ - spec/rails_app/app/models/admin.rb
224
+ - spec/rails_app/app/models/encrypted_user.rb
225
+ - spec/rails_app/app/models/guest_user.rb
226
+ - spec/rails_app/app/models/user.rb
227
+ - spec/rails_app/app/views/home/dashboard.html.erb
228
+ - spec/rails_app/app/views/home/index.html.erb
229
+ - spec/rails_app/app/views/layouts/application.html.erb
230
+ - spec/rails_app/config.ru
231
+ - spec/rails_app/config/application.rb
232
+ - spec/rails_app/config/boot.rb
233
+ - spec/rails_app/config/database.yml
234
+ - spec/rails_app/config/environment.rb
235
+ - spec/rails_app/config/environments/development.rb
236
+ - spec/rails_app/config/environments/production.rb
237
+ - spec/rails_app/config/environments/test.rb
238
+ - spec/rails_app/config/initializers/backtrace_silencers.rb
239
+ - spec/rails_app/config/initializers/cookies_serializer.rb
240
+ - spec/rails_app/config/initializers/devise.rb
241
+ - spec/rails_app/config/initializers/inflections.rb
242
+ - spec/rails_app/config/initializers/mime_types.rb
243
+ - spec/rails_app/config/initializers/secret_token.rb
244
+ - spec/rails_app/config/initializers/session_store.rb
245
+ - spec/rails_app/config/initializers/wrap_parameters.rb
246
+ - spec/rails_app/config/locales/devise.en.yml
247
+ - spec/rails_app/config/locales/en.yml
248
+ - spec/rails_app/config/routes.rb
249
+ - spec/rails_app/db/migrate/20140403184646_devise_create_users.rb
250
+ - spec/rails_app/db/migrate/20140407172619_two_factor_authentication_add_to_users.rb
251
+ - spec/rails_app/db/migrate/20140407215513_add_nickanme_to_users.rb
252
+ - spec/rails_app/db/migrate/20151224171231_add_encrypted_columns_to_user.rb
253
+ - spec/rails_app/db/migrate/20151224180310_populate_otp_column.rb
254
+ - spec/rails_app/db/migrate/20151228230340_remove_otp_secret_key_from_user.rb
255
+ - spec/rails_app/db/migrate/20160209032439_devise_create_admins.rb
256
+ - spec/rails_app/db/schema.rb
257
+ - spec/rails_app/lib/assets/.gitkeep
258
+ - spec/rails_app/lib/sms_provider.rb
259
+ - spec/rails_app/public/404.html
260
+ - spec/rails_app/public/422.html
261
+ - spec/rails_app/public/500.html
262
+ - spec/rails_app/public/favicon.ico
263
+ - spec/rails_app/script/rails
264
+ - spec/spec_helper.rb
265
+ - spec/support/authenticated_model_helper.rb
266
+ - spec/support/capybara.rb
267
+ - spec/support/controller_helper.rb
268
+ - spec/support/features_spec_helper.rb
269
+ - spec/support/sms_provider.rb
270
+ - spec/support/totp_helper.rb
271
+ homepage: https://github.com/devise2fa/devise_two_factor_authentication
272
+ licenses:
273
+ - MIT
274
+ metadata: {}
275
+ post_install_message:
276
+ rdoc_options: []
277
+ require_paths:
278
+ - lib
279
+ required_ruby_version: !ruby/object:Gem::Requirement
280
+ requirements:
281
+ - - ">="
282
+ - !ruby/object:Gem::Version
283
+ version: '0'
284
+ required_rubygems_version: !ruby/object:Gem::Requirement
285
+ requirements:
286
+ - - ">="
287
+ - !ruby/object:Gem::Version
288
+ version: '0'
289
+ requirements: []
290
+ rubygems_version: 3.3.7
291
+ signing_key:
292
+ specification_version: 4
293
+ summary: Two factor authentication plugin for devise forked from Houdini/two_factor_authentication
294
+ test_files: []