kaze 2.1.0 → 2.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.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +69 -1
  3. data/README.md +42 -2
  4. data/lib/kaze/commands/app/base_stack.rb +14 -0
  5. data/lib/kaze/commands/app/hotwire_stack.rb +4 -1
  6. data/lib/kaze/commands/app/inertia_react_stack.rb +3 -1
  7. data/lib/kaze/commands/app/inertia_vue_stack.rb +3 -1
  8. data/lib/kaze/version.rb +1 -1
  9. data/stubs/default/app/forms/auth/login_form.rb +6 -1
  10. data/stubs/default/app/forms/auth/two_factor_challenge_form.rb +24 -0
  11. data/stubs/default/app/forms/confirm_two_factor_form.rb +5 -0
  12. data/stubs/default/app/forms/disable_two_factor_form.rb +7 -0
  13. data/stubs/default/app/models/concerns/two_factor_authenticatable.rb +112 -0
  14. data/stubs/default/app/models/session_guard.rb +8 -1
  15. data/stubs/default/app/models/two_factor_challenge.rb +55 -0
  16. data/stubs/default/app/models/user.rb +1 -0
  17. data/stubs/default/config/initializers/active_record_encryption.rb +20 -0
  18. data/stubs/default/config/routes.rb +9 -0
  19. data/stubs/default/db/migrate/20240101000001_add_two_factor_to_users.rb +15 -0
  20. data/stubs/default/test/integration/auth/rate_limiting_test.rb +64 -0
  21. data/stubs/default/test/integration/auth/two_factor_challenge_test.rb +114 -0
  22. data/stubs/default/test/integration/settings/two_factor_test.rb +104 -0
  23. data/stubs/default/test/models/two_factor_authenticatable_test.rb +143 -0
  24. data/stubs/default/test/test_helper.rb +16 -0
  25. data/stubs/hotwire/app/controllers/auth/authenticated_session_controller.rb +32 -1
  26. data/stubs/hotwire/app/controllers/auth/two_factor_challenge_controller.rb +59 -0
  27. data/stubs/hotwire/app/controllers/concerns/set_two_factor_challenge.rb +8 -0
  28. data/stubs/hotwire/app/controllers/settings/two_factor_controller.rb +48 -0
  29. data/stubs/hotwire/app/views/auth/forgot_password.html.erb +1 -1
  30. data/stubs/hotwire/app/views/auth/login.html.erb +1 -1
  31. data/stubs/hotwire/app/views/auth/register.html.erb +2 -2
  32. data/stubs/hotwire/app/views/auth/reset_password.html.erb +3 -3
  33. data/stubs/hotwire/app/views/auth/two_factor_challenge.html.erb +21 -0
  34. data/stubs/hotwire/app/views/auth/verify_email.html.erb +2 -2
  35. data/stubs/hotwire/app/views/layouts/_settings.html.erb +1 -0
  36. data/stubs/hotwire/app/views/layouts/_sidebar_user.html.erb +1 -1
  37. data/stubs/hotwire/app/views/settings/password/_update_password_form.html.erb +6 -6
  38. data/stubs/hotwire/app/views/settings/profile/_confirm_user_deletion_modal.html.erb +1 -1
  39. data/stubs/hotwire/app/views/settings/profile/_delete_user_form.html.erb +1 -1
  40. data/stubs/hotwire/app/views/settings/two_factor/_confirming.html.erb +20 -0
  41. data/stubs/hotwire/app/views/settings/two_factor/_disabled.html.erb +8 -0
  42. data/stubs/hotwire/app/views/settings/two_factor/_enabled.html.erb +29 -0
  43. data/stubs/hotwire/app/views/settings/two_factor/edit.html.erb +16 -0
  44. data/stubs/inertia-common/app/controllers/auth/authenticated_session_controller.rb +30 -1
  45. data/stubs/inertia-common/app/controllers/auth/two_factor_challenge_controller.rb +53 -0
  46. data/stubs/inertia-common/app/controllers/concerns/set_two_factor_challenge.rb +8 -0
  47. data/stubs/inertia-common/app/controllers/settings/two_factor_controller.rb +60 -0
  48. data/stubs/inertia-react-ts/app/javascript/Layouts/SettingsLayout.tsx +5 -1
  49. data/stubs/inertia-react-ts/app/javascript/Pages/Auth/ForgotPassword.tsx +2 -2
  50. data/stubs/inertia-react-ts/app/javascript/Pages/Auth/Register.tsx +1 -1
  51. data/stubs/inertia-react-ts/app/javascript/Pages/Auth/ResetPassword.tsx +3 -3
  52. data/stubs/inertia-react-ts/app/javascript/Pages/Auth/TwoFactorChallenge.tsx +71 -0
  53. data/stubs/inertia-react-ts/app/javascript/Pages/Auth/VerifyEmail.tsx +3 -3
  54. data/stubs/inertia-react-ts/app/javascript/Pages/Settings/Partials/DeleteUserForm.tsx +2 -2
  55. data/stubs/inertia-react-ts/app/javascript/Pages/Settings/Partials/UpdatePasswordForm.tsx +3 -3
  56. data/stubs/inertia-react-ts/app/javascript/Pages/Settings/TwoFactor.tsx +199 -0
  57. data/stubs/inertia-vue-ts/app/javascript/Layouts/SettingsLayout.vue +5 -1
  58. data/stubs/inertia-vue-ts/app/javascript/Pages/Auth/ForgotPassword.vue +2 -2
  59. data/stubs/inertia-vue-ts/app/javascript/Pages/Auth/Register.vue +1 -1
  60. data/stubs/inertia-vue-ts/app/javascript/Pages/Auth/ResetPassword.vue +3 -3
  61. data/stubs/inertia-vue-ts/app/javascript/Pages/Auth/TwoFactorChallenge.vue +60 -0
  62. data/stubs/inertia-vue-ts/app/javascript/Pages/Auth/VerifyEmail.vue +3 -3
  63. data/stubs/inertia-vue-ts/app/javascript/Pages/Settings/Partials/DeleteUserForm.vue +2 -2
  64. data/stubs/inertia-vue-ts/app/javascript/Pages/Settings/Partials/UpdatePasswordForm.vue +3 -3
  65. data/stubs/inertia-vue-ts/app/javascript/Pages/Settings/TwoFactor.vue +147 -0
  66. metadata +41 -1
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kaze
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cuong Giang
@@ -37,6 +37,20 @@ dependencies:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
39
  version: '2.6'
40
+ - !ruby/object:Gem::Dependency
41
+ name: minitest
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '5.0'
47
+ type: :development
48
+ prerelease: false
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '5.0'
40
54
  - !ruby/object:Gem::Dependency
41
55
  name: railties
42
56
  requirement: !ruby/object:Gem::Requirement
@@ -78,7 +92,10 @@ files:
78
92
  - stubs/default/app/forms/auth/new_password_form.rb
79
93
  - stubs/default/app/forms/auth/register_form.rb
80
94
  - stubs/default/app/forms/auth/send_password_reset_link_form.rb
95
+ - stubs/default/app/forms/auth/two_factor_challenge_form.rb
96
+ - stubs/default/app/forms/confirm_two_factor_form.rb
81
97
  - stubs/default/app/forms/delete_user_form.rb
98
+ - stubs/default/app/forms/disable_two_factor_form.rb
82
99
  - stubs/default/app/forms/update_password_form.rb
83
100
  - stubs/default/app/forms/update_profile_information_form.rb
84
101
  - stubs/default/app/mailers/application_mailer.rb
@@ -86,8 +103,10 @@ files:
86
103
  - stubs/default/app/models/application_record.rb
87
104
  - stubs/default/app/models/concerns/can_reset_password.rb
88
105
  - stubs/default/app/models/concerns/must_verify_email.rb
106
+ - stubs/default/app/models/concerns/two_factor_authenticatable.rb
89
107
  - stubs/default/app/models/current.rb
90
108
  - stubs/default/app/models/session_guard.rb
109
+ - stubs/default/app/models/two_factor_challenge.rb
91
110
  - stubs/default/app/models/user.rb
92
111
  - stubs/default/app/validators/current_password_validator.rb
93
112
  - stubs/default/app/validators/email_validator.rb
@@ -98,16 +117,22 @@ files:
98
117
  - stubs/default/app/views/user_mailer/reset_password.html.erb
99
118
  - stubs/default/app/views/user_mailer/verify_email.html.erb
100
119
  - stubs/default/bin/dev
120
+ - stubs/default/config/initializers/active_record_encryption.rb
101
121
  - stubs/default/config/routes.rb
102
122
  - stubs/default/db/migrate/20240101000000_create_users.rb
123
+ - stubs/default/db/migrate/20240101000001_add_two_factor_to_users.rb
103
124
  - stubs/default/test/factories/users.rb
104
125
  - stubs/default/test/integration/appearance_test.rb
105
126
  - stubs/default/test/integration/auth/authentication_test.rb
106
127
  - stubs/default/test/integration/auth/email_verification_test.rb
107
128
  - stubs/default/test/integration/auth/password_reset_test.rb
129
+ - stubs/default/test/integration/auth/rate_limiting_test.rb
108
130
  - stubs/default/test/integration/auth/registration_test.rb
131
+ - stubs/default/test/integration/auth/two_factor_challenge_test.rb
109
132
  - stubs/default/test/integration/password_update_test.rb
110
133
  - stubs/default/test/integration/profile_test.rb
134
+ - stubs/default/test/integration/settings/two_factor_test.rb
135
+ - stubs/default/test/models/two_factor_authenticatable_test.rb
111
136
  - stubs/default/test/test_helper.rb
112
137
  - stubs/hotwire/app/assets/tailwind/application.css
113
138
  - stubs/hotwire/app/components/application_logo_component.rb
@@ -134,16 +159,19 @@ files:
134
159
  - stubs/hotwire/app/controllers/auth/new_password_controller.rb
135
160
  - stubs/hotwire/app/controllers/auth/password_reset_link_controller.rb
136
161
  - stubs/hotwire/app/controllers/auth/registered_user_controller.rb
162
+ - stubs/hotwire/app/controllers/auth/two_factor_challenge_controller.rb
137
163
  - stubs/hotwire/app/controllers/auth/verified_email_controller.rb
138
164
  - stubs/hotwire/app/controllers/concerns/authenticate.rb
139
165
  - stubs/hotwire/app/controllers/concerns/redirect_if_authenticated.rb
140
166
  - stubs/hotwire/app/controllers/concerns/set_current_auth.rb
167
+ - stubs/hotwire/app/controllers/concerns/set_two_factor_challenge.rb
141
168
  - stubs/hotwire/app/controllers/concerns/sidebar_state.rb
142
169
  - stubs/hotwire/app/controllers/concerns/validate_signature.rb
143
170
  - stubs/hotwire/app/controllers/dashboard_controller.rb
144
171
  - stubs/hotwire/app/controllers/settings/appearance_controller.rb
145
172
  - stubs/hotwire/app/controllers/settings/password_controller.rb
146
173
  - stubs/hotwire/app/controllers/settings/profile_controller.rb
174
+ - stubs/hotwire/app/controllers/settings/two_factor_controller.rb
147
175
  - stubs/hotwire/app/controllers/welcome_controller.rb
148
176
  - stubs/hotwire/app/javascript/alpinejs.stub
149
177
  - stubs/hotwire/app/javascript/application.js
@@ -151,6 +179,7 @@ files:
151
179
  - stubs/hotwire/app/views/auth/login.html.erb
152
180
  - stubs/hotwire/app/views/auth/register.html.erb
153
181
  - stubs/hotwire/app/views/auth/reset_password.html.erb
182
+ - stubs/hotwire/app/views/auth/two_factor_challenge.html.erb
154
183
  - stubs/hotwire/app/views/auth/verify_email.html.erb
155
184
  - stubs/hotwire/app/views/dashboard/index.html.erb
156
185
  - stubs/hotwire/app/views/layouts/_appearance.html.erb
@@ -169,6 +198,10 @@ files:
169
198
  - stubs/hotwire/app/views/settings/profile/_update_profile_information_form.html.erb
170
199
  - stubs/hotwire/app/views/settings/profile/destroy.turbo_stream.erb
171
200
  - stubs/hotwire/app/views/settings/profile/edit.html.erb
201
+ - stubs/hotwire/app/views/settings/two_factor/_confirming.html.erb
202
+ - stubs/hotwire/app/views/settings/two_factor/_disabled.html.erb
203
+ - stubs/hotwire/app/views/settings/two_factor/_enabled.html.erb
204
+ - stubs/hotwire/app/views/settings/two_factor/edit.html.erb
172
205
  - stubs/hotwire/app/views/welcome/index.html.erb
173
206
  - stubs/hotwire/config/importmap.rb
174
207
  - stubs/inertia-common/app/controllers/application_controller.rb
@@ -177,17 +210,20 @@ files:
177
210
  - stubs/inertia-common/app/controllers/auth/new_password_controller.rb
178
211
  - stubs/inertia-common/app/controllers/auth/password_reset_link_controller.rb
179
212
  - stubs/inertia-common/app/controllers/auth/registered_user_controller.rb
213
+ - stubs/inertia-common/app/controllers/auth/two_factor_challenge_controller.rb
180
214
  - stubs/inertia-common/app/controllers/auth/verified_email_controller.rb
181
215
  - stubs/inertia-common/app/controllers/concerns/authenticate.rb
182
216
  - stubs/inertia-common/app/controllers/concerns/handle_inertia_requests.rb
183
217
  - stubs/inertia-common/app/controllers/concerns/redirect_if_authenticated.rb
184
218
  - stubs/inertia-common/app/controllers/concerns/set_current_auth.rb
219
+ - stubs/inertia-common/app/controllers/concerns/set_two_factor_challenge.rb
185
220
  - stubs/inertia-common/app/controllers/concerns/validate_signature.rb
186
221
  - stubs/inertia-common/app/controllers/concerns/verify_csrf_token.rb
187
222
  - stubs/inertia-common/app/controllers/dashboard_controller.rb
188
223
  - stubs/inertia-common/app/controllers/settings/appearance_controller.rb
189
224
  - stubs/inertia-common/app/controllers/settings/password_controller.rb
190
225
  - stubs/inertia-common/app/controllers/settings/profile_controller.rb
226
+ - stubs/inertia-common/app/controllers/settings/two_factor_controller.rb
191
227
  - stubs/inertia-common/app/controllers/welcome_controller.rb
192
228
  - stubs/inertia-common/bin/vite
193
229
  - stubs/inertia-common/config/initializers/inertia_rails.rb
@@ -229,6 +265,7 @@ files:
229
265
  - stubs/inertia-react-ts/app/javascript/Pages/Auth/Login.tsx
230
266
  - stubs/inertia-react-ts/app/javascript/Pages/Auth/Register.tsx
231
267
  - stubs/inertia-react-ts/app/javascript/Pages/Auth/ResetPassword.tsx
268
+ - stubs/inertia-react-ts/app/javascript/Pages/Auth/TwoFactorChallenge.tsx
232
269
  - stubs/inertia-react-ts/app/javascript/Pages/Auth/VerifyEmail.tsx
233
270
  - stubs/inertia-react-ts/app/javascript/Pages/Dashboard.tsx
234
271
  - stubs/inertia-react-ts/app/javascript/Pages/Settings/Appearance.tsx
@@ -238,6 +275,7 @@ files:
238
275
  - stubs/inertia-react-ts/app/javascript/Pages/Settings/Partials/UpdateProfileInformationForm.tsx
239
276
  - stubs/inertia-react-ts/app/javascript/Pages/Settings/Password.tsx
240
277
  - stubs/inertia-react-ts/app/javascript/Pages/Settings/Profile.tsx
278
+ - stubs/inertia-react-ts/app/javascript/Pages/Settings/TwoFactor.tsx
241
279
  - stubs/inertia-react-ts/app/javascript/Pages/Welcome.tsx
242
280
  - stubs/inertia-react-ts/app/javascript/entrypoints/application.tsx
243
281
  - stubs/inertia-react-ts/app/javascript/entrypoints/bootstrap.ts
@@ -358,6 +396,7 @@ files:
358
396
  - stubs/inertia-vue-ts/app/javascript/Pages/Auth/Login.vue
359
397
  - stubs/inertia-vue-ts/app/javascript/Pages/Auth/Register.vue
360
398
  - stubs/inertia-vue-ts/app/javascript/Pages/Auth/ResetPassword.vue
399
+ - stubs/inertia-vue-ts/app/javascript/Pages/Auth/TwoFactorChallenge.vue
361
400
  - stubs/inertia-vue-ts/app/javascript/Pages/Auth/VerifyEmail.vue
362
401
  - stubs/inertia-vue-ts/app/javascript/Pages/Dashboard.vue
363
402
  - stubs/inertia-vue-ts/app/javascript/Pages/Settings/Appearance.vue
@@ -367,6 +406,7 @@ files:
367
406
  - stubs/inertia-vue-ts/app/javascript/Pages/Settings/Partials/UpdateProfileInformationForm.vue
368
407
  - stubs/inertia-vue-ts/app/javascript/Pages/Settings/Password.vue
369
408
  - stubs/inertia-vue-ts/app/javascript/Pages/Settings/Profile.vue
409
+ - stubs/inertia-vue-ts/app/javascript/Pages/Settings/TwoFactor.vue
370
410
  - stubs/inertia-vue-ts/app/javascript/Pages/Welcome.vue
371
411
  - stubs/inertia-vue-ts/app/javascript/composables/useInitials.ts
372
412
  - stubs/inertia-vue-ts/app/javascript/entrypoints/application.ts